aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/idl.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
commitc04b663c7bb4b750deeb8f48f620497ec13da8fa (patch)
tree151ebc8bfdd2ad918caf5e6e2d8013e14272ddf8 /contrib/python/Pygments/py3/pygments/lexers/idl.py
parent0d55ca22c507d18c2f35718687e0b06d9915397b (diff)
downloadydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/idl.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/idl.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/idl.py b/contrib/python/Pygments/py3/pygments/lexers/idl.py
index 22b8346ac3..d24f8cdd33 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/idl.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/idl.py
@@ -4,14 +4,15 @@
Lexers for IDL.
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
-from pygments.lexer import RegexLexer, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, Number, String
+from pygments.lexer import RegexLexer, words, bygroups
+from pygments.token import Text, Comment, Operator, Keyword, Name, Number, \
+ String, Whitespace
__all__ = ['IDLLexer']
@@ -23,6 +24,7 @@ class IDLLexer(RegexLexer):
.. versionadded:: 1.6
"""
name = 'IDL'
+ url = 'https://www.l3harrisgeospatial.com/Software-Technology/IDL'
aliases = ['idl']
filenames = ['*.pro']
mimetypes = ['text/idl']
@@ -248,7 +250,8 @@ class IDLLexer(RegexLexer):
tokens = {
'root': [
- (r'^\s*;.*?\n', Comment.Single),
+ (r'(^\s*)(;.*?)(\n)', bygroups(Whitespace, Comment.Single,
+ Whitespace)),
(words(_RESERVED, prefix=r'\b', suffix=r'\b'), Keyword),
(words(_BUILTIN_LIB, prefix=r'\b', suffix=r'\b'), Name.Builtin),
(r'\+=|-=|\^=|\*=|/=|#=|##=|<=|>=|=', Operator),
@@ -264,6 +267,8 @@ class IDLLexer(RegexLexer):
(r'\b[+\-]?[0-9]+U?L{1,2}\b', Number.Integer.Long),
(r'\b[+\-]?[0-9]+U?S?\b', Number.Integer),
(r'\b[+\-]?[0-9]+B\b', Number),
+ (r'[ \t]+', Whitespace),
+ (r'\n', Whitespace),
(r'.', Text),
]
}
@@ -277,4 +282,4 @@ class IDLLexer(RegexLexer):
if 'endswitch' in text:
result += 0.01
- return result \ No newline at end of file
+ return result