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

changeset 7983
54c5cfbb1e29
parent 7701
25f42e208e08
equal deleted inserted replaced
7982:48d210e41c65 7983:54c5cfbb1e29
3 pygments.lexers.urbi 3 pygments.lexers.urbi
4 ~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for UrbiScript language. 6 Lexers for UrbiScript language.
7 7
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2021 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
115 (r'"', String.Double, "string.double"), 115 (r'"', String.Double, "string.double"),
116 (r"'", String.Single, "string.single"), 116 (r"'", String.Single, "string.single"),
117 ], 117 ],
118 'string.double': [ 118 'string.double': [
119 (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback), 119 (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback),
120 (r'(\\\\|\\"|[^"])*?"', String.Double, '#pop'), 120 (r'(\\\\|\\[^\\]|[^"\\])*?"', String.Double, '#pop'),
121 ], 121 ],
122 'string.single': [ 122 'string.single': [
123 (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback), 123 (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback),
124 (r"(\\\\|\\'|[^'])*?'", String.Single, '#pop'), 124 (r"(\\\\|\\[^\\]|[^'\\])*?'", String.Single, '#pop'),
125 ], 125 ],
126 # from http://pygments.org/docs/lexerdevelopment/#changing-states 126 # from http://pygments.org/docs/lexerdevelopment/#changing-states
127 'comment': [ 127 'comment': [
128 (r'[^*/]', Comment.Multiline), 128 (r'[^*/]', Comment.Multiline),
129 (r'/\*', Comment.Multiline, '#push'), 129 (r'/\*', Comment.Multiline, '#push'),
130 (r'\*/', Comment.Multiline, '#pop'), 130 (r'\*/', Comment.Multiline, '#pop'),
131 (r'[*/]', Comment.Multiline), 131 (r'[*/]', Comment.Multiline),
132 ] 132 ]
133 } 133 }
134
135 def analyse_text(text):
136 """This is fairly similar to C and others, but freezeif and
137 waituntil are unique keywords."""
138 result = 0
139
140 if 'freezeif' in text:
141 result += 0.05
142
143 if 'waituntil' in text:
144 result += 0.05
145
146 return result

eric ide

mercurial