summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorDavid Corbett <corbett.dav@northeastern.edu>2022-07-16 02:39:33 -0400
committerGitHub <noreply@github.com>2022-07-16 08:39:33 +0200
commit4c2be199e6f2beb59eb99d769fdfca3fac9ef8ee (patch)
tree6ce99d417181f2c543cc231cf8ee0a00eaa2a1ac /pygments
parenta5631c348952f6f742ecac3214a25297d0757fce (diff)
downloadpygments-git-4c2be199e6f2beb59eb99d769fdfca3fac9ef8ee.tar.gz
Update `Inform6Lexer` to Inform 6.40 (#2190)
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/int_fiction.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/pygments/lexers/int_fiction.py b/pygments/lexers/int_fiction.py
index 01ad8b7c..0e7c8180 100644
--- a/pygments/lexers/int_fiction.py
+++ b/pygments/lexers/int_fiction.py
@@ -175,6 +175,10 @@ class Inform6Lexer(RegexLexer):
# Other values
(_name, Name, '#pop')
],
+ 'value?': [
+ include('value'),
+ default('#pop')
+ ],
# Strings
'dictionary-word': [
(r'[~^]+', String.Escape),
@@ -191,8 +195,8 @@ class Inform6Lexer(RegexLexer):
(r'\\', String.Escape),
(r'@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*' %
(_newline, _newline), String.Escape),
- (r'@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F])*'
- r'(\\\s*[%s]\s*)*\}' % (_newline, _newline, _newline),
+ (r'@(\\\s*[%s]\s*)*[({]((\\\s*[%s]\s*)*[0-9a-zA-Z_])*'
+ r'(\\\s*[%s]\s*)*[)}]' % (_newline, _newline, _newline),
String.Escape),
(r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline),
String.Escape),
@@ -210,6 +214,13 @@ class Inform6Lexer(RegexLexer):
(_name, Name.Constant, '#pop'),
include('value')
],
+ 'constant*': [
+ include('_whitespace'),
+ (r',', Punctuation),
+ (r'=', Punctuation, 'value?'),
+ (_name, Name.Constant, 'value?'),
+ default('#pop')
+ ],
'_global': [
include('_whitespace'),
(_name, Name.Variable.Global, '#pop'),
@@ -252,7 +263,7 @@ class Inform6Lexer(RegexLexer):
(r'(?i)class\b', Keyword,
('object-body', 'duplicates', 'class-name')),
(r'(?i)(constant|default)\b', Keyword,
- ('default', 'expression', '_constant')),
+ ('default', 'constant*')),
(r'(?i)(end\b)(.*)', bygroups(Keyword, Text)),
(r'(?i)(extend|verb)\b', Keyword, 'grammar'),
(r'(?i)fake_action\b', Keyword, ('default', '_constant')),