diff options
Diffstat (limited to 'pygments/lexers/verification.py')
-rw-r--r-- | pygments/lexers/verification.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/pygments/lexers/verification.py b/pygments/lexers/verification.py index f6530726..f70a0a2c 100644 --- a/pygments/lexers/verification.py +++ b/pygments/lexers/verification.py @@ -11,7 +11,7 @@ from pygments.lexer import RegexLexer, include, words from pygments.token import Comment, Operator, Keyword, Name, Number, \ - Punctuation, Whitespace + Punctuation, Text, Generic __all__ = ['BoogieLexer', 'SilverLexer'] @@ -29,8 +29,9 @@ class BoogieLexer(RegexLexer): tokens = { 'root': [ # Whitespace and Comments - (r'\n', Whitespace), - (r'\s+', Whitespace), + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), # line continuation (r'//[/!](.*?)\n', Comment.Doc), (r'//(.*?)\n', Comment.Single), (r'/\*', Comment.Multiline, 'comment'), @@ -45,6 +46,7 @@ class BoogieLexer(RegexLexer): (words(('bool', 'int', 'ref'), suffix=r'\b'), Keyword.Type), include('numbers'), (r"(>=|<=|:=|!=|==>|&&|\|\||[+/\-=>*<\[\]])", Operator), + (r'\{.*?\}', Generic.Emph), #triggers (r"([{}():;,.])", Punctuation), # Identifier (r'[a-zA-Z_]\w*', Name), @@ -74,8 +76,9 @@ class SilverLexer(RegexLexer): tokens = { 'root': [ # Whitespace and Comments - (r'\n', Whitespace), - (r'\s+', Whitespace), + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), # line continuation (r'//[/!](.*?)\n', Comment.Doc), (r'//(.*?)\n', Comment.Single), (r'/\*', Comment.Multiline, 'comment'), @@ -83,18 +86,18 @@ class SilverLexer(RegexLexer): (words(( 'result', 'true', 'false', 'null', 'method', 'function', 'predicate', 'program', 'domain', 'axiom', 'var', 'returns', - 'field', 'define', 'requires', 'ensures', 'invariant', - 'fold', 'unfold', 'inhale', 'exhale', 'new', 'assert', + 'field', 'define', 'fold', 'unfold', 'inhale', 'exhale', 'new', 'assert', 'assume', 'goto', 'while', 'if', 'elseif', 'else', 'fresh', 'constraining', 'Seq', 'Set', 'Multiset', 'union', 'intersection', 'setminus', 'subset', 'unfolding', 'in', 'old', 'forall', 'exists', 'acc', 'wildcard', 'write', 'none', 'epsilon', 'perm', 'unique', 'apply', 'package', 'folding', 'label', 'forperm'), suffix=r'\b'), Keyword), - (words(('Int', 'Perm', 'Bool', 'Ref'), suffix=r'\b'), Keyword.Type), + (words(('requires', 'ensures', 'invariant'), suffix=r'\b'), Name.Decorator), + (words(('Int', 'Perm', 'Bool', 'Ref', 'Rational'), suffix=r'\b'), Keyword.Type), include('numbers'), - (r'[!%&*+=|?:<>/\-\[\]]', Operator), + (r'\{.*?\}', Generic.Emph), #triggers (r'([{}():;,.])', Punctuation), # Identifier (r'[\w$]\w*', Name), |