diff options
| author | orivej <[email protected]> | 2022-02-10 16:45:01 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:01 +0300 | 
| commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
| tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/python/Pygments/py2/pygments/lexers/qvt.py | |
| parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/lexers/qvt.py')
| -rw-r--r-- | contrib/python/Pygments/py2/pygments/lexers/qvt.py | 98 | 
1 files changed, 49 insertions, 49 deletions
diff --git a/contrib/python/Pygments/py2/pygments/lexers/qvt.py b/contrib/python/Pygments/py2/pygments/lexers/qvt.py index a45a3d04c05..b1c1495c0fd 100644 --- a/contrib/python/Pygments/py2/pygments/lexers/qvt.py +++ b/contrib/python/Pygments/py2/pygments/lexers/qvt.py @@ -5,12 +5,12 @@      Lexer for QVT Operational language. -    :copyright: Copyright 2006-2019 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, bygroups, include, combined, default, \  -    words  +from pygments.lexer import RegexLexer, bygroups, include, combined, default, \ +    words  from pygments.token import Text, Comment, Operator, Keyword, Punctuation, \      Name, String, Number @@ -18,7 +18,7 @@ __all__ = ['QVToLexer']  class QVToLexer(RegexLexer): -    u"""  +    u"""      For the `QVT Operational Mapping language <http://www.omg.org/spec/QVT/1.1/>`_.      Reference for implementing this: «Meta Object Facility (MOF) 2.0 @@ -51,26 +51,26 @@ class QVToLexer(RegexLexer):               bygroups(Comment, Comment, Comment.Preproc, Comment)),              # Uncomment the following if you want to distinguish between              # '/*' and '/**', à la javadoc -            # (r'/[*]{2}(.|\n)*?[*]/', Comment.Multiline),  +            # (r'/[*]{2}(.|\n)*?[*]/', Comment.Multiline),              (r'/[*](.|\n)*?[*]/', Comment.Multiline),              (r'\\\n', Text),              (r'(and|not|or|xor|##?)\b', Operator.Word), -            (r'(:{1,2}=|[-+]=)\b', Operator.Word),  -            (r'(@|<<|>>)\b', Keyword),  # stereotypes  -            (r'!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]', Operator),  +            (r'(:{1,2}=|[-+]=)\b', Operator.Word), +            (r'(@|<<|>>)\b', Keyword),  # stereotypes +            (r'!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]', Operator),              (r'[]{}:(),;[]', Punctuation),              (r'(true|false|unlimited|null)\b', Keyword.Constant),              (r'(this|self|result)\b', Name.Builtin.Pseudo),              (r'(var)\b', Keyword.Declaration),              (r'(from|import)\b', Keyword.Namespace, 'fromimport'), -            (r'(metamodel|class|exception|primitive|enum|transformation|'  -             r'library)(\s+)(\w+)',  +            (r'(metamodel|class|exception|primitive|enum|transformation|' +             r'library)(\s+)(\w+)',               bygroups(Keyword.Word, Text, Name.Class)), -            (r'(exception)(\s+)(\w+)',  -             bygroups(Keyword.Word, Text, Name.Exception)),  +            (r'(exception)(\s+)(\w+)', +             bygroups(Keyword.Word, Text, Name.Exception)),              (r'(main)\b', Name.Function), -            (r'(mapping|helper|query)(\s+)',  -             bygroups(Keyword.Declaration, Text), 'operation'),  +            (r'(mapping|helper|query)(\s+)', +             bygroups(Keyword.Declaration, Text), 'operation'),              (r'(assert)(\s+)\b', bygroups(Keyword, Text), 'assert'),              (r'(Bag|Collection|Dict|OrderedSet|Sequence|Set|Tuple|List)\b',               Keyword.Type), @@ -79,45 +79,45 @@ class QVToLexer(RegexLexer):              ("'", String, combined('stringescape', 'sqs')),              include('name'),              include('numbers'), -            # (r'([a-zA-Z_]\w*)(::)([a-zA-Z_]\w*)',  +            # (r'([a-zA-Z_]\w*)(::)([a-zA-Z_]\w*)',              # bygroups(Text, Text, Text)), -        ],  +        ],          'fromimport': [              (r'(?:[ \t]|\\\n)+', Text), -            (r'[a-zA-Z_][\w.]*', Name.Namespace),  -            default('#pop'),  -        ],  +            (r'[a-zA-Z_][\w.]*', Name.Namespace), +            default('#pop'), +        ],          'operation': [              (r'::', Text), -            (r'(.*::)([a-zA-Z_]\w*)([ \t]*)(\()',  -             bygroups(Text, Name.Function, Text, Punctuation), '#pop')  -        ],  +            (r'(.*::)([a-zA-Z_]\w*)([ \t]*)(\()', +             bygroups(Text, Name.Function, Text, Punctuation), '#pop') +        ],          'assert': [              (r'(warning|error|fatal)\b', Keyword, '#pop'), -            default('#pop'),  # all else: go back  -        ],  +            default('#pop'),  # all else: go back +        ],          'keywords': [ -            (words((  -                'abstract', 'access', 'any', 'assert', 'blackbox', 'break',  -                'case', 'collect', 'collectNested', 'collectOne', 'collectselect',  -                'collectselectOne', 'composes', 'compute', 'configuration',  -                'constructor', 'continue', 'datatype', 'default', 'derived',  -                'disjuncts', 'do', 'elif', 'else', 'end', 'endif', 'except',  -                'exists', 'extends', 'forAll', 'forEach', 'forOne', 'from', 'if',  -                'implies', 'in', 'inherits', 'init', 'inout', 'intermediate',  -                'invresolve', 'invresolveIn', 'invresolveone', 'invresolveoneIn',  -                'isUnique', 'iterate', 'late', 'let', 'literal', 'log', 'map',  -                'merges', 'modeltype', 'new', 'object', 'one', 'ordered', 'out',  -                'package', 'population', 'property', 'raise', 'readonly',  -                'references', 'refines', 'reject', 'resolve', 'resolveIn',  -                'resolveone', 'resolveoneIn', 'return', 'select', 'selectOne',  -                'sortedBy', 'static', 'switch', 'tag', 'then', 'try', 'typedef',  -                'unlimited', 'uses', 'when', 'where', 'while', 'with', 'xcollect',  -                'xmap', 'xselect'), suffix=r'\b'), Keyword),  +            (words(( +                'abstract', 'access', 'any', 'assert', 'blackbox', 'break', +                'case', 'collect', 'collectNested', 'collectOne', 'collectselect', +                'collectselectOne', 'composes', 'compute', 'configuration', +                'constructor', 'continue', 'datatype', 'default', 'derived', +                'disjuncts', 'do', 'elif', 'else', 'end', 'endif', 'except', +                'exists', 'extends', 'forAll', 'forEach', 'forOne', 'from', 'if', +                'implies', 'in', 'inherits', 'init', 'inout', 'intermediate', +                'invresolve', 'invresolveIn', 'invresolveone', 'invresolveoneIn', +                'isUnique', 'iterate', 'late', 'let', 'literal', 'log', 'map', +                'merges', 'modeltype', 'new', 'object', 'one', 'ordered', 'out', +                'package', 'population', 'property', 'raise', 'readonly', +                'references', 'refines', 'reject', 'resolve', 'resolveIn', +                'resolveone', 'resolveoneIn', 'return', 'select', 'selectOne', +                'sortedBy', 'static', 'switch', 'tag', 'then', 'try', 'typedef', +                'unlimited', 'uses', 'when', 'where', 'while', 'with', 'xcollect', +                'xmap', 'xselect'), suffix=r'\b'), Keyword),          ],          # There is no need to distinguish between String.Single and @@ -126,27 +126,27 @@ class QVToLexer(RegexLexer):              (r'[^\\\'"\n]+', String),              # quotes, percents and backslashes must be parsed one at a time              (r'[\'"\\]', String), -        ],  +        ],          'stringescape': [              (r'\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})', String.Escape)          ], -        'dqs': [  # double-quoted string  +        'dqs': [  # double-quoted string              (r'"', String, '#pop'),              (r'\\\\|\\"', String.Escape),              include('strings') -        ],  -        'sqs': [  # single-quoted string  +        ], +        'sqs': [  # single-quoted string              (r"'", String, '#pop'),              (r"\\\\|\\'", String.Escape),              include('strings') -        ],  +        ],          'name': [ -            (r'[a-zA-Z_]\w*', Name),  -        ],  +            (r'[a-zA-Z_]\w*', Name), +        ],          # numbers: excerpt taken from the python lexer          'numbers': [              (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),              (r'\d+[eE][+-]?[0-9]+', Number.Float),              (r'\d+', Number.Integer)          ], -    }  +    }  | 
