eric6/ThirdParty/Pygments/pygments/lexers/verification.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
diff -r bf5f777260a6 -r 21b0534faebc eric6/ThirdParty/Pygments/pygments/lexers/verification.py
--- a/eric6/ThirdParty/Pygments/pygments/lexers/verification.py	Tue Apr 21 19:44:19 2020 +0200
+++ b/eric6/ThirdParty/Pygments/pygments/lexers/verification.py	Tue Apr 21 19:47:10 2020 +0200
@@ -5,13 +5,13 @@
 
     Lexer for Intermediate Verification Languages (IVLs).
 
-    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 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 @@
     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 @@
             (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 @@
     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 @@
             (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),

eric ide

mercurial