diff options
author | nkozlovskiy <nmk@ydb.tech> | 2023-09-29 12:24:06 +0300 |
---|---|---|
committer | nkozlovskiy <nmk@ydb.tech> | 2023-09-29 12:41:34 +0300 |
commit | e0e3e1717e3d33762ce61950504f9637a6e669ed (patch) | |
tree | bca3ff6939b10ed60c3d5c12439963a1146b9711 /contrib/python/Pygments/py3/pygments/lexers/cplint.py | |
parent | 38f2c5852db84c7b4d83adfcb009eb61541d1ccd (diff) | |
download | ydb-e0e3e1717e3d33762ce61950504f9637a6e669ed.tar.gz |
add ydb deps
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/cplint.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/cplint.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/cplint.py b/contrib/python/Pygments/py3/pygments/lexers/cplint.py new file mode 100644 index 0000000000..8a48c013f0 --- /dev/null +++ b/contrib/python/Pygments/py3/pygments/lexers/cplint.py @@ -0,0 +1,44 @@ +""" + pygments.lexers.cplint + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the cplint language + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import bygroups, inherit, words +from pygments.lexers import PrologLexer +from pygments.token import Operator, Keyword, Name, String, Punctuation + +__all__ = ['CplintLexer'] + + +class CplintLexer(PrologLexer): + """ + Lexer for cplint files, including CP-logic, Logic Programs with Annotated + Disjunctions, Distributional Clauses syntax, ProbLog, DTProbLog. + + .. versionadded:: 2.12 + """ + name = 'cplint' + url = 'https://cplint.eu' + aliases = ['cplint'] + filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl', '*.P', '*.lpad', '*.cpl'] + mimetypes = ['text/x-cplint'] + + tokens = { + 'root': [ + (r'map_query', Keyword), + (words(('gaussian', 'uniform_dens', 'dirichlet', 'gamma', 'beta', + 'poisson', 'binomial', 'geometric', 'exponential', 'pascal', + 'multinomial', 'user', 'val', 'uniform', 'discrete', + 'finite')), Name.Builtin), + # annotations of atoms + (r'([a-z]+)(:)', bygroups(String.Atom, Punctuation)), + (r':(-|=)|::?|~=?|=>', Operator), + (r'\?', Name.Builtin), + inherit, + ], + } |