Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
cplint.py44 linesDownload Raw Back to lexers
1"""2    pygments.lexers.cplint3    ~~~~~~~~~~~~~~~~~~~~~~4 5    Lexer for the cplint language6 7    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.8    :license: BSD, see LICENSE for details.9"""10 11from pygments.lexer import bygroups, inherit, words12from pygments.lexers import PrologLexer13from pygments.token import Operator, Keyword, Name, String, Punctuation14 15__all__ = ['CplintLexer']16 17 18class CplintLexer(PrologLexer):19    """20    Lexer for cplint files, including CP-logic, Logic Programs with Annotated21    Disjunctions, Distributional Clauses syntax, ProbLog, DTProbLog.22    """23    name = 'cplint'24    url = 'https://cplint.eu'25    aliases = ['cplint']26    filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl', '*.P', '*.lpad', '*.cpl']27    mimetypes = ['text/x-cplint']28    version_added = '2.12'29 30    tokens = {31        'root': [32            (r'map_query', Keyword),33            (words(('gaussian', 'uniform_dens', 'dirichlet', 'gamma', 'beta',34                    'poisson', 'binomial', 'geometric', 'exponential', 'pascal',35                    'multinomial', 'user', 'val', 'uniform', 'discrete',36                    'finite')), Name.Builtin),37            # annotations of atoms38            (r'([a-z]+)(:)', bygroups(String.Atom, Punctuation)),39            (r':(-|=)|::?|~=?|=>', Operator),40            (r'\?', Name.Builtin),41            inherit,42        ],43    }44 
codekingpro/portable-devtools · Team Ai