eric6/ThirdParty/Pygments/pygments/lexers/prolog.py

changeset 7701
25f42e208e08
parent 7547
21b0534faebc
child 7983
54c5cfbb1e29
equal deleted inserted replaced
7700:a3cf077a8db3 7701:25f42e208e08
3 pygments.lexers.prolog 3 pygments.lexers.prolog
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for Prolog and Prolog-like languages. 6 Lexers for Prolog and Prolog-like languages.
7 7
8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
53 (r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])', 53 (r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])',
54 Operator), 54 Operator),
55 (r'(mod|div|not)\b', Operator), 55 (r'(mod|div|not)\b', Operator),
56 (r'_', Keyword), # The don't-care variable 56 (r'_', Keyword), # The don't-care variable
57 (r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)), 57 (r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)),
58 (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' 58 (r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
59 u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' 59 r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
60 u'(\\s*)(:-|-->)', 60 r'(\s*)(:-|-->)',
61 bygroups(Name.Function, Text, Operator)), # function defn 61 bygroups(Name.Function, Text, Operator)), # function defn
62 (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' 62 (r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
63 u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' 63 r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
64 u'(\\s*)(\\()', 64 r'(\s*)(\()',
65 bygroups(Name.Function, Text, Punctuation)), 65 bygroups(Name.Function, Text, Punctuation)),
66 (u'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' 66 (r'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
67 u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*', 67 r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*',
68 String.Atom), # atom, characters 68 String.Atom), # atom, characters
69 # This one includes ! 69 # This one includes !
70 (u'[#&*+\\-./:<=>?@\\\\^~\u00a1-\u00bf\u2010-\u303f]+', 70 (r'[#&*+\-./:<=>?@\\^~\u00a1-\u00bf\u2010-\u303f]+',
71 String.Atom), # atom, graphics 71 String.Atom), # atom, graphics
72 (r'[A-Z_]\w*', Name.Variable), 72 (r'[A-Z_]\w*', Name.Variable),
73 (u'\\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text), 73 (r'\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text),
74 ], 74 ],
75 'nested-comment': [ 75 'nested-comment': [
76 (r'\*/', Comment.Multiline, '#pop'), 76 (r'\*/', Comment.Multiline, '#pop'),
77 (r'/\*', Comment.Multiline, '#push'), 77 (r'/\*', Comment.Multiline, '#push'),
78 (r'[^*/]+', Comment.Multiline), 78 (r'[^*/]+', Comment.Multiline),

eric ide

mercurial