diff options
| author | David Corbett <corbett.dav@husky.neu.edu> | 2020-05-26 16:10:49 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-26 22:10:49 +0200 |
| commit | ee804f7a07e9b04478497b5a3dcf5cb013e9cb05 (patch) | |
| tree | b60a33fa1e03cbb8d40d44bdf43cf1b18d8aa86d /pygments | |
| parent | b94261595ebe040ddaaafec929c9ec6d1daad91b (diff) | |
| download | pygments-git-ee804f7a07e9b04478497b5a3dcf5cb013e9cb05.tar.gz | |
Update `Inform6Lexer` to Inform 6.34 (#1461)
Diffstat (limited to 'pygments')
| -rw-r--r-- | pygments/lexers/int_fiction.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/pygments/lexers/int_fiction.py b/pygments/lexers/int_fiction.py index 89d5bccc..393438f8 100644 --- a/pygments/lexers/int_fiction.py +++ b/pygments/lexers/int_fiction.py @@ -118,7 +118,7 @@ class Inform6Lexer(RegexLexer): include('_whitespace'), # Strings (r'[%s][^@][%s]' % (_squote, _squote), String.Char, '#pop'), - (r'([%s])(@\{[0-9a-fA-F]{1,4}\})([%s])' % (_squote, _squote), + (r'([%s])(@\{[0-9a-fA-F]*\})([%s])' % (_squote, _squote), bygroups(String.Char, String.Escape, String.Char), '#pop'), (r'([%s])(@.{2})([%s])' % (_squote, _squote), bygroups(String.Char, String.Escape, String.Char), '#pop'), @@ -180,7 +180,7 @@ class Inform6Lexer(RegexLexer): (r'[~^]+', String.Escape), (r'[^~^\\@({%s]+' % _squote, String.Single), (r'[({]', String.Single), - (r'@\{[0-9a-fA-F]{,4}\}', String.Escape), + (r'@\{[0-9a-fA-F]*\}', String.Escape), (r'@.{2}', String.Escape), (r'[%s]' % _squote, String.Single, '#pop') ], @@ -191,7 +191,7 @@ 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]){,4}' + (r'@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F])*' r'(\\\s*[%s]\s*)*\}' % (_newline, _newline, _newline), String.Escape), (r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline), @@ -257,8 +257,8 @@ class Inform6Lexer(RegexLexer): (r'(?i)(extend|verb)\b', Keyword, 'grammar'), (r'(?i)fake_action\b', Keyword, ('default', '_constant')), (r'(?i)import\b', Keyword, 'manifest'), - (r'(?i)(include|link)\b', Keyword, - ('default', 'before-plain-string')), + (r'(?i)(include|link|origsource)\b', Keyword, + ('default', 'before-plain-string?')), (r'(?i)(lowstring|undef)\b', Keyword, ('default', '_constant')), (r'(?i)message\b', Keyword, ('default', 'diagnostic')), (r'(?i)(nearby|object)\b', Keyword, @@ -365,11 +365,12 @@ class Inform6Lexer(RegexLexer): 'diagnostic': [ include('_whitespace'), (r'[%s]' % _dquote, String.Double, ('#pop', 'message-string')), - default(('#pop', 'before-plain-string', 'directive-keyword?')) + default(('#pop', 'before-plain-string?', 'directive-keyword?')) ], - 'before-plain-string': [ + 'before-plain-string?': [ include('_whitespace'), - (r'[%s]' % _dquote, String.Double, ('#pop', 'plain-string')) + (r'[%s]' % _dquote, String.Double, ('#pop', 'plain-string')), + default('#pop') ], 'message-string': [ (r'[~^]+', String.Escape), @@ -386,6 +387,7 @@ class Inform6Lexer(RegexLexer): 'replace', 'reverse', 'scope', 'score', 'special', 'string', 'table', 'terminating', 'time', 'topic', 'warning', 'with'), suffix=r'\b'), Keyword, '#pop'), + (r'static\b', Keyword), (r'[%s]{1,2}>|[+=]' % _dash, Punctuation, '#pop') ], '_directive-keyword': [ |
