diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/Pygments/py3/pygments/lexers/graphics.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/graphics.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/graphics.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/graphics.py b/contrib/python/Pygments/py3/pygments/lexers/graphics.py index 7e750c2868..9f3e4a4431 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/graphics.py +++ b/contrib/python/Pygments/py3/pygments/lexers/graphics.py @@ -4,7 +4,7 @@ Lexers for computer graphics and plotting related languages. - :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -407,7 +407,7 @@ class AsymptoteLexer(RegexLexer): .. versionadded:: 1.2 """ name = 'Asymptote' - aliases = ['asymptote', 'asy'] + aliases = ['asymptote', 'asy'] filenames = ['*.asy'] mimetypes = ['text/x-asymptote'] @@ -424,7 +424,7 @@ class AsymptoteLexer(RegexLexer): ], 'statements': [ # simple string (TeX friendly) - (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), # C style string (with character escapes) (r"'", String, 'string'), (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), @@ -774,26 +774,26 @@ class PovrayLexer(RegexLexer): (r'[0-9]+\.[0-9]*', Number.Float), (r'\.[0-9]+', Number.Float), (r'[0-9]+', Number.Integer), - (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), (r'\s+', Whitespace), ] } - - def analyse_text(text): - """POVRAY is similar to JSON/C, but the combination of camera and - light_source is probably not very likely elsewhere. HLSL or GLSL - are similar (GLSL even has #version), but they miss #declare, and - light_source/camera are not keywords anywhere else -- it's fair - to assume though that any POVRAY scene must have a camera and - lightsource.""" - result = 0 - if '#version' in text: - result += 0.05 - if '#declare' in text: - result += 0.05 - if 'camera' in text: - result += 0.05 - if 'light_source' in text: - result += 0.1 - - return result + + def analyse_text(text): + """POVRAY is similar to JSON/C, but the combination of camera and + light_source is probably not very likely elsewhere. HLSL or GLSL + are similar (GLSL even has #version), but they miss #declare, and + light_source/camera are not keywords anywhere else -- it's fair + to assume though that any POVRAY scene must have a camera and + lightsource.""" + result = 0 + if '#version' in text: + result += 0.05 + if '#declare' in text: + result += 0.05 + if 'camera' in text: + result += 0.05 + if 'light_source' in text: + result += 0.1 + + return result |