diff options
author | nkozlovskiy <[email protected]> | 2023-09-29 12:24:06 +0300 |
---|---|---|
committer | nkozlovskiy <[email protected]> | 2023-09-29 12:41:34 +0300 |
commit | e0e3e1717e3d33762ce61950504f9637a6e669ed (patch) | |
tree | bca3ff6939b10ed60c3d5c12439963a1146b9711 /contrib/python/Pygments/py3/pygments/lexers/procfile.py | |
parent | 38f2c5852db84c7b4d83adfcb009eb61541d1ccd (diff) |
add ydb deps
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/procfile.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/procfile.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/procfile.py b/contrib/python/Pygments/py3/pygments/lexers/procfile.py new file mode 100644 index 00000000000..4f9b59c3500 --- /dev/null +++ b/contrib/python/Pygments/py3/pygments/lexers/procfile.py @@ -0,0 +1,42 @@ +""" + pygments.lexers.procfile + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Procfile file format. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Name, Number, String, Text, Punctuation + +__all__ = ["ProcfileLexer"] + + +class ProcfileLexer(RegexLexer): + """ + Lexer for Procfile file format. + + The format is used to run processes on Heroku or is used by Foreman or + Honcho tools. + + .. versionadded:: 2.10 + """ + name = 'Procfile' + url = 'https://devcenter.heroku.com/articles/procfile#procfile-format' + aliases = ['procfile'] + filenames = ['Procfile'] + + tokens = { + 'root': [ + (r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)), + (r'\s+', Text.Whitespace), + (r'"[^"]*"', String), + (r"'[^']*'", String), + (r'[0-9]+', Number.Integer), + (r'\$[a-zA-Z_][\w]*', Name.Variable), + (r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)), + (r'([\w\-\./]+)', Text), + ], + } |