aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/elm.py
diff options
context:
space:
mode:
authorilezhankin <ilezhankin@yandex-team.ru>2022-02-10 16:45:56 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:56 +0300
commit62a805381e41500fbc7914c37c71ab040a098f4e (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/python/Pygments/py3/pygments/lexers/elm.py
parent1d125034f06575234f83f24f08677955133f140e (diff)
downloadydb-62a805381e41500fbc7914c37c71ab040a098f4e.tar.gz
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/elm.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/elm.py204
1 files changed, 102 insertions, 102 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/elm.py b/contrib/python/Pygments/py3/pygments/lexers/elm.py
index b387919f0a..298dbf5986 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/elm.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/elm.py
@@ -1,123 +1,123 @@
-"""
- pygments.lexers.elm
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Elm programming language.
-
+"""
+ pygments.lexers.elm
+ ~~~~~~~~~~~~~~~~~~~
+
+ Lexer for the Elm programming language.
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
+ :license: BSD, see LICENSE for details.
+"""
+
from pygments.lexer import RegexLexer, words, include, bygroups
from pygments.token import Comment, Keyword, Name, Number, Punctuation, String, \
Text, Whitespace
-
-__all__ = ['ElmLexer']
-
-
-class ElmLexer(RegexLexer):
- """
- For `Elm <http://elm-lang.org/>`_ source code.
-
- .. versionadded:: 2.1
- """
-
- name = 'Elm'
- aliases = ['elm']
- filenames = ['*.elm']
- mimetypes = ['text/x-elm']
-
+
+__all__ = ['ElmLexer']
+
+
+class ElmLexer(RegexLexer):
+ """
+ For `Elm <http://elm-lang.org/>`_ source code.
+
+ .. versionadded:: 2.1
+ """
+
+ name = 'Elm'
+ aliases = ['elm']
+ filenames = ['*.elm']
+ mimetypes = ['text/x-elm']
+
validName = r'[a-z_][a-zA-Z0-9_\']*'
-
- specialName = r'^main '
-
- builtinOps = (
- '~', '||', '|>', '|', '`', '^', '\\', '\'', '>>', '>=', '>', '==',
- '=', '<~', '<|', '<=', '<<', '<-', '<', '::', ':', '/=', '//', '/',
- '..', '.', '->', '-', '++', '+', '*', '&&', '%',
- )
-
- reservedWords = words((
- 'alias', 'as', 'case', 'else', 'if', 'import', 'in',
- 'let', 'module', 'of', 'port', 'then', 'type', 'where',
+
+ specialName = r'^main '
+
+ builtinOps = (
+ '~', '||', '|>', '|', '`', '^', '\\', '\'', '>>', '>=', '>', '==',
+ '=', '<~', '<|', '<=', '<<', '<-', '<', '::', ':', '/=', '//', '/',
+ '..', '.', '->', '-', '++', '+', '*', '&&', '%',
+ )
+
+ reservedWords = words((
+ 'alias', 'as', 'case', 'else', 'if', 'import', 'in',
+ 'let', 'module', 'of', 'port', 'then', 'type', 'where',
), suffix=r'\b')
-
- tokens = {
- 'root': [
-
- # Comments
+
+ tokens = {
+ 'root': [
+
+ # Comments
(r'\{-', Comment.Multiline, 'comment'),
- (r'--.*', Comment.Single),
-
- # Whitespace
+ (r'--.*', Comment.Single),
+
+ # Whitespace
(r'\s+', Whitespace),
-
- # Strings
- (r'"', String, 'doublequote'),
-
- # Modules
+
+ # Strings
+ (r'"', String, 'doublequote'),
+
+ # Modules
(r'^(\s*)(module)(\s*)', bygroups(Whitespace, Keyword.Namespace,
Whitespace), 'imports'),
-
- # Imports
+
+ # Imports
(r'^(\s*)(import)(\s*)', bygroups(Whitespace, Keyword.Namespace,
Whitespace), 'imports'),
-
- # Shaders
- (r'\[glsl\|.*', Name.Entity, 'shader'),
-
- # Keywords
- (reservedWords, Keyword.Reserved),
-
- # Types
+
+ # Shaders
+ (r'\[glsl\|.*', Name.Entity, 'shader'),
+
+ # Keywords
+ (reservedWords, Keyword.Reserved),
+
+ # Types
(r'[A-Z][a-zA-Z0-9_]*', Keyword.Type),
-
- # Main
- (specialName, Keyword.Reserved),
-
- # Prefix Operators
- (words((builtinOps), prefix=r'\(', suffix=r'\)'), Name.Function),
-
- # Infix Operators
+
+ # Main
+ (specialName, Keyword.Reserved),
+
+ # Prefix Operators
+ (words((builtinOps), prefix=r'\(', suffix=r'\)'), Name.Function),
+
+ # Infix Operators
(words(builtinOps), Name.Function),
-
- # Numbers
- include('numbers'),
-
- # Variable Names
- (validName, Name.Variable),
-
- # Parens
+
+ # Numbers
+ include('numbers'),
+
+ # Variable Names
+ (validName, Name.Variable),
+
+ # Parens
(r'[,()\[\]{}]', Punctuation),
-
- ],
-
- 'comment': [
+
+ ],
+
+ 'comment': [
(r'-(?!\})', Comment.Multiline),
(r'\{-', Comment.Multiline, 'comment'),
- (r'[^-}]', Comment.Multiline),
+ (r'[^-}]', Comment.Multiline),
(r'-\}', Comment.Multiline, '#pop'),
- ],
-
- 'doublequote': [
+ ],
+
+ 'doublequote': [
(r'\\u[0-9a-fA-F]{4}', String.Escape),
(r'\\[nrfvb\\"]', String.Escape),
- (r'[^"]', String),
- (r'"', String, '#pop'),
- ],
-
- 'imports': [
- (r'\w+(\.\w+)*', Name.Class, '#pop'),
- ],
-
- 'numbers': [
- (r'_?\d+\.(?=\d+)', Number.Float),
- (r'_?\d+', Number.Integer),
- ],
-
- 'shader': [
- (r'\|(?!\])', Name.Entity),
- (r'\|\]', Name.Entity, '#pop'),
+ (r'[^"]', String),
+ (r'"', String, '#pop'),
+ ],
+
+ 'imports': [
+ (r'\w+(\.\w+)*', Name.Class, '#pop'),
+ ],
+
+ 'numbers': [
+ (r'_?\d+\.(?=\d+)', Number.Float),
+ (r'_?\d+', Number.Integer),
+ ],
+
+ 'shader': [
+ (r'\|(?!\])', Name.Entity),
+ (r'\|\]', Name.Entity, '#pop'),
(r'(.*)(\n)', bygroups(Name.Entity, Whitespace)),
- ],
- }
+ ],
+ }