aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/cplint.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/cplint.py
parent0d55ca22c507d18c2f35718687e0b06d9915397b (diff)
downloadydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/cplint.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/cplint.py47
1 files changed, 47 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..5c10885f61
--- /dev/null
+++ b/contrib/python/Pygments/py3/pygments/lexers/cplint.py
@@ -0,0 +1,47 @@
+"""
+ pygments.lexers.cplint
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Lexer for the cplint language
+
+ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import bygroups, inherit, words
+from pygments.lexers import PrologLexer
+from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
+ Number, 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),
+ (r'([a-z]+)(:)', bygroups(String.Atom, Punctuation)), # annotations of atoms
+ (r':(-|=)|::?|~=?|=>', Operator),
+ (r'\?', Name.Builtin),
+ inherit,
+ ],
+ }
+
+