Amar-Aly commited on
Commit
ee78fba
·
verified ·
1 Parent(s): 8e535fb

Add files using upload-large-folder tool

Browse files
Files changed (23) hide show
  1. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/lisp.py +0 -0
  2. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/macaulay2.py +1847 -0
  3. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/make.py +212 -0
  4. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/maple.py +291 -0
  5. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/markup.py +1659 -0
  6. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/math.py +21 -0
  7. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/matlab.py +0 -0
  8. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/maxima.py +84 -0
  9. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/meson.py +139 -0
  10. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mime.py +210 -0
  11. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/minecraft.py +392 -0
  12. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mips.py +130 -0
  13. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/ml.py +958 -0
  14. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/modeling.py +368 -0
  15. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/modula2.py +1579 -0
  16. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mojo.py +707 -0
  17. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/monte.py +203 -0
  18. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mosel.py +447 -0
  19. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/ncl.py +894 -0
  20. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nimrod.py +199 -0
  21. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nit.py +63 -0
  22. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nix.py +144 -0
  23. .cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/numbair.py +63 -0
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/lisp.py ADDED
The diff for this file is too large to render. See raw diff
 
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/macaulay2.py ADDED
@@ -0,0 +1,1847 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.macaulay2
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for Macaulay2.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, words
12
+ from pygments.token import Comment, Keyword, Name, String, Text
13
+
14
+ __all__ = ['Macaulay2Lexer']
15
+
16
+ # Auto-generated for Macaulay2-1.25.11. Do not modify this file manually.
17
+
18
+ M2KEYWORDS = (
19
+ "SPACE",
20
+ "TEST",
21
+ "and",
22
+ "break",
23
+ "breakpoint",
24
+ "catch",
25
+ "continue",
26
+ "do",
27
+ "elapsedTime",
28
+ "elapsedTiming",
29
+ "else",
30
+ "for",
31
+ "from",
32
+ "global",
33
+ "if",
34
+ "in",
35
+ "list",
36
+ "local",
37
+ "new",
38
+ "not",
39
+ "of",
40
+ "or",
41
+ "profile",
42
+ "return",
43
+ "shield",
44
+ "step",
45
+ "symbol",
46
+ "then",
47
+ "threadLocal",
48
+ "threadVariable",
49
+ "throw",
50
+ "time",
51
+ "timing",
52
+ "to",
53
+ "try",
54
+ "when",
55
+ "while",
56
+ "xor"
57
+ )
58
+
59
+ M2DATATYPES = (
60
+ "ANCHOR",
61
+ "Adjacent",
62
+ "AffineVariety",
63
+ "Analyzer",
64
+ "AngleBarList",
65
+ "Array",
66
+ "AssociativeExpression",
67
+ "AtomicInt",
68
+ "BLOCKQUOTE",
69
+ "BODY",
70
+ "BOLD",
71
+ "BR",
72
+ "BUTTON",
73
+ "Bag",
74
+ "BasicList",
75
+ "BettiTally",
76
+ "BinaryOperation",
77
+ "Boolean",
78
+ "CC",
79
+ "CDATA",
80
+ "CODE",
81
+ "COMMENT",
82
+ "CacheTable",
83
+ "ChainComplex",
84
+ "ChainComplexMap",
85
+ "CoherentSheaf",
86
+ "Command",
87
+ "CompiledFunction",
88
+ "CompiledFunctionBody",
89
+ "CompiledFunctionClosure",
90
+ "ComplexField",
91
+ "Constant",
92
+ "DD",
93
+ "DIV",
94
+ "DL",
95
+ "DT",
96
+ "Database",
97
+ "Descent",
98
+ "Describe",
99
+ "Dictionary",
100
+ "DirectSum",
101
+ "Divide",
102
+ "DocumentTag",
103
+ "EM",
104
+ "Eliminate",
105
+ "EngineRing",
106
+ "Equation",
107
+ "ExampleItem",
108
+ "Expression",
109
+ "File",
110
+ "FilePosition",
111
+ "FractionField",
112
+ "Function",
113
+ "FunctionApplication",
114
+ "FunctionBody",
115
+ "FunctionClosure",
116
+ "GaloisField",
117
+ "GeneralOrderedMonoid",
118
+ "GlobalDictionary",
119
+ "GradedModule",
120
+ "GradedModuleMap",
121
+ "GroebnerBasis",
122
+ "GroebnerBasisOptions",
123
+ "HEAD",
124
+ "HEADER1",
125
+ "HEADER2",
126
+ "HEADER3",
127
+ "HEADER4",
128
+ "HEADER5",
129
+ "HEADER6",
130
+ "HR",
131
+ "HREF",
132
+ "HTML",
133
+ "HashTable",
134
+ "HeaderType",
135
+ "Holder",
136
+ "Hybrid",
137
+ "Hypertext",
138
+ "HypertextContainer",
139
+ "HypertextParagraph",
140
+ "HypertextVoid",
141
+ "IFRAME",
142
+ "IMG",
143
+ "INDENT",
144
+ "INPUT",
145
+ "ITALIC",
146
+ "Ideal",
147
+ "ImmutableType",
148
+ "IndeterminateNumber",
149
+ "IndexedVariable",
150
+ "IndexedVariableTable",
151
+ "InexactField",
152
+ "InexactFieldFamily",
153
+ "InexactNumber",
154
+ "InfiniteNumber",
155
+ "IntermediateMarkUpType",
156
+ "Iterator",
157
+ "KBD",
158
+ "Keyword",
159
+ "LABEL",
160
+ "LATER",
161
+ "LI",
162
+ "LINK",
163
+ "LITERAL",
164
+ "List",
165
+ "LocalDictionary",
166
+ "LowerBound",
167
+ "MENU",
168
+ "META",
169
+ "Manipulator",
170
+ "MapExpression",
171
+ "MarkUpType",
172
+ "Matrix",
173
+ "MatrixExpression",
174
+ "MethodFunction",
175
+ "MethodFunctionBinary",
176
+ "MethodFunctionSingle",
177
+ "MethodFunctionWithOptions",
178
+ "Minus",
179
+ "Module",
180
+ "Monoid",
181
+ "MonoidElement",
182
+ "MonomialIdeal",
183
+ "MultigradedBettiTally",
184
+ "MutableHashTable",
185
+ "MutableList",
186
+ "MutableMatrix",
187
+ "Net",
188
+ "NetFile",
189
+ "Nothing",
190
+ "Number",
191
+ "NumberedVerticalList",
192
+ "OL",
193
+ "OneExpression",
194
+ "Option",
195
+ "OptionTable",
196
+ "OrderedMonoid",
197
+ "PARA",
198
+ "PRE",
199
+ "Package",
200
+ "Parenthesize",
201
+ "Parser",
202
+ "Partition",
203
+ "PolynomialRing",
204
+ "Power",
205
+ "Product",
206
+ "ProductOrder",
207
+ "Program",
208
+ "ProgramRun",
209
+ "ProjectiveHilbertPolynomial",
210
+ "ProjectiveVariety",
211
+ "Pseudocode",
212
+ "PseudocodeClosure",
213
+ "QQ",
214
+ "QuotientRing",
215
+ "RR",
216
+ "RRi",
217
+ "RealField",
218
+ "Resolution",
219
+ "Ring",
220
+ "RingElement",
221
+ "RingFamily",
222
+ "RingMap",
223
+ "RowExpression",
224
+ "SAMP",
225
+ "SCRIPT",
226
+ "SMALL",
227
+ "SPAN",
228
+ "STRONG",
229
+ "STYLE",
230
+ "SUB",
231
+ "SUBSECTION",
232
+ "SUP",
233
+ "ScriptedFunctor",
234
+ "SelfInitializingType",
235
+ "Sequence",
236
+ "Set",
237
+ "SheafExpression",
238
+ "SheafMap",
239
+ "SheafOfRings",
240
+ "SparseMonomialVectorExpression",
241
+ "SparseVectorExpression",
242
+ "String",
243
+ "Subscript",
244
+ "Sum",
245
+ "SumOfTwists",
246
+ "Superscript",
247
+ "Symbol",
248
+ "SymbolBody",
249
+ "TABLE",
250
+ "TD",
251
+ "TEX",
252
+ "TH",
253
+ "TITLE",
254
+ "TO",
255
+ "TO2",
256
+ "TOH",
257
+ "TR",
258
+ "TT",
259
+ "Table",
260
+ "Tally",
261
+ "Task",
262
+ "TensorProduct",
263
+ "TestInput",
264
+ "Thing",
265
+ "Time",
266
+ "Type",
267
+ "UL",
268
+ "URL",
269
+ "VAR",
270
+ "Variety",
271
+ "Vector",
272
+ "VectorExpression",
273
+ "VerticalList",
274
+ "VirtualTally",
275
+ "VisibleList",
276
+ "WrapperType",
277
+ "ZZ",
278
+ "ZeroExpression"
279
+ )
280
+
281
+ M2FUNCTIONS = (
282
+ "BesselJ",
283
+ "BesselY",
284
+ "Beta",
285
+ "Digamma",
286
+ "EXAMPLE",
287
+ "End",
288
+ "Fano",
289
+ "GCstats",
290
+ "GF",
291
+ "Gamma",
292
+ "Grassmannian",
293
+ "Hom",
294
+ "LLL",
295
+ "LUdecomposition",
296
+ "M2CODE",
297
+ "NNParser",
298
+ "Proj",
299
+ "QQParser",
300
+ "QRDecomposition",
301
+ "SVD",
302
+ "SYNOPSIS",
303
+ "Schubert",
304
+ "Spec",
305
+ "ZZParser",
306
+ "about",
307
+ "abs",
308
+ "accumulate",
309
+ "acos",
310
+ "acosh",
311
+ "acot",
312
+ "acoth",
313
+ "addCancelTask",
314
+ "addDependencyTask",
315
+ "addEndFunction",
316
+ "addHook",
317
+ "addStartTask",
318
+ "adjoint",
319
+ "agm",
320
+ "alarm",
321
+ "all",
322
+ "ambient",
323
+ "analyticSpread",
324
+ "ancestor",
325
+ "ancestors",
326
+ "andP",
327
+ "ann",
328
+ "annihilator",
329
+ "antipode",
330
+ "any",
331
+ "append",
332
+ "applicationDirectory",
333
+ "apply",
334
+ "applyKeys",
335
+ "applyPairs",
336
+ "applyTable",
337
+ "applyValues",
338
+ "apropos",
339
+ "arXiv",
340
+ "ascii",
341
+ "asin",
342
+ "asinh",
343
+ "ass",
344
+ "assert",
345
+ "associatedGradedRing",
346
+ "associatedPrimes",
347
+ "atEndOfFile",
348
+ "atan",
349
+ "atan2",
350
+ "atanh",
351
+ "autoload",
352
+ "baseFilename",
353
+ "baseName",
354
+ "baseRing",
355
+ "basis",
356
+ "beginDocumentation",
357
+ "benchmark",
358
+ "betti",
359
+ "between",
360
+ "binomial",
361
+ "borel",
362
+ "cacheValue",
363
+ "cancelTask",
364
+ "canonicalBundle",
365
+ "capture",
366
+ "ceiling",
367
+ "centerString",
368
+ "chainComplex",
369
+ "changeBase",
370
+ "changeDirectory",
371
+ "char",
372
+ "charAnalyzer",
373
+ "characters",
374
+ "check",
375
+ "checkDegrees",
376
+ "chi",
377
+ "class",
378
+ "clean",
379
+ "clearEcho",
380
+ "code",
381
+ "codim",
382
+ "coefficient",
383
+ "coefficientRing",
384
+ "coefficients",
385
+ "cohomology",
386
+ "coimage",
387
+ "coker",
388
+ "cokernel",
389
+ "collectGarbage",
390
+ "columnAdd",
391
+ "columnMult",
392
+ "columnPermute",
393
+ "columnRankProfile",
394
+ "columnSwap",
395
+ "columnate",
396
+ "combine",
397
+ "commandInterpreter",
398
+ "commonRing",
399
+ "commonest",
400
+ "comodule",
401
+ "compareExchange",
402
+ "complement",
403
+ "complete",
404
+ "components",
405
+ "compose",
406
+ "compositions",
407
+ "compress",
408
+ "concatenate",
409
+ "conductor",
410
+ "cone",
411
+ "conjugate",
412
+ "connectionCount",
413
+ "constParser",
414
+ "content",
415
+ "contract",
416
+ "conwayPolynomial",
417
+ "copy",
418
+ "copyDirectory",
419
+ "copyFile",
420
+ "cos",
421
+ "cosh",
422
+ "cot",
423
+ "cotangentSheaf",
424
+ "coth",
425
+ "cover",
426
+ "coverMap",
427
+ "cpuTime",
428
+ "createTask",
429
+ "csc",
430
+ "csch",
431
+ "currentColumnNumber",
432
+ "currentDirectory",
433
+ "currentPosition",
434
+ "currentRowNumber",
435
+ "currentTime",
436
+ "deadParser",
437
+ "debug",
438
+ "debugError",
439
+ "decompose",
440
+ "deepSplice",
441
+ "default",
442
+ "degree",
443
+ "degreeGroup",
444
+ "degreeLength",
445
+ "degrees",
446
+ "degreesMonoid",
447
+ "degreesRing",
448
+ "delete",
449
+ "demark",
450
+ "denominator",
451
+ "depth",
452
+ "describe",
453
+ "det",
454
+ "determinant",
455
+ "diagonalMatrix",
456
+ "diameter",
457
+ "dictionary",
458
+ "diff",
459
+ "difference",
460
+ "dim",
461
+ "directProduct",
462
+ "directSum",
463
+ "disassemble",
464
+ "discriminant",
465
+ "dismiss",
466
+ "distinguished",
467
+ "divideByVariable",
468
+ "doc",
469
+ "document",
470
+ "drop",
471
+ "dual",
472
+ "eagonNorthcott",
473
+ "echoOff",
474
+ "echoOn",
475
+ "eigenvalues",
476
+ "eigenvectors",
477
+ "eint",
478
+ "elements",
479
+ "eliminate",
480
+ "endPackage",
481
+ "entries",
482
+ "erase",
483
+ "erf",
484
+ "erfc",
485
+ "error",
486
+ "euler",
487
+ "eulers",
488
+ "even",
489
+ "examples",
490
+ "exchange",
491
+ "exec",
492
+ "exp",
493
+ "expectedReesIdeal",
494
+ "expm1",
495
+ "exponents",
496
+ "export",
497
+ "exportFrom",
498
+ "exportMutable",
499
+ "expression",
500
+ "extend",
501
+ "exteriorPower",
502
+ "factor",
503
+ "fileExecutable",
504
+ "fileExists",
505
+ "fileLength",
506
+ "fileMode",
507
+ "fileReadable",
508
+ "fileTime",
509
+ "fileWritable",
510
+ "fillMatrix",
511
+ "findFiles",
512
+ "findHeft",
513
+ "findProgram",
514
+ "findSynonyms",
515
+ "first",
516
+ "firstkey",
517
+ "fittingIdeal",
518
+ "flagLookup",
519
+ "flatten",
520
+ "flattenRing",
521
+ "flip",
522
+ "floor",
523
+ "fold",
524
+ "forceGB",
525
+ "fork",
526
+ "format",
527
+ "formation",
528
+ "frac",
529
+ "fraction",
530
+ "frames",
531
+ "fromDividedPowers",
532
+ "fromDual",
533
+ "functionBody",
534
+ "futureParser",
535
+ "gb",
536
+ "gbRemove",
537
+ "gbSnapshot",
538
+ "gcd",
539
+ "gcdCoefficients",
540
+ "gcdLLL",
541
+ "genera",
542
+ "generateAssertions",
543
+ "generator",
544
+ "generators",
545
+ "genericMatrix",
546
+ "genericSkewMatrix",
547
+ "genericSymmetricMatrix",
548
+ "gens",
549
+ "genus",
550
+ "get",
551
+ "getChangeMatrix",
552
+ "getGlobalSymbol",
553
+ "getIOThreadMode",
554
+ "getNetFile",
555
+ "getNonUnit",
556
+ "getPrimeWithRootOfUnity",
557
+ "getSymbol",
558
+ "getWWW",
559
+ "getc",
560
+ "getenv",
561
+ "globalAssign",
562
+ "globalAssignFunction",
563
+ "globalAssignment",
564
+ "globalReleaseFunction",
565
+ "gradedModule",
566
+ "gradedModuleMap",
567
+ "gramm",
568
+ "graphIdeal",
569
+ "graphRing",
570
+ "groebnerBasis",
571
+ "groupID",
572
+ "hash",
573
+ "hashTable",
574
+ "headlines",
575
+ "heft",
576
+ "height",
577
+ "hermite",
578
+ "hilbertFunction",
579
+ "hilbertPolynomial",
580
+ "hilbertSeries",
581
+ "hold",
582
+ "homogenize",
583
+ "homology",
584
+ "homomorphism",
585
+ "hooks",
586
+ "horizontalJoin",
587
+ "html",
588
+ "httpHeaders",
589
+ "hypertext",
590
+ "icFracP",
591
+ "icFractions",
592
+ "icMap",
593
+ "icPIdeal",
594
+ "ideal",
595
+ "idealSheaf",
596
+ "idealizer",
597
+ "identity",
598
+ "image",
599
+ "imaginaryPart",
600
+ "importFrom",
601
+ "independentSets",
602
+ "index",
603
+ "indices",
604
+ "inducedMap",
605
+ "inducesWellDefinedMap",
606
+ "info",
607
+ "input",
608
+ "insert",
609
+ "installAssignmentMethod",
610
+ "installHilbertFunction",
611
+ "installMethod",
612
+ "installMinprimes",
613
+ "installPackage",
614
+ "installedPackages",
615
+ "instance",
616
+ "instances",
617
+ "integralClosure",
618
+ "integrate",
619
+ "intersect",
620
+ "intersectInP",
621
+ "intersection",
622
+ "interval",
623
+ "inverse",
624
+ "inverseErf",
625
+ "inversePermutation",
626
+ "inverseRegularizedBeta",
627
+ "inverseRegularizedGamma",
628
+ "inverseSystem",
629
+ "irreducibleCharacteristicSeries",
630
+ "irreducibleDecomposition",
631
+ "isANumber",
632
+ "isAffineRing",
633
+ "isBorel",
634
+ "isCanceled",
635
+ "isCommutative",
636
+ "isConstant",
637
+ "isDirectSum",
638
+ "isDirectory",
639
+ "isEmpty",
640
+ "isExact",
641
+ "isField",
642
+ "isFinite",
643
+ "isFinitePrimeField",
644
+ "isFreeModule",
645
+ "isGlobalSymbol",
646
+ "isHomogeneous",
647
+ "isIdeal",
648
+ "isInfinite",
649
+ "isInjective",
650
+ "isInputFile",
651
+ "isIsomorphic",
652
+ "isIsomorphism",
653
+ "isLLL",
654
+ "isLinearType",
655
+ "isListener",
656
+ "isLocallyFree",
657
+ "isMember",
658
+ "isModule",
659
+ "isMonomialIdeal",
660
+ "isMutable",
661
+ "isNormal",
662
+ "isOpen",
663
+ "isOutputFile",
664
+ "isPolynomialRing",
665
+ "isPrimary",
666
+ "isPrime",
667
+ "isPrimitive",
668
+ "isProjective",
669
+ "isPseudoprime",
670
+ "isQuotientModule",
671
+ "isQuotientOf",
672
+ "isQuotientRing",
673
+ "isReady",
674
+ "isReal",
675
+ "isReduction",
676
+ "isRegularFile",
677
+ "isRing",
678
+ "isSkewCommutative",
679
+ "isSmooth",
680
+ "isSorted",
681
+ "isSquareFree",
682
+ "isStandardGradedPolynomialRing",
683
+ "isSubmodule",
684
+ "isSubquotient",
685
+ "isSubset",
686
+ "isSupportedInZeroLocus",
687
+ "isSurjective",
688
+ "isTable",
689
+ "isUnit",
690
+ "isVeryAmple",
691
+ "isWellDefined",
692
+ "isWeylAlgebra",
693
+ "isc",
694
+ "isomorphism",
695
+ "iterator",
696
+ "jacobian",
697
+ "jacobianDual",
698
+ "join",
699
+ "ker",
700
+ "kernel",
701
+ "kernelLLL",
702
+ "kernelOfLocalization",
703
+ "keys",
704
+ "kill",
705
+ "koszul",
706
+ "last",
707
+ "lcm",
708
+ "leadCoefficient",
709
+ "leadComponent",
710
+ "leadMonomial",
711
+ "leadTerm",
712
+ "left",
713
+ "length",
714
+ "letterParser",
715
+ "lift",
716
+ "liftable",
717
+ "limitFiles",
718
+ "limitProcesses",
719
+ "lines",
720
+ "linkFile",
721
+ "listForm",
722
+ "listSymbols",
723
+ "lngamma",
724
+ "load",
725
+ "loadPackage",
726
+ "localDictionaries",
727
+ "localize",
728
+ "locate",
729
+ "log",
730
+ "log1p",
731
+ "lookup",
732
+ "lookupCount",
733
+ "makeDirectory",
734
+ "makeDocumentTag",
735
+ "makePackageIndex",
736
+ "makeS2",
737
+ "map",
738
+ "markedGB",
739
+ "match",
740
+ "mathML",
741
+ "matrix",
742
+ "max",
743
+ "maxPosition",
744
+ "member",
745
+ "memoize",
746
+ "memoizeClear",
747
+ "memoizeValues",
748
+ "merge",
749
+ "mergePairs",
750
+ "method",
751
+ "methodOptions",
752
+ "methods",
753
+ "midpoint",
754
+ "min",
755
+ "minPosition",
756
+ "minPres",
757
+ "mingens",
758
+ "mingle",
759
+ "minimalBetti",
760
+ "minimalPresentation",
761
+ "minimalPrimes",
762
+ "minimalReduction",
763
+ "minimize",
764
+ "minimizeFilename",
765
+ "minors",
766
+ "minprimes",
767
+ "minus",
768
+ "mkdir",
769
+ "mod",
770
+ "module",
771
+ "modulo",
772
+ "monoid",
773
+ "monomialCurveIdeal",
774
+ "monomialIdeal",
775
+ "monomialSubideal",
776
+ "monomials",
777
+ "moveFile",
778
+ "multidegree",
779
+ "multidoc",
780
+ "multigraded",
781
+ "multiplicity",
782
+ "mutable",
783
+ "mutableIdentity",
784
+ "mutableMatrix",
785
+ "nanosleep",
786
+ "needs",
787
+ "needsPackage",
788
+ "net",
789
+ "netList",
790
+ "newClass",
791
+ "newCoordinateSystem",
792
+ "newNetFile",
793
+ "newPackage",
794
+ "newRing",
795
+ "next",
796
+ "nextPrime",
797
+ "nextkey",
798
+ "nonspaceAnalyzer",
799
+ "norm",
800
+ "normalCone",
801
+ "notImplemented",
802
+ "nullParser",
803
+ "nullSpace",
804
+ "nullhomotopy",
805
+ "numColumns",
806
+ "numRows",
807
+ "number",
808
+ "numcols",
809
+ "numerator",
810
+ "numeric",
811
+ "numericInterval",
812
+ "numgens",
813
+ "numrows",
814
+ "odd",
815
+ "oeis",
816
+ "ofClass",
817
+ "on",
818
+ "openDatabase",
819
+ "openDatabaseOut",
820
+ "openFiles",
821
+ "openIn",
822
+ "openInOut",
823
+ "openListener",
824
+ "openOut",
825
+ "openOutAppend",
826
+ "optP",
827
+ "optionalSignParser",
828
+ "options",
829
+ "orP",
830
+ "override",
831
+ "pack",
832
+ "package",
833
+ "packageTemplate",
834
+ "pad",
835
+ "pager",
836
+ "pairs",
837
+ "parallelApply",
838
+ "parent",
839
+ "part",
840
+ "partition",
841
+ "partitions",
842
+ "parts",
843
+ "pdim",
844
+ "peek",
845
+ "permanents",
846
+ "permutations",
847
+ "pfaffian",
848
+ "pfaffians",
849
+ "pivots",
850
+ "plus",
851
+ "poincare",
852
+ "poincareN",
853
+ "polarize",
854
+ "poly",
855
+ "position",
856
+ "positions",
857
+ "power",
858
+ "powermod",
859
+ "precision",
860
+ "preimage",
861
+ "prepend",
862
+ "presentation",
863
+ "pretty",
864
+ "primaryComponent",
865
+ "primaryDecomposition",
866
+ "print",
867
+ "printString",
868
+ "printerr",
869
+ "processID",
870
+ "product",
871
+ "projectiveHilbertPolynomial",
872
+ "promote",
873
+ "protect",
874
+ "prune",
875
+ "pseudoRemainder",
876
+ "pseudocode",
877
+ "pullback",
878
+ "pushForward",
879
+ "pushout",
880
+ "quotient",
881
+ "quotientRemainder",
882
+ "radical",
883
+ "radicalContainment",
884
+ "random",
885
+ "randomKRationalPoint",
886
+ "randomMutableMatrix",
887
+ "randomSubset",
888
+ "rank",
889
+ "rays",
890
+ "read",
891
+ "readDirectory",
892
+ "readPackage",
893
+ "readlink",
894
+ "realPart",
895
+ "realpath",
896
+ "recursionDepth",
897
+ "reduceHilbert",
898
+ "reducedRowEchelonForm",
899
+ "reductionNumber",
900
+ "reesAlgebra",
901
+ "reesAlgebraIdeal",
902
+ "reesIdeal",
903
+ "regSeqInIdeal",
904
+ "regex",
905
+ "regexQuote",
906
+ "registerFinalizer",
907
+ "regularity",
908
+ "regularizedBeta",
909
+ "regularizedGamma",
910
+ "relations",
911
+ "relativizeFilename",
912
+ "remainder",
913
+ "remove",
914
+ "removeDirectory",
915
+ "removeFile",
916
+ "removeLowestDimension",
917
+ "reorganize",
918
+ "replace",
919
+ "res",
920
+ "reshape",
921
+ "resolution",
922
+ "resultant",
923
+ "reverse",
924
+ "right",
925
+ "ring",
926
+ "ringFromFractions",
927
+ "roots",
928
+ "rotate",
929
+ "round",
930
+ "rowAdd",
931
+ "rowMult",
932
+ "rowPermute",
933
+ "rowRankProfile",
934
+ "rowSwap",
935
+ "rsort",
936
+ "run",
937
+ "runHooks",
938
+ "runLengthEncode",
939
+ "runProgram",
940
+ "same",
941
+ "saturate",
942
+ "scan",
943
+ "scanKeys",
944
+ "scanLines",
945
+ "scanPairs",
946
+ "scanValues",
947
+ "schedule",
948
+ "schreyerOrder",
949
+ "searchPath",
950
+ "sec",
951
+ "sech",
952
+ "seeParsing",
953
+ "select",
954
+ "selectInSubring",
955
+ "selectKeys",
956
+ "selectPairs",
957
+ "selectValues",
958
+ "selectVariables",
959
+ "separate",
960
+ "separateRegexp",
961
+ "sequence",
962
+ "serialNumber",
963
+ "set",
964
+ "setEcho",
965
+ "setGroupID",
966
+ "setIOExclusive",
967
+ "setIOSynchronized",
968
+ "setIOUnSynchronized",
969
+ "setRandomSeed",
970
+ "setup",
971
+ "setupEmacs",
972
+ "setupLift",
973
+ "setupPromote",
974
+ "sheaf",
975
+ "sheafHom",
976
+ "sheafMap",
977
+ "show",
978
+ "showHtml",
979
+ "showTex",
980
+ "sign",
981
+ "simpleDocFrob",
982
+ "sin",
983
+ "singularLocus",
984
+ "sinh",
985
+ "size",
986
+ "size2",
987
+ "sleep",
988
+ "smithNormalForm",
989
+ "solve",
990
+ "someTerms",
991
+ "sort",
992
+ "sortColumns",
993
+ "source",
994
+ "span",
995
+ "specialFiber",
996
+ "specialFiberIdeal",
997
+ "splice",
998
+ "splitWWW",
999
+ "sqrt",
1000
+ "stack",
1001
+ "stacksProject",
1002
+ "stacktrace",
1003
+ "standardForm",
1004
+ "standardPairs",
1005
+ "stashValue",
1006
+ "status",
1007
+ "store",
1008
+ "style",
1009
+ "sub",
1010
+ "sublists",
1011
+ "submatrix",
1012
+ "submatrixByDegrees",
1013
+ "subquotient",
1014
+ "subsets",
1015
+ "substitute",
1016
+ "substring",
1017
+ "subtable",
1018
+ "sum",
1019
+ "super",
1020
+ "support",
1021
+ "switch",
1022
+ "sylvesterMatrix",
1023
+ "symbolBody",
1024
+ "symlinkDirectory",
1025
+ "symlinkFile",
1026
+ "symmetricAlgebra",
1027
+ "symmetricAlgebraIdeal",
1028
+ "symmetricKernel",
1029
+ "symmetricPower",
1030
+ "synonym",
1031
+ "syz",
1032
+ "syzygyScheme",
1033
+ "table",
1034
+ "take",
1035
+ "tally",
1036
+ "tan",
1037
+ "tangentCone",
1038
+ "tangentSheaf",
1039
+ "tanh",
1040
+ "target",
1041
+ "taskResult",
1042
+ "temporaryFileName",
1043
+ "tensor",
1044
+ "tensorAssociativity",
1045
+ "terminalParser",
1046
+ "terms",
1047
+ "testHunekeQuestion",
1048
+ "tests",
1049
+ "tex",
1050
+ "texMath",
1051
+ "times",
1052
+ "toAbsolutePath",
1053
+ "toCC",
1054
+ "toDividedPowers",
1055
+ "toDual",
1056
+ "toExternalString",
1057
+ "toField",
1058
+ "toList",
1059
+ "toLower",
1060
+ "toRR",
1061
+ "toRRi",
1062
+ "toSequence",
1063
+ "toString",
1064
+ "toUpper",
1065
+ "top",
1066
+ "topCoefficients",
1067
+ "topComponents",
1068
+ "trace",
1069
+ "transpose",
1070
+ "trim",
1071
+ "truncate",
1072
+ "truncateOutput",
1073
+ "tutorial",
1074
+ "ultimate",
1075
+ "unbag",
1076
+ "uncurry",
1077
+ "undocumented",
1078
+ "uniform",
1079
+ "uninstallAllPackages",
1080
+ "uninstallPackage",
1081
+ "union",
1082
+ "unique",
1083
+ "uniquePermutations",
1084
+ "unsequence",
1085
+ "unstack",
1086
+ "urlEncode",
1087
+ "use",
1088
+ "userSymbols",
1089
+ "utf8",
1090
+ "utf8check",
1091
+ "utf8substring",
1092
+ "validate",
1093
+ "value",
1094
+ "values",
1095
+ "variety",
1096
+ "vars",
1097
+ "vector",
1098
+ "versalEmbedding",
1099
+ "wait",
1100
+ "wedgeProduct",
1101
+ "weightRange",
1102
+ "whichGm",
1103
+ "width",
1104
+ "wikipedia",
1105
+ "wrap",
1106
+ "youngest",
1107
+ "zero",
1108
+ "zeta"
1109
+ )
1110
+
1111
+ M2CONSTANTS = (
1112
+ "A1BrouwerDegrees",
1113
+ "AbstractSimplicialComplexes",
1114
+ "AbstractToricVarieties",
1115
+ "Acknowledgement",
1116
+ "AdditionalPaths",
1117
+ "AdjointIdeal",
1118
+ "AdjunctionForSurfaces",
1119
+ "AfterEval",
1120
+ "AfterNoPrint",
1121
+ "AfterPrint",
1122
+ "AInfinity",
1123
+ "AlgebraicSplines",
1124
+ "Algorithm",
1125
+ "Alignment",
1126
+ "AllCodimensions",
1127
+ "AllMarkovBases",
1128
+ "allowableThreads",
1129
+ "AnalyzeSheafOnP1",
1130
+ "applicationDirectorySuffix",
1131
+ "argument",
1132
+ "Ascending",
1133
+ "AssociativeAlgebras",
1134
+ "Authors",
1135
+ "AuxiliaryFiles",
1136
+ "backtrace",
1137
+ "Bareiss",
1138
+ "Base",
1139
+ "BaseFunction",
1140
+ "baseRings",
1141
+ "BaseRow",
1142
+ "BasisElementLimit",
1143
+ "Bayer",
1144
+ "BeforePrint",
1145
+ "BeginningMacaulay2",
1146
+ "Benchmark",
1147
+ "BernsteinSato",
1148
+ "Bertini",
1149
+ "BettiCharacters",
1150
+ "BGG",
1151
+ "BIBasis",
1152
+ "Binary",
1153
+ "Binomial",
1154
+ "BinomialEdgeIdeals",
1155
+ "Binomials",
1156
+ "BKZ",
1157
+ "blockMatrixForm",
1158
+ "Body",
1159
+ "BoijSoederberg",
1160
+ "Book3264Examples",
1161
+ "BooleanGB",
1162
+ "Boxes",
1163
+ "Brackets",
1164
+ "Browse",
1165
+ "Bruns",
1166
+ "cache",
1167
+ "CacheExampleOutput",
1168
+ "CallLimit",
1169
+ "CannedExample",
1170
+ "CatalanConstant",
1171
+ "Caveat",
1172
+ "CellularResolutions",
1173
+ "Center",
1174
+ "Certification",
1175
+ "ChainComplexExtras",
1176
+ "ChainComplexOperations",
1177
+ "ChangeMatrix",
1178
+ "CharacteristicClasses",
1179
+ "CheckDocumentation",
1180
+ "Chordal",
1181
+ "Citation",
1182
+ "cite",
1183
+ "Classic",
1184
+ "clearAll",
1185
+ "clearOutput",
1186
+ "close",
1187
+ "closeIn",
1188
+ "closeOut",
1189
+ "ClosestFit",
1190
+ "Code",
1191
+ "CodimensionLimit",
1192
+ "CodingTheory",
1193
+ "CoefficientRing",
1194
+ "Cofactor",
1195
+ "CohenEngine",
1196
+ "CohenTopLevel",
1197
+ "CohomCalg",
1198
+ "CoincidentRootLoci",
1199
+ "commandLine",
1200
+ "compactMatrixForm",
1201
+ "Complement",
1202
+ "CompleteIntersection",
1203
+ "CompleteIntersectionResolutions",
1204
+ "Complexes",
1205
+ "ConductorElement",
1206
+ "Configuration",
1207
+ "ConformalBlocks",
1208
+ "ConnectionMatrices",
1209
+ "Consequences",
1210
+ "Constants",
1211
+ "Contributors",
1212
+ "ConvexInterface",
1213
+ "ConwayPolynomials",
1214
+ "copyright",
1215
+ "Core",
1216
+ "CorrespondenceScrolls",
1217
+ "CotangentSchubert",
1218
+ "cotangentSurjection",
1219
+ "coverageSummary",
1220
+ "CpMackeyFunctors",
1221
+ "Cremona",
1222
+ "currentFileDirectory",
1223
+ "currentFileName",
1224
+ "currentLayout",
1225
+ "currentPackage",
1226
+ "Cyclotomic",
1227
+ "Date",
1228
+ "dd",
1229
+ "DebuggingMode",
1230
+ "debuggingMode",
1231
+ "debugLevel",
1232
+ "DecomposableSparseSystems",
1233
+ "Decompose",
1234
+ "Default",
1235
+ "defaultPrecision",
1236
+ "Degree",
1237
+ "DegreeGroup",
1238
+ "DegreeLift",
1239
+ "DegreeLimit",
1240
+ "DegreeMap",
1241
+ "DegreeOrder",
1242
+ "DegreeRank",
1243
+ "Degrees",
1244
+ "Dense",
1245
+ "Density",
1246
+ "Depth",
1247
+ "Descending",
1248
+ "Description",
1249
+ "DeterminantalRepresentations",
1250
+ "DGAlgebras",
1251
+ "dictionaryPath",
1252
+ "DiffAlg",
1253
+ "Dispatch",
1254
+ "DivideConquer",
1255
+ "DividedPowers",
1256
+ "Dmodules",
1257
+ "docExample",
1258
+ "docTemplate",
1259
+ "Down",
1260
+ "Dynamic",
1261
+ "EagonResolution",
1262
+ "EdgeIdeals",
1263
+ "edit",
1264
+ "EigenSolver",
1265
+ "EisenbudHunekeVasconcelos",
1266
+ "Elimination",
1267
+ "EliminationMatrices",
1268
+ "EllipticCurves",
1269
+ "EllipticIntegrals",
1270
+ "Email",
1271
+ "embeddedToAbstract",
1272
+ "end",
1273
+ "endl",
1274
+ "Engine",
1275
+ "engineDebugLevel",
1276
+ "EngineTests",
1277
+ "EnumerationCurves",
1278
+ "environment",
1279
+ "EquivariantGB",
1280
+ "errorDepth",
1281
+ "EulerConstant",
1282
+ "eulerSequence",
1283
+ "Example",
1284
+ "ExampleFiles",
1285
+ "ExampleSystems",
1286
+ "Exclude",
1287
+ "exit",
1288
+ "Ext",
1289
+ "ExteriorExtensions",
1290
+ "ExteriorIdeals",
1291
+ "ExteriorModules",
1292
+ "ExtLongExactSequence",
1293
+ "false",
1294
+ "FastMinors",
1295
+ "FastNonminimal",
1296
+ "FGLM",
1297
+ "fileDictionaries",
1298
+ "fileExitHooks",
1299
+ "FileName",
1300
+ "FindOne",
1301
+ "FiniteFittingIdeals",
1302
+ "First",
1303
+ "FirstPackage",
1304
+ "FlatMonoid",
1305
+ "Flexible",
1306
+ "flush",
1307
+ "FollowLinks",
1308
+ "ForeignFunctions",
1309
+ "FormalGroupLaws",
1310
+ "Format",
1311
+ "FourierMotzkin",
1312
+ "FourTiTwo",
1313
+ "fpLLL",
1314
+ "FrobeniusThresholds",
1315
+ "FunctionFieldDesingularization",
1316
+ "GameTheory",
1317
+ "GBDegrees",
1318
+ "gbTrace",
1319
+ "GenerateAssertions",
1320
+ "Generic",
1321
+ "GenericInitialIdeal",
1322
+ "GeometricDecomposability",
1323
+ "gfanInterface",
1324
+ "Givens",
1325
+ "GKMVarieties",
1326
+ "GLex",
1327
+ "Global",
1328
+ "GlobalAssignHook",
1329
+ "globalAssignmentHooks",
1330
+ "GlobalHookStore",
1331
+ "GlobalReleaseHook",
1332
+ "GlobalSectionLimit",
1333
+ "Gorenstein",
1334
+ "GradedLieAlgebras",
1335
+ "GraphicalModels",
1336
+ "GraphicalModelsMLE",
1337
+ "Graphics",
1338
+ "Graphs",
1339
+ "GRevLex",
1340
+ "GroebnerStrata",
1341
+ "GroebnerWalk",
1342
+ "GroupLex",
1343
+ "GroupRevLex",
1344
+ "GTZ",
1345
+ "Hadamard",
1346
+ "handleInterrupts",
1347
+ "HardDegreeLimit",
1348
+ "Heading",
1349
+ "Headline",
1350
+ "Heft",
1351
+ "Height",
1352
+ "help",
1353
+ "Hermite",
1354
+ "Hermitian",
1355
+ "HH",
1356
+ "hh",
1357
+ "HigherCIOperators",
1358
+ "HighestWeights",
1359
+ "Hilbert",
1360
+ "HodgeIntegrals",
1361
+ "HolonomicSystems",
1362
+ "homeDirectory",
1363
+ "HomePage",
1364
+ "Homogeneous",
1365
+ "Homogeneous2",
1366
+ "HomologicalAlgebraPackage",
1367
+ "HomotopyLieAlgebra",
1368
+ "HorizontalSpace",
1369
+ "HyperplaneArrangements",
1370
+ "id",
1371
+ "idealSheafSequence",
1372
+ "IgnoreExampleErrors",
1373
+ "ii",
1374
+ "IncidenceCorrespondenceCohomology",
1375
+ "incomparable",
1376
+ "Increment",
1377
+ "indeterminate",
1378
+ "Index",
1379
+ "indexComponents",
1380
+ "infinity",
1381
+ "InfoDirSection",
1382
+ "infoHelp",
1383
+ "Inhomogeneous",
1384
+ "Inputs",
1385
+ "InstallPrefix",
1386
+ "IntegerProgramming",
1387
+ "IntegralClosure",
1388
+ "interpreterDepth",
1389
+ "Intersection",
1390
+ "InvariantRing",
1391
+ "InverseMethod",
1392
+ "Inverses",
1393
+ "InverseSystems",
1394
+ "Invertible",
1395
+ "InvolutiveBases",
1396
+ "Isomorphism",
1397
+ "Item",
1398
+ "Iterate",
1399
+ "Jacobian",
1400
+ "Jets",
1401
+ "Join",
1402
+ "JSON",
1403
+ "JSONRPC",
1404
+ "K3Carpets",
1405
+ "K3Surfaces",
1406
+ "Keep",
1407
+ "KeepFiles",
1408
+ "KeepZeroes",
1409
+ "Key",
1410
+ "Keywords",
1411
+ "Kronecker",
1412
+ "KustinMiller",
1413
+ "lastMatch",
1414
+ "LatticePolytopes",
1415
+ "Layout",
1416
+ "Left",
1417
+ "LengthLimit",
1418
+ "Lex",
1419
+ "LexIdeals",
1420
+ "LieAlgebraRepresentations",
1421
+ "Limit",
1422
+ "Linear",
1423
+ "LinearAlgebra",
1424
+ "LinearTruncations",
1425
+ "lineNumber",
1426
+ "listLocalSymbols",
1427
+ "listUserSymbols",
1428
+ "LLLBases",
1429
+ "loadDepth",
1430
+ "LoadDocumentation",
1431
+ "loadedFiles",
1432
+ "loadedPackages",
1433
+ "Local",
1434
+ "LocalRings",
1435
+ "LongPolynomial",
1436
+ "M0nbar",
1437
+ "Macaulay2Doc",
1438
+ "Maintainer",
1439
+ "MakeDocumentation",
1440
+ "MakeHTML",
1441
+ "MakeInfo",
1442
+ "MakePDF",
1443
+ "MapleInterface",
1444
+ "Markov",
1445
+ "MatchingFields",
1446
+ "MatrixFactorizations",
1447
+ "MatrixSchubert",
1448
+ "Matroids",
1449
+ "maxAllowableThreads",
1450
+ "maxExponent",
1451
+ "MaximalRank",
1452
+ "MaxReductionCount",
1453
+ "MCMApproximations",
1454
+ "MergeTeX",
1455
+ "minExponent",
1456
+ "MinimalGenerators",
1457
+ "MinimalMatrix",
1458
+ "minimalPresentationMap",
1459
+ "minimalPresentationMapInv",
1460
+ "MinimalPrimes",
1461
+ "Minimize",
1462
+ "MinimumVersion",
1463
+ "Miura",
1464
+ "MixedMultiplicity",
1465
+ "ModuleDeformations",
1466
+ "MonodromySolver",
1467
+ "Monomial",
1468
+ "MonomialAlgebras",
1469
+ "MonomialIntegerPrograms",
1470
+ "MonomialOrbits",
1471
+ "MonomialOrder",
1472
+ "Monomials",
1473
+ "MonomialSize",
1474
+ "Msolve",
1475
+ "MultigradedBGG",
1476
+ "MultigradedImplicitization",
1477
+ "MultiGradedRationalMap",
1478
+ "MultiplicitySequence",
1479
+ "MultiplierIdeals",
1480
+ "MultiplierIdealsDim2",
1481
+ "MultiprojectiveVarieties",
1482
+ "NAGtypes",
1483
+ "Name",
1484
+ "Nauty",
1485
+ "NautyGraphs",
1486
+ "NCAlgebra",
1487
+ "NCLex",
1488
+ "NewFromMethod",
1489
+ "newline",
1490
+ "NewMethod",
1491
+ "NewOfFromMethod",
1492
+ "NewOfMethod",
1493
+ "nil",
1494
+ "Node",
1495
+ "NoetherianOperators",
1496
+ "NoetherNormalization",
1497
+ "NonminimalComplexes",
1498
+ "NonPrincipalTestIdeals",
1499
+ "NoPrint",
1500
+ "Normaliz",
1501
+ "NormalToricVarieties",
1502
+ "NotANumber",
1503
+ "notify",
1504
+ "NTL",
1505
+ "null",
1506
+ "nullaryMethods",
1507
+ "NumericalAlgebraicGeometry",
1508
+ "NumericalCertification",
1509
+ "NumericalImplicitization",
1510
+ "NumericalLinearAlgebra",
1511
+ "NumericalSchubertCalculus",
1512
+ "NumericalSemigroups",
1513
+ "NumericSolutions",
1514
+ "numTBBThreads",
1515
+ "OIGroebnerBases",
1516
+ "OldChainComplexes",
1517
+ "OldPolyhedra",
1518
+ "OldToricVectorBundles",
1519
+ "OnlineLookup",
1520
+ "OO",
1521
+ "oo",
1522
+ "ooo",
1523
+ "oooo",
1524
+ "OpenMath",
1525
+ "operatorAttributes",
1526
+ "OptionalComponentsPresent",
1527
+ "Options",
1528
+ "Order",
1529
+ "order",
1530
+ "Oscillators",
1531
+ "OutputDictionary",
1532
+ "Outputs",
1533
+ "PackageCitations",
1534
+ "PackageDictionary",
1535
+ "PackageExports",
1536
+ "PackageImports",
1537
+ "PackageTemplate",
1538
+ "PairLimit",
1539
+ "PairsRemaining",
1540
+ "ParallelF4",
1541
+ "ParallelizeByDegree",
1542
+ "Parametrization",
1543
+ "Parsing",
1544
+ "path",
1545
+ "PathSignatures",
1546
+ "PencilsOfQuadrics",
1547
+ "Permanents",
1548
+ "Permutations",
1549
+ "PHCpack",
1550
+ "PhylogeneticTrees",
1551
+ "pi",
1552
+ "PieriMaps",
1553
+ "PlaneCurveLinearSeries",
1554
+ "PlaneCurveSingularities",
1555
+ "Points",
1556
+ "Polyhedra",
1557
+ "Polymake",
1558
+ "PolyominoIdeals",
1559
+ "Posets",
1560
+ "Position",
1561
+ "PositivityToricBundles",
1562
+ "POSIX",
1563
+ "Postfix",
1564
+ "Pre",
1565
+ "Precision",
1566
+ "Prefix",
1567
+ "prefixDirectory",
1568
+ "prefixPath",
1569
+ "PrimaryDecomposition",
1570
+ "PrimaryTag",
1571
+ "PrimitiveElement",
1572
+ "Print",
1573
+ "printingAccuracy",
1574
+ "printingLeadLimit",
1575
+ "printingPrecision",
1576
+ "printingSeparator",
1577
+ "printingTimeLimit",
1578
+ "printingTrailLimit",
1579
+ "printWidth",
1580
+ "Probability",
1581
+ "profileSummary",
1582
+ "programPaths",
1583
+ "Projective",
1584
+ "Prune",
1585
+ "PruneComplex",
1586
+ "pruningMap",
1587
+ "PseudomonomialPrimaryDecomposition",
1588
+ "Pullback",
1589
+ "pullbackMaps",
1590
+ "PushForward",
1591
+ "pushoutMaps",
1592
+ "Python",
1593
+ "QthPower",
1594
+ "QuadraticIdealExamplesByRoos",
1595
+ "Quasidegrees",
1596
+ "QuaternaryQuartics",
1597
+ "QuillenSuslin",
1598
+ "quit",
1599
+ "Quotient",
1600
+ "Radical",
1601
+ "RadicalCodim1",
1602
+ "RaiseError",
1603
+ "RandomCanonicalCurves",
1604
+ "RandomComplexes",
1605
+ "RandomCurves",
1606
+ "RandomCurvesOverVerySmallFiniteFields",
1607
+ "RandomGenus14Curves",
1608
+ "RandomIdeals",
1609
+ "RandomMonomialIdeals",
1610
+ "RandomObjects",
1611
+ "RandomPlaneCurves",
1612
+ "RandomPoints",
1613
+ "RandomSpaceCurves",
1614
+ "Range",
1615
+ "RationalMaps",
1616
+ "RationalPoints",
1617
+ "RationalPoints2",
1618
+ "ReactionNetworks",
1619
+ "RealFP",
1620
+ "RealQP",
1621
+ "RealQP1",
1622
+ "RealRoots",
1623
+ "RealRR",
1624
+ "RealXD",
1625
+ "recursionLimit",
1626
+ "Reduce",
1627
+ "ReesAlgebra",
1628
+ "References",
1629
+ "ReflexivePolytopesDB",
1630
+ "Regularity",
1631
+ "RelativeCanonicalResolution",
1632
+ "Reload",
1633
+ "RemakeAllDocumentation",
1634
+ "RerunExamples",
1635
+ "ResidualIntersections",
1636
+ "ResLengthThree",
1637
+ "ResolutionsOfStanleyReisnerRings",
1638
+ "restart",
1639
+ "Result",
1640
+ "Resultants",
1641
+ "returnCode",
1642
+ "Reverse",
1643
+ "RevLex",
1644
+ "RHom",
1645
+ "Right",
1646
+ "RInterface",
1647
+ "rootPath",
1648
+ "rootURI",
1649
+ "RunDirectory",
1650
+ "RunExamples",
1651
+ "RunExternalM2",
1652
+ "SagbiGbDetection",
1653
+ "Saturation",
1654
+ "SaturationMap",
1655
+ "Schubert2",
1656
+ "SchurComplexes",
1657
+ "SchurFunctors",
1658
+ "SchurRings",
1659
+ "SchurVeronese",
1660
+ "SCMAlgebras",
1661
+ "scriptCommandLine",
1662
+ "SCSCP",
1663
+ "SectionRing",
1664
+ "SeeAlso",
1665
+ "SegreClasses",
1666
+ "SemidefiniteProgramming",
1667
+ "Seminormalization",
1668
+ "SeparateExec",
1669
+ "Serialization",
1670
+ "sheafExt",
1671
+ "ShimoyamaYokoyama",
1672
+ "showClassStructure",
1673
+ "showStructure",
1674
+ "showUserStructure",
1675
+ "SimpleDoc",
1676
+ "SimplicialComplexes",
1677
+ "SimplicialDecomposability",
1678
+ "SimplicialPosets",
1679
+ "SimplifyFractions",
1680
+ "SizeLimit",
1681
+ "SkewCommutative",
1682
+ "SlackIdeals",
1683
+ "SLnEquivariantMatrices",
1684
+ "SLPexpressions",
1685
+ "Sort",
1686
+ "SortStrategy",
1687
+ "SourceCode",
1688
+ "SourceRing",
1689
+ "SpaceCurves",
1690
+ "SparseResultants",
1691
+ "SpechtModule",
1692
+ "SpecialFanoFourfolds",
1693
+ "SpectralSequences",
1694
+ "SRdeformations",
1695
+ "Standard",
1696
+ "StartWithOneMinor",
1697
+ "StatePolytope",
1698
+ "StatGraphs",
1699
+ "stderr",
1700
+ "stdio",
1701
+ "StopBeforeComputation",
1702
+ "stopIfError",
1703
+ "StopIteration",
1704
+ "StopWithMinimalGenerators",
1705
+ "Strategy",
1706
+ "Strict",
1707
+ "StronglyStableIdeals",
1708
+ "Style",
1709
+ "SubalgebraBases",
1710
+ "Subnodes",
1711
+ "SubringLimit",
1712
+ "subscript",
1713
+ "Sugarless",
1714
+ "SumsOfSquares",
1715
+ "SuperLinearAlgebra",
1716
+ "superscript",
1717
+ "SVDComplexes",
1718
+ "SwitchingFields",
1719
+ "SymbolicPowers",
1720
+ "SymmetricPolynomials",
1721
+ "Synopsis",
1722
+ "Syzygies",
1723
+ "SyzygyLimit",
1724
+ "SyzygyMatrix",
1725
+ "SyzygyRows",
1726
+ "Tableaux",
1727
+ "TangentCone",
1728
+ "TateOnProducts",
1729
+ "TensorComplexes",
1730
+ "TerraciniLoci",
1731
+ "Test",
1732
+ "testExample",
1733
+ "TestIdeals",
1734
+ "TeXmacs",
1735
+ "Text",
1736
+ "ThinSincereQuivers",
1737
+ "ThreadedGB",
1738
+ "Threads",
1739
+ "Threshold",
1740
+ "Topcom",
1741
+ "topLevelMode",
1742
+ "Tor",
1743
+ "TorAlgebra",
1744
+ "Toric",
1745
+ "ToricHigherDirectImages",
1746
+ "ToricInvariants",
1747
+ "ToricTopology",
1748
+ "ToricVectorBundles",
1749
+ "Torsion",
1750
+ "TorsionFree",
1751
+ "TotalPairs",
1752
+ "Tree",
1753
+ "TriangularSets",
1754
+ "Triangulations",
1755
+ "Tries",
1756
+ "Trim",
1757
+ "Triplets",
1758
+ "Tropical",
1759
+ "TropicalToric",
1760
+ "true",
1761
+ "Truncate",
1762
+ "Truncations",
1763
+ "TSpreadIdeals",
1764
+ "TypicalValue",
1765
+ "typicalValues",
1766
+ "Undo",
1767
+ "Unique",
1768
+ "Units",
1769
+ "Unmixed",
1770
+ "Up",
1771
+ "UpdateOnly",
1772
+ "UpperTriangular",
1773
+ "Usage",
1774
+ "UseCachedExampleOutput",
1775
+ "UseHilbertFunction",
1776
+ "UserMode",
1777
+ "UseSyzygies",
1778
+ "Valuations",
1779
+ "Variable",
1780
+ "VariableBaseName",
1781
+ "Variables",
1782
+ "Varieties",
1783
+ "Vasconcelos",
1784
+ "VectorFields",
1785
+ "VectorGraphics",
1786
+ "Verbose",
1787
+ "Verbosity",
1788
+ "Verify",
1789
+ "VersalDeformations",
1790
+ "Version",
1791
+ "version",
1792
+ "VerticalSpace",
1793
+ "viewHelp",
1794
+ "VirtualResolutions",
1795
+ "Visualize",
1796
+ "VNumber",
1797
+ "WebApp",
1798
+ "Weights",
1799
+ "WeilDivisors",
1800
+ "WeylAlgebra",
1801
+ "WeylAlgebras",
1802
+ "WeylGroups",
1803
+ "WhitneyStratifications",
1804
+ "Wrap",
1805
+ "XML",
1806
+ "yonedaSheafExtension"
1807
+ )
1808
+
1809
+ class Macaulay2Lexer(RegexLexer):
1810
+ """Lexer for Macaulay2, a software system for research in algebraic geometry."""
1811
+
1812
+ name = 'Macaulay2'
1813
+ url = 'https://macaulay2.com/'
1814
+ aliases = ['macaulay2']
1815
+ filenames = ['*.m2']
1816
+ version_added = '2.12'
1817
+
1818
+ tokens = {
1819
+ 'root': [
1820
+ (r'--.*$', Comment.Single),
1821
+ (r'-\*', Comment.Multiline, 'block comment'),
1822
+ (r'"', String, 'quote string'),
1823
+ (r'///', String, 'slash string'),
1824
+ (words(M2KEYWORDS, prefix=r'\b', suffix=r'\b'), Keyword),
1825
+ (words(M2DATATYPES, prefix=r'\b', suffix=r'\b'), Name.Builtin),
1826
+ (words(M2FUNCTIONS, prefix=r'\b', suffix=r'\b'), Name.Function),
1827
+ (words(M2CONSTANTS, prefix=r'\b', suffix=r'\b'), Name.Constant),
1828
+ (r'\s+', Text.Whitespace),
1829
+ (r'.', Text)
1830
+ ],
1831
+ 'block comment' : [
1832
+ (r'[^*-]+', Comment.Multiline),
1833
+ (r'\*-', Comment.Multiline, '#pop'),
1834
+ (r'[*-]', Comment.Multiline)
1835
+ ],
1836
+ 'quote string' : [
1837
+ (r'[^\\"]+', String),
1838
+ (r'"', String, '#pop'),
1839
+ (r'\\"?', String),
1840
+ ],
1841
+ 'slash string' : [
1842
+ (r'[^/]+', String),
1843
+ (r'(//)+(?!/)', String),
1844
+ (r'/(//)+(?!/)', String, '#pop'),
1845
+ (r'/', String)
1846
+ ]
1847
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/make.py ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.make
3
+ ~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for Makefiles and similar.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import Lexer, RegexLexer, include, bygroups, \
14
+ do_insertions, using
15
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
16
+ Punctuation, Whitespace
17
+ from pygments.lexers.shell import BashLexer
18
+
19
+ __all__ = ['MakefileLexer', 'BaseMakefileLexer', 'CMakeLexer']
20
+
21
+
22
+ class MakefileLexer(Lexer):
23
+ """
24
+ Lexer for BSD and GNU make extensions (lenient enough to handle both in
25
+ the same file even).
26
+
27
+ *Rewritten in Pygments 0.10.*
28
+ """
29
+
30
+ name = 'Makefile'
31
+ aliases = ['make', 'makefile', 'mf', 'bsdmake']
32
+ filenames = ['*.mak', '*.mk', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile']
33
+ mimetypes = ['text/x-makefile']
34
+ url = 'https://en.wikipedia.org/wiki/Make_(software)'
35
+ version_added = ''
36
+
37
+ r_special = re.compile(
38
+ r'^(?:'
39
+ # BSD Make
40
+ r'\.\s*(include|undef|error|warning|if|else|elif|endif|for|endfor)|'
41
+ # GNU Make
42
+ r'\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:|vpath)|'
43
+ # GNU Automake
44
+ r'\s*(if|else|endif))(?=\s)')
45
+ r_comment = re.compile(r'^\s*@?#')
46
+
47
+ def get_tokens_unprocessed(self, text):
48
+ ins = []
49
+ lines = text.splitlines(keepends=True)
50
+ done = ''
51
+ lex = BaseMakefileLexer(**self.options)
52
+ backslashflag = False
53
+ for line in lines:
54
+ if self.r_special.match(line) or backslashflag:
55
+ ins.append((len(done), [(0, Comment.Preproc, line)]))
56
+ backslashflag = line.strip().endswith('\\')
57
+ elif self.r_comment.match(line):
58
+ ins.append((len(done), [(0, Comment, line)]))
59
+ else:
60
+ done += line
61
+ yield from do_insertions(ins, lex.get_tokens_unprocessed(done))
62
+
63
+ def analyse_text(text):
64
+ # Many makefiles have $(BIG_CAPS) style variables
65
+ if re.search(r'\$\([A-Z_]+\)', text):
66
+ return 0.1
67
+
68
+
69
+ class BaseMakefileLexer(RegexLexer):
70
+ """
71
+ Lexer for simple Makefiles (no preprocessing).
72
+ """
73
+
74
+ name = 'Base Makefile'
75
+ aliases = ['basemake']
76
+ filenames = []
77
+ mimetypes = []
78
+ url = 'https://en.wikipedia.org/wiki/Make_(software)'
79
+ version_added = '0.10'
80
+
81
+ tokens = {
82
+ 'root': [
83
+ # recipes (need to allow spaces because of expandtabs)
84
+ (r'^(?:[\t ]+.*\n|\n)+', using(BashLexer)),
85
+ # special variables
86
+ (r'\$[<@$+%?|*]', Keyword),
87
+ (r'\s+', Whitespace),
88
+ (r'#.*?\n', Comment),
89
+ (r'((?:un)?export)(\s+)(?=[\w${}\t -]+\n)',
90
+ bygroups(Keyword, Whitespace), 'export'),
91
+ (r'(?:un)?export\s+', Keyword),
92
+ # assignment
93
+ (r'([\w${}().-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)',
94
+ bygroups(
95
+ Name.Variable, Whitespace, Operator, Whitespace,
96
+ using(BashLexer))),
97
+ # strings
98
+ (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
99
+ (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
100
+ # targets
101
+ (r'([^\n:]+)(:+)([ \t]*)', bygroups(
102
+ Name.Function, Operator, Whitespace),
103
+ 'block-header'),
104
+ # expansions
105
+ (r'\$\(', Keyword, 'expansion'),
106
+ ],
107
+ 'expansion': [
108
+ (r'[^\w$().-]+', Text),
109
+ (r'[\w.-]+', Name.Variable),
110
+ (r'\$', Keyword),
111
+ (r'\(', Keyword, '#push'),
112
+ (r'\)', Keyword, '#pop'),
113
+ ],
114
+ 'export': [
115
+ (r'[\w${}-]+', Name.Variable),
116
+ (r'\n', Text, '#pop'),
117
+ (r'\s+', Whitespace),
118
+ ],
119
+ 'block-header': [
120
+ (r'[,|]', Punctuation),
121
+ (r'#.*?\n', Comment, '#pop'),
122
+ (r'\\\n', Text), # line continuation
123
+ (r'\$\(', Keyword, 'expansion'),
124
+ (r'[a-zA-Z_]+', Name),
125
+ (r'\n', Whitespace, '#pop'),
126
+ (r'.', Text),
127
+ ],
128
+ }
129
+
130
+
131
+ class CMakeLexer(RegexLexer):
132
+ """
133
+ Lexer for CMake files.
134
+ """
135
+ name = 'CMake'
136
+ url = 'https://cmake.org/documentation/'
137
+ aliases = ['cmake']
138
+ filenames = ['*.cmake', 'CMakeLists.txt']
139
+ mimetypes = ['text/x-cmake']
140
+ version_added = '1.2'
141
+
142
+ tokens = {
143
+ 'root': [
144
+ # (r'(ADD_CUSTOM_COMMAND|ADD_CUSTOM_TARGET|ADD_DEFINITIONS|'
145
+ # r'ADD_DEPENDENCIES|ADD_EXECUTABLE|ADD_LIBRARY|ADD_SUBDIRECTORY|'
146
+ # r'ADD_TEST|AUX_SOURCE_DIRECTORY|BUILD_COMMAND|BUILD_NAME|'
147
+ # r'CMAKE_MINIMUM_REQUIRED|CONFIGURE_FILE|CREATE_TEST_SOURCELIST|'
148
+ # r'ELSE|ELSEIF|ENABLE_LANGUAGE|ENABLE_TESTING|ENDFOREACH|'
149
+ # r'ENDFUNCTION|ENDIF|ENDMACRO|ENDWHILE|EXEC_PROGRAM|'
150
+ # r'EXECUTE_PROCESS|EXPORT_LIBRARY_DEPENDENCIES|FILE|FIND_FILE|'
151
+ # r'FIND_LIBRARY|FIND_PACKAGE|FIND_PATH|FIND_PROGRAM|FLTK_WRAP_UI|'
152
+ # r'FOREACH|FUNCTION|GET_CMAKE_PROPERTY|GET_DIRECTORY_PROPERTY|'
153
+ # r'GET_FILENAME_COMPONENT|GET_SOURCE_FILE_PROPERTY|'
154
+ # r'GET_TARGET_PROPERTY|GET_TEST_PROPERTY|IF|INCLUDE|'
155
+ # r'INCLUDE_DIRECTORIES|INCLUDE_EXTERNAL_MSPROJECT|'
156
+ # r'INCLUDE_REGULAR_EXPRESSION|INSTALL|INSTALL_FILES|'
157
+ # r'INSTALL_PROGRAMS|INSTALL_TARGETS|LINK_DIRECTORIES|'
158
+ # r'LINK_LIBRARIES|LIST|LOAD_CACHE|LOAD_COMMAND|MACRO|'
159
+ # r'MAKE_DIRECTORY|MARK_AS_ADVANCED|MATH|MESSAGE|OPTION|'
160
+ # r'OUTPUT_REQUIRED_FILES|PROJECT|QT_WRAP_CPP|QT_WRAP_UI|REMOVE|'
161
+ # r'REMOVE_DEFINITIONS|SEPARATE_ARGUMENTS|SET|'
162
+ # r'SET_DIRECTORY_PROPERTIES|SET_SOURCE_FILES_PROPERTIES|'
163
+ # r'SET_TARGET_PROPERTIES|SET_TESTS_PROPERTIES|SITE_NAME|'
164
+ # r'SOURCE_GROUP|STRING|SUBDIR_DEPENDS|SUBDIRS|'
165
+ # r'TARGET_LINK_LIBRARIES|TRY_COMPILE|TRY_RUN|UNSET|'
166
+ # r'USE_MANGLED_MESA|UTILITY_SOURCE|VARIABLE_REQUIRES|'
167
+ # r'VTK_MAKE_INSTANTIATOR|VTK_WRAP_JAVA|VTK_WRAP_PYTHON|'
168
+ # r'VTK_WRAP_TCL|WHILE|WRITE_FILE|'
169
+ # r'COUNTARGS)\b', Name.Builtin, 'args'),
170
+ (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Builtin, Whitespace,
171
+ Punctuation), 'args'),
172
+ include('keywords'),
173
+ include('ws')
174
+ ],
175
+ 'args': [
176
+ (r'\(', Punctuation, '#push'),
177
+ (r'\)', Punctuation, '#pop'),
178
+ (r'(\$\{)(.+?)(\})', bygroups(Operator, Name.Variable, Operator)),
179
+ (r'(\$ENV\{)(.+?)(\})', bygroups(Operator, Name.Variable, Operator)),
180
+ (r'(\$<)(.+?)(>)', bygroups(Operator, Name.Variable, Operator)),
181
+ (r'(?s)".*?"', String.Double),
182
+ (r'\\\S+', String),
183
+ (r'\[(?P<level>=*)\[[\w\W]*?\](?P=level)\]', String.Multiline),
184
+ (r'[^)$"# \t\n]+', String),
185
+ (r'\n', Whitespace), # explicitly legal
186
+ include('keywords'),
187
+ include('ws')
188
+ ],
189
+ 'string': [
190
+
191
+ ],
192
+ 'keywords': [
193
+ (r'\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|'
194
+ r'MSVC70|MSVC71|MSVC80|MSVC90)\b', Keyword),
195
+ ],
196
+ 'ws': [
197
+ (r'[ \t]+', Whitespace),
198
+ (r'#\[(?P<level>=*)\[[\w\W]*?\](?P=level)\]', Comment),
199
+ (r'#.*\n', Comment),
200
+ ]
201
+ }
202
+
203
+ def analyse_text(text):
204
+ exp = (
205
+ r'^[ \t]*CMAKE_MINIMUM_REQUIRED[ \t]*'
206
+ r'\([ \t]*VERSION[ \t]*\d+(\.\d+)*[ \t]*'
207
+ r'([ \t]FATAL_ERROR)?[ \t]*\)[ \t]*'
208
+ r'(#[^\n]*)?$'
209
+ )
210
+ if re.search(exp, text, flags=re.MULTILINE | re.IGNORECASE):
211
+ return 0.8
212
+ return 0.0
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/maple.py ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.maple
3
+ ~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for Maple.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import words, bygroups, ExtendedRegexLexer
12
+ from pygments.token import Comment, Name, String, Whitespace, Operator, Punctuation, Number, Keyword
13
+
14
+ __all__ = ['MapleLexer']
15
+
16
+
17
+ class MapleLexer(ExtendedRegexLexer):
18
+ """
19
+ Lexer for Maple.
20
+ """
21
+
22
+ name = 'Maple'
23
+ aliases = ['maple']
24
+ filenames = ['*.mpl', '*.mi', '*.mm']
25
+ mimetypes = ['text/x-maple']
26
+ url = 'https://www.maplesoft.com/products/Maple/'
27
+ version_added = '2.19'
28
+
29
+ keywords = ('and',
30
+ 'assuming',
31
+ 'break',
32
+ 'by',
33
+ 'catch',
34
+ 'description',
35
+ 'do',
36
+ 'done',
37
+ 'elif',
38
+ 'else',
39
+ 'end',
40
+ 'error',
41
+ 'export',
42
+ 'fi',
43
+ 'finally',
44
+ 'for',
45
+ 'from',
46
+ 'global',
47
+ 'if',
48
+ 'implies',
49
+ 'in',
50
+ 'intersect',
51
+ 'local',
52
+ 'minus',
53
+ 'mod',
54
+ 'module',
55
+ 'next',
56
+ 'not',
57
+ 'od',
58
+ 'option',
59
+ 'options',
60
+ 'or',
61
+ 'proc',
62
+ 'quit',
63
+ 'read',
64
+ 'return',
65
+ 'save',
66
+ 'stop',
67
+ 'subset',
68
+ 'then',
69
+ 'to',
70
+ 'try',
71
+ 'union',
72
+ 'use',
73
+ 'uses',
74
+ 'while',
75
+ 'xor')
76
+
77
+ builtins = ('abs',
78
+ 'add',
79
+ 'addressof',
80
+ 'anames',
81
+ 'and',
82
+ 'andmap',
83
+ 'andseq',
84
+ 'appendto',
85
+ 'Array',
86
+ 'array',
87
+ 'ArrayOptions',
88
+ 'assemble',
89
+ 'ASSERT',
90
+ 'assign',
91
+ 'assigned',
92
+ 'attributes',
93
+ 'cat',
94
+ 'ceil',
95
+ 'coeff',
96
+ 'coeffs',
97
+ 'conjugate',
98
+ 'convert',
99
+ 'CopySign',
100
+ 'DEBUG',
101
+ 'debugopts',
102
+ 'Default0',
103
+ 'DefaultOverflow',
104
+ 'DefaultUnderflow',
105
+ 'degree',
106
+ 'denom',
107
+ 'diff',
108
+ 'disassemble',
109
+ 'divide',
110
+ 'done',
111
+ 'entries',
112
+ 'EqualEntries',
113
+ 'eval',
114
+ 'evalb',
115
+ 'evalf',
116
+ 'evalhf',
117
+ 'evalindets',
118
+ 'evaln',
119
+ 'expand',
120
+ 'exports',
121
+ 'factorial',
122
+ 'floor',
123
+ 'frac',
124
+ 'frem',
125
+ 'FromInert',
126
+ 'frontend',
127
+ 'gc',
128
+ 'genpoly',
129
+ 'has',
130
+ 'hastype',
131
+ 'hfarray',
132
+ 'icontent',
133
+ 'igcd',
134
+ 'ilcm',
135
+ 'ilog10',
136
+ 'Im',
137
+ 'implies',
138
+ 'indets',
139
+ 'indices',
140
+ 'intersect',
141
+ 'iolib',
142
+ 'iquo',
143
+ 'irem',
144
+ 'iroot',
145
+ 'iroot',
146
+ 'isqrt',
147
+ 'kernelopts',
148
+ 'lcoeff',
149
+ 'ldegree',
150
+ 'length',
151
+ 'lexorder',
152
+ 'lhs',
153
+ 'lowerbound',
154
+ 'lprint',
155
+ 'macro',
156
+ 'map',
157
+ 'max',
158
+ 'maxnorm',
159
+ 'member',
160
+ 'membertype',
161
+ 'min',
162
+ 'minus',
163
+ 'mod',
164
+ 'modp',
165
+ 'modp1',
166
+ 'modp2',
167
+ 'mods',
168
+ 'mul',
169
+ 'NextAfter',
170
+ 'nops',
171
+ 'normal',
172
+ 'not',
173
+ 'numboccur',
174
+ 'numelems',
175
+ 'numer',
176
+ 'NumericClass',
177
+ 'NumericEvent',
178
+ 'NumericEventHandler',
179
+ 'NumericStatus',
180
+ 'op',
181
+ 'or',
182
+ 'order',
183
+ 'OrderedNE',
184
+ 'ormap',
185
+ 'orseq',
186
+ 'parse',
187
+ 'piecewise',
188
+ 'pointto',
189
+ 'print',
190
+ 'quit',
191
+ 'Re',
192
+ 'readlib',
193
+ 'Record',
194
+ 'remove',
195
+ 'rhs',
196
+ 'round',
197
+ 'rtable',
198
+ 'rtable_elems',
199
+ 'rtable_eval',
200
+ 'rtable_indfns',
201
+ 'rtable_num_elems',
202
+ 'rtable_options',
203
+ 'rtable_redim',
204
+ 'rtable_scanblock',
205
+ 'rtable_set_indfn',
206
+ 'rtable_split_unit',
207
+ 'savelib',
208
+ 'Scale10',
209
+ 'Scale2',
210
+ 'SDMPolynom',
211
+ 'searchtext',
212
+ 'SearchText',
213
+ 'select',
214
+ 'selectremove',
215
+ 'seq',
216
+ 'series',
217
+ 'setattribute',
218
+ 'SFloatExponent',
219
+ 'SFloatMantissa',
220
+ 'sign',
221
+ 'sort',
222
+ 'ssystem',
223
+ 'stop',
224
+ 'String',
225
+ 'subs',
226
+ 'subset',
227
+ 'subsindets',
228
+ 'subsop',
229
+ 'substring',
230
+ 'system',
231
+ 'table',
232
+ 'taylor',
233
+ 'tcoeff',
234
+ 'time',
235
+ 'timelimit',
236
+ 'ToInert',
237
+ 'traperror',
238
+ 'trunc',
239
+ 'type',
240
+ 'typematch',
241
+ 'unames',
242
+ 'unassign',
243
+ 'union',
244
+ 'Unordered',
245
+ 'upperbound',
246
+ 'userinfo',
247
+ 'writeto',
248
+ 'xor',
249
+ 'xormap',
250
+ 'xorseq')
251
+
252
+ def delayed_callback(self, match, ctx):
253
+ yield match.start(1), Punctuation, match.group(1) # quote
254
+
255
+ ctx.pos = match.start(2)
256
+ orig_end = ctx.end
257
+ ctx.end = match.end(2)
258
+
259
+ yield from self.get_tokens_unprocessed(context=ctx)
260
+ yield match.end(2), Punctuation, match.group(1) # quote
261
+
262
+ ctx.pos = match.end()
263
+ ctx.end = orig_end
264
+
265
+ tokens = {
266
+ 'root': [
267
+ (r'#.*\n', Comment.Single),
268
+ (r'\(\*', Comment.Multiline, 'comment'),
269
+ (r'"(\\.|.|\s)*?"', String),
270
+ (r"('+)((.|\n)*?)\1", delayed_callback),
271
+ (r'`(\\`|.)*?`', Name),
272
+ (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword),
273
+ (words(builtins, prefix=r'\b', suffix=r'\b'), Name.Builtin),
274
+ (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
275
+ (r'(:=|\*\*|@@|<=|>=|<>|->|::|\.\.|&\+|[\+\-\*\.\^\$/@&,:=<>%~])', Operator),
276
+ (r'[;^!@$\(\)\[\]{}|_\\#?]+', Punctuation),
277
+ (r'(\d+)(\.\.)', bygroups(Number.Integer, Punctuation)),
278
+ (r'(\d*\.\d+|\d+\.\d*)([eE][+-]?\d+)?', Number.Float),
279
+ (r'\d+', Number.Integer),
280
+ (r'\s+', Whitespace),
281
+ ],
282
+ 'comment': [
283
+ (r'.*\(\*', Comment.Multiline, '#push'),
284
+ (r'.*\*\)', Comment.Multiline, '#pop'),
285
+ (r'.*\n', Comment.Multiline),
286
+ ]
287
+ }
288
+
289
+ def analyse_text(text):
290
+ if ':=' in text:
291
+ return 0.1
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/markup.py ADDED
@@ -0,0 +1,1659 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.markup
3
+ ~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for non-HTML markup languages.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexers.html import XmlLexer
14
+ from pygments.lexers.javascript import JavascriptLexer
15
+ from pygments.lexers.css import CssLexer
16
+ from pygments.lexers.lilypond import LilyPondLexer
17
+ from pygments.lexers.data import JsonLexer
18
+
19
+ from pygments.lexer import RegexLexer, DelegatingLexer, include, bygroups, \
20
+ using, this, do_insertions, default, words
21
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
22
+ Number, Punctuation, Generic, Other, Whitespace, Literal
23
+ from pygments.util import get_bool_opt, ClassNotFound
24
+
25
+ __all__ = ['BBCodeLexer', 'MoinWikiLexer', 'RstLexer', 'TexLexer', 'GroffLexer',
26
+ 'MozPreprocHashLexer', 'MozPreprocPercentLexer',
27
+ 'MozPreprocXulLexer', 'MozPreprocJavascriptLexer',
28
+ 'MozPreprocCssLexer', 'MarkdownLexer', 'OrgLexer', 'TiddlyWiki5Lexer',
29
+ 'WikitextLexer']
30
+
31
+
32
+ class BBCodeLexer(RegexLexer):
33
+ """
34
+ A lexer that highlights BBCode(-like) syntax.
35
+ """
36
+
37
+ name = 'BBCode'
38
+ aliases = ['bbcode']
39
+ mimetypes = ['text/x-bbcode']
40
+ url = 'https://www.bbcode.org/'
41
+ version_added = '0.6'
42
+
43
+ tokens = {
44
+ 'root': [
45
+ (r'[^[]+', Text),
46
+ # tag/end tag begin
47
+ (r'\[/?\w+', Keyword, 'tag'),
48
+ # stray bracket
49
+ (r'\[', Text),
50
+ ],
51
+ 'tag': [
52
+ (r'\s+', Text),
53
+ # attribute with value
54
+ (r'(\w+)(=)("?[^\s"\]]+"?)',
55
+ bygroups(Name.Attribute, Operator, String)),
56
+ # tag argument (a la [color=green])
57
+ (r'(=)("?[^\s"\]]+"?)',
58
+ bygroups(Operator, String)),
59
+ # tag end
60
+ (r'\]', Keyword, '#pop'),
61
+ ],
62
+ }
63
+
64
+
65
+ class MoinWikiLexer(RegexLexer):
66
+ """
67
+ For MoinMoin (and Trac) Wiki markup.
68
+ """
69
+
70
+ name = 'MoinMoin/Trac Wiki markup'
71
+ aliases = ['trac-wiki', 'moin']
72
+ filenames = []
73
+ mimetypes = ['text/x-trac-wiki']
74
+ url = 'https://moinmo.in'
75
+ version_added = '0.7'
76
+
77
+ flags = re.MULTILINE | re.IGNORECASE
78
+
79
+ tokens = {
80
+ 'root': [
81
+ (r'^#.*$', Comment),
82
+ (r'(!)(\S+)', bygroups(Keyword, Text)), # Ignore-next
83
+ # Titles
84
+ (r'^(=+)([^=]+)(=+)(\s*#.+)?$',
85
+ bygroups(Generic.Heading, using(this), Generic.Heading, String)),
86
+ # Literal code blocks, with optional shebang
87
+ (r'(\{\{\{)(\n#!.+)?', bygroups(Name.Builtin, Name.Namespace), 'codeblock'),
88
+ (r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting
89
+ # Lists
90
+ (r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)),
91
+ (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
92
+ # Other Formatting
93
+ (r'\[\[\w+.*?\]\]', Keyword), # Macro
94
+ (r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])',
95
+ bygroups(Keyword, String, Keyword)), # Link
96
+ (r'^----+$', Keyword), # Horizontal rules
97
+ (r'[^\n\'\[{!_~^,|]+', Text),
98
+ (r'\n', Text),
99
+ (r'.', Text),
100
+ ],
101
+ 'codeblock': [
102
+ (r'\}\}\}', Name.Builtin, '#pop'),
103
+ # these blocks are allowed to be nested in Trac, but not MoinMoin
104
+ (r'\{\{\{', Text, '#push'),
105
+ (r'[^{}]+', Comment.Preproc), # slurp boring text
106
+ (r'.', Comment.Preproc), # allow loose { or }
107
+ ],
108
+ }
109
+
110
+
111
+ class RstLexer(RegexLexer):
112
+ """
113
+ For reStructuredText markup.
114
+
115
+ Additional options accepted:
116
+
117
+ `handlecodeblocks`
118
+ Highlight the contents of ``.. sourcecode:: language``,
119
+ ``.. code:: language`` and ``.. code-block:: language``
120
+ directives with a lexer for the given language (default:
121
+ ``True``).
122
+
123
+ .. versionadded:: 0.8
124
+ """
125
+ name = 'reStructuredText'
126
+ url = 'https://docutils.sourceforge.io/rst.html'
127
+ aliases = ['restructuredtext', 'rst', 'rest']
128
+ filenames = ['*.rst', '*.rest']
129
+ mimetypes = ["text/x-rst", "text/prs.fallenstein.rst"]
130
+ version_added = '0.7'
131
+ flags = re.MULTILINE
132
+
133
+ def _handle_sourcecode(self, match):
134
+ from pygments.lexers import get_lexer_by_name
135
+
136
+ # section header
137
+ yield match.start(1), Punctuation, match.group(1)
138
+ yield match.start(2), Text, match.group(2)
139
+ yield match.start(3), Operator.Word, match.group(3)
140
+ yield match.start(4), Punctuation, match.group(4)
141
+ yield match.start(5), Text, match.group(5)
142
+ yield match.start(6), Keyword, match.group(6)
143
+ yield match.start(7), Text, match.group(7)
144
+
145
+ # lookup lexer if wanted and existing
146
+ lexer = None
147
+ if self.handlecodeblocks:
148
+ try:
149
+ lexer = get_lexer_by_name(match.group(6).strip())
150
+ except ClassNotFound:
151
+ pass
152
+ indention = match.group(8)
153
+ indention_size = len(indention)
154
+ code = (indention + match.group(9) + match.group(10) + match.group(11))
155
+
156
+ # no lexer for this language. handle it like it was a code block
157
+ if lexer is None:
158
+ yield match.start(8), String, code
159
+ return
160
+
161
+ # highlight the lines with the lexer.
162
+ ins = []
163
+ codelines = code.splitlines(True)
164
+ code = ''
165
+ for line in codelines:
166
+ if len(line) > indention_size:
167
+ ins.append((len(code), [(0, Text, line[:indention_size])]))
168
+ code += line[indention_size:]
169
+ else:
170
+ code += line
171
+ yield from do_insertions(ins, lexer.get_tokens_unprocessed(code))
172
+
173
+ # from docutils.parsers.rst.states
174
+ closers = '\'")]}>\u2019\u201d\xbb!?'
175
+ unicode_delimiters = '\u2010\u2011\u2012\u2013\u2014\u00a0'
176
+ end_string_suffix = (rf'((?=$)|(?=[-/:.,; \n\x00{re.escape(unicode_delimiters)}{re.escape(closers)}]))')
177
+
178
+ tokens = {
179
+ 'root': [
180
+ # Heading with overline
181
+ (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)'
182
+ r'(.+)(\n)(\1)(\n)',
183
+ bygroups(Generic.Heading, Text, Generic.Heading,
184
+ Text, Generic.Heading, Text)),
185
+ # Plain heading
186
+ (r'^(\S.*)(\n)(={3,}|-{3,}|`{3,}|:{3,}|\.{3,}|\'{3,}|"{3,}|'
187
+ r'~{3,}|\^{3,}|_{3,}|\*{3,}|\+{3,}|#{3,})(\n)',
188
+ bygroups(Generic.Heading, Text, Generic.Heading, Text)),
189
+ # Bulleted lists
190
+ (r'^(\s*)([-*+])( .+\n(?:\1 .+\n)*)',
191
+ bygroups(Text, Number, using(this, state='inline'))),
192
+ # Numbered lists
193
+ (r'^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1 .+\n)*)',
194
+ bygroups(Text, Number, using(this, state='inline'))),
195
+ (r'^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1 .+\n)*)',
196
+ bygroups(Text, Number, using(this, state='inline'))),
197
+ # Numbered, but keep words at BOL from becoming lists
198
+ (r'^(\s*)([A-Z]+\.)( .+\n(?:\1 .+\n)+)',
199
+ bygroups(Text, Number, using(this, state='inline'))),
200
+ (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1 .+\n)+)',
201
+ bygroups(Text, Number, using(this, state='inline'))),
202
+ # Line blocks
203
+ (r'^(\s*)(\|)( .+\n(?:\| .+\n)*)',
204
+ bygroups(Text, Operator, using(this, state='inline'))),
205
+ # Sourcecode directives
206
+ (r'^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)'
207
+ r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*)?\n)+)',
208
+ _handle_sourcecode),
209
+ # A directive
210
+ (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
211
+ bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
212
+ using(this, state='inline'))),
213
+ # A reference target
214
+ (r'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$',
215
+ bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
216
+ # A footnote/citation target
217
+ (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
218
+ bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
219
+ # A substitution def
220
+ (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
221
+ bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word,
222
+ Punctuation, Text, using(this, state='inline'))),
223
+ # Comments
224
+ (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment),
225
+ # Field list marker
226
+ (r'^( *)(:(?:\\\\|\\:|[^:\n])+:(?=\s))([ \t]*)',
227
+ bygroups(Text, Name.Class, Text)),
228
+ # Definition list
229
+ (r'^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)',
230
+ bygroups(using(this, state='inline'), using(this, state='inline'))),
231
+ # Code blocks
232
+ (r'(::)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\3.*)?\n)+)',
233
+ bygroups(String.Escape, Text, String, String, Text, String)),
234
+ include('inline'),
235
+ ],
236
+ 'inline': [
237
+ (r'\\.', Text), # escape
238
+ (r'``', String, 'literal'), # code
239
+ (r'(`.+?)(<.+?>)(`__?)', # reference with inline target
240
+ bygroups(String, String.Interpol, String)),
241
+ (r'`.+?`__?', String), # reference
242
+ (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?',
243
+ bygroups(Name.Variable, Name.Attribute)), # role
244
+ (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)',
245
+ bygroups(Name.Attribute, Name.Variable)), # role (content first)
246
+ (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis
247
+ (r'\*.+?\*', Generic.Emph), # Emphasis
248
+ (r'\[.*?\]_', String), # Footnote or citation
249
+ (r'<.+?>', Name.Tag), # Hyperlink
250
+ (r'[^\\\n\[*`:]+', Text),
251
+ (r'.', Text),
252
+ ],
253
+ 'literal': [
254
+ (r'[^`]+', String),
255
+ (r'``' + end_string_suffix, String, '#pop'),
256
+ (r'`', String),
257
+ ]
258
+ }
259
+
260
+ def __init__(self, **options):
261
+ self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
262
+ RegexLexer.__init__(self, **options)
263
+
264
+ def analyse_text(text):
265
+ if text[:2] == '..' and text[2:3] != '.':
266
+ return 0.3
267
+ p1 = text.find("\n")
268
+ p2 = text.find("\n", p1 + 1)
269
+ if (p2 > -1 and # has two lines
270
+ p1 * 2 + 1 == p2 and # they are the same length
271
+ text[p1+1] in '-=' and # the next line both starts and ends with
272
+ text[p1+1] == text[p2-1]): # ...a sufficiently high header
273
+ return 0.5
274
+
275
+
276
+ class TexLexer(RegexLexer):
277
+ """
278
+ Lexer for the TeX and LaTeX typesetting languages.
279
+ """
280
+
281
+ name = 'TeX'
282
+ aliases = ['tex', 'latex']
283
+ filenames = ['*.tex', '*.aux', '*.toc']
284
+ mimetypes = ['text/x-tex', 'text/x-latex']
285
+ url = 'https://tug.org'
286
+ version_added = ''
287
+
288
+ tokens = {
289
+ 'general': [
290
+ (r'%.*?\n', Comment),
291
+ (r'[{}]', Name.Builtin),
292
+ (r'[&_^]', Name.Builtin),
293
+ ],
294
+ 'root': [
295
+ (r'\\\[', String.Backtick, 'displaymath'),
296
+ (r'\\\(', String, 'inlinemath'),
297
+ (r'\$\$', String.Backtick, 'displaymath'),
298
+ (r'\$', String, 'inlinemath'),
299
+ (r'\\([a-zA-Z@_:]+|\S?)', Keyword, 'command'),
300
+ (r'\\$', Keyword),
301
+ include('general'),
302
+ (r'[^\\$%&_^{}]+', Text),
303
+ ],
304
+ 'math': [
305
+ (r'\\([a-zA-Z]+|\S?)', Name.Variable),
306
+ include('general'),
307
+ (r'[0-9]+', Number),
308
+ (r'[-=!+*/()\[\]]', Operator),
309
+ (r'[^=!+*/()\[\]\\$%&_^{}0-9-]+', Name.Builtin),
310
+ ],
311
+ 'inlinemath': [
312
+ (r'\\\)', String, '#pop'),
313
+ (r'\$', String, '#pop'),
314
+ include('math'),
315
+ ],
316
+ 'displaymath': [
317
+ (r'\\\]', String, '#pop'),
318
+ (r'\$\$', String, '#pop'),
319
+ (r'\$', Name.Builtin),
320
+ include('math'),
321
+ ],
322
+ 'command': [
323
+ (r'\[.*?\]', Name.Attribute),
324
+ (r'\*', Keyword),
325
+ default('#pop'),
326
+ ],
327
+ }
328
+
329
+ def analyse_text(text):
330
+ for start in ("\\documentclass", "\\input", "\\documentstyle",
331
+ "\\relax"):
332
+ if text[:len(start)] == start:
333
+ return True
334
+
335
+
336
+ class GroffLexer(RegexLexer):
337
+ """
338
+ Lexer for the (g)roff typesetting language, supporting groff
339
+ extensions. Mainly useful for highlighting manpage sources.
340
+ """
341
+
342
+ name = 'Groff'
343
+ aliases = ['groff', 'nroff', 'man']
344
+ filenames = ['*.[1-9]', '*.man', '*.1p', '*.3pm']
345
+ mimetypes = ['application/x-troff', 'text/troff']
346
+ url = 'https://www.gnu.org/software/groff'
347
+ version_added = '0.6'
348
+
349
+ tokens = {
350
+ 'root': [
351
+ (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'),
352
+ (r'\.', Punctuation, 'request'),
353
+ # Regular characters, slurp till we find a backslash or newline
354
+ (r'[^\\\n]+', Text, 'textline'),
355
+ default('textline'),
356
+ ],
357
+ 'textline': [
358
+ include('escapes'),
359
+ (r'[^\\\n]+', Text),
360
+ (r'\n', Text, '#pop'),
361
+ ],
362
+ 'escapes': [
363
+ # groff has many ways to write escapes.
364
+ (r'\\"[^\n]*', Comment),
365
+ (r'\\[fn]\w', String.Escape),
366
+ (r'\\\(.{2}', String.Escape),
367
+ (r'\\.\[.*\]', String.Escape),
368
+ (r'\\.', String.Escape),
369
+ (r'\\\n', Text, 'request'),
370
+ ],
371
+ 'request': [
372
+ (r'\n', Text, '#pop'),
373
+ include('escapes'),
374
+ (r'"[^\n"]+"', String.Double),
375
+ (r'\d+', Number),
376
+ (r'\S+', String),
377
+ (r'\s+', Text),
378
+ ],
379
+ }
380
+
381
+ def analyse_text(text):
382
+ if text[:1] != '.':
383
+ return False
384
+ if text[:3] == '.\\"':
385
+ return True
386
+ if text[:4] == '.TH ':
387
+ return True
388
+ if text[1:3].isalnum() and text[3].isspace():
389
+ return 0.9
390
+
391
+
392
+ class MozPreprocHashLexer(RegexLexer):
393
+ """
394
+ Lexer for Mozilla Preprocessor files (with '#' as the marker).
395
+
396
+ Other data is left untouched.
397
+ """
398
+ name = 'mozhashpreproc'
399
+ aliases = [name]
400
+ filenames = []
401
+ mimetypes = []
402
+ url = 'https://firefox-source-docs.mozilla.org/build/buildsystem/preprocessor.html'
403
+ version_added = '2.0'
404
+
405
+ tokens = {
406
+ 'root': [
407
+ (r'^#', Comment.Preproc, ('expr', 'exprstart')),
408
+ (r'.+', Other),
409
+ ],
410
+ 'exprstart': [
411
+ (r'(literal)(.*)', bygroups(Comment.Preproc, Text), '#pop:2'),
412
+ (words((
413
+ 'define', 'undef', 'if', 'ifdef', 'ifndef', 'else', 'elif',
414
+ 'elifdef', 'elifndef', 'endif', 'expand', 'filter', 'unfilter',
415
+ 'include', 'includesubst', 'error')),
416
+ Comment.Preproc, '#pop'),
417
+ ],
418
+ 'expr': [
419
+ (words(('!', '!=', '==', '&&', '||')), Operator),
420
+ (r'(defined)(\()', bygroups(Keyword, Punctuation)),
421
+ (r'\)', Punctuation),
422
+ (r'[0-9]+', Number.Decimal),
423
+ (r'__\w+?__', Name.Variable),
424
+ (r'@\w+?@', Name.Class),
425
+ (r'\w+', Name),
426
+ (r'\n', Text, '#pop'),
427
+ (r'\s+', Text),
428
+ (r'\S', Punctuation),
429
+ ],
430
+ }
431
+
432
+
433
+ class MozPreprocPercentLexer(MozPreprocHashLexer):
434
+ """
435
+ Lexer for Mozilla Preprocessor files (with '%' as the marker).
436
+
437
+ Other data is left untouched.
438
+ """
439
+ name = 'mozpercentpreproc'
440
+ aliases = [name]
441
+ filenames = []
442
+ mimetypes = []
443
+ url = 'https://firefox-source-docs.mozilla.org/build/buildsystem/preprocessor.html'
444
+ version_added = '2.0'
445
+
446
+ tokens = {
447
+ 'root': [
448
+ (r'^%', Comment.Preproc, ('expr', 'exprstart')),
449
+ (r'.+', Other),
450
+ ],
451
+ }
452
+
453
+
454
+ class MozPreprocXulLexer(DelegatingLexer):
455
+ """
456
+ Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
457
+ `XmlLexer`.
458
+ """
459
+ name = "XUL+mozpreproc"
460
+ aliases = ['xul+mozpreproc']
461
+ filenames = ['*.xul.in']
462
+ mimetypes = []
463
+ url = 'https://firefox-source-docs.mozilla.org/build/buildsystem/preprocessor.html'
464
+ version_added = '2.0'
465
+
466
+ def __init__(self, **options):
467
+ super().__init__(XmlLexer, MozPreprocHashLexer, **options)
468
+
469
+
470
+ class MozPreprocJavascriptLexer(DelegatingLexer):
471
+ """
472
+ Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
473
+ `JavascriptLexer`.
474
+ """
475
+ name = "Javascript+mozpreproc"
476
+ aliases = ['javascript+mozpreproc']
477
+ filenames = ['*.js.in']
478
+ mimetypes = []
479
+ url = 'https://firefox-source-docs.mozilla.org/build/buildsystem/preprocessor.html'
480
+ version_added = '2.0'
481
+
482
+ def __init__(self, **options):
483
+ super().__init__(JavascriptLexer, MozPreprocHashLexer, **options)
484
+
485
+
486
+ class MozPreprocCssLexer(DelegatingLexer):
487
+ """
488
+ Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
489
+ `CssLexer`.
490
+ """
491
+ name = "CSS+mozpreproc"
492
+ aliases = ['css+mozpreproc']
493
+ filenames = ['*.css.in']
494
+ mimetypes = []
495
+ url = 'https://firefox-source-docs.mozilla.org/build/buildsystem/preprocessor.html'
496
+ version_added = '2.0'
497
+
498
+ def __init__(self, **options):
499
+ super().__init__(CssLexer, MozPreprocPercentLexer, **options)
500
+
501
+
502
+ class MarkdownLexer(RegexLexer):
503
+ """
504
+ For Markdown markup.
505
+ """
506
+ name = 'Markdown'
507
+ url = 'https://daringfireball.net/projects/markdown/'
508
+ aliases = ['markdown', 'md']
509
+ filenames = ['*.md', '*.markdown']
510
+ mimetypes = ["text/x-markdown"]
511
+ version_added = '2.2'
512
+ flags = re.MULTILINE
513
+
514
+ def _handle_codeblock(self, match):
515
+ from pygments.lexers import get_lexer_by_name
516
+
517
+ yield match.start('initial'), String.Backtick, match.group('initial')
518
+ yield match.start('lang'), String.Backtick, match.group('lang')
519
+ if match.group('afterlang') is not None:
520
+ yield match.start('whitespace'), Whitespace, match.group('whitespace')
521
+ yield match.start('extra'), Text, match.group('extra')
522
+ yield match.start('newline'), Whitespace, match.group('newline')
523
+
524
+ # lookup lexer if wanted and existing
525
+ lexer = None
526
+ if self.handlecodeblocks:
527
+ try:
528
+ lexer = get_lexer_by_name(match.group('lang').strip())
529
+ except ClassNotFound:
530
+ pass
531
+ code = match.group('code')
532
+ # no lexer for this language. handle it like it was a code block
533
+ if lexer is None:
534
+ yield match.start('code'), String, code
535
+ else:
536
+ # FIXME: aren't the offsets wrong?
537
+ yield from do_insertions([], lexer.get_tokens_unprocessed(code))
538
+
539
+ yield match.start('terminator'), String.Backtick, match.group('terminator')
540
+
541
+ tokens = {
542
+ 'root': [
543
+ # heading with '#' prefix (atx-style)
544
+ (r'(^#[^#].+)(\n)', bygroups(Generic.Heading, Text)),
545
+ # subheading with '#' prefix (atx-style)
546
+ (r'(^#{2,6}[^#].+)(\n)', bygroups(Generic.Subheading, Text)),
547
+ # heading with '=' underlines (Setext-style)
548
+ (r'^(.+)(\n)(=+)(\n)', bygroups(Generic.Heading, Text, Generic.Heading, Text)),
549
+ # subheading with '-' underlines (Setext-style)
550
+ (r'^(.+)(\n)(-+)(\n)', bygroups(Generic.Subheading, Text, Generic.Subheading, Text)),
551
+ # task list
552
+ (r'^(\s*)([*-] )(\[[ xX]\])( .+\n)',
553
+ bygroups(Whitespace, Keyword, Keyword, using(this, state='inline'))),
554
+ # bulleted list
555
+ (r'^(\s*)([*-])(\s)(.+\n)',
556
+ bygroups(Whitespace, Keyword, Whitespace, using(this, state='inline'))),
557
+ # numbered list
558
+ (r'^(\s*)([0-9]+\.)( .+\n)',
559
+ bygroups(Whitespace, Keyword, using(this, state='inline'))),
560
+ # quote
561
+ (r'^(\s*>\s)(.+\n)', bygroups(Keyword, Generic.Emph)),
562
+ # code block fenced by 3 backticks
563
+ (r'^(\s*```\n[\w\W]*?^\s*```$\n)', String.Backtick),
564
+ # code block with language
565
+ # Some tools include extra stuff after the language name, just
566
+ # highlight that as text. For example: https://docs.enola.dev/use/execmd
567
+ (r'''(?x)
568
+ ^(?P<initial>\s*```)
569
+ (?P<lang>[\w\-]+)
570
+ (?P<afterlang>
571
+ (?P<whitespace>[^\S\n]+)
572
+ (?P<extra>.*))?
573
+ (?P<newline>\n)
574
+ (?P<code>(.|\n)*?)
575
+ (?P<terminator>^\s*```$\n)
576
+ ''',
577
+ _handle_codeblock),
578
+
579
+ include('inline'),
580
+ ],
581
+ 'inline': [
582
+ # escape
583
+ (r'\\.', Text),
584
+ # inline code
585
+ (r'([^`]?)(`[^`\n]+`)', bygroups(Text, String.Backtick)),
586
+ # warning: the following rules eat outer tags.
587
+ # eg. **foo _bar_ baz** => foo and baz are not recognized as bold
588
+ # bold fenced by '**'
589
+ (r'([^\*]?)(\*\*[^* \n][^*\n]*\*\*)', bygroups(Text, Generic.Strong)),
590
+ # bold fenced by '__'
591
+ (r'([^_]?)(__[^_ \n][^_\n]*__)', bygroups(Text, Generic.Strong)),
592
+ # italics fenced by '*'
593
+ (r'([^\*]?)(\*[^* \n][^*\n]*\*)', bygroups(Text, Generic.Emph)),
594
+ # italics fenced by '_'
595
+ (r'([^_]?)(_[^_ \n][^_\n]*_)', bygroups(Text, Generic.Emph)),
596
+ # strikethrough
597
+ (r'([^~]?)(~~[^~ \n][^~\n]*~~)', bygroups(Text, Generic.Deleted)),
598
+ # mentions and topics (twitter and github stuff)
599
+ (r'[@#][\w/:]+', Name.Entity),
600
+ # (image?) links eg: ![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)
601
+ (r'(!?\[)([^]]+)(\])(\()([^)]+)(\))',
602
+ bygroups(Text, Name.Tag, Text, Text, Name.Attribute, Text)),
603
+ # reference-style links, e.g.:
604
+ # [an example][id]
605
+ # [id]: http://example.com/
606
+ (r'(\[)([^]]+)(\])(\[)([^]]*)(\])',
607
+ bygroups(Text, Name.Tag, Text, Text, Name.Label, Text)),
608
+ (r'^(\s*\[)([^]]*)(\]:\s*)(.+)',
609
+ bygroups(Text, Name.Label, Text, Name.Attribute)),
610
+
611
+ # general text, must come last!
612
+ (r'[^\\\s]+', Text),
613
+ (r'.', Text),
614
+ ],
615
+ }
616
+
617
+ def __init__(self, **options):
618
+ self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
619
+ RegexLexer.__init__(self, **options)
620
+
621
+ class OrgLexer(RegexLexer):
622
+ """
623
+ For Org Mode markup.
624
+ """
625
+ name = 'Org Mode'
626
+ url = 'https://orgmode.org'
627
+ aliases = ['org', 'orgmode', 'org-mode']
628
+ filenames = ['*.org']
629
+ mimetypes = ["text/org"]
630
+ version_added = '2.18'
631
+
632
+ def _inline(start, end):
633
+ return rf'(?<!\w){start}(.|\n(?!\n))+?{end}(?!\w)'
634
+
635
+ tokens = {
636
+ 'root': [
637
+ (r'^# .*', Comment.Single),
638
+
639
+ # Headings
640
+ (r'^(\* )(COMMENT)( .*)',
641
+ bygroups(Generic.Heading, Comment.Preproc, Generic.Heading)),
642
+ (r'^(\*\*+ )(COMMENT)( .*)',
643
+ bygroups(Generic.Subheading, Comment.Preproc, Generic.Subheading)),
644
+ (r'^(\* )(DONE)( .*)',
645
+ bygroups(Generic.Heading, Generic.Deleted, Generic.Heading)),
646
+ (r'^(\*\*+ )(DONE)( .*)',
647
+ bygroups(Generic.Subheading, Generic.Deleted, Generic.Subheading)),
648
+ (r'^(\* )(TODO)( .*)',
649
+ bygroups(Generic.Heading, Generic.Error, Generic.Heading)),
650
+ (r'^(\*\*+ )(TODO)( .*)',
651
+ bygroups(Generic.Subheading, Generic.Error, Generic.Subheading)),
652
+
653
+ (r'^(\* .+?)( :[a-zA-Z0-9_@:]+:)?$', bygroups(Generic.Heading, Generic.Emph)),
654
+ (r'^(\*\*+ .+?)( :[a-zA-Z0-9_@:]+:)?$', bygroups(Generic.Subheading, Generic.Emph)),
655
+
656
+ # Unordered lists items, including TODO items and description items
657
+ (r'^(?:( *)([+-] )|( +)(\* ))(\[[ X-]\])?(.+ ::)?',
658
+ bygroups(Whitespace, Keyword, Whitespace, Keyword, Generic.Prompt, Name.Label)),
659
+
660
+ # Ordered list items
661
+ (r'^( *)([0-9]+[.)])( \[@[0-9]+\])?', bygroups(Whitespace, Keyword, Generic.Emph)),
662
+
663
+ # Dynamic blocks
664
+ (r'(?i)^( *#\+begin: *)((?:.|\n)*?)(^ *#\+end: *$)',
665
+ bygroups(Operator.Word, using(this), Operator.Word)),
666
+
667
+ # Comment blocks
668
+ (r'(?i)^( *#\+begin_comment *\n)((?:.|\n)*?)(^ *#\+end_comment *$)',
669
+ bygroups(Operator.Word, Comment.Multiline, Operator.Word)),
670
+
671
+ # Source code blocks
672
+ # TODO: language-dependent syntax highlighting (see Markdown lexer)
673
+ (r'(?i)^( *#\+begin_src .*)((?:.|\n)*?)(^ *#\+end_src *$)',
674
+ bygroups(Operator.Word, Text, Operator.Word)),
675
+
676
+ # Other blocks
677
+ (r'(?i)^( *#\+begin_\w+)( *\n)((?:.|\n)*?)(^ *#\+end_\w+)( *$)',
678
+ bygroups(Operator.Word, Whitespace, Text, Operator.Word, Whitespace)),
679
+
680
+ # Keywords
681
+ (r'^(#\+\w+:)(.*)$', bygroups(Name.Namespace, Text)),
682
+
683
+ # Properties and drawers
684
+ (r'(?i)^( *:\w+: *\n)((?:.|\n)*?)(^ *:end: *$)',
685
+ bygroups(Name.Decorator, Comment.Special, Name.Decorator)),
686
+
687
+ # Line break operator
688
+ (r'\\\\$', Operator),
689
+
690
+ (r'^\s*CLOSED:\s+', Generic.Deleted, 'dateline'),
691
+ (r'^\s*(?:DEADLINE:|SCHEDULED:)\s+', Generic.Error, 'dateline'),
692
+
693
+ # Bold
694
+ (_inline(r'\*', r'\*+'), Generic.Strong),
695
+ # Italic
696
+ (_inline(r'/', r'/'), Generic.Emph),
697
+ # Verbatim
698
+ (_inline(r'=', r'='), String), # TODO token
699
+ # Code
700
+ (_inline(r'~', r'~'), String),
701
+ # Strikethrough
702
+ (_inline(r'\+', r'\+'), Generic.Deleted),
703
+ # Underline
704
+ (_inline(r'_', r'_+'), Generic.EmphStrong),
705
+
706
+ # Dates
707
+ (r'<.+?>', Literal.Date),
708
+ # Macros
709
+ (r'\{\{\{.+?\}\}\}', Comment.Preproc),
710
+ # Footnotes
711
+ (r'(?<!\[)\[fn:.+?\]', Name.Tag),
712
+ # Links
713
+ (r'(?s)(\[\[)(.*?)(\]\[)(.*?)(\]\])',
714
+ bygroups(Punctuation, Name.Attribute, Punctuation, Name.Tag, Punctuation)),
715
+ (r'(?s)(\[\[)(.+?)(\]\])', bygroups(Punctuation, Name.Attribute, Punctuation)),
716
+ (r'(<<)(.+?)(>>)', bygroups(Punctuation, Name.Attribute, Punctuation)),
717
+
718
+ # Tables
719
+ (r'^( *)(\|[ -].*?[ -]\|)$', bygroups(Whitespace, String)),
720
+
721
+ # Any other text
722
+ (r'[^#*+\-0-9:\\/=~_<{\[|\n]+', Text),
723
+ (r'[#*+\-0-9:\\/=~_<{\[|\n]', Text),
724
+ ],
725
+ 'dateline': [
726
+ (r'\s*CLOSED:\s+', Generic.Deleted),
727
+ (r'\s*(?:DEADLINE:|SCHEDULED:)\s+', Generic.Error),
728
+ (r'\[.+?\]', Literal.Date),
729
+ (r'<[^>]+?>', Literal.Date),
730
+ (r'(\s*)$', Text, '#pop'),
731
+ (r'.', Text),
732
+ ],
733
+ }
734
+
735
+ class TiddlyWiki5Lexer(RegexLexer):
736
+ """
737
+ For TiddlyWiki5 markup.
738
+ """
739
+ name = 'tiddler'
740
+ url = 'https://tiddlywiki.com/#TiddlerFiles'
741
+ aliases = ['tid']
742
+ filenames = ['*.tid']
743
+ mimetypes = ["text/vnd.tiddlywiki"]
744
+ version_added = '2.7'
745
+ flags = re.MULTILINE
746
+
747
+ def _handle_codeblock(self, match):
748
+ """
749
+ match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks
750
+ """
751
+ from pygments.lexers import get_lexer_by_name
752
+
753
+ # section header
754
+ yield match.start(1), String, match.group(1)
755
+ yield match.start(2), String, match.group(2)
756
+ yield match.start(3), Text, match.group(3)
757
+
758
+ # lookup lexer if wanted and existing
759
+ lexer = None
760
+ if self.handlecodeblocks:
761
+ try:
762
+ lexer = get_lexer_by_name(match.group(2).strip())
763
+ except ClassNotFound:
764
+ pass
765
+ code = match.group(4)
766
+
767
+ # no lexer for this language. handle it like it was a code block
768
+ if lexer is None:
769
+ yield match.start(4), String, code
770
+ return
771
+
772
+ yield from do_insertions([], lexer.get_tokens_unprocessed(code))
773
+
774
+ yield match.start(5), String, match.group(5)
775
+
776
+ def _handle_cssblock(self, match):
777
+ """
778
+ match args: 1:style tag 2:newline, 3:code, 4:closing style tag
779
+ """
780
+ from pygments.lexers import get_lexer_by_name
781
+
782
+ # section header
783
+ yield match.start(1), String, match.group(1)
784
+ yield match.start(2), String, match.group(2)
785
+
786
+ lexer = None
787
+ if self.handlecodeblocks:
788
+ try:
789
+ lexer = get_lexer_by_name('css')
790
+ except ClassNotFound:
791
+ pass
792
+ code = match.group(3)
793
+
794
+ # no lexer for this language. handle it like it was a code block
795
+ if lexer is None:
796
+ yield match.start(3), String, code
797
+ return
798
+
799
+ yield from do_insertions([], lexer.get_tokens_unprocessed(code))
800
+
801
+ yield match.start(4), String, match.group(4)
802
+
803
+ tokens = {
804
+ 'root': [
805
+ # title in metadata section
806
+ (r'^(title)(:\s)(.+\n)', bygroups(Keyword, Text, Generic.Heading)),
807
+ # headings
808
+ (r'^(!)([^!].+\n)', bygroups(Generic.Heading, Text)),
809
+ (r'^(!{2,6})(.+\n)', bygroups(Generic.Subheading, Text)),
810
+ # bulleted or numbered lists or single-line block quotes
811
+ # (can be mixed)
812
+ (r'^(\s*)([*#>]+)(\s*)(.+\n)',
813
+ bygroups(Text, Keyword, Text, using(this, state='inline'))),
814
+ # multi-line block quotes
815
+ (r'^(<<<.*\n)([\w\W]*?)(^<<<.*$)', bygroups(String, Text, String)),
816
+ # table header
817
+ (r'^(\|.*?\|h)$', bygroups(Generic.Strong)),
818
+ # table footer or caption
819
+ (r'^(\|.*?\|[cf])$', bygroups(Generic.Emph)),
820
+ # table class
821
+ (r'^(\|.*?\|k)$', bygroups(Name.Tag)),
822
+ # definitions
823
+ (r'^(;.*)$', bygroups(Generic.Strong)),
824
+ # text block
825
+ (r'^(```\n)([\w\W]*?)(^```$)', bygroups(String, Text, String)),
826
+ # code block with language
827
+ (r'^(```)(\w+)(\n)([\w\W]*?)(^```$)', _handle_codeblock),
828
+ # CSS style block
829
+ (r'^(<style>)(\n)([\w\W]*?)(^</style>$)', _handle_cssblock),
830
+
831
+ include('keywords'),
832
+ include('inline'),
833
+ ],
834
+ 'keywords': [
835
+ (words((
836
+ '\\define', '\\end', 'caption', 'created', 'modified', 'tags',
837
+ 'title', 'type'), prefix=r'^', suffix=r'\b'),
838
+ Keyword),
839
+ ],
840
+ 'inline': [
841
+ # escape
842
+ (r'\\.', Text),
843
+ # created or modified date
844
+ (r'\d{17}', Number.Integer),
845
+ # italics
846
+ (r'(\s)(//[^/]+//)((?=\W|\n))',
847
+ bygroups(Text, Generic.Emph, Text)),
848
+ # superscript
849
+ (r'(\s)(\^\^[^\^]+\^\^)', bygroups(Text, Generic.Emph)),
850
+ # subscript
851
+ (r'(\s)(,,[^,]+,,)', bygroups(Text, Generic.Emph)),
852
+ # underscore
853
+ (r'(\s)(__[^_]+__)', bygroups(Text, Generic.Strong)),
854
+ # bold
855
+ (r"(\s)(''[^']+'')((?=\W|\n))",
856
+ bygroups(Text, Generic.Strong, Text)),
857
+ # strikethrough
858
+ (r'(\s)(~~[^~]+~~)((?=\W|\n))',
859
+ bygroups(Text, Generic.Deleted, Text)),
860
+ # TiddlyWiki variables
861
+ (r'<<[^>]+>>', Name.Tag),
862
+ (r'\$\$[^$]+\$\$', Name.Tag),
863
+ (r'\$\([^)]+\)\$', Name.Tag),
864
+ # TiddlyWiki style or class
865
+ (r'^@@.*$', Name.Tag),
866
+ # HTML tags
867
+ (r'</?[^>]+>', Name.Tag),
868
+ # inline code
869
+ (r'`[^`]+`', String.Backtick),
870
+ # HTML escaped symbols
871
+ (r'&\S*?;', String.Regex),
872
+ # Wiki links
873
+ (r'(\[{2})([^]\|]+)(\]{2})', bygroups(Text, Name.Tag, Text)),
874
+ # External links
875
+ (r'(\[{2})([^]\|]+)(\|)([^]\|]+)(\]{2})',
876
+ bygroups(Text, Name.Tag, Text, Name.Attribute, Text)),
877
+ # Transclusion
878
+ (r'(\{{2})([^}]+)(\}{2})', bygroups(Text, Name.Tag, Text)),
879
+ # URLs
880
+ (r'(\b.?.?tps?://[^\s"]+)', bygroups(Name.Attribute)),
881
+
882
+ # general text, must come last!
883
+ (r'[\w]+', Text),
884
+ (r'.', Text)
885
+ ],
886
+ }
887
+
888
+ def __init__(self, **options):
889
+ self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
890
+ RegexLexer.__init__(self, **options)
891
+
892
+
893
+ class WikitextLexer(RegexLexer):
894
+ """
895
+ For MediaWiki Wikitext.
896
+
897
+ Parsing Wikitext is tricky, and results vary between different MediaWiki
898
+ installations, so we only highlight common syntaxes (built-in or from
899
+ popular extensions), and also assume templates produce no unbalanced
900
+ syntaxes.
901
+ """
902
+ name = 'Wikitext'
903
+ url = 'https://www.mediawiki.org/wiki/Wikitext'
904
+ aliases = ['wikitext', 'mediawiki']
905
+ filenames = []
906
+ mimetypes = ['text/x-wiki']
907
+ version_added = '2.15'
908
+ flags = re.MULTILINE
909
+
910
+ def nowiki_tag_rules(tag_name):
911
+ return [
912
+ (rf'(?i)(</)({tag_name})(\s*)(>)', bygroups(Punctuation,
913
+ Name.Tag, Whitespace, Punctuation), '#pop'),
914
+ include('entity'),
915
+ include('text'),
916
+ ]
917
+
918
+ def plaintext_tag_rules(tag_name):
919
+ return [
920
+ (rf'(?si)(.*?)(</)({tag_name})(\s*)(>)', bygroups(Text,
921
+ Punctuation, Name.Tag, Whitespace, Punctuation), '#pop'),
922
+ ]
923
+
924
+ def delegate_tag_rules(tag_name, lexer, **lexer_kwargs):
925
+ return [
926
+ (rf'(?i)(</)({tag_name})(\s*)(>)', bygroups(Punctuation,
927
+ Name.Tag, Whitespace, Punctuation), '#pop'),
928
+ (rf'(?si).+?(?=</{tag_name}\s*>)', using(lexer, **lexer_kwargs)),
929
+ ]
930
+
931
+ def text_rules(token):
932
+ return [
933
+ (r'\w+', token),
934
+ (r'[^\S\n]+', token),
935
+ (r'(?s).', token),
936
+ ]
937
+
938
+ def handle_syntaxhighlight(self, match, ctx):
939
+ from pygments.lexers import get_lexer_by_name
940
+
941
+ attr_content = match.group()
942
+ start = 0
943
+ index = 0
944
+ while True:
945
+ index = attr_content.find('>', start)
946
+ # Exclude comment end (-->)
947
+ if attr_content[index-2:index] != '--':
948
+ break
949
+ start = index + 1
950
+
951
+ if index == -1:
952
+ # No tag end
953
+ yield from self.get_tokens_unprocessed(attr_content, stack=['root', 'attr'])
954
+ return
955
+ attr = attr_content[:index]
956
+ yield from self.get_tokens_unprocessed(attr, stack=['root', 'attr'])
957
+ yield match.start(3) + index, Punctuation, '>'
958
+
959
+ lexer = None
960
+ content = attr_content[index+1:]
961
+ lang_match = re.findall(r'\blang=("|\'|)(\w+)(\1)', attr)
962
+
963
+ if len(lang_match) >= 1:
964
+ # Pick the last match in case of multiple matches
965
+ lang = lang_match[-1][1]
966
+ try:
967
+ lexer = get_lexer_by_name(lang)
968
+ except ClassNotFound:
969
+ pass
970
+
971
+ if lexer is None:
972
+ yield match.start() + index + 1, Text, content
973
+ else:
974
+ yield from lexer.get_tokens_unprocessed(content)
975
+
976
+ def handle_score(self, match, ctx):
977
+ attr_content = match.group()
978
+ start = 0
979
+ index = 0
980
+ while True:
981
+ index = attr_content.find('>', start)
982
+ # Exclude comment end (-->)
983
+ if attr_content[index-2:index] != '--':
984
+ break
985
+ start = index + 1
986
+
987
+ if index == -1:
988
+ # No tag end
989
+ yield from self.get_tokens_unprocessed(attr_content, stack=['root', 'attr'])
990
+ return
991
+ attr = attr_content[:index]
992
+ content = attr_content[index+1:]
993
+ yield from self.get_tokens_unprocessed(attr, stack=['root', 'attr'])
994
+ yield match.start(3) + index, Punctuation, '>'
995
+
996
+ lang_match = re.findall(r'\blang=("|\'|)(\w+)(\1)', attr)
997
+ # Pick the last match in case of multiple matches
998
+ lang = lang_match[-1][1] if len(lang_match) >= 1 else 'lilypond'
999
+
1000
+ if lang == 'lilypond': # Case sensitive
1001
+ yield from LilyPondLexer().get_tokens_unprocessed(content)
1002
+ else: # ABC
1003
+ # FIXME: Use ABC lexer in the future
1004
+ yield match.start() + index + 1, Text, content
1005
+
1006
+ # a-z removed to prevent linter from complaining, REMEMBER to use (?i)
1007
+ title_char = r' %!"$&\'()*,\-./0-9:;=?@A-Z\\\^_`~+\u0080-\uFFFF'
1008
+ nbsp_char = r'(?:\t|&nbsp;|&\#0*160;|&\#[Xx]0*[Aa]0;|[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000])'
1009
+ link_address = r'(?:[0-9.]+|\[[0-9a-f:.]+\]|[^\x00-\x20"<>\[\]\x7F\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFFFD])'
1010
+ link_char_class = r'[^\x00-\x20"<>\[\]\x7F\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFFFD]'
1011
+ double_slashes_i = {
1012
+ '__FORCETOC__', '__NOCONTENTCONVERT__', '__NOCC__', '__NOEDITSECTION__', '__NOGALLERY__',
1013
+ '__NOTITLECONVERT__', '__NOTC__', '__NOTOC__', '__TOC__',
1014
+ }
1015
+ double_slashes = {
1016
+ '__EXPECTUNUSEDCATEGORY__', '__HIDDENCAT__', '__INDEX__', '__NEWSECTIONLINK__',
1017
+ '__NOINDEX__', '__NONEWSECTIONLINK__', '__STATICREDIRECT__', '__NOGLOBAL__',
1018
+ '__DISAMBIG__', '__EXPECTED_UNCONNECTED_PAGE__',
1019
+ }
1020
+ protocols = {
1021
+ 'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://', 'https://',
1022
+ 'irc://', 'ircs://', 'magnet:', 'mailto:', 'mms://', 'news:', 'nntp://', 'redis://',
1023
+ 'sftp://', 'sip:', 'sips:', 'sms:', 'ssh://', 'svn://', 'tel:', 'telnet://', 'urn:',
1024
+ 'worldwind://', 'xmpp:', '//',
1025
+ }
1026
+ non_relative_protocols = protocols - {'//'}
1027
+ html_tags = {
1028
+ 'abbr', 'b', 'bdi', 'bdo', 'big', 'blockquote', 'br', 'caption', 'center', 'cite', 'code',
1029
+ 'data', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'font', 'h1', 'h2', 'h3', 'h4', 'h5',
1030
+ 'h6', 'hr', 'i', 'ins', 'kbd', 'li', 'link', 'mark', 'meta', 'ol', 'p', 'q', 'rb', 'rp',
1031
+ 'rt', 'rtc', 'ruby', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup',
1032
+ 'table', 'td', 'th', 'time', 'tr', 'tt', 'u', 'ul', 'var', 'wbr',
1033
+ }
1034
+ parser_tags = {
1035
+ 'graph', 'charinsert', 'rss', 'chem', 'categorytree', 'nowiki', 'inputbox', 'math',
1036
+ 'hiero', 'score', 'pre', 'ref', 'translate', 'imagemap', 'templatestyles', 'languages',
1037
+ 'noinclude', 'mapframe', 'section', 'poem', 'syntaxhighlight', 'includeonly', 'tvar',
1038
+ 'onlyinclude', 'templatedata', 'langconvert', 'timeline', 'dynamicpagelist', 'gallery',
1039
+ 'maplink', 'ce', 'references',
1040
+ }
1041
+ variant_langs = {
1042
+ # ZhConverter.php
1043
+ 'zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-hk', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw',
1044
+ # WuuConverter.php
1045
+ 'wuu', 'wuu-hans', 'wuu-hant',
1046
+ # UzConverter.php
1047
+ 'uz', 'uz-latn', 'uz-cyrl',
1048
+ # TlyConverter.php
1049
+ 'tly', 'tly-cyrl',
1050
+ # TgConverter.php
1051
+ 'tg', 'tg-latn',
1052
+ # SrConverter.php
1053
+ 'sr', 'sr-ec', 'sr-el',
1054
+ # ShiConverter.php
1055
+ 'shi', 'shi-tfng', 'shi-latn',
1056
+ # ShConverter.php
1057
+ 'sh-latn', 'sh-cyrl',
1058
+ # KuConverter.php
1059
+ 'ku', 'ku-arab', 'ku-latn',
1060
+ # IuConverter.php
1061
+ 'iu', 'ike-cans', 'ike-latn',
1062
+ # GanConverter.php
1063
+ 'gan', 'gan-hans', 'gan-hant',
1064
+ # EnConverter.php
1065
+ 'en', 'en-x-piglatin',
1066
+ # CrhConverter.php
1067
+ 'crh', 'crh-cyrl', 'crh-latn',
1068
+ # BanConverter.php
1069
+ 'ban', 'ban-bali', 'ban-x-dharma', 'ban-x-palmleaf', 'ban-x-pku',
1070
+ }
1071
+ magic_vars_i = {
1072
+ 'ARTICLEPATH', 'INT', 'PAGEID', 'SCRIPTPATH', 'SERVER', 'SERVERNAME', 'STYLEPATH',
1073
+ }
1074
+ magic_vars = {
1075
+ '!', '=', 'BASEPAGENAME', 'BASEPAGENAMEE', 'CASCADINGSOURCES', 'CONTENTLANGUAGE',
1076
+ 'CONTENTLANG', 'CURRENTDAY', 'CURRENTDAY2', 'CURRENTDAYNAME', 'CURRENTDOW', 'CURRENTHOUR',
1077
+ 'CURRENTMONTH', 'CURRENTMONTH2', 'CURRENTMONTH1', 'CURRENTMONTHABBREV', 'CURRENTMONTHNAME',
1078
+ 'CURRENTMONTHNAMEGEN', 'CURRENTTIME', 'CURRENTTIMESTAMP', 'CURRENTVERSION', 'CURRENTWEEK',
1079
+ 'CURRENTYEAR', 'DIRECTIONMARK', 'DIRMARK', 'FULLPAGENAME', 'FULLPAGENAMEE', 'LOCALDAY',
1080
+ 'LOCALDAY2', 'LOCALDAYNAME', 'LOCALDOW', 'LOCALHOUR', 'LOCALMONTH', 'LOCALMONTH2',
1081
+ 'LOCALMONTH1', 'LOCALMONTHABBREV', 'LOCALMONTHNAME', 'LOCALMONTHNAMEGEN', 'LOCALTIME',
1082
+ 'LOCALTIMESTAMP', 'LOCALWEEK', 'LOCALYEAR', 'NAMESPACE', 'NAMESPACEE', 'NAMESPACENUMBER',
1083
+ 'NUMBEROFACTIVEUSERS', 'NUMBEROFADMINS', 'NUMBEROFARTICLES', 'NUMBEROFEDITS',
1084
+ 'NUMBEROFFILES', 'NUMBEROFPAGES', 'NUMBEROFUSERS', 'PAGELANGUAGE', 'PAGENAME', 'PAGENAMEE',
1085
+ 'REVISIONDAY', 'REVISIONDAY2', 'REVISIONID', 'REVISIONMONTH', 'REVISIONMONTH1',
1086
+ 'REVISIONSIZE', 'REVISIONTIMESTAMP', 'REVISIONUSER', 'REVISIONYEAR', 'ROOTPAGENAME',
1087
+ 'ROOTPAGENAMEE', 'SITENAME', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME', 'SUBJECTPAGENAMEE',
1088
+ 'ARTICLEPAGENAMEE', 'SUBJECTSPACE', 'ARTICLESPACE', 'SUBJECTSPACEE', 'ARTICLESPACEE',
1089
+ 'SUBPAGENAME', 'SUBPAGENAMEE', 'TALKPAGENAME', 'TALKPAGENAMEE', 'TALKSPACE', 'TALKSPACEE',
1090
+ }
1091
+ parser_functions_i = {
1092
+ 'ANCHORENCODE', 'BIDI', 'CANONICALURL', 'CANONICALURLE', 'FILEPATH', 'FORMATNUM',
1093
+ 'FULLURL', 'FULLURLE', 'GENDER', 'GRAMMAR', 'INT', r'\#LANGUAGE', 'LC', 'LCFIRST', 'LOCALURL',
1094
+ 'LOCALURLE', 'NS', 'NSE', 'PADLEFT', 'PADRIGHT', 'PAGEID', 'PLURAL', 'UC', 'UCFIRST',
1095
+ 'URLENCODE',
1096
+ }
1097
+ parser_functions = {
1098
+ 'BASEPAGENAME', 'BASEPAGENAMEE', 'CASCADINGSOURCES', 'DEFAULTSORT', 'DEFAULTSORTKEY',
1099
+ 'DEFAULTCATEGORYSORT', 'FULLPAGENAME', 'FULLPAGENAMEE', 'NAMESPACE', 'NAMESPACEE',
1100
+ 'NAMESPACENUMBER', 'NUMBERINGROUP', 'NUMINGROUP', 'NUMBEROFACTIVEUSERS', 'NUMBEROFADMINS',
1101
+ 'NUMBEROFARTICLES', 'NUMBEROFEDITS', 'NUMBEROFFILES', 'NUMBEROFPAGES', 'NUMBEROFUSERS',
1102
+ 'PAGENAME', 'PAGENAMEE', 'PAGESINCATEGORY', 'PAGESINCAT', 'PAGESIZE', 'PROTECTIONEXPIRY',
1103
+ 'PROTECTIONLEVEL', 'REVISIONDAY', 'REVISIONDAY2', 'REVISIONID', 'REVISIONMONTH',
1104
+ 'REVISIONMONTH1', 'REVISIONTIMESTAMP', 'REVISIONUSER', 'REVISIONYEAR', 'ROOTPAGENAME',
1105
+ 'ROOTPAGENAMEE', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME', 'SUBJECTPAGENAMEE',
1106
+ 'ARTICLEPAGENAMEE', 'SUBJECTSPACE', 'ARTICLESPACE', 'SUBJECTSPACEE', 'ARTICLESPACEE',
1107
+ 'SUBPAGENAME', 'SUBPAGENAMEE', 'TALKPAGENAME', 'TALKPAGENAMEE', 'TALKSPACE', 'TALKSPACEE',
1108
+ 'INT', 'DISPLAYTITLE', 'PAGESINNAMESPACE', 'PAGESINNS',
1109
+ }
1110
+
1111
+ tokens = {
1112
+ 'root': [
1113
+ # Redirects
1114
+ (r"""(?xi)
1115
+ (\A\s*?)(\#REDIRECT:?) # may contain a colon
1116
+ (\s+)(\[\[) (?=[^\]\n]* \]\]$)
1117
+ """,
1118
+ bygroups(Whitespace, Keyword, Whitespace, Punctuation), 'redirect-inner'),
1119
+ # Subheadings
1120
+ (r'^(={2,6})(.+?)(\1)(\s*$\n)',
1121
+ bygroups(Generic.Subheading, Generic.Subheading, Generic.Subheading, Whitespace)),
1122
+ # Headings
1123
+ (r'^(=.+?=)(\s*$\n)',
1124
+ bygroups(Generic.Heading, Whitespace)),
1125
+ # Double-slashed magic words
1126
+ (words(double_slashes_i, prefix=r'(?i)'), Name.Function.Magic),
1127
+ (words(double_slashes), Name.Function.Magic),
1128
+ # Raw URLs
1129
+ (r'(?i)\b(?:{}){}{}*'.format('|'.join(protocols),
1130
+ link_address, link_char_class), Name.Label),
1131
+ # Magic links
1132
+ (rf'\b(?:RFC|PMID){nbsp_char}+[0-9]+\b',
1133
+ Name.Function.Magic),
1134
+ (r"""(?x)
1135
+ \bISBN {nbsp_char}
1136
+ (?: 97[89] {nbsp_dash}? )?
1137
+ (?: [0-9] {nbsp_dash}? ){{9}} # escape format()
1138
+ [0-9Xx]\b
1139
+ """.format(nbsp_char=nbsp_char, nbsp_dash=f'(?:-|{nbsp_char})'), Name.Function.Magic),
1140
+ include('list'),
1141
+ include('inline'),
1142
+ include('text'),
1143
+ ],
1144
+ 'redirect-inner': [
1145
+ (r'(\]\])(\s*?\n)', bygroups(Punctuation, Whitespace), '#pop'),
1146
+ (r'(\#)([^#]*?)', bygroups(Punctuation, Name.Label)),
1147
+ (rf'(?i)[{title_char}]+', Name.Tag),
1148
+ ],
1149
+ 'list': [
1150
+ # Description lists
1151
+ (r'^;', Keyword, 'dt'),
1152
+ # Ordered lists, unordered lists and indents
1153
+ (r'^[#:*]+', Keyword),
1154
+ # Horizontal rules
1155
+ (r'^-{4,}', Keyword),
1156
+ ],
1157
+ 'inline': [
1158
+ # Signatures
1159
+ (r'~{3,5}', Keyword),
1160
+ # Entities
1161
+ include('entity'),
1162
+ # Bold & italic
1163
+ (r"('')(''')(?!')", bygroups(Generic.Emph,
1164
+ Generic.EmphStrong), 'inline-italic-bold'),
1165
+ (r"'''(?!')", Generic.Strong, 'inline-bold'),
1166
+ (r"''(?!')", Generic.Emph, 'inline-italic'),
1167
+ # Comments & parameters & templates
1168
+ include('replaceable'),
1169
+ # Media links
1170
+ (
1171
+ r"""(?xi)
1172
+ (\[\[)
1173
+ (File|Image) (:)
1174
+ ((?: [{}] | \{{{{2,3}}[^{{}}]*?\}}{{2,3}} | <!--[\s\S]*?--> )*)
1175
+ (?: (\#) ([{}]*?) )?
1176
+ """.format(title_char, f'{title_char}#'),
1177
+ bygroups(Punctuation, Name.Namespace, Punctuation,
1178
+ using(this, state=['wikilink-name']), Punctuation, Name.Label),
1179
+ 'medialink-inner'
1180
+ ),
1181
+ # Wikilinks
1182
+ (
1183
+ r"""(?xi)
1184
+ (\[\[)(?!{}) # Should not contain URLs
1185
+ (?: ([{}]*) (:))?
1186
+ ((?: [{}] | \{{{{2,3}}[^{{}}]*?\}}{{2,3}} | <!--[\s\S]*?--> )*?)
1187
+ (?: (\#) ([{}]*?) )?
1188
+ (\]\])
1189
+ """.format('|'.join(protocols), title_char.replace('/', ''),
1190
+ title_char, f'{title_char}#'),
1191
+ bygroups(Punctuation, Name.Namespace, Punctuation,
1192
+ using(this, state=['wikilink-name']), Punctuation, Name.Label, Punctuation)
1193
+ ),
1194
+ (
1195
+ r"""(?xi)
1196
+ (\[\[)(?!{})
1197
+ (?: ([{}]*) (:))?
1198
+ ((?: [{}] | \{{{{2,3}}[^{{}}]*?\}}{{2,3}} | <!--[\s\S]*?--> )*?)
1199
+ (?: (\#) ([{}]*?) )?
1200
+ (\|)
1201
+ """.format('|'.join(protocols), title_char.replace('/', ''),
1202
+ title_char, f'{title_char}#'),
1203
+ bygroups(Punctuation, Name.Namespace, Punctuation,
1204
+ using(this, state=['wikilink-name']), Punctuation, Name.Label, Punctuation),
1205
+ 'wikilink-inner'
1206
+ ),
1207
+ # External links
1208
+ (
1209
+ r"""(?xi)
1210
+ (\[)
1211
+ ((?:{}) {} {}*)
1212
+ (\s*)
1213
+ """.format('|'.join(protocols), link_address, link_char_class),
1214
+ bygroups(Punctuation, Name.Label, Whitespace),
1215
+ 'extlink-inner'
1216
+ ),
1217
+ # Tables
1218
+ (r'^(:*)(\s*?)(\{\|)([^\n]*)$', bygroups(Keyword,
1219
+ Whitespace, Punctuation, using(this, state=['root', 'attr'])), 'table'),
1220
+ # HTML tags
1221
+ (r'(?i)(<)({})\b'.format('|'.join(html_tags)),
1222
+ bygroups(Punctuation, Name.Tag), 'tag-inner-ordinary'),
1223
+ (r'(?i)(</)({})\b(\s*)(>)'.format('|'.join(html_tags)),
1224
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1225
+ # <nowiki>
1226
+ (r'(?i)(<)(nowiki)\b', bygroups(Punctuation,
1227
+ Name.Tag), ('tag-nowiki', 'tag-inner')),
1228
+ # <pre>
1229
+ (r'(?i)(<)(pre)\b', bygroups(Punctuation,
1230
+ Name.Tag), ('tag-pre', 'tag-inner')),
1231
+ # <categorytree>
1232
+ (r'(?i)(<)(categorytree)\b', bygroups(
1233
+ Punctuation, Name.Tag), ('tag-categorytree', 'tag-inner')),
1234
+ # <hiero>
1235
+ (r'(?i)(<)(hiero)\b', bygroups(Punctuation,
1236
+ Name.Tag), ('tag-hiero', 'tag-inner')),
1237
+ # <math>
1238
+ (r'(?i)(<)(math)\b', bygroups(Punctuation,
1239
+ Name.Tag), ('tag-math', 'tag-inner')),
1240
+ # <chem>
1241
+ (r'(?i)(<)(chem)\b', bygroups(Punctuation,
1242
+ Name.Tag), ('tag-chem', 'tag-inner')),
1243
+ # <ce>
1244
+ (r'(?i)(<)(ce)\b', bygroups(Punctuation,
1245
+ Name.Tag), ('tag-ce', 'tag-inner')),
1246
+ # <charinsert>
1247
+ (r'(?i)(<)(charinsert)\b', bygroups(
1248
+ Punctuation, Name.Tag), ('tag-charinsert', 'tag-inner')),
1249
+ # <templatedata>
1250
+ (r'(?i)(<)(templatedata)\b', bygroups(
1251
+ Punctuation, Name.Tag), ('tag-templatedata', 'tag-inner')),
1252
+ # <gallery>
1253
+ (r'(?i)(<)(gallery)\b', bygroups(
1254
+ Punctuation, Name.Tag), ('tag-gallery', 'tag-inner')),
1255
+ # <graph>
1256
+ (r'(?i)(<)(gallery)\b', bygroups(
1257
+ Punctuation, Name.Tag), ('tag-graph', 'tag-inner')),
1258
+ # <dynamicpagelist>
1259
+ (r'(?i)(<)(dynamicpagelist)\b', bygroups(
1260
+ Punctuation, Name.Tag), ('tag-dynamicpagelist', 'tag-inner')),
1261
+ # <inputbox>
1262
+ (r'(?i)(<)(inputbox)\b', bygroups(
1263
+ Punctuation, Name.Tag), ('tag-inputbox', 'tag-inner')),
1264
+ # <rss>
1265
+ (r'(?i)(<)(rss)\b', bygroups(
1266
+ Punctuation, Name.Tag), ('tag-rss', 'tag-inner')),
1267
+ # <imagemap>
1268
+ (r'(?i)(<)(imagemap)\b', bygroups(
1269
+ Punctuation, Name.Tag), ('tag-imagemap', 'tag-inner')),
1270
+ # <syntaxhighlight>
1271
+ (r'(?i)(</)(syntaxhighlight)\b(\s*)(>)',
1272
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1273
+ (r'(?si)(<)(syntaxhighlight)\b([^>]*?(?<!/)>.*?)(?=</\2\s*>)',
1274
+ bygroups(Punctuation, Name.Tag, handle_syntaxhighlight)),
1275
+ # <syntaxhighlight>: Fallback case for self-closing tags
1276
+ (r'(?i)(<)(syntaxhighlight)\b(\s*?)((?:[^>]|-->)*?)(/\s*?(?<!--)>)', bygroups(
1277
+ Punctuation, Name.Tag, Whitespace, using(this, state=['root', 'attr']), Punctuation)),
1278
+ # <source>
1279
+ (r'(?i)(</)(source)\b(\s*)(>)',
1280
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1281
+ (r'(?si)(<)(source)\b([^>]*?(?<!/)>.*?)(?=</\2\s*>)',
1282
+ bygroups(Punctuation, Name.Tag, handle_syntaxhighlight)),
1283
+ # <source>: Fallback case for self-closing tags
1284
+ (r'(?i)(<)(source)\b(\s*?)((?:[^>]|-->)*?)(/\s*?(?<!--)>)', bygroups(
1285
+ Punctuation, Name.Tag, Whitespace, using(this, state=['root', 'attr']), Punctuation)),
1286
+ # <score>
1287
+ (r'(?i)(</)(score)\b(\s*)(>)',
1288
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1289
+ (r'(?si)(<)(score)\b([^>]*?(?<!/)>.*?)(?=</\2\s*>)',
1290
+ bygroups(Punctuation, Name.Tag, handle_score)),
1291
+ # <score>: Fallback case for self-closing tags
1292
+ (r'(?i)(<)(score)\b(\s*?)((?:[^>]|-->)*?)(/\s*?(?<!--)>)', bygroups(
1293
+ Punctuation, Name.Tag, Whitespace, using(this, state=['root', 'attr']), Punctuation)),
1294
+ # Other parser tags
1295
+ (r'(?i)(<)({})\b'.format('|'.join(parser_tags)),
1296
+ bygroups(Punctuation, Name.Tag), 'tag-inner-ordinary'),
1297
+ (r'(?i)(</)({})\b(\s*)(>)'.format('|'.join(parser_tags)),
1298
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1299
+ # LanguageConverter markups
1300
+ (
1301
+ r"""(?xi)
1302
+ (-\{{) # Use {{ to escape format()
1303
+ ([^|]) (\|)
1304
+ (?:
1305
+ (?: ([^;]*?) (=>))?
1306
+ (\s* (?:{variants}) \s*) (:)
1307
+ )?
1308
+ """.format(variants='|'.join(variant_langs)),
1309
+ bygroups(Punctuation, Keyword, Punctuation,
1310
+ using(this, state=['root', 'lc-raw']),
1311
+ Operator, Name.Label, Punctuation),
1312
+ 'lc-inner'
1313
+ ),
1314
+ # LanguageConverter markups: composite conversion grammar
1315
+ (
1316
+ r"""(?xi)
1317
+ (-\{)
1318
+ ([a-z\s;-]*?) (\|)
1319
+ """,
1320
+ bygroups(Punctuation,
1321
+ using(this, state=['root', 'lc-flag']),
1322
+ Punctuation),
1323
+ 'lc-raw'
1324
+ ),
1325
+ # LanguageConverter markups: fallbacks
1326
+ (
1327
+ r"""(?xi)
1328
+ (-\{{) (?!\{{) # Use {{ to escape format()
1329
+ (?: (\s* (?:{variants}) \s*) (:))?
1330
+ """.format(variants='|'.join(variant_langs)),
1331
+ bygroups(Punctuation, Name.Label, Punctuation),
1332
+ 'lc-inner'
1333
+ ),
1334
+ ],
1335
+ 'wikilink-name': [
1336
+ include('replaceable'),
1337
+ (r'[^{<]+', Name.Tag),
1338
+ (r'(?s).', Name.Tag),
1339
+ ],
1340
+ 'wikilink-inner': [
1341
+ # Quit in case of another wikilink
1342
+ (r'(?=\[\[)', Punctuation, '#pop'),
1343
+ (r'\]\]', Punctuation, '#pop'),
1344
+ include('inline'),
1345
+ include('text'),
1346
+ ],
1347
+ 'medialink-inner': [
1348
+ (r'\]\]', Punctuation, '#pop'),
1349
+ (r'(\|)([^\n=|]*)(=)',
1350
+ bygroups(Punctuation, Name.Attribute, Operator)),
1351
+ (r'\|', Punctuation),
1352
+ include('inline'),
1353
+ include('text'),
1354
+ ],
1355
+ 'quote-common': [
1356
+ # Quit in case of link/template endings
1357
+ (r'(?=\]\]|\{\{|\}\})', Punctuation, '#pop'),
1358
+ (r'\n', Text, '#pop'),
1359
+ ],
1360
+ 'inline-italic': [
1361
+ include('quote-common'),
1362
+ (r"('')(''')(?!')", bygroups(Generic.Emph,
1363
+ Generic.Strong), ('#pop', 'inline-bold')),
1364
+ (r"'''(?!')", Generic.EmphStrong, ('#pop', 'inline-italic-bold')),
1365
+ (r"''(?!')", Generic.Emph, '#pop'),
1366
+ include('inline'),
1367
+ include('text-italic'),
1368
+ ],
1369
+ 'inline-bold': [
1370
+ include('quote-common'),
1371
+ (r"(''')('')(?!')", bygroups(
1372
+ Generic.Strong, Generic.Emph), ('#pop', 'inline-italic')),
1373
+ (r"'''(?!')", Generic.Strong, '#pop'),
1374
+ (r"''(?!')", Generic.EmphStrong, ('#pop', 'inline-bold-italic')),
1375
+ include('inline'),
1376
+ include('text-bold'),
1377
+ ],
1378
+ 'inline-bold-italic': [
1379
+ include('quote-common'),
1380
+ (r"('')(''')(?!')", bygroups(Generic.EmphStrong,
1381
+ Generic.Strong), '#pop'),
1382
+ (r"'''(?!')", Generic.EmphStrong, ('#pop', 'inline-italic')),
1383
+ (r"''(?!')", Generic.EmphStrong, ('#pop', 'inline-bold')),
1384
+ include('inline'),
1385
+ include('text-bold-italic'),
1386
+ ],
1387
+ 'inline-italic-bold': [
1388
+ include('quote-common'),
1389
+ (r"(''')('')(?!')", bygroups(
1390
+ Generic.EmphStrong, Generic.Emph), '#pop'),
1391
+ (r"'''(?!')", Generic.EmphStrong, ('#pop', 'inline-italic')),
1392
+ (r"''(?!')", Generic.EmphStrong, ('#pop', 'inline-bold')),
1393
+ include('inline'),
1394
+ include('text-bold-italic'),
1395
+ ],
1396
+ 'lc-flag': [
1397
+ (r'\s+', Whitespace),
1398
+ (r';', Punctuation),
1399
+ *text_rules(Keyword),
1400
+ ],
1401
+ 'lc-inner': [
1402
+ (
1403
+ r"""(?xi)
1404
+ (;)
1405
+ (?: ([^;]*?) (=>))?
1406
+ (\s* (?:{variants}) \s*) (:)
1407
+ """.format(variants='|'.join(variant_langs)),
1408
+ bygroups(Punctuation, using(this, state=['root', 'lc-raw']),
1409
+ Operator, Name.Label, Punctuation)
1410
+ ),
1411
+ (r';?\s*?\}-', Punctuation, '#pop'),
1412
+ include('inline'),
1413
+ include('text'),
1414
+ ],
1415
+ 'lc-raw': [
1416
+ (r'\}-', Punctuation, '#pop'),
1417
+ include('inline'),
1418
+ include('text'),
1419
+ ],
1420
+ 'replaceable': [
1421
+ # Comments
1422
+ (r'<!--[\s\S]*?(?:-->|\Z)', Comment.Multiline),
1423
+ # Parameters
1424
+ (
1425
+ r"""(?x)
1426
+ (\{{3})
1427
+ ([^|]*?)
1428
+ (?=\}{3}|\|)
1429
+ """,
1430
+ bygroups(Punctuation, Name.Variable),
1431
+ 'parameter-inner',
1432
+ ),
1433
+ # Magic variables
1434
+ (r'(?i)(\{{\{{)(\s*)({})(\s*)(\}}\}})'.format('|'.join(magic_vars_i)),
1435
+ bygroups(Punctuation, Whitespace, Name.Function, Whitespace, Punctuation)),
1436
+ (r'(\{{\{{)(\s*)({})(\s*)(\}}\}})'.format('|'.join(magic_vars)),
1437
+ bygroups(Punctuation, Whitespace, Name.Function, Whitespace, Punctuation)),
1438
+ # Parser functions & templates
1439
+ (r'\{\{', Punctuation, 'template-begin-space'),
1440
+ # <tvar> legacy syntax
1441
+ (r'(?i)(<)(tvar)\b(\|)([^>]*?)(>)', bygroups(Punctuation,
1442
+ Name.Tag, Punctuation, String, Punctuation)),
1443
+ (r'</>', Punctuation, '#pop'),
1444
+ # <tvar>
1445
+ (r'(?i)(<)(tvar)\b', bygroups(Punctuation, Name.Tag), 'tag-inner-ordinary'),
1446
+ (r'(?i)(</)(tvar)\b(\s*)(>)',
1447
+ bygroups(Punctuation, Name.Tag, Whitespace, Punctuation)),
1448
+ ],
1449
+ 'parameter-inner': [
1450
+ (r'\}{3}', Punctuation, '#pop'),
1451
+ (r'\|', Punctuation),
1452
+ include('inline'),
1453
+ include('text'),
1454
+ ],
1455
+ 'template-begin-space': [
1456
+ # Templates allow line breaks at the beginning, and due to how MediaWiki handles
1457
+ # comments, an extra state is required to handle things like {{\n<!---->\n name}}
1458
+ (r'<!--[\s\S]*?(?:-->|\Z)', Comment.Multiline),
1459
+ (r'\s+', Whitespace),
1460
+ # Parser functions
1461
+ (
1462
+ r'(?i)(\#[{}]*?|{})(:)'.format(title_char,
1463
+ '|'.join(parser_functions_i)),
1464
+ bygroups(Name.Function, Punctuation), ('#pop', 'template-inner')
1465
+ ),
1466
+ (
1467
+ r'({})(:)'.format('|'.join(parser_functions)),
1468
+ bygroups(Name.Function, Punctuation), ('#pop', 'template-inner')
1469
+ ),
1470
+ # Templates
1471
+ (
1472
+ rf'(?i)([{title_char}]*?)(:)',
1473
+ bygroups(Name.Namespace, Punctuation), ('#pop', 'template-name')
1474
+ ),
1475
+ default(('#pop', 'template-name'),),
1476
+ ],
1477
+ 'template-name': [
1478
+ (r'(\s*?)(\|)', bygroups(Text, Punctuation), ('#pop', 'template-inner')),
1479
+ (r'\}\}', Punctuation, '#pop'),
1480
+ (r'\n', Text, '#pop'),
1481
+ include('replaceable'),
1482
+ *text_rules(Name.Tag),
1483
+ ],
1484
+ 'template-inner': [
1485
+ (r'\}\}', Punctuation, '#pop'),
1486
+ (r'\|', Punctuation),
1487
+ (
1488
+ r"""(?x)
1489
+ (?<=\|)
1490
+ ( (?: (?! \{\{ | \}\} )[^=\|<])*? ) # Exclude templates and tags
1491
+ (=)
1492
+ """,
1493
+ bygroups(Name.Label, Operator)
1494
+ ),
1495
+ include('inline'),
1496
+ include('text'),
1497
+ ],
1498
+ 'table': [
1499
+ # Use [ \t\n\r\0\x0B] instead of \s to follow PHP trim() behavior
1500
+ # Endings
1501
+ (r'^([ \t\n\r\0\x0B]*?)(\|\})',
1502
+ bygroups(Whitespace, Punctuation), '#pop'),
1503
+ # Table rows
1504
+ (r'^([ \t\n\r\0\x0B]*?)(\|-+)(.*)$', bygroups(Whitespace, Punctuation,
1505
+ using(this, state=['root', 'attr']))),
1506
+ # Captions
1507
+ (
1508
+ r"""(?x)
1509
+ ^([ \t\n\r\0\x0B]*?)(\|\+)
1510
+ # Exclude links, template and tags
1511
+ (?: ( (?: (?! \[\[ | \{\{ )[^|\n<] )*? )(\|) )?
1512
+ (.*?)$
1513
+ """,
1514
+ bygroups(Whitespace, Punctuation, using(this, state=[
1515
+ 'root', 'attr']), Punctuation, Generic.Heading),
1516
+ ),
1517
+ # Table data
1518
+ (
1519
+ r"""(?x)
1520
+ ( ^(?:[ \t\n\r\0\x0B]*?)\| | \|\| )
1521
+ (?: ( (?: (?! \[\[ | \{\{ )[^|\n<] )*? )(\|)(?!\|) )?
1522
+ """,
1523
+ bygroups(Punctuation, using(this, state=[
1524
+ 'root', 'attr']), Punctuation),
1525
+ ),
1526
+ # Table headers
1527
+ (
1528
+ r"""(?x)
1529
+ ( ^(?:[ \t\n\r\0\x0B]*?)! )
1530
+ (?: ( (?: (?! \[\[ | \{\{ )[^|\n<] )*? )(\|)(?!\|) )?
1531
+ """,
1532
+ bygroups(Punctuation, using(this, state=[
1533
+ 'root', 'attr']), Punctuation),
1534
+ 'table-header',
1535
+ ),
1536
+ include('list'),
1537
+ include('inline'),
1538
+ include('text'),
1539
+ ],
1540
+ 'table-header': [
1541
+ # Requires another state for || handling inside headers
1542
+ (r'\n', Text, '#pop'),
1543
+ (
1544
+ r"""(?x)
1545
+ (!!|\|\|)
1546
+ (?:
1547
+ ( (?: (?! \[\[ | \{\{ )[^|\n<] )*? )
1548
+ (\|)(?!\|)
1549
+ )?
1550
+ """,
1551
+ bygroups(Punctuation, using(this, state=[
1552
+ 'root', 'attr']), Punctuation)
1553
+ ),
1554
+ *text_rules(Generic.Subheading),
1555
+ ],
1556
+ 'entity': [
1557
+ (r'&\S*?;', Name.Entity),
1558
+ ],
1559
+ 'dt': [
1560
+ (r'\n', Text, '#pop'),
1561
+ include('inline'),
1562
+ (r':', Keyword, '#pop'),
1563
+ include('text'),
1564
+ ],
1565
+ 'extlink-inner': [
1566
+ (r'\]', Punctuation, '#pop'),
1567
+ include('inline'),
1568
+ include('text'),
1569
+ ],
1570
+ 'nowiki-ish': [
1571
+ include('entity'),
1572
+ include('text'),
1573
+ ],
1574
+ 'attr': [
1575
+ include('replaceable'),
1576
+ (r'\s+', Whitespace),
1577
+ (r'(=)(\s*)(")', bygroups(Operator, Whitespace, String.Double), 'attr-val-2'),
1578
+ (r"(=)(\s*)(')", bygroups(Operator, Whitespace, String.Single), 'attr-val-1'),
1579
+ (r'(=)(\s*)', bygroups(Operator, Whitespace), 'attr-val-0'),
1580
+ (r'[\w:-]+', Name.Attribute),
1581
+
1582
+ ],
1583
+ 'attr-val-0': [
1584
+ (r'\s', Whitespace, '#pop'),
1585
+ include('replaceable'),
1586
+ *text_rules(String),
1587
+ ],
1588
+ 'attr-val-1': [
1589
+ (r"'", String.Single, '#pop'),
1590
+ include('replaceable'),
1591
+ *text_rules(String.Single),
1592
+ ],
1593
+ 'attr-val-2': [
1594
+ (r'"', String.Double, '#pop'),
1595
+ include('replaceable'),
1596
+ *text_rules(String.Double),
1597
+ ],
1598
+ 'tag-inner-ordinary': [
1599
+ (r'/?\s*>', Punctuation, '#pop'),
1600
+ include('tag-attr'),
1601
+ ],
1602
+ 'tag-inner': [
1603
+ # Return to root state for self-closing tags
1604
+ (r'/\s*>', Punctuation, '#pop:2'),
1605
+ (r'\s*>', Punctuation, '#pop'),
1606
+ include('tag-attr'),
1607
+ ],
1608
+ # There states below are just like their non-tag variants, the key difference is
1609
+ # they forcibly quit when encountering tag closing markup
1610
+ 'tag-attr': [
1611
+ include('replaceable'),
1612
+ (r'\s+', Whitespace),
1613
+ (r'(=)(\s*)(")', bygroups(Operator,
1614
+ Whitespace, String.Double), 'tag-attr-val-2'),
1615
+ (r"(=)(\s*)(')", bygroups(Operator,
1616
+ Whitespace, String.Single), 'tag-attr-val-1'),
1617
+ (r'(=)(\s*)', bygroups(Operator, Whitespace), 'tag-attr-val-0'),
1618
+ (r'[\w:-]+', Name.Attribute),
1619
+
1620
+ ],
1621
+ 'tag-attr-val-0': [
1622
+ (r'\s', Whitespace, '#pop'),
1623
+ (r'/?>', Punctuation, '#pop:2'),
1624
+ include('replaceable'),
1625
+ *text_rules(String),
1626
+ ],
1627
+ 'tag-attr-val-1': [
1628
+ (r"'", String.Single, '#pop'),
1629
+ (r'/?>', Punctuation, '#pop:2'),
1630
+ include('replaceable'),
1631
+ *text_rules(String.Single),
1632
+ ],
1633
+ 'tag-attr-val-2': [
1634
+ (r'"', String.Double, '#pop'),
1635
+ (r'/?>', Punctuation, '#pop:2'),
1636
+ include('replaceable'),
1637
+ *text_rules(String.Double),
1638
+ ],
1639
+ 'tag-nowiki': nowiki_tag_rules('nowiki'),
1640
+ 'tag-pre': nowiki_tag_rules('pre'),
1641
+ 'tag-categorytree': plaintext_tag_rules('categorytree'),
1642
+ 'tag-dynamicpagelist': plaintext_tag_rules('dynamicpagelist'),
1643
+ 'tag-hiero': plaintext_tag_rules('hiero'),
1644
+ 'tag-inputbox': plaintext_tag_rules('inputbox'),
1645
+ 'tag-imagemap': plaintext_tag_rules('imagemap'),
1646
+ 'tag-charinsert': plaintext_tag_rules('charinsert'),
1647
+ 'tag-timeline': plaintext_tag_rules('timeline'),
1648
+ 'tag-gallery': plaintext_tag_rules('gallery'),
1649
+ 'tag-graph': plaintext_tag_rules('graph'),
1650
+ 'tag-rss': plaintext_tag_rules('rss'),
1651
+ 'tag-math': delegate_tag_rules('math', TexLexer, state='math'),
1652
+ 'tag-chem': delegate_tag_rules('chem', TexLexer, state='math'),
1653
+ 'tag-ce': delegate_tag_rules('ce', TexLexer, state='math'),
1654
+ 'tag-templatedata': delegate_tag_rules('templatedata', JsonLexer),
1655
+ 'text-italic': text_rules(Generic.Emph),
1656
+ 'text-bold': text_rules(Generic.Strong),
1657
+ 'text-bold-italic': text_rules(Generic.EmphStrong),
1658
+ 'text': text_rules(Text),
1659
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/math.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.math
3
+ ~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Just export lexers that were contained in this module.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ # ruff: noqa: F401
12
+ from pygments.lexers.python import NumPyLexer
13
+ from pygments.lexers.matlab import MatlabLexer, MatlabSessionLexer, \
14
+ OctaveLexer, ScilabLexer
15
+ from pygments.lexers.julia import JuliaLexer, JuliaConsoleLexer
16
+ from pygments.lexers.r import RConsoleLexer, SLexer, RdLexer
17
+ from pygments.lexers.modeling import BugsLexer, JagsLexer, StanLexer
18
+ from pygments.lexers.idl import IDLLexer
19
+ from pygments.lexers.algebra import MuPADLexer
20
+
21
+ __all__ = []
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/matlab.py ADDED
The diff for this file is too large to render. See raw diff
 
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/maxima.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.maxima
3
+ ~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for the computer algebra system Maxima.
6
+
7
+ Derived from pygments/lexers/algebra.py.
8
+
9
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
10
+ :license: BSD, see LICENSE for details.
11
+ """
12
+
13
+ import re
14
+
15
+ from pygments.lexer import RegexLexer, bygroups, words
16
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
17
+ Number, Punctuation
18
+
19
+ __all__ = ['MaximaLexer']
20
+
21
+ class MaximaLexer(RegexLexer):
22
+ """
23
+ A Maxima lexer.
24
+ Derived from pygments.lexers.MuPADLexer.
25
+ """
26
+ name = 'Maxima'
27
+ url = 'http://maxima.sourceforge.net'
28
+ aliases = ['maxima', 'macsyma']
29
+ filenames = ['*.mac', '*.max']
30
+ version_added = '2.11'
31
+
32
+ keywords = ('if', 'then', 'else', 'elseif',
33
+ 'do', 'while', 'repeat', 'until',
34
+ 'for', 'from', 'to', 'downto', 'step', 'thru')
35
+
36
+ constants = ('%pi', '%e', '%phi', '%gamma', '%i',
37
+ 'und', 'ind', 'infinity', 'inf', 'minf',
38
+ 'true', 'false', 'unknown', 'done')
39
+
40
+ operators = (r'.', r':', r'=', r'#',
41
+ r'+', r'-', r'*', r'/', r'^',
42
+ r'@', r'>', r'<', r'|', r'!', r"'")
43
+
44
+ operator_words = ('and', 'or', 'not')
45
+
46
+ tokens = {
47
+ 'root': [
48
+ (r'/\*', Comment.Multiline, 'comment'),
49
+ (r'"(?:[^"\\]|\\.)*"', String),
50
+ (r'\(|\)|\[|\]|\{|\}', Punctuation),
51
+ (r'[,;$]', Punctuation),
52
+ (words (constants), Name.Constant),
53
+ (words (keywords), Keyword),
54
+ (words (operators), Operator),
55
+ (words (operator_words), Operator.Word),
56
+ (r'''(?x)
57
+ ((?:[a-zA-Z_#][\w#]*|`[^`]*`)
58
+ (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])''',
59
+ bygroups(Name.Function, Text.Whitespace, Punctuation)),
60
+ (r'''(?x)
61
+ (?:[a-zA-Z_#%][\w#%]*|`[^`]*`)
62
+ (?:::[a-zA-Z_#%][\w#%]*|`[^`]*`)*''', Name.Variable),
63
+ (r'[-+]?(\d*\.\d+([bdefls][-+]?\d+)?|\d+(\.\d*)?[bdefls][-+]?\d+)', Number.Float),
64
+ (r'[-+]?\d+', Number.Integer),
65
+ (r'\s+', Text.Whitespace),
66
+ (r'.', Text)
67
+ ],
68
+ 'comment': [
69
+ (r'[^*/]+', Comment.Multiline),
70
+ (r'/\*', Comment.Multiline, '#push'),
71
+ (r'\*/', Comment.Multiline, '#pop'),
72
+ (r'[*/]', Comment.Multiline)
73
+ ]
74
+ }
75
+
76
+ def analyse_text (text):
77
+ strength = 0.0
78
+ # Input expression terminator.
79
+ if re.search (r'\$\s*$', text, re.MULTILINE):
80
+ strength += 0.05
81
+ # Function definition operator.
82
+ if ':=' in text:
83
+ strength += 0.02
84
+ return strength
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/meson.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.meson
3
+ ~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Pygments lexer for the Meson build system
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, words, include
12
+ from pygments.token import Comment, Name, Number, Punctuation, Operator, \
13
+ Keyword, String, Whitespace
14
+
15
+ __all__ = ['MesonLexer']
16
+
17
+
18
+ class MesonLexer(RegexLexer):
19
+ """Meson language lexer.
20
+
21
+ The grammar definition use to transcribe the syntax was retrieved from
22
+ https://mesonbuild.com/Syntax.html#grammar for version 0.58.
23
+ Some of those definitions are improperly transcribed, so the Meson++
24
+ implementation was also checked: https://github.com/dcbaker/meson-plus-plus.
25
+ """
26
+
27
+ # TODO String interpolation @VARNAME@ inner matches
28
+ # TODO keyword_arg: value inner matches
29
+
30
+ name = 'Meson'
31
+ url = 'https://mesonbuild.com/'
32
+ aliases = ['meson', 'meson.build']
33
+ filenames = ['meson.build', 'meson.options', 'meson_options.txt']
34
+ mimetypes = ['text/x-meson']
35
+ version_added = '2.10'
36
+
37
+ tokens = {
38
+ 'root': [
39
+ (r'#.*?$', Comment),
40
+ (r"'''.*'''", String.Single),
41
+ (r'[1-9][0-9]*', Number.Integer),
42
+ (r'0o[0-7]+', Number.Oct),
43
+ (r'0x[a-fA-F0-9]+', Number.Hex),
44
+ include('string'),
45
+ include('keywords'),
46
+ include('expr'),
47
+ (r'[a-zA-Z_][a-zA-Z_0-9]*', Name),
48
+ (r'\s+', Whitespace),
49
+ ],
50
+ 'string': [
51
+ (r"[']{3}([']{0,2}([^\\']|\\(.|\n)))*[']{3}", String),
52
+ (r"'.*?(?<!\\)(\\\\)*?'", String),
53
+ ],
54
+ 'keywords': [
55
+ (words((
56
+ 'if',
57
+ 'elif',
58
+ 'else',
59
+ 'endif',
60
+ 'foreach',
61
+ 'endforeach',
62
+ 'break',
63
+ 'continue',
64
+ ),
65
+ suffix=r'\b'), Keyword),
66
+ ],
67
+ 'expr': [
68
+ (r'(in|and|or|not)\b', Operator.Word),
69
+ (r'([\*/%\+-]=?|==|!=|=)', Operator),
70
+ (r'[\[\]{}:().,?]', Punctuation),
71
+ (words(('true', 'false'), suffix=r'\b'), Keyword.Constant),
72
+ include('builtins'),
73
+ (words((
74
+ 'meson',
75
+ 'build_machine',
76
+ 'host_machine',
77
+ 'target_machine',
78
+ ),
79
+ suffix=r'\b'), Name.Variable.Magic),
80
+ ],
81
+ 'builtins': [
82
+ # This list was extracted from the v0.58 reference manual
83
+ (words((
84
+ 'add_global_arguments',
85
+ 'add_global_link_arguments',
86
+ 'add_languages',
87
+ 'add_project_arguments',
88
+ 'add_project_link_arguments',
89
+ 'add_test_setup',
90
+ 'assert',
91
+ 'benchmark',
92
+ 'both_libraries',
93
+ 'build_target',
94
+ 'configuration_data',
95
+ 'configure_file',
96
+ 'custom_target',
97
+ 'declare_dependency',
98
+ 'dependency',
99
+ 'disabler',
100
+ 'environment',
101
+ 'error',
102
+ 'executable',
103
+ 'files',
104
+ 'find_library',
105
+ 'find_program',
106
+ 'generator',
107
+ 'get_option',
108
+ 'get_variable',
109
+ 'include_directories',
110
+ 'install_data',
111
+ 'install_headers',
112
+ 'install_man',
113
+ 'install_subdir',
114
+ 'is_disabler',
115
+ 'is_variable',
116
+ 'jar',
117
+ 'join_paths',
118
+ 'library',
119
+ 'message',
120
+ 'project',
121
+ 'range',
122
+ 'run_command',
123
+ 'set_variable',
124
+ 'shared_library',
125
+ 'shared_module',
126
+ 'static_library',
127
+ 'subdir',
128
+ 'subdir_done',
129
+ 'subproject',
130
+ 'summary',
131
+ 'test',
132
+ 'vcs_tag',
133
+ 'warning',
134
+ ),
135
+ prefix=r'(?<!\.)',
136
+ suffix=r'\b'), Name.Builtin),
137
+ (r'(?<!\.)import\b', Name.Namespace),
138
+ ],
139
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mime.py ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.mime
3
+ ~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for Multipurpose Internet Mail Extensions (MIME) data.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include
14
+ from pygments.lexers import get_lexer_for_mimetype
15
+ from pygments.token import Text, Name, String, Operator, Comment, Other
16
+ from pygments.util import get_int_opt, ClassNotFound
17
+
18
+ __all__ = ["MIMELexer"]
19
+
20
+
21
+ class MIMELexer(RegexLexer):
22
+ """
23
+ Lexer for Multipurpose Internet Mail Extensions (MIME) data. This lexer is
24
+ designed to process nested multipart data.
25
+
26
+ It assumes that the given data contains both header and body (and is
27
+ split at an empty line). If no valid header is found, then the entire data
28
+ will be treated as body.
29
+
30
+ Additional options accepted:
31
+
32
+ `MIME-max-level`
33
+ Max recursion level for nested MIME structure. Any negative number
34
+ would treated as unlimited. (default: -1)
35
+
36
+ `Content-Type`
37
+ Treat the data as a specific content type. Useful when header is
38
+ missing, or this lexer would try to parse from header. (default:
39
+ `text/plain`)
40
+
41
+ `Multipart-Boundary`
42
+ Set the default multipart boundary delimiter. This option is only used
43
+ when `Content-Type` is `multipart` and header is missing. This lexer
44
+ would try to parse from header by default. (default: None)
45
+
46
+ `Content-Transfer-Encoding`
47
+ Treat the data as a specific encoding. Or this lexer would try to parse
48
+ from header by default. (default: None)
49
+ """
50
+
51
+ name = "MIME"
52
+ aliases = ["mime"]
53
+ mimetypes = ["multipart/mixed",
54
+ "multipart/related",
55
+ "multipart/alternative"]
56
+ url = 'https://en.wikipedia.org/wiki/MIME'
57
+ version_added = '2.5'
58
+
59
+ def __init__(self, **options):
60
+ super().__init__(**options)
61
+ self.boundary = options.get("Multipart-Boundary")
62
+ self.content_transfer_encoding = options.get("Content_Transfer_Encoding")
63
+ self.content_type = options.get("Content_Type", "text/plain")
64
+ self.max_nested_level = get_int_opt(options, "MIME-max-level", -1)
65
+
66
+ def get_header_tokens(self, match):
67
+ field = match.group(1)
68
+
69
+ if field.lower() in self.attention_headers:
70
+ yield match.start(1), Name.Tag, field + ":"
71
+ yield match.start(2), Text.Whitespace, match.group(2)
72
+
73
+ pos = match.end(2)
74
+ body = match.group(3)
75
+ for i, t, v in self.get_tokens_unprocessed(body, ("root", field.lower())):
76
+ yield pos + i, t, v
77
+
78
+ else:
79
+ yield match.start(), Comment, match.group()
80
+
81
+ def get_body_tokens(self, match):
82
+ pos_body_start = match.start()
83
+ entire_body = match.group()
84
+
85
+ # skip first newline
86
+ if entire_body[0] == '\n':
87
+ yield pos_body_start, Text.Whitespace, '\n'
88
+ pos_body_start = pos_body_start + 1
89
+ entire_body = entire_body[1:]
90
+
91
+ # if it is not a multipart
92
+ if not self.content_type.startswith("multipart") or not self.boundary:
93
+ for i, t, v in self.get_bodypart_tokens(entire_body):
94
+ yield pos_body_start + i, t, v
95
+ return
96
+
97
+ # find boundary
98
+ bdry_pattern = rf"^--{re.escape(self.boundary)}(--)?\n"
99
+ bdry_matcher = re.compile(bdry_pattern, re.MULTILINE)
100
+
101
+ # some data has prefix text before first boundary
102
+ m = bdry_matcher.search(entire_body)
103
+ if m:
104
+ pos_part_start = pos_body_start + m.end()
105
+ pos_iter_start = lpos_end = m.end()
106
+ yield pos_body_start, Text, entire_body[:m.start()]
107
+ yield pos_body_start + lpos_end, String.Delimiter, m.group()
108
+ else:
109
+ pos_part_start = pos_body_start
110
+ pos_iter_start = 0
111
+
112
+ # process tokens of each body part
113
+ for m in bdry_matcher.finditer(entire_body, pos_iter_start):
114
+ # bodypart
115
+ lpos_start = pos_part_start - pos_body_start
116
+ lpos_end = m.start()
117
+ part = entire_body[lpos_start:lpos_end]
118
+ for i, t, v in self.get_bodypart_tokens(part):
119
+ yield pos_part_start + i, t, v
120
+
121
+ # boundary
122
+ yield pos_body_start + lpos_end, String.Delimiter, m.group()
123
+ pos_part_start = pos_body_start + m.end()
124
+
125
+ # some data has suffix text after last boundary
126
+ lpos_start = pos_part_start - pos_body_start
127
+ if lpos_start != len(entire_body):
128
+ yield pos_part_start, Text, entire_body[lpos_start:]
129
+
130
+ def get_bodypart_tokens(self, text):
131
+ # return if:
132
+ # * no content
133
+ # * no content type specific
134
+ # * content encoding is not readable
135
+ # * max recurrsion exceed
136
+ if not text.strip() or not self.content_type:
137
+ return [(0, Other, text)]
138
+
139
+ cte = self.content_transfer_encoding
140
+ if cte and cte not in {"8bit", "7bit", "quoted-printable"}:
141
+ return [(0, Other, text)]
142
+
143
+ if self.max_nested_level == 0:
144
+ return [(0, Other, text)]
145
+
146
+ # get lexer
147
+ try:
148
+ lexer = get_lexer_for_mimetype(self.content_type)
149
+ except ClassNotFound:
150
+ return [(0, Other, text)]
151
+
152
+ if isinstance(lexer, type(self)):
153
+ lexer.max_nested_level = self.max_nested_level - 1
154
+
155
+ return lexer.get_tokens_unprocessed(text)
156
+
157
+ def store_content_type(self, match):
158
+ self.content_type = match.group(1)
159
+
160
+ prefix_len = match.start(1) - match.start(0)
161
+ yield match.start(0), Text.Whitespace, match.group(0)[:prefix_len]
162
+ yield match.start(1), Name.Label, match.group(2)
163
+ yield match.end(2), String.Delimiter, '/'
164
+ yield match.start(3), Name.Label, match.group(3)
165
+
166
+ def get_content_type_subtokens(self, match):
167
+ yield match.start(1), Text, match.group(1)
168
+ yield match.start(2), Text.Whitespace, match.group(2)
169
+ yield match.start(3), Name.Attribute, match.group(3)
170
+ yield match.start(4), Operator, match.group(4)
171
+ yield match.start(5), String, match.group(5)
172
+
173
+ if match.group(3).lower() == "boundary":
174
+ boundary = match.group(5).strip()
175
+ if boundary[0] == '"' and boundary[-1] == '"':
176
+ boundary = boundary[1:-1]
177
+ self.boundary = boundary
178
+
179
+ def store_content_transfer_encoding(self, match):
180
+ self.content_transfer_encoding = match.group(0).lower()
181
+ yield match.start(0), Name.Constant, match.group(0)
182
+
183
+ attention_headers = {"content-type", "content-transfer-encoding"}
184
+
185
+ tokens = {
186
+ "root": [
187
+ (r"^([\w-]+):( *)([\s\S]*?\n)(?![ \t])", get_header_tokens),
188
+ (r"^$[\s\S]+", get_body_tokens),
189
+ ],
190
+ "header": [
191
+ # folding
192
+ (r"\n[ \t]", Text.Whitespace),
193
+ (r"\n(?![ \t])", Text.Whitespace, "#pop"),
194
+ ],
195
+ "content-type": [
196
+ include("header"),
197
+ (
198
+ r"^\s*((multipart|application|audio|font|image|model|text|video"
199
+ r"|message)/([\w-]+))",
200
+ store_content_type,
201
+ ),
202
+ (r'(;)((?:[ \t]|\n[ \t])*)([\w:-]+)(=)([\s\S]*?)(?=;|\n(?![ \t]))',
203
+ get_content_type_subtokens),
204
+ (r';[ \t]*\n(?![ \t])', Text, '#pop'),
205
+ ],
206
+ "content-transfer-encoding": [
207
+ include("header"),
208
+ (r"([\w-]+)", store_content_transfer_encoding),
209
+ ],
210
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/minecraft.py ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.minecraft
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for Minecraft related languages.
6
+
7
+ SNBT. A data communication format used in Minecraft.
8
+ wiki: https://minecraft.wiki/w/NBT_format
9
+
10
+ MCFunction. The Function file for Minecraft Data packs and Add-ons.
11
+ official: https://learn.microsoft.com/en-us/minecraft/creator/documents/functionsintroduction
12
+ wiki: https://minecraft.wiki/w/Function
13
+
14
+ MCSchema. A kind of data Schema for Minecraft Add-on Development.
15
+ official: https://learn.microsoft.com/en-us/minecraft/creator/reference/content/schemasreference/
16
+ community example: https://www.mcbe-dev.net/addons/data-driven/manifest.html
17
+
18
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
19
+ :license: BSD, see LICENSE for details.
20
+ """
21
+
22
+ from pygments.lexer import RegexLexer, default, include, bygroups
23
+ from pygments.token import Comment, Keyword, Literal, Name, Number, Operator, \
24
+ Punctuation, String, Text, Whitespace
25
+
26
+ __all__ = ['SNBTLexer', 'MCFunctionLexer', 'MCSchemaLexer']
27
+
28
+
29
+ class SNBTLexer(RegexLexer):
30
+ """Lexer for stringified NBT, a data format used in Minecraft
31
+ """
32
+
33
+ name = "SNBT"
34
+ url = "https://minecraft.wiki/w/NBT_format"
35
+ aliases = ["snbt"]
36
+ filenames = ["*.snbt"]
37
+ mimetypes = ["text/snbt"]
38
+ version_added = '2.12'
39
+
40
+ tokens = {
41
+ "root": [
42
+ # We only look for the open bracket here since square bracket
43
+ # is only valid in NBT pathing (which is a mcfunction idea).
44
+ (r"\{", Punctuation, "compound"),
45
+ (r"[^\{]+", Text),
46
+ ],
47
+
48
+ "whitespace": [
49
+ (r"\s+", Whitespace),
50
+ ],
51
+
52
+ "operators": [
53
+ (r"[,:;]", Punctuation),
54
+ ],
55
+
56
+ "literals": [
57
+ (r"(true|false)", Keyword.Constant),
58
+ (r"-?\d+[eE]-?\d+", Number.Float),
59
+ (r"-?\d*\.\d+[fFdD]?", Number.Float),
60
+ (r"-?\d+[bBsSlLfFdD]?", Number.Integer),
61
+
62
+ # Separate states for both types of strings so they don't entangle
63
+ (r'"', String.Double, "literals.string_double"),
64
+ (r"'", String.Single, "literals.string_single"),
65
+ ],
66
+ "literals.string_double": [
67
+ (r"\\.", String.Escape),
68
+ (r'[^\\"\n]+', String.Double),
69
+ (r'"', String.Double, "#pop"),
70
+ ],
71
+ "literals.string_single": [
72
+ (r"\\.", String.Escape),
73
+ (r"[^\\'\n]+", String.Single),
74
+ (r"'", String.Single, "#pop"),
75
+ ],
76
+
77
+ "compound": [
78
+ # this handles the unquoted snbt keys
79
+ # note: stringified keys still work
80
+ (r"[A-Z_a-z]+", Name.Attribute),
81
+ include("operators"),
82
+ include("whitespace"),
83
+ include("literals"),
84
+ (r"\{", Punctuation, "#push"),
85
+ (r"\[", Punctuation, "list"),
86
+ (r"\}", Punctuation, "#pop"),
87
+ ],
88
+
89
+ "list": [
90
+ (r"[A-Z_a-z]+", Name.Attribute),
91
+ include("literals"),
92
+ include("operators"),
93
+ include("whitespace"),
94
+ (r"\[", Punctuation, "#push"),
95
+ (r"\{", Punctuation, "compound"),
96
+ (r"\]", Punctuation, "#pop"),
97
+ ],
98
+ }
99
+
100
+
101
+ class MCFunctionLexer(RegexLexer):
102
+ """Lexer for the mcfunction scripting language used in Minecraft.
103
+
104
+ Modelled somewhat after the `GitHub mcfunction grammar <https://github.com/Arcensoth/language-mcfunction>`_.
105
+ """
106
+
107
+ name = "MCFunction"
108
+ url = "https://minecraft.wiki/w/Commands"
109
+ aliases = ["mcfunction", "mcf"]
110
+ filenames = ["*.mcfunction"]
111
+ mimetypes = ["text/mcfunction"]
112
+ version_added = '2.12'
113
+
114
+ # Used to denotate the start of a block comment, borrowed from Github's mcfunction
115
+ _block_comment_prefix = "[>!]"
116
+
117
+ tokens = {
118
+ "root": [
119
+ include("names"),
120
+ include("comments"),
121
+ include("literals"),
122
+ include("whitespace"),
123
+ include("property"),
124
+ include("operators"),
125
+ include("selectors"),
126
+ ],
127
+
128
+ "names": [
129
+ # The start of a command (either beginning of line OR after the run keyword)
130
+ # We don't encode a list of keywords since mods, plugins, or even pre-processors
131
+ # may add new commands, so we have a 'close-enough' regex which catches them.
132
+ (r"^(\s*)([a-z_]+)", bygroups(Whitespace, Name.Builtin)),
133
+ (r"(?<=run)\s+[a-z_]+", Name.Builtin),
134
+
135
+ # UUID
136
+ (r"\b[0-9a-fA-F]+(?:-[0-9a-fA-F]+){4}\b", Name.Variable),
137
+ include("resource-name"),
138
+ # normal command names and scoreboards
139
+ # there's no way to know the differences unfortuntely
140
+ (r"[A-Za-z_][\w.#%$]+", Keyword.Constant),
141
+ (r"[#%$][\w.#%$]+", Name.Variable.Magic),
142
+ ],
143
+
144
+ "resource-name": [
145
+ # resource names have to be lowercase
146
+ (r"#?[a-z_][a-z_.-]*:[a-z0-9_./-]+", Name.Function),
147
+ # similar to above except optional `:``
148
+ # a `/` must be present "somewhere"
149
+ (r"#?[a-z0-9_\.\-]+\/[a-z0-9_\.\-\/]+", Name.Function),
150
+ ],
151
+
152
+ "whitespace": [
153
+ (r"\s+", Whitespace),
154
+ ],
155
+
156
+ "comments": [
157
+ (rf"^\s*(#{_block_comment_prefix})", Comment.Multiline,
158
+ ("comments.block", "comments.block.emphasized")),
159
+ (r"#.*$", Comment.Single),
160
+ ],
161
+ "comments.block": [
162
+ (rf"^\s*#{_block_comment_prefix}", Comment.Multiline,
163
+ "comments.block.emphasized"),
164
+ (r"^\s*#", Comment.Multiline, "comments.block.normal"),
165
+ default("#pop"),
166
+ ],
167
+ "comments.block.normal": [
168
+ include("comments.block.special"),
169
+ (r"\S+", Comment.Multiline),
170
+ (r"\n", Text, "#pop"),
171
+ include("whitespace"),
172
+ ],
173
+ "comments.block.emphasized": [
174
+ include("comments.block.special"),
175
+ (r"\S+", String.Doc),
176
+ (r"\n", Text, "#pop"),
177
+ include("whitespace"),
178
+ ],
179
+ "comments.block.special": [
180
+ # Params
181
+ (r"@\S+", Name.Decorator),
182
+
183
+ include("resource-name"),
184
+
185
+ # Scoreboard player names
186
+ (r"[#%$][\w.#%$]+", Name.Variable.Magic),
187
+ ],
188
+
189
+ "operators": [
190
+ (r"[\-~%^?!+*<>\\/|&=.]", Operator),
191
+ ],
192
+
193
+ "literals": [
194
+ (r"\.\.", Literal),
195
+ (r"(true|false)", Keyword.Pseudo),
196
+
197
+ # these are like unquoted strings and appear in many places
198
+ (r"[A-Za-z_]+", Name.Variable.Class),
199
+
200
+ (r"[0-7]b", Number.Byte),
201
+ (r"[+-]?\d*\.?\d+([eE]?[+-]?\d+)?[df]?\b", Number.Float),
202
+ (r"[+-]?\d+\b", Number.Integer),
203
+ (r'"', String.Double, "literals.string-double"),
204
+ (r"'", String.Single, "literals.string-single"),
205
+ ],
206
+ "literals.string-double": [
207
+ (r"\\.", String.Escape),
208
+ (r'[^\\"\n]+', String.Double),
209
+ (r'"', String.Double, "#pop"),
210
+ ],
211
+ "literals.string-single": [
212
+ (r"\\.", String.Escape),
213
+ (r"[^\\'\n]+", String.Single),
214
+ (r"'", String.Single, "#pop"),
215
+ ],
216
+
217
+ "selectors": [
218
+ (r"@[a-z]", Name.Variable),
219
+ ],
220
+
221
+
222
+ ## Generic Property Container
223
+ # There are several, differing instances where the language accepts
224
+ # specific contained keys or contained key, value pairings.
225
+ #
226
+ # Property Maps:
227
+ # - Starts with either `[` or `{`
228
+ # - Key separated by `:` or `=`
229
+ # - Deliminated by `,`
230
+ #
231
+ # Property Lists:
232
+ # - Starts with `[`
233
+ # - Deliminated by `,`
234
+ #
235
+ # For simplicity, these patterns match a generic, nestable structure
236
+ # which follow a key, value pattern. For normal lists, there's only keys.
237
+ # This allow some "illegal" structures, but we'll accept those for
238
+ # sake of simplicity
239
+ #
240
+ # Examples:
241
+ # - `[facing=up, powered=true]` (blockstate)
242
+ # - `[name="hello world", nbt={key: 1b}]` (selector + nbt)
243
+ # - `[{"text": "value"}, "literal"]` (json)
244
+ ##
245
+ "property": [
246
+ # This state gets included in root and also several substates
247
+ # We do this to shortcut the starting of new properties
248
+ # within other properties. Lists can have sublists and compounds
249
+ # and values can start a new property (see the `difficult_1.txt`
250
+ # snippet).
251
+ (r"\{", Punctuation, ("property.curly", "property.key")),
252
+ (r"\[", Punctuation, ("property.square", "property.key")),
253
+ ],
254
+ "property.curly": [
255
+ include("whitespace"),
256
+ include("property"),
257
+ (r"\}", Punctuation, "#pop"),
258
+ ],
259
+ "property.square": [
260
+ include("whitespace"),
261
+ include("property"),
262
+ (r"\]", Punctuation, "#pop"),
263
+
264
+ # lists can have sequences of items
265
+ (r",", Punctuation),
266
+ ],
267
+ "property.key": [
268
+ include("whitespace"),
269
+
270
+ # resource names (for advancements)
271
+ # can omit `:` to default `minecraft:`
272
+ # must check if there is a future equals sign if `:` is in the name
273
+ (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+(?=\s*\=)", Name.Attribute, "property.delimiter"),
274
+ (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Attribute, "property.delimiter"),
275
+
276
+ # unquoted NBT key
277
+ (r"[A-Za-z_\-\+]+", Name.Attribute, "property.delimiter"),
278
+
279
+ # quoted JSON or NBT key
280
+ (r'"', Name.Attribute, "property.delimiter", "literals.string-double"),
281
+ (r"'", Name.Attribute, "property.delimiter", "literals.string-single"),
282
+
283
+ # index for a list
284
+ (r"-?\d+", Number.Integer, "property.delimiter"),
285
+
286
+ default("#pop"),
287
+ ],
288
+ "property.key.string-double": [
289
+ (r"\\.", String.Escape),
290
+ (r'[^\\"\n]+', Name.Attribute),
291
+ (r'"', Name.Attribute, "#pop"),
292
+ ],
293
+ "property.key.string-single": [
294
+ (r"\\.", String.Escape),
295
+ (r"[^\\'\n]+", Name.Attribute),
296
+ (r"'", Name.Attribute, "#pop"),
297
+ ],
298
+ "property.delimiter": [
299
+ include("whitespace"),
300
+
301
+ (r"[:=]!?", Punctuation, "property.value"),
302
+ (r",", Punctuation),
303
+
304
+ default("#pop"),
305
+ ],
306
+ "property.value": [
307
+ include("whitespace"),
308
+
309
+ # unquoted resource names are valid literals here
310
+ (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+", Name.Tag),
311
+ (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Tag),
312
+
313
+ include("literals"),
314
+ include("property"),
315
+
316
+ default("#pop"),
317
+ ],
318
+ }
319
+
320
+
321
+ class MCSchemaLexer(RegexLexer):
322
+ """Lexer for Minecraft Add-ons data Schemas, an interface structure standard used in Minecraft
323
+ """
324
+
325
+ name = 'MCSchema'
326
+ url = 'https://learn.microsoft.com/en-us/minecraft/creator/reference/content/schemasreference/'
327
+ aliases = ['mcschema']
328
+ filenames = ['*.mcschema']
329
+ mimetypes = ['text/mcschema']
330
+ version_added = '2.14'
331
+
332
+ tokens = {
333
+ 'commentsandwhitespace': [
334
+ (r'\s+', Whitespace),
335
+ (r'//.*?$', Comment.Single),
336
+ (r'/\*.*?\*/', Comment.Multiline)
337
+ ],
338
+ 'slashstartsregex': [
339
+ include('commentsandwhitespace'),
340
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
341
+ r'([gimuysd]+\b|\B)', String.Regex, '#pop'),
342
+ (r'(?=/)', Text, ('#pop', 'badregex')),
343
+ default('#pop')
344
+ ],
345
+ 'badregex': [
346
+ (r'\n', Whitespace, '#pop')
347
+ ],
348
+ 'singlestring': [
349
+ (r'\\.', String.Escape),
350
+ (r"'", String.Single, '#pop'),
351
+ (r"[^\\']+", String.Single),
352
+ ],
353
+ 'doublestring': [
354
+ (r'\\.', String.Escape),
355
+ (r'"', String.Double, '#pop'),
356
+ (r'[^\\"]+', String.Double),
357
+ ],
358
+ 'root': [
359
+ (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
360
+ include('commentsandwhitespace'),
361
+
362
+ # keywords for optional word and field types
363
+ (r'(?<=: )opt', Operator.Word),
364
+ (r'(?<=\s)[\w-]*(?=(\s+"|\n))', Keyword.Declaration),
365
+
366
+ # numeric literals
367
+ (r'0[bB][01]+', Number.Bin),
368
+ (r'0[oO]?[0-7]+', Number.Oct),
369
+ (r'0[xX][0-9a-fA-F]+', Number.Hex),
370
+ (r'\d+', Number.Integer),
371
+ (r'(\.\d+|\d+\.\d*|\d+)([eE][-+]?\d+)?', Number.Float),
372
+
373
+ # possible punctuations
374
+ (r'\.\.\.|=>', Punctuation),
375
+ (r'\+\+|--|~|\?\?=?|\?|:|\\(?=\n)|'
376
+ r'(<<|>>>?|==?|!=?|(?:\*\*|\|\||&&|[-<>+*%&|^/]))=?', Operator, 'slashstartsregex'),
377
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
378
+ (r'[})\].]', Punctuation),
379
+
380
+ # strings
381
+ (r"'", String.Single, 'singlestring'),
382
+ (r'"', String.Double, 'doublestring'),
383
+
384
+ # title line
385
+ (r'[\w-]*?(?=:\{?\n)', String.Symbol),
386
+ # title line with a version code, formatted
387
+ # `major.minor.patch-prerelease+buildmeta`
388
+ (r'([\w-]*?)(:)(\d+)(?:(\.)(\d+)(?:(\.)(\d+)(?:(\-)((?:[^\W_]|-)*(?:\.(?:[^\W_]|-)*)*))?(?:(\+)((?:[^\W_]|-)+(?:\.(?:[^\W_]|-)+)*))?)?)?(?=:\{?\n)', bygroups(String.Symbol, Operator, Number.Integer, Operator, Number.Integer, Operator, Number.Integer, Operator, String, Operator, String)),
389
+
390
+ (r'.*\n', Text),
391
+ ]
392
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mips.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.mips
3
+ ~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for MIPS assembly.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, words
12
+ from pygments.token import Whitespace, Comment, String, Keyword, Name, Text
13
+
14
+ __all__ = ["MIPSLexer"]
15
+
16
+
17
+ class MIPSLexer(RegexLexer):
18
+ """
19
+ A MIPS Assembly Lexer.
20
+
21
+ Based on the Emacs major mode by hlissner:
22
+ https://github.com/hlissner/emacs-mips-mode
23
+ """
24
+
25
+ name = 'MIPS'
26
+ aliases = ['mips']
27
+ version_added = ''
28
+ # TODO: add '*.s' and '*.asm', which will require designing an analyse_text
29
+ # method for this lexer and refactoring those from Gas and Nasm in order to
30
+ # have relatively reliable detection
31
+ filenames = ['*.mips', '*.MIPS']
32
+ url = 'https://mips.com'
33
+
34
+ keywords = [
35
+ # Arithmetic insturctions
36
+ "add", "sub", "subu", "addi", "subi", "addu", "addiu",
37
+ # Multiplication/division
38
+ "mul", "mult", "multu", "mulu", "madd", "maddu", "msub", "msubu", "div", "divu",
39
+ # Bitwise operations
40
+ "and", "or", "nor", "xor", "andi", "ori", "xori", "clo", "clz",
41
+ # Shifts
42
+ "sll", "srl", "sllv", "srlv", "sra", "srav",
43
+ # Comparisons
44
+ "slt", "sltu", "slti", "sltiu",
45
+ # Move data
46
+ "mfhi", "mthi", "mflo", "mtlo", "movn", "movz", "movf", "movt",
47
+ # Jump
48
+ "j", "jal", "jalr", "jr",
49
+ # branch
50
+ "bc1f", "bc1t", "beq", "bgez", "bgezal", "bgtz", "blez", "bltzal", "bltz", "bne",
51
+ # Load
52
+ "lui", "lb", "lbu", "lh", "lhu", "lw", "lwcl", "lwl", "lwr",
53
+ # Store
54
+ "sb", "sh", "sw", "swl", "swr", # coproc: swc1 sdc1
55
+ # Concurrent load/store
56
+ "ll", "sc",
57
+ # Trap handling
58
+ "teq", "teqi", "tne", "tneqi", "tge", "tgeu", "tgei", "tgeiu", "tlt", "tltu", "tlti",
59
+ "tltiu",
60
+ # Exception / Interrupt
61
+ "eret", "break", "bop", "syscall",
62
+ # --- Floats -----------------------------------------------------
63
+ # Arithmetic
64
+ "add.s", "add.d", "sub.s", "sub.d", "mul.s", "mul.d", "div.s", "div.d", "neg.d",
65
+ "neg.s",
66
+ # Comparison
67
+ "c.e.d", "c.e.s", "c.le.d", "c.le.s", "c.lt.s", "c.lt.d", # "c.gt.s", "c.gt.d",
68
+ "madd.s", "madd.d", "msub.s", "msub.d",
69
+ # Move Floats
70
+ "mov.d", "move.s", "movf.d", "movf.s", "movt.d", "movt.s", "movn.d", "movn.s",
71
+ "movnzd", "movz.s", "movz.d",
72
+ # Conversion
73
+ "cvt.d.s", "cvt.d.w", "cvt.s.d", "cvt.s.w", "cvt.w.d", "cvt.w.s", "trunc.w.d",
74
+ "trunc.w.s",
75
+ # Math
76
+ "abs.s", "abs.d", "sqrt.s", "sqrt.d", "ceil.w.d", "ceil.w.s", "floor.w.d",
77
+ "floor.w.s", "round.w.d", "round.w.s",
78
+ ]
79
+
80
+ pseudoinstructions = [
81
+ # Arithmetic & logical
82
+ "rem", "remu", "mulo", "mulou", "abs", "neg", "negu", "not", "rol", "ror",
83
+ # branches
84
+ "b", "beqz", "bge", "bgeu", "bgt", "bgtu", "ble", "bleu", "blt", "bltu", "bnez",
85
+ # loads
86
+ "la", "li", "ld", "ulh", "ulhu", "ulw",
87
+ # Store
88
+ "sd", "ush", "usw",
89
+ # move
90
+ "move", # coproc: "mfc1.d",
91
+ # comparisons
92
+ "sgt", "sgtu", "sge", "sgeu", "sle", "sleu", "sne", "seq",
93
+ # --- Floats -----------------------------------------------------
94
+ # load-store
95
+ "l.d", "l.s", "s.d", "s.s",
96
+ ]
97
+
98
+ directives = [
99
+ ".align", ".ascii", ".asciiz", ".byte", ".data", ".double", ".extern", ".float",
100
+ ".globl", ".half", ".kdata", ".ktext", ".space", ".text", ".word",
101
+ ]
102
+
103
+ deprecated = [
104
+ "beql", "bnel", "bgtzl", "bgezl", "bltzl", "blezl", "bltzall", "bgezall",
105
+ ]
106
+
107
+ tokens = {
108
+ 'root': [
109
+ (r'\s+', Whitespace),
110
+ (r'#.*', Comment),
111
+ (r'"', String, 'string'),
112
+ (r'-?[0-9]+?', Keyword.Constant),
113
+ (r'\w*:', Name.Function),
114
+ (words(deprecated, suffix=r'\b'), Keyword.Pseudo), # need warning face
115
+ (words(pseudoinstructions, suffix=r'\b'), Name.Variable),
116
+ (words(keywords, suffix=r'\b'), Keyword),
117
+ (r'[slm][ftwd]c[0-9]([.]d)?', Keyword),
118
+ (r'\$(f?[0-2][0-9]|f?3[01]|[ft]?[0-9]|[vk][01]|a[0-3]|s[0-7]|[gsf]p|ra|at|zero)',
119
+ Keyword.Type),
120
+ (words(directives, suffix=r'\b'), Name.Entity), # Preprocessor?
121
+ (r':|,|;|\{|\}|=>|@|\$|=', Name.Builtin),
122
+ (r'\w+', Text),
123
+ (r'.', Text),
124
+ ],
125
+ 'string': [
126
+ (r'\\.', String.Escape),
127
+ (r'"', String, '#pop'),
128
+ (r'[^\\"]+', String),
129
+ ],
130
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/ml.py ADDED
@@ -0,0 +1,958 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.ml
3
+ ~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for ML family languages.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include, bygroups, default, words
14
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
+ Number, Punctuation, Error
16
+
17
+ __all__ = ['SMLLexer', 'OcamlLexer', 'OpaLexer', 'ReasonLexer', 'FStarLexer']
18
+
19
+
20
+ class SMLLexer(RegexLexer):
21
+ """
22
+ For the Standard ML language.
23
+ """
24
+
25
+ name = 'Standard ML'
26
+ aliases = ['sml']
27
+ filenames = ['*.sml', '*.sig', '*.fun']
28
+ mimetypes = ['text/x-standardml', 'application/x-standardml']
29
+ url = 'https://en.wikipedia.org/wiki/Standard_ML'
30
+ version_added = '1.5'
31
+
32
+ alphanumid_reserved = {
33
+ # Core
34
+ 'abstype', 'and', 'andalso', 'as', 'case', 'datatype', 'do', 'else',
35
+ 'end', 'exception', 'fn', 'fun', 'handle', 'if', 'in', 'infix',
36
+ 'infixr', 'let', 'local', 'nonfix', 'of', 'op', 'open', 'orelse',
37
+ 'raise', 'rec', 'then', 'type', 'val', 'with', 'withtype', 'while',
38
+ # Modules
39
+ 'eqtype', 'functor', 'include', 'sharing', 'sig', 'signature',
40
+ 'struct', 'structure', 'where',
41
+ }
42
+
43
+ symbolicid_reserved = {
44
+ # Core
45
+ ':', r'\|', '=', '=>', '->', '#',
46
+ # Modules
47
+ ':>',
48
+ }
49
+
50
+ nonid_reserved = {'(', ')', '[', ']', '{', '}', ',', ';', '...', '_'}
51
+
52
+ alphanumid_re = r"[a-zA-Z][\w']*"
53
+ symbolicid_re = r"[!%&$#+\-/:<=>?@\\~`^|*]+"
54
+
55
+ # A character constant is a sequence of the form #s, where s is a string
56
+ # constant denoting a string of size one character. This setup just parses
57
+ # the entire string as either a String.Double or a String.Char (depending
58
+ # on the argument), even if the String.Char is an erroneous
59
+ # multiple-character string.
60
+ def stringy(whatkind):
61
+ return [
62
+ (r'[^"\\]', whatkind),
63
+ (r'\\[\\"abtnvfr]', String.Escape),
64
+ # Control-character notation is used for codes < 32,
65
+ # where \^@ == \000
66
+ (r'\\\^[\x40-\x5e]', String.Escape),
67
+ # Docs say 'decimal digits'
68
+ (r'\\[0-9]{3}', String.Escape),
69
+ (r'\\u[0-9a-fA-F]{4}', String.Escape),
70
+ (r'\\\s+\\', String.Interpol),
71
+ (r'"', whatkind, '#pop'),
72
+ ]
73
+
74
+ # Callbacks for distinguishing tokens and reserved words
75
+ def long_id_callback(self, match):
76
+ if match.group(1) in self.alphanumid_reserved:
77
+ token = Error
78
+ else:
79
+ token = Name.Namespace
80
+ yield match.start(1), token, match.group(1)
81
+ yield match.start(2), Punctuation, match.group(2)
82
+
83
+ def end_id_callback(self, match):
84
+ if match.group(1) in self.alphanumid_reserved:
85
+ token = Error
86
+ elif match.group(1) in self.symbolicid_reserved:
87
+ token = Error
88
+ else:
89
+ token = Name
90
+ yield match.start(1), token, match.group(1)
91
+
92
+ def id_callback(self, match):
93
+ str = match.group(1)
94
+ if str in self.alphanumid_reserved:
95
+ token = Keyword.Reserved
96
+ elif str in self.symbolicid_reserved:
97
+ token = Punctuation
98
+ else:
99
+ token = Name
100
+ yield match.start(1), token, str
101
+
102
+ tokens = {
103
+ # Whitespace and comments are (almost) everywhere
104
+ 'whitespace': [
105
+ (r'\s+', Text),
106
+ (r'\(\*', Comment.Multiline, 'comment'),
107
+ ],
108
+
109
+ 'delimiters': [
110
+ # This lexer treats these delimiters specially:
111
+ # Delimiters define scopes, and the scope is how the meaning of
112
+ # the `|' is resolved - is it a case/handle expression, or function
113
+ # definition by cases? (This is not how the Definition works, but
114
+ # it's how MLton behaves, see http://mlton.org/SMLNJDeviations)
115
+ (r'\(|\[|\{', Punctuation, 'main'),
116
+ (r'\)|\]|\}', Punctuation, '#pop'),
117
+ (r'\b(let|if|local)\b(?!\')', Keyword.Reserved, ('main', 'main')),
118
+ (r'\b(struct|sig|while)\b(?!\')', Keyword.Reserved, 'main'),
119
+ (r'\b(do|else|end|in|then)\b(?!\')', Keyword.Reserved, '#pop'),
120
+ ],
121
+
122
+ 'core': [
123
+ # Punctuation that doesn't overlap symbolic identifiers
124
+ (r'({})'.format('|'.join(re.escape(z) for z in nonid_reserved)),
125
+ Punctuation),
126
+
127
+ # Special constants: strings, floats, numbers in decimal and hex
128
+ (r'#"', String.Char, 'char'),
129
+ (r'"', String.Double, 'string'),
130
+ (r'~?0x[0-9a-fA-F]+', Number.Hex),
131
+ (r'0wx[0-9a-fA-F]+', Number.Hex),
132
+ (r'0w\d+', Number.Integer),
133
+ (r'~?\d+\.\d+[eE]~?\d+', Number.Float),
134
+ (r'~?\d+\.\d+', Number.Float),
135
+ (r'~?\d+[eE]~?\d+', Number.Float),
136
+ (r'~?\d+', Number.Integer),
137
+
138
+ # Labels
139
+ (r'#\s*[1-9][0-9]*', Name.Label),
140
+ (rf'#\s*({alphanumid_re})', Name.Label),
141
+ (rf'#\s+({symbolicid_re})', Name.Label),
142
+ # Some reserved words trigger a special, local lexer state change
143
+ (r'\b(datatype|abstype)\b(?!\')', Keyword.Reserved, 'dname'),
144
+ (r'\b(exception)\b(?!\')', Keyword.Reserved, 'ename'),
145
+ (r'\b(functor|include|open|signature|structure)\b(?!\')',
146
+ Keyword.Reserved, 'sname'),
147
+ (r'\b(type|eqtype)\b(?!\')', Keyword.Reserved, 'tname'),
148
+
149
+ # Regular identifiers, long and otherwise
150
+ (r'\'[\w\']*', Name.Decorator),
151
+ (rf'({alphanumid_re})(\.)', long_id_callback, "dotted"),
152
+ (rf'({alphanumid_re})', id_callback),
153
+ (rf'({symbolicid_re})', id_callback),
154
+ ],
155
+ 'dotted': [
156
+ (rf'({alphanumid_re})(\.)', long_id_callback),
157
+ (rf'({alphanumid_re})', end_id_callback, "#pop"),
158
+ (rf'({symbolicid_re})', end_id_callback, "#pop"),
159
+ (r'\s+', Error),
160
+ (r'\S+', Error),
161
+ ],
162
+
163
+
164
+ # Main parser (prevents errors in files that have scoping errors)
165
+ 'root': [
166
+ default('main')
167
+ ],
168
+
169
+ # In this scope, I expect '|' to not be followed by a function name,
170
+ # and I expect 'and' to be followed by a binding site
171
+ 'main': [
172
+ include('whitespace'),
173
+
174
+ # Special behavior of val/and/fun
175
+ (r'\b(val|and)\b(?!\')', Keyword.Reserved, 'vname'),
176
+ (r'\b(fun)\b(?!\')', Keyword.Reserved,
177
+ ('#pop', 'main-fun', 'fname')),
178
+
179
+ include('delimiters'),
180
+ include('core'),
181
+ (r'\S+', Error),
182
+ ],
183
+
184
+ # In this scope, I expect '|' and 'and' to be followed by a function
185
+ 'main-fun': [
186
+ include('whitespace'),
187
+
188
+ (r'\s', Text),
189
+ (r'\(\*', Comment.Multiline, 'comment'),
190
+
191
+ # Special behavior of val/and/fun
192
+ (r'\b(fun|and)\b(?!\')', Keyword.Reserved, 'fname'),
193
+ (r'\b(val)\b(?!\')', Keyword.Reserved,
194
+ ('#pop', 'main', 'vname')),
195
+
196
+ # Special behavior of '|' and '|'-manipulating keywords
197
+ (r'\|', Punctuation, 'fname'),
198
+ (r'\b(case|handle)\b(?!\')', Keyword.Reserved,
199
+ ('#pop', 'main')),
200
+
201
+ include('delimiters'),
202
+ include('core'),
203
+ (r'\S+', Error),
204
+ ],
205
+
206
+ # Character and string parsers
207
+ 'char': stringy(String.Char),
208
+ 'string': stringy(String.Double),
209
+
210
+ 'breakout': [
211
+ (r'(?=\b({})\b(?!\'))'.format('|'.join(alphanumid_reserved)), Text, '#pop'),
212
+ ],
213
+
214
+ # Dealing with what comes after module system keywords
215
+ 'sname': [
216
+ include('whitespace'),
217
+ include('breakout'),
218
+
219
+ (rf'({alphanumid_re})', Name.Namespace),
220
+ default('#pop'),
221
+ ],
222
+
223
+ # Dealing with what comes after the 'fun' (or 'and' or '|') keyword
224
+ 'fname': [
225
+ include('whitespace'),
226
+ (r'\'[\w\']*', Name.Decorator),
227
+ (r'\(', Punctuation, 'tyvarseq'),
228
+
229
+ (rf'({alphanumid_re})', Name.Function, '#pop'),
230
+ (rf'({symbolicid_re})', Name.Function, '#pop'),
231
+
232
+ # Ignore interesting function declarations like "fun (x + y) = ..."
233
+ default('#pop'),
234
+ ],
235
+
236
+ # Dealing with what comes after the 'val' (or 'and') keyword
237
+ 'vname': [
238
+ include('whitespace'),
239
+ (r'\'[\w\']*', Name.Decorator),
240
+ (r'\(', Punctuation, 'tyvarseq'),
241
+
242
+ (rf'({alphanumid_re})(\s*)(=(?!{symbolicid_re}))',
243
+ bygroups(Name.Variable, Text, Punctuation), '#pop'),
244
+ (rf'({symbolicid_re})(\s*)(=(?!{symbolicid_re}))',
245
+ bygroups(Name.Variable, Text, Punctuation), '#pop'),
246
+ (rf'({alphanumid_re})', Name.Variable, '#pop'),
247
+ (rf'({symbolicid_re})', Name.Variable, '#pop'),
248
+
249
+ # Ignore interesting patterns like 'val (x, y)'
250
+ default('#pop'),
251
+ ],
252
+
253
+ # Dealing with what comes after the 'type' (or 'and') keyword
254
+ 'tname': [
255
+ include('whitespace'),
256
+ include('breakout'),
257
+
258
+ (r'\'[\w\']*', Name.Decorator),
259
+ (r'\(', Punctuation, 'tyvarseq'),
260
+ (rf'=(?!{symbolicid_re})', Punctuation, ('#pop', 'typbind')),
261
+
262
+ (rf'({alphanumid_re})', Keyword.Type),
263
+ (rf'({symbolicid_re})', Keyword.Type),
264
+ (r'\S+', Error, '#pop'),
265
+ ],
266
+
267
+ # A type binding includes most identifiers
268
+ 'typbind': [
269
+ include('whitespace'),
270
+
271
+ (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')),
272
+
273
+ include('breakout'),
274
+ include('core'),
275
+ (r'\S+', Error, '#pop'),
276
+ ],
277
+
278
+ # Dealing with what comes after the 'datatype' (or 'and') keyword
279
+ 'dname': [
280
+ include('whitespace'),
281
+ include('breakout'),
282
+
283
+ (r'\'[\w\']*', Name.Decorator),
284
+ (r'\(', Punctuation, 'tyvarseq'),
285
+ (r'(=)(\s*)(datatype)',
286
+ bygroups(Punctuation, Text, Keyword.Reserved), '#pop'),
287
+ (rf'=(?!{symbolicid_re})', Punctuation,
288
+ ('#pop', 'datbind', 'datcon')),
289
+
290
+ (rf'({alphanumid_re})', Keyword.Type),
291
+ (rf'({symbolicid_re})', Keyword.Type),
292
+ (r'\S+', Error, '#pop'),
293
+ ],
294
+
295
+ # common case - A | B | C of int
296
+ 'datbind': [
297
+ include('whitespace'),
298
+
299
+ (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'dname')),
300
+ (r'\b(withtype)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')),
301
+ (r'\b(of)\b(?!\')', Keyword.Reserved),
302
+
303
+ (rf'(\|)(\s*)({alphanumid_re})',
304
+ bygroups(Punctuation, Text, Name.Class)),
305
+ (rf'(\|)(\s+)({symbolicid_re})',
306
+ bygroups(Punctuation, Text, Name.Class)),
307
+
308
+ include('breakout'),
309
+ include('core'),
310
+ (r'\S+', Error),
311
+ ],
312
+
313
+ # Dealing with what comes after an exception
314
+ 'ename': [
315
+ include('whitespace'),
316
+
317
+ (rf'(and\b)(\s+)({alphanumid_re})',
318
+ bygroups(Keyword.Reserved, Text, Name.Class)),
319
+ (rf'(and\b)(\s*)({symbolicid_re})',
320
+ bygroups(Keyword.Reserved, Text, Name.Class)),
321
+ (r'\b(of)\b(?!\')', Keyword.Reserved),
322
+ (rf'({alphanumid_re})|({symbolicid_re})', Name.Class),
323
+
324
+ default('#pop'),
325
+ ],
326
+
327
+ 'datcon': [
328
+ include('whitespace'),
329
+ (rf'({alphanumid_re})', Name.Class, '#pop'),
330
+ (rf'({symbolicid_re})', Name.Class, '#pop'),
331
+ (r'\S+', Error, '#pop'),
332
+ ],
333
+
334
+ # Series of type variables
335
+ 'tyvarseq': [
336
+ (r'\s', Text),
337
+ (r'\(\*', Comment.Multiline, 'comment'),
338
+
339
+ (r'\'[\w\']*', Name.Decorator),
340
+ (alphanumid_re, Name),
341
+ (r',', Punctuation),
342
+ (r'\)', Punctuation, '#pop'),
343
+ (symbolicid_re, Name),
344
+ ],
345
+
346
+ 'comment': [
347
+ (r'[^(*)]', Comment.Multiline),
348
+ (r'\(\*', Comment.Multiline, '#push'),
349
+ (r'\*\)', Comment.Multiline, '#pop'),
350
+ (r'[(*)]', Comment.Multiline),
351
+ ],
352
+ }
353
+
354
+
355
+ class OcamlLexer(RegexLexer):
356
+ """
357
+ For the OCaml language.
358
+ """
359
+
360
+ name = 'OCaml'
361
+ url = 'https://ocaml.org/'
362
+ aliases = ['ocaml']
363
+ filenames = ['*.ml', '*.mli', '*.mll', '*.mly']
364
+ mimetypes = ['text/x-ocaml']
365
+ version_added = '0.7'
366
+
367
+ keywords = (
368
+ 'and', 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done',
369
+ 'downto', 'else', 'end', 'exception', 'external', 'false',
370
+ 'for', 'fun', 'function', 'functor', 'if', 'in', 'include',
371
+ 'inherit', 'initializer', 'lazy', 'let', 'match', 'method',
372
+ 'module', 'mutable', 'new', 'object', 'of', 'open', 'private',
373
+ 'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try',
374
+ 'type', 'val', 'virtual', 'when', 'while', 'with',
375
+ )
376
+ keyopts = (
377
+ '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-',
378
+ r'-\.', '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<',
379
+ '<-', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>',
380
+ r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|]', r'\}', '~'
381
+ )
382
+
383
+ operators = r'[!$%&*+\./:<=>?@^|~-]'
384
+ word_operators = ('asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'or')
385
+ prefix_syms = r'[!?~]'
386
+ infix_syms = r'[=<>@^|&+\*/$%-]'
387
+ primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array')
388
+
389
+ tokens = {
390
+ 'escape-sequence': [
391
+ (r'\\[\\"\'ntbr]', String.Escape),
392
+ (r'\\[0-9]{3}', String.Escape),
393
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
394
+ ],
395
+ 'root': [
396
+ (r'\s+', Text),
397
+ (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo),
398
+ (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'),
399
+ (r'\b([A-Z][\w\']*)', Name.Class),
400
+ (r'\(\*(?![)])', Comment, 'comment'),
401
+ (r'\b({})\b'.format('|'.join(keywords)), Keyword),
402
+ (r'({})'.format('|'.join(keyopts[::-1])), Operator),
403
+ (rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
404
+ (r'\b({})\b'.format('|'.join(word_operators)), Operator.Word),
405
+ (r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
406
+
407
+ (r"[^\W\d][\w']*", Name),
408
+
409
+ (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
410
+ (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
411
+ (r'0[oO][0-7][0-7_]*', Number.Oct),
412
+ (r'0[bB][01][01_]*', Number.Bin),
413
+ (r'\d[\d_]*', Number.Integer),
414
+
415
+ (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
416
+ String.Char),
417
+ (r"'.'", String.Char),
418
+ (r"'", Keyword), # a stray quote is another syntax element
419
+
420
+ (r'"', String.Double, 'string'),
421
+
422
+ (r'[~?][a-z][\w\']*:', Name.Variable),
423
+ ],
424
+ 'comment': [
425
+ (r'[^(*)]+', Comment),
426
+ (r'\(\*', Comment, '#push'),
427
+ (r'\*\)', Comment, '#pop'),
428
+ (r'[(*)]', Comment),
429
+ ],
430
+ 'string': [
431
+ (r'[^\\"]+', String.Double),
432
+ include('escape-sequence'),
433
+ (r'\\\n', String.Double),
434
+ (r'"', String.Double, '#pop'),
435
+ ],
436
+ 'dotted': [
437
+ (r'\s+', Text),
438
+ (r'\.', Punctuation),
439
+ (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace),
440
+ (r'[A-Z][\w\']*', Name.Class, '#pop'),
441
+ (r'[a-z_][\w\']*', Name, '#pop'),
442
+ default('#pop'),
443
+ ],
444
+ }
445
+
446
+
447
+ class OpaLexer(RegexLexer):
448
+ """
449
+ Lexer for the Opa language.
450
+ """
451
+
452
+ name = 'Opa'
453
+ aliases = ['opa']
454
+ filenames = ['*.opa']
455
+ mimetypes = ['text/x-opa']
456
+ url = 'http://opalang.org'
457
+ version_added = '1.5'
458
+
459
+ # most of these aren't strictly keywords
460
+ # but if you color only real keywords, you might just
461
+ # as well not color anything
462
+ keywords = (
463
+ 'and', 'as', 'begin', 'case', 'client', 'css', 'database', 'db', 'do',
464
+ 'else', 'end', 'external', 'forall', 'function', 'if', 'import',
465
+ 'match', 'module', 'or', 'package', 'parser', 'rec', 'server', 'then',
466
+ 'type', 'val', 'with', 'xml_parser',
467
+ )
468
+
469
+ # matches both stuff and `stuff`
470
+ ident_re = r'(([a-zA-Z_]\w*)|(`[^`]*`))'
471
+
472
+ op_re = r'[.=\-<>,@~%/+?*&^!]'
473
+ punc_re = r'[()\[\],;|]' # '{' and '}' are treated elsewhere
474
+ # because they are also used for inserts
475
+
476
+ tokens = {
477
+ # copied from the caml lexer, should be adapted
478
+ 'escape-sequence': [
479
+ (r'\\[\\"\'ntr}]', String.Escape),
480
+ (r'\\[0-9]{3}', String.Escape),
481
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
482
+ ],
483
+
484
+ # factorizing these rules, because they are inserted many times
485
+ 'comments': [
486
+ (r'/\*', Comment, 'nested-comment'),
487
+ (r'//.*?$', Comment),
488
+ ],
489
+ 'comments-and-spaces': [
490
+ include('comments'),
491
+ (r'\s+', Text),
492
+ ],
493
+
494
+ 'root': [
495
+ include('comments-and-spaces'),
496
+ # keywords
497
+ (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword),
498
+ # directives
499
+ # we could parse the actual set of directives instead of anything
500
+ # starting with @, but this is troublesome
501
+ # because it needs to be adjusted all the time
502
+ # and assuming we parse only sources that compile, it is useless
503
+ (r'@' + ident_re + r'\b', Name.Builtin.Pseudo),
504
+
505
+ # number literals
506
+ (r'-?.[\d]+([eE][+\-]?\d+)', Number.Float),
507
+ (r'-?\d+.\d*([eE][+\-]?\d+)', Number.Float),
508
+ (r'-?\d+[eE][+\-]?\d+', Number.Float),
509
+ (r'0[xX][\da-fA-F]+', Number.Hex),
510
+ (r'0[oO][0-7]+', Number.Oct),
511
+ (r'0[bB][01]+', Number.Bin),
512
+ (r'\d+', Number.Integer),
513
+ # color literals
514
+ (r'#[\da-fA-F]{3,6}', Number.Integer),
515
+
516
+ # string literals
517
+ (r'"', String.Double, 'string'),
518
+ # char literal, should be checked because this is the regexp from
519
+ # the caml lexer
520
+ (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2})|.)'",
521
+ String.Char),
522
+
523
+ # this is meant to deal with embedded exprs in strings
524
+ # every time we find a '}' we pop a state so that if we were
525
+ # inside a string, we are back in the string state
526
+ # as a consequence, we must also push a state every time we find a
527
+ # '{' or else we will have errors when parsing {} for instance
528
+ (r'\{', Operator, '#push'),
529
+ (r'\}', Operator, '#pop'),
530
+
531
+ # html literals
532
+ # this is a much more strict that the actual parser,
533
+ # since a<b would not be parsed as html
534
+ # but then again, the parser is way too lax, and we can't hope
535
+ # to have something as tolerant
536
+ (r'<(?=[a-zA-Z>])', String.Single, 'html-open-tag'),
537
+
538
+ # db path
539
+ # matching the '[_]' in '/a[_]' because it is a part
540
+ # of the syntax of the db path definition
541
+ # unfortunately, i don't know how to match the ']' in
542
+ # /a[1], so this is somewhat inconsistent
543
+ (r'[@?!]?(/\w+)+(\[_\])?', Name.Variable),
544
+ # putting the same color on <- as on db path, since
545
+ # it can be used only to mean Db.write
546
+ (r'<-(?!'+op_re+r')', Name.Variable),
547
+
548
+ # 'modules'
549
+ # although modules are not distinguished by their names as in caml
550
+ # the standard library seems to follow the convention that modules
551
+ # only area capitalized
552
+ (r'\b([A-Z]\w*)(?=\.)', Name.Namespace),
553
+
554
+ # operators
555
+ # = has a special role because this is the only
556
+ # way to syntactic distinguish binding constructions
557
+ # unfortunately, this colors the equal in {x=2} too
558
+ (r'=(?!'+op_re+r')', Keyword),
559
+ (rf'({op_re})+', Operator),
560
+ (rf'({punc_re})+', Operator),
561
+
562
+ # coercions
563
+ (r':', Operator, 'type'),
564
+ # type variables
565
+ # we need this rule because we don't parse specially type
566
+ # definitions so in "type t('a) = ...", "'a" is parsed by 'root'
567
+ ("'"+ident_re, Keyword.Type),
568
+
569
+ # id literal, #something, or #{expr}
570
+ (r'#'+ident_re, String.Single),
571
+ (r'#(?=\{)', String.Single),
572
+
573
+ # identifiers
574
+ # this avoids to color '2' in 'a2' as an integer
575
+ (ident_re, Text),
576
+
577
+ # default, not sure if that is needed or not
578
+ # (r'.', Text),
579
+ ],
580
+
581
+ # it is quite painful to have to parse types to know where they end
582
+ # this is the general rule for a type
583
+ # a type is either:
584
+ # * -> ty
585
+ # * type-with-slash
586
+ # * type-with-slash -> ty
587
+ # * type-with-slash (, type-with-slash)+ -> ty
588
+ #
589
+ # the code is pretty funky in here, but this code would roughly
590
+ # translate in caml to:
591
+ # let rec type stream =
592
+ # match stream with
593
+ # | [< "->"; stream >] -> type stream
594
+ # | [< ""; stream >] ->
595
+ # type_with_slash stream
596
+ # type_lhs_1 stream;
597
+ # and type_1 stream = ...
598
+ 'type': [
599
+ include('comments-and-spaces'),
600
+ (r'->', Keyword.Type),
601
+ default(('#pop', 'type-lhs-1', 'type-with-slash')),
602
+ ],
603
+
604
+ # parses all the atomic or closed constructions in the syntax of type
605
+ # expressions: record types, tuple types, type constructors, basic type
606
+ # and type variables
607
+ 'type-1': [
608
+ include('comments-and-spaces'),
609
+ (r'\(', Keyword.Type, ('#pop', 'type-tuple')),
610
+ (r'~?\{', Keyword.Type, ('#pop', 'type-record')),
611
+ (ident_re+r'\(', Keyword.Type, ('#pop', 'type-tuple')),
612
+ (ident_re, Keyword.Type, '#pop'),
613
+ ("'"+ident_re, Keyword.Type),
614
+ # this case is not in the syntax but sometimes
615
+ # we think we are parsing types when in fact we are parsing
616
+ # some css, so we just pop the states until we get back into
617
+ # the root state
618
+ default('#pop'),
619
+ ],
620
+
621
+ # type-with-slash is either:
622
+ # * type-1
623
+ # * type-1 (/ type-1)+
624
+ 'type-with-slash': [
625
+ include('comments-and-spaces'),
626
+ default(('#pop', 'slash-type-1', 'type-1')),
627
+ ],
628
+ 'slash-type-1': [
629
+ include('comments-and-spaces'),
630
+ ('/', Keyword.Type, ('#pop', 'type-1')),
631
+ # same remark as above
632
+ default('#pop'),
633
+ ],
634
+
635
+ # we go in this state after having parsed a type-with-slash
636
+ # while trying to parse a type
637
+ # and at this point we must determine if we are parsing an arrow
638
+ # type (in which case we must continue parsing) or not (in which
639
+ # case we stop)
640
+ 'type-lhs-1': [
641
+ include('comments-and-spaces'),
642
+ (r'->', Keyword.Type, ('#pop', 'type')),
643
+ (r'(?=,)', Keyword.Type, ('#pop', 'type-arrow')),
644
+ default('#pop'),
645
+ ],
646
+ 'type-arrow': [
647
+ include('comments-and-spaces'),
648
+ # the look ahead here allows to parse f(x : int, y : float -> truc)
649
+ # correctly
650
+ (r',(?=[^:]*?->)', Keyword.Type, 'type-with-slash'),
651
+ (r'->', Keyword.Type, ('#pop', 'type')),
652
+ # same remark as above
653
+ default('#pop'),
654
+ ],
655
+
656
+ # no need to do precise parsing for tuples and records
657
+ # because they are closed constructions, so we can simply
658
+ # find the closing delimiter
659
+ # note that this function would be not work if the source
660
+ # contained identifiers like `{)` (although it could be patched
661
+ # to support it)
662
+ 'type-tuple': [
663
+ include('comments-and-spaces'),
664
+ (r'[^()/*]+', Keyword.Type),
665
+ (r'[/*]', Keyword.Type),
666
+ (r'\(', Keyword.Type, '#push'),
667
+ (r'\)', Keyword.Type, '#pop'),
668
+ ],
669
+ 'type-record': [
670
+ include('comments-and-spaces'),
671
+ (r'[^{}/*]+', Keyword.Type),
672
+ (r'[/*]', Keyword.Type),
673
+ (r'\{', Keyword.Type, '#push'),
674
+ (r'\}', Keyword.Type, '#pop'),
675
+ ],
676
+
677
+ # 'type-tuple': [
678
+ # include('comments-and-spaces'),
679
+ # (r'\)', Keyword.Type, '#pop'),
680
+ # default(('#pop', 'type-tuple-1', 'type-1')),
681
+ # ],
682
+ # 'type-tuple-1': [
683
+ # include('comments-and-spaces'),
684
+ # (r',?\s*\)', Keyword.Type, '#pop'), # ,) is a valid end of tuple, in (1,)
685
+ # (r',', Keyword.Type, 'type-1'),
686
+ # ],
687
+ # 'type-record':[
688
+ # include('comments-and-spaces'),
689
+ # (r'\}', Keyword.Type, '#pop'),
690
+ # (r'~?(?:\w+|`[^`]*`)', Keyword.Type, 'type-record-field-expr'),
691
+ # ],
692
+ # 'type-record-field-expr': [
693
+ #
694
+ # ],
695
+
696
+ 'nested-comment': [
697
+ (r'[^/*]+', Comment),
698
+ (r'/\*', Comment, '#push'),
699
+ (r'\*/', Comment, '#pop'),
700
+ (r'[/*]', Comment),
701
+ ],
702
+
703
+ # the copy pasting between string and single-string
704
+ # is kinda sad. Is there a way to avoid that??
705
+ 'string': [
706
+ (r'[^\\"{]+', String.Double),
707
+ (r'"', String.Double, '#pop'),
708
+ (r'\{', Operator, 'root'),
709
+ include('escape-sequence'),
710
+ ],
711
+ 'single-string': [
712
+ (r'[^\\\'{]+', String.Double),
713
+ (r'\'', String.Double, '#pop'),
714
+ (r'\{', Operator, 'root'),
715
+ include('escape-sequence'),
716
+ ],
717
+
718
+ # all the html stuff
719
+ # can't really reuse some existing html parser
720
+ # because we must be able to parse embedded expressions
721
+
722
+ # we are in this state after someone parsed the '<' that
723
+ # started the html literal
724
+ 'html-open-tag': [
725
+ (r'[\w\-:]+', String.Single, ('#pop', 'html-attr')),
726
+ (r'>', String.Single, ('#pop', 'html-content')),
727
+ ],
728
+
729
+ # we are in this state after someone parsed the '</' that
730
+ # started the end of the closing tag
731
+ 'html-end-tag': [
732
+ # this is a star, because </> is allowed
733
+ (r'[\w\-:]*>', String.Single, '#pop'),
734
+ ],
735
+
736
+ # we are in this state after having parsed '<ident(:ident)?'
737
+ # we thus parse a possibly empty list of attributes
738
+ 'html-attr': [
739
+ (r'\s+', Text),
740
+ (r'[\w\-:]+=', String.Single, 'html-attr-value'),
741
+ (r'/>', String.Single, '#pop'),
742
+ (r'>', String.Single, ('#pop', 'html-content')),
743
+ ],
744
+
745
+ 'html-attr-value': [
746
+ (r"'", String.Single, ('#pop', 'single-string')),
747
+ (r'"', String.Single, ('#pop', 'string')),
748
+ (r'#'+ident_re, String.Single, '#pop'),
749
+ (r'#(?=\{)', String.Single, ('#pop', 'root')),
750
+ (r'[^"\'{`=<>]+', String.Single, '#pop'),
751
+ (r'\{', Operator, ('#pop', 'root')), # this is a tail call!
752
+ ],
753
+
754
+ # we should probably deal with '\' escapes here
755
+ 'html-content': [
756
+ (r'<!--', Comment, 'html-comment'),
757
+ (r'</', String.Single, ('#pop', 'html-end-tag')),
758
+ (r'<', String.Single, 'html-open-tag'),
759
+ (r'\{', Operator, 'root'),
760
+ (r'[^<{]+', String.Single),
761
+ ],
762
+
763
+ 'html-comment': [
764
+ (r'-->', Comment, '#pop'),
765
+ (r'[^\-]+|-', Comment),
766
+ ],
767
+ }
768
+
769
+
770
+ class ReasonLexer(RegexLexer):
771
+ """
772
+ For the ReasonML language.
773
+ """
774
+
775
+ name = 'ReasonML'
776
+ url = 'https://reasonml.github.io/'
777
+ aliases = ['reasonml', 'reason']
778
+ filenames = ['*.re', '*.rei']
779
+ mimetypes = ['text/x-reasonml']
780
+ version_added = '2.6'
781
+
782
+ keywords = (
783
+ 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', 'downto',
784
+ 'else', 'end', 'exception', 'external', 'false', 'for', 'fun', 'esfun',
785
+ 'function', 'functor', 'if', 'in', 'include', 'inherit', 'initializer', 'lazy',
786
+ 'let', 'switch', 'module', 'pub', 'mutable', 'new', 'nonrec', 'object', 'of',
787
+ 'open', 'pri', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try',
788
+ 'type', 'val', 'virtual', 'when', 'while', 'with',
789
+ )
790
+ keyopts = (
791
+ '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-',
792
+ r'-\.', '=>', r'\.', r'\.\.', r'\.\.\.', ':', '::', ':=', ':>', ';', ';;', '<',
793
+ '<-', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>',
794
+ r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|\|', r'\|]', r'\}', '~'
795
+ )
796
+
797
+ operators = r'[!$%&*+\./:<=>?@^|~-]'
798
+ word_operators = ('and', 'asr', 'land', 'lor', 'lsl', 'lsr', 'lxor', 'mod', 'or')
799
+ prefix_syms = r'[!?~]'
800
+ infix_syms = r'[=<>@^|&+\*/$%-]'
801
+ primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array')
802
+
803
+ tokens = {
804
+ 'escape-sequence': [
805
+ (r'\\[\\"\'ntbr]', String.Escape),
806
+ (r'\\[0-9]{3}', String.Escape),
807
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
808
+ ],
809
+ 'root': [
810
+ (r'\s+', Text),
811
+ (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo),
812
+ (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'),
813
+ (r'\b([A-Z][\w\']*)', Name.Class),
814
+ (r'//.*?\n', Comment.Single),
815
+ (r'\/\*(?!/)', Comment.Multiline, 'comment'),
816
+ (r'\b({})\b'.format('|'.join(keywords)), Keyword),
817
+ (r'({})'.format('|'.join(keyopts[::-1])), Operator.Word),
818
+ (rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
819
+ (r'\b({})\b'.format('|'.join(word_operators)), Operator.Word),
820
+ (r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
821
+
822
+ (r"[^\W\d][\w']*", Name),
823
+
824
+ (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
825
+ (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
826
+ (r'0[oO][0-7][0-7_]*', Number.Oct),
827
+ (r'0[bB][01][01_]*', Number.Bin),
828
+ (r'\d[\d_]*', Number.Integer),
829
+
830
+ (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
831
+ String.Char),
832
+ (r"'.'", String.Char),
833
+ (r"'", Keyword),
834
+
835
+ (r'"', String.Double, 'string'),
836
+
837
+ (r'[~?][a-z][\w\']*:', Name.Variable),
838
+ ],
839
+ 'comment': [
840
+ (r'[^/*]+', Comment.Multiline),
841
+ (r'\/\*', Comment.Multiline, '#push'),
842
+ (r'\*\/', Comment.Multiline, '#pop'),
843
+ (r'\*', Comment.Multiline),
844
+ ],
845
+ 'string': [
846
+ (r'[^\\"]+', String.Double),
847
+ include('escape-sequence'),
848
+ (r'\\\n', String.Double),
849
+ (r'"', String.Double, '#pop'),
850
+ ],
851
+ 'dotted': [
852
+ (r'\s+', Text),
853
+ (r'\.', Punctuation),
854
+ (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace),
855
+ (r'[A-Z][\w\']*', Name.Class, '#pop'),
856
+ (r'[a-z_][\w\']*', Name, '#pop'),
857
+ default('#pop'),
858
+ ],
859
+ }
860
+
861
+
862
+ class FStarLexer(RegexLexer):
863
+ """
864
+ For the F* language.
865
+ """
866
+
867
+ name = 'FStar'
868
+ url = 'https://www.fstar-lang.org/'
869
+ aliases = ['fstar']
870
+ filenames = ['*.fst', '*.fsti']
871
+ mimetypes = ['text/x-fstar']
872
+ version_added = '2.7'
873
+
874
+ keywords = (
875
+ 'abstract', 'attributes', 'noeq', 'unopteq', 'and'
876
+ 'begin', 'by', 'default', 'effect', 'else', 'end', 'ensures',
877
+ 'exception', 'exists', 'false', 'forall', 'fun', 'function', 'if',
878
+ 'in', 'include', 'inline', 'inline_for_extraction', 'irreducible',
879
+ 'logic', 'match', 'module', 'mutable', 'new', 'new_effect', 'noextract',
880
+ 'of', 'open', 'opaque', 'private', 'range_of', 'reifiable',
881
+ 'reify', 'reflectable', 'requires', 'set_range_of', 'sub_effect',
882
+ 'synth', 'then', 'total', 'true', 'try', 'type', 'unfold', 'unfoldable',
883
+ 'val', 'when', 'with', 'not'
884
+ )
885
+ decl_keywords = ('let', 'rec')
886
+ assume_keywords = ('assume', 'admit', 'assert', 'calc')
887
+ keyopts = (
888
+ r'~', r'-', r'/\\', r'\\/', r'<:', r'<@', r'\(\|', r'\|\)', r'#', r'u#',
889
+ r'&', r'\(', r'\)', r'\(\)', r',', r'~>', r'->', r'<-', r'<--', r'<==>',
890
+ r'==>', r'\.', r'\?', r'\?\.', r'\.\[', r'\.\(', r'\.\(\|', r'\.\[\|',
891
+ r'\{:pattern', r':', r'::', r':=', r';', r';;', r'=', r'%\[', r'!\{',
892
+ r'\[', r'\[@', r'\[\|', r'\|>', r'\]', r'\|\]', r'\{', r'\|', r'\}', r'\$'
893
+ )
894
+
895
+ operators = r'[!$%&*+\./:<=>?@^|~-]'
896
+ prefix_syms = r'[!?~]'
897
+ infix_syms = r'[=<>@^|&+\*/$%-]'
898
+ primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array')
899
+
900
+ tokens = {
901
+ 'escape-sequence': [
902
+ (r'\\[\\"\'ntbr]', String.Escape),
903
+ (r'\\[0-9]{3}', String.Escape),
904
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
905
+ ],
906
+ 'root': [
907
+ (r'\s+', Text),
908
+ (r'false|true|False|True|\(\)|\[\]', Name.Builtin.Pseudo),
909
+ (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'),
910
+ (r'\b([A-Z][\w\']*)', Name.Class),
911
+ (r'\(\*(?![)])', Comment, 'comment'),
912
+ (r'\/\/.+$', Comment),
913
+ (r'\b({})\b'.format('|'.join(keywords)), Keyword),
914
+ (r'\b({})\b'.format('|'.join(assume_keywords)), Name.Exception),
915
+ (r'\b({})\b'.format('|'.join(decl_keywords)), Keyword.Declaration),
916
+ (r'({})'.format('|'.join(keyopts[::-1])), Operator),
917
+ (rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
918
+ (r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
919
+
920
+ (r"[^\W\d][\w']*", Name),
921
+
922
+ (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
923
+ (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
924
+ (r'0[oO][0-7][0-7_]*', Number.Oct),
925
+ (r'0[bB][01][01_]*', Number.Bin),
926
+ (r'\d[\d_]*', Number.Integer),
927
+
928
+ (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
929
+ String.Char),
930
+ (r"'.'", String.Char),
931
+ (r"'", Keyword), # a stray quote is another syntax element
932
+ (r"\`([\w\'.]+)\`", Operator.Word), # for infix applications
933
+ (r"\`", Keyword), # for quoting
934
+ (r'"', String.Double, 'string'),
935
+
936
+ (r'[~?][a-z][\w\']*:', Name.Variable),
937
+ ],
938
+ 'comment': [
939
+ (r'[^(*)]+', Comment),
940
+ (r'\(\*', Comment, '#push'),
941
+ (r'\*\)', Comment, '#pop'),
942
+ (r'[(*)]', Comment),
943
+ ],
944
+ 'string': [
945
+ (r'[^\\"]+', String.Double),
946
+ include('escape-sequence'),
947
+ (r'\\\n', String.Double),
948
+ (r'"', String.Double, '#pop'),
949
+ ],
950
+ 'dotted': [
951
+ (r'\s+', Text),
952
+ (r'\.', Punctuation),
953
+ (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace),
954
+ (r'[A-Z][\w\']*', Name.Class, '#pop'),
955
+ (r'[a-z_][\w\']*', Name, '#pop'),
956
+ default('#pop'),
957
+ ],
958
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/modeling.py ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.modeling
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for modeling languages.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include, bygroups, using, default
14
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
+ Number, Punctuation, Whitespace
16
+
17
+ from pygments.lexers.html import HtmlLexer
18
+ from pygments.lexers import _stan_builtins
19
+
20
+ __all__ = ['ModelicaLexer', 'BugsLexer', 'JagsLexer', 'StanLexer']
21
+
22
+
23
+ class ModelicaLexer(RegexLexer):
24
+ """
25
+ For Modelica source code.
26
+ """
27
+ name = 'Modelica'
28
+ url = 'http://www.modelica.org/'
29
+ aliases = ['modelica']
30
+ filenames = ['*.mo']
31
+ mimetypes = ['text/x-modelica']
32
+ version_added = '1.1'
33
+
34
+ flags = re.DOTALL | re.MULTILINE
35
+
36
+ _name = r"(?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)"
37
+
38
+ tokens = {
39
+ 'whitespace': [
40
+ (r'[\s\ufeff]+', Text),
41
+ (r'//[^\n]*\n?', Comment.Single),
42
+ (r'/\*.*?\*/', Comment.Multiline)
43
+ ],
44
+ 'root': [
45
+ include('whitespace'),
46
+ (r'"', String.Double, 'string'),
47
+ (r'[()\[\]{},;]+', Punctuation),
48
+ (r'\.?[*^/+-]|\.|<>|[<>:=]=?', Operator),
49
+ (r'\d+(\.?\d*[eE][-+]?\d+|\.\d*)', Number.Float),
50
+ (r'\d+', Number.Integer),
51
+ (r'(abs|acos|actualStream|array|asin|assert|AssertionLevel|atan|'
52
+ r'atan2|backSample|Boolean|cardinality|cat|ceil|change|Clock|'
53
+ r'Connections|cos|cosh|cross|delay|diagonal|div|edge|exp|'
54
+ r'ExternalObject|fill|floor|getInstanceName|hold|homotopy|'
55
+ r'identity|inStream|integer|Integer|interval|inverse|isPresent|'
56
+ r'linspace|log|log10|matrix|max|min|mod|ndims|noClock|noEvent|'
57
+ r'ones|outerProduct|pre|previous|product|Real|reinit|rem|rooted|'
58
+ r'sample|scalar|semiLinear|shiftSample|sign|sin|sinh|size|skew|'
59
+ r'smooth|spatialDistribution|sqrt|StateSelect|String|subSample|'
60
+ r'sum|superSample|symmetric|tan|tanh|terminal|terminate|time|'
61
+ r'transpose|vector|zeros)\b', Name.Builtin),
62
+ (r'(algorithm|annotation|break|connect|constant|constrainedby|der|'
63
+ r'discrete|each|else|elseif|elsewhen|encapsulated|enumeration|'
64
+ r'equation|exit|expandable|extends|external|firstTick|final|flow|for|if|'
65
+ r'import|impure|in|initial|inner|input|interval|loop|nondiscrete|outer|'
66
+ r'output|parameter|partial|protected|public|pure|redeclare|'
67
+ r'replaceable|return|stream|then|when|while)\b',
68
+ Keyword.Reserved),
69
+ (r'(and|not|or)\b', Operator.Word),
70
+ (r'(block|class|connector|end|function|model|operator|package|'
71
+ r'record|type)\b', Keyword.Reserved, 'class'),
72
+ (r'(false|true)\b', Keyword.Constant),
73
+ (r'within\b', Keyword.Reserved, 'package-prefix'),
74
+ (_name, Name)
75
+ ],
76
+ 'class': [
77
+ include('whitespace'),
78
+ (r'(function|record)\b', Keyword.Reserved),
79
+ (r'(if|for|when|while)\b', Keyword.Reserved, '#pop'),
80
+ (_name, Name.Class, '#pop'),
81
+ default('#pop')
82
+ ],
83
+ 'package-prefix': [
84
+ include('whitespace'),
85
+ (_name, Name.Namespace, '#pop'),
86
+ default('#pop')
87
+ ],
88
+ 'string': [
89
+ (r'"', String.Double, '#pop'),
90
+ (r'\\[\'"?\\abfnrtv]', String.Escape),
91
+ (r'(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))',
92
+ using(HtmlLexer)),
93
+ (r'<|\\?[^"\\<]+', String.Double)
94
+ ]
95
+ }
96
+
97
+
98
+ class BugsLexer(RegexLexer):
99
+ """
100
+ Pygments Lexer for OpenBugs and WinBugs
101
+ models.
102
+ """
103
+
104
+ name = 'BUGS'
105
+ aliases = ['bugs', 'winbugs', 'openbugs']
106
+ filenames = ['*.bug']
107
+ url = 'https://www.mrc-bsu.cam.ac.uk/software/bugs/openbugs'
108
+ version_added = '1.6'
109
+
110
+ _FUNCTIONS = (
111
+ # Scalar functions
112
+ 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
113
+ 'cloglog', 'cos', 'cosh', 'cumulative', 'cut', 'density', 'deviance',
114
+ 'equals', 'expr', 'gammap', 'ilogit', 'icloglog', 'integral', 'log',
115
+ 'logfact', 'loggam', 'logit', 'max', 'min', 'phi', 'post.p.value',
116
+ 'pow', 'prior.p.value', 'probit', 'replicate.post', 'replicate.prior',
117
+ 'round', 'sin', 'sinh', 'solution', 'sqrt', 'step', 'tan', 'tanh',
118
+ 'trunc',
119
+ # Vector functions
120
+ 'inprod', 'interp.lin', 'inverse', 'logdet', 'mean', 'eigen.vals',
121
+ 'ode', 'prod', 'p.valueM', 'rank', 'ranked', 'replicate.postM',
122
+ 'sd', 'sort', 'sum',
123
+ # Special
124
+ 'D', 'I', 'F', 'T', 'C')
125
+ """ OpenBUGS built-in functions
126
+
127
+ From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAII
128
+
129
+ This also includes
130
+
131
+ - T, C, I : Truncation and censoring.
132
+ ``T`` and ``C`` are in OpenBUGS. ``I`` in WinBUGS.
133
+ - D : ODE
134
+ - F : Functional http://www.openbugs.info/Examples/Functionals.html
135
+
136
+ """
137
+
138
+ _DISTRIBUTIONS = ('dbern', 'dbin', 'dcat', 'dnegbin', 'dpois',
139
+ 'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
140
+ 'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
141
+ 'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
142
+ 'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
143
+ 'dmt', 'dwish')
144
+ """ OpenBUGS built-in distributions
145
+
146
+ Functions from
147
+ http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI
148
+ """
149
+
150
+ tokens = {
151
+ 'whitespace': [
152
+ (r"\s+", Text),
153
+ ],
154
+ 'comments': [
155
+ # Comments
156
+ (r'#.*$', Comment.Single),
157
+ ],
158
+ 'root': [
159
+ # Comments
160
+ include('comments'),
161
+ include('whitespace'),
162
+ # Block start
163
+ (r'(model)(\s+)(\{)',
164
+ bygroups(Keyword.Namespace, Text, Punctuation)),
165
+ # Reserved Words
166
+ (r'(for|in)(?![\w.])', Keyword.Reserved),
167
+ # Built-in Functions
168
+ (r'({})(?=\s*\()'.format(r'|'.join(_FUNCTIONS + _DISTRIBUTIONS)),
169
+ Name.Builtin),
170
+ # Regular variable names
171
+ (r'[A-Za-z][\w.]*', Name),
172
+ # Number Literals
173
+ (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
174
+ # Punctuation
175
+ (r'\[|\]|\(|\)|:|,|;', Punctuation),
176
+ # Assignment operators
177
+ # SLexer makes these tokens Operators.
178
+ (r'<-|~', Operator),
179
+ # Infix and prefix operators
180
+ (r'\+|-|\*|/', Operator),
181
+ # Block
182
+ (r'[{}]', Punctuation),
183
+ ]
184
+ }
185
+
186
+ def analyse_text(text):
187
+ if re.search(r"^\s*model\s*{", text, re.M):
188
+ return 0.7
189
+ else:
190
+ return 0.0
191
+
192
+
193
+ class JagsLexer(RegexLexer):
194
+ """
195
+ Pygments Lexer for JAGS.
196
+ """
197
+
198
+ name = 'JAGS'
199
+ aliases = ['jags']
200
+ filenames = ['*.jag', '*.bug']
201
+ url = 'https://mcmc-jags.sourceforge.io'
202
+ version_added = '1.6'
203
+
204
+ # JAGS
205
+ _FUNCTIONS = (
206
+ 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
207
+ 'cos', 'cosh', 'cloglog',
208
+ 'equals', 'exp', 'icloglog', 'ifelse', 'ilogit', 'log', 'logfact',
209
+ 'loggam', 'logit', 'phi', 'pow', 'probit', 'round', 'sin', 'sinh',
210
+ 'sqrt', 'step', 'tan', 'tanh', 'trunc', 'inprod', 'interp.lin',
211
+ 'logdet', 'max', 'mean', 'min', 'prod', 'sum', 'sd', 'inverse',
212
+ 'rank', 'sort', 't', 'acos', 'acosh', 'asin', 'asinh', 'atan',
213
+ # Truncation/Censoring (should I include)
214
+ 'T', 'I')
215
+ # Distributions with density, probability and quartile functions
216
+ _DISTRIBUTIONS = tuple(f'[dpq]{x}' for x in
217
+ ('bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp',
218
+ 'df', 'gamma', 'gen.gamma', 'logis', 'lnorm',
219
+ 'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib'))
220
+ # Other distributions without density and probability
221
+ _OTHER_DISTRIBUTIONS = (
222
+ 'dt', 'dunif', 'dbetabin', 'dbern', 'dbin', 'dcat', 'dhyper',
223
+ 'ddirch', 'dmnorm', 'dwish', 'dmt', 'dmulti', 'dbinom', 'dchisq',
224
+ 'dnbinom', 'dweibull', 'ddirich')
225
+
226
+ tokens = {
227
+ 'whitespace': [
228
+ (r"\s+", Text),
229
+ ],
230
+ 'names': [
231
+ # Regular variable names
232
+ (r'[a-zA-Z][\w.]*\b', Name),
233
+ ],
234
+ 'comments': [
235
+ # do not use stateful comments
236
+ (r'(?s)/\*.*?\*/', Comment.Multiline),
237
+ # Comments
238
+ (r'#.*$', Comment.Single),
239
+ ],
240
+ 'root': [
241
+ # Comments
242
+ include('comments'),
243
+ include('whitespace'),
244
+ # Block start
245
+ (r'(model|data)(\s+)(\{)',
246
+ bygroups(Keyword.Namespace, Text, Punctuation)),
247
+ (r'var(?![\w.])', Keyword.Declaration),
248
+ # Reserved Words
249
+ (r'(for|in)(?![\w.])', Keyword.Reserved),
250
+ # Builtins
251
+ # Need to use lookahead because . is a valid char
252
+ (r'({})(?=\s*\()'.format(r'|'.join(_FUNCTIONS
253
+ + _DISTRIBUTIONS
254
+ + _OTHER_DISTRIBUTIONS)),
255
+ Name.Builtin),
256
+ # Names
257
+ include('names'),
258
+ # Number Literals
259
+ (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
260
+ (r'\[|\]|\(|\)|:|,|;', Punctuation),
261
+ # Assignment operators
262
+ (r'<-|~', Operator),
263
+ # # JAGS includes many more than OpenBUGS
264
+ (r'\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%', Operator),
265
+ (r'[{}]', Punctuation),
266
+ ]
267
+ }
268
+
269
+ def analyse_text(text):
270
+ if re.search(r'^\s*model\s*\{', text, re.M):
271
+ if re.search(r'^\s*data\s*\{', text, re.M):
272
+ return 0.9
273
+ elif re.search(r'^\s*var', text, re.M):
274
+ return 0.9
275
+ else:
276
+ return 0.3
277
+ else:
278
+ return 0
279
+
280
+
281
+ class StanLexer(RegexLexer):
282
+ """Pygments Lexer for Stan models.
283
+
284
+ The Stan modeling language is specified in the *Stan Modeling Language
285
+ User's Guide and Reference Manual, v2.17.0*,
286
+ `pdf <https://github.com/stan-dev/stan/releases/download/v2.17.0/stan-reference-2.17.0.pdf>`__.
287
+ """
288
+
289
+ name = 'Stan'
290
+ aliases = ['stan']
291
+ filenames = ['*.stan']
292
+ url = 'https://mc-stan.org'
293
+ version_added = '1.6'
294
+
295
+ tokens = {
296
+ 'whitespace': [
297
+ (r"\s+", Text),
298
+ ],
299
+ 'comments': [
300
+ (r'(?s)/\*.*?\*/', Comment.Multiline),
301
+ # Comments
302
+ (r'(//|#).*$', Comment.Single),
303
+ ],
304
+ 'root': [
305
+ (r'"[^"]*"', String),
306
+ # Comments
307
+ include('comments'),
308
+ # block start
309
+ include('whitespace'),
310
+ # Block start
311
+ (r'({})(\s*)(\{{)'.format(r'|'.join(('functions', 'data', r'transformed\s+?data',
312
+ 'parameters', r'transformed\s+parameters',
313
+ 'model', r'generated\s+quantities'))),
314
+ bygroups(Keyword.Namespace, Text, Punctuation)),
315
+ # target keyword
316
+ (r'target\s*\+=', Keyword),
317
+ # jacobian += statement
318
+ (r'jacobian\s*\+=', Keyword),
319
+ # Reserved Words
320
+ (r'({})\b'.format(r'|'.join(_stan_builtins.KEYWORDS)), Keyword),
321
+ # Truncation
322
+ (r'T(?=\s*\[)', Keyword),
323
+ # Data types
324
+ (r'({})\b'.format(r'|'.join(_stan_builtins.TYPES)), Keyword.Type),
325
+ # < should be punctuation, but elsewhere I can't tell if it is in
326
+ # a range constraint
327
+ (r'(<)(\s*)(upper|lower|offset|multiplier)(\s*)(=)',
328
+ bygroups(Operator, Whitespace, Keyword, Whitespace, Punctuation)),
329
+ (r'(,)(\s*)(upper)(\s*)(=)',
330
+ bygroups(Punctuation, Whitespace, Keyword, Whitespace, Punctuation)),
331
+ # Punctuation
332
+ (r"[;,\[\]()]", Punctuation),
333
+ # Builtin
334
+ (r'({})(?=\s*\()'.format('|'.join(_stan_builtins.FUNCTIONS)), Name.Builtin),
335
+ (r'(~)(\s*)({})(?=\s*\()'.format('|'.join(_stan_builtins.DISTRIBUTIONS)),
336
+ bygroups(Operator, Whitespace, Name.Builtin)),
337
+ # Special names ending in __, like lp__
338
+ (r'[A-Za-z]\w*__\b', Name.Builtin.Pseudo),
339
+ (r'({})\b'.format(r'|'.join(_stan_builtins.RESERVED)), Keyword.Reserved),
340
+ # user-defined functions
341
+ (r'[A-Za-z]\w*(?=\s*\()]', Name.Function),
342
+ # Imaginary Literals
343
+ (r'[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?i', Number.Float),
344
+ (r'\.[0-9]+([eE][+-]?[0-9]+)?i', Number.Float),
345
+ (r'[0-9]+i', Number.Float),
346
+ # Real Literals
347
+ (r'[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?', Number.Float),
348
+ (r'\.[0-9]+([eE][+-]?[0-9]+)?', Number.Float),
349
+ # Integer Literals
350
+ (r'[0-9]+', Number.Integer),
351
+ # Regular variable names
352
+ (r'[A-Za-z]\w*\b', Name),
353
+ # Assignment operators
354
+ (r'<-|(?:\+|-|\.?/|\.?\*|=)?=|~', Operator),
355
+ # Infix, prefix and postfix operators (and = )
356
+ (r"\+|-|\.?\*|\.?/|\\|'|\.?\^|!=?|<=?|>=?|\|\||&&|%|\?|:|%/%|!", Operator),
357
+ # Block delimiters
358
+ (r'[{}]', Punctuation),
359
+ # Distribution |
360
+ (r'\|', Punctuation)
361
+ ]
362
+ }
363
+
364
+ def analyse_text(text):
365
+ if re.search(r'^\s*parameters\s*\{', text, re.M):
366
+ return 1.0
367
+ else:
368
+ return 0.0
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/modula2.py ADDED
@@ -0,0 +1,1579 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.modula2
3
+ ~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Multi-Dialect Lexer for Modula-2.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include
14
+ from pygments.util import get_bool_opt, get_list_opt
15
+ from pygments.token import Text, Comment, Operator, Keyword, Name, \
16
+ String, Number, Punctuation, Error
17
+
18
+ __all__ = ['Modula2Lexer']
19
+
20
+
21
+ # Multi-Dialect Modula-2 Lexer
22
+ class Modula2Lexer(RegexLexer):
23
+ """
24
+ For Modula-2 source code.
25
+
26
+ The Modula-2 lexer supports several dialects. By default, it operates in
27
+ fallback mode, recognising the *combined* literals, punctuation symbols
28
+ and operators of all supported dialects, and the *combined* reserved words
29
+ and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10, while not
30
+ differentiating between library defined identifiers.
31
+
32
+ To select a specific dialect, a dialect option may be passed
33
+ or a dialect tag may be embedded into a source file.
34
+
35
+ Dialect Options:
36
+
37
+ `m2pim`
38
+ Select PIM Modula-2 dialect.
39
+ `m2iso`
40
+ Select ISO Modula-2 dialect.
41
+ `m2r10`
42
+ Select Modula-2 R10 dialect.
43
+ `objm2`
44
+ Select Objective Modula-2 dialect.
45
+
46
+ The PIM and ISO dialect options may be qualified with a language extension.
47
+
48
+ Language Extensions:
49
+
50
+ `+aglet`
51
+ Select Aglet Modula-2 extensions, available with m2iso.
52
+ `+gm2`
53
+ Select GNU Modula-2 extensions, available with m2pim.
54
+ `+p1`
55
+ Select p1 Modula-2 extensions, available with m2iso.
56
+ `+xds`
57
+ Select XDS Modula-2 extensions, available with m2iso.
58
+
59
+
60
+ Passing a Dialect Option via Unix Commandline Interface
61
+
62
+ Dialect options may be passed to the lexer using the `dialect` key.
63
+ Only one such option should be passed. If multiple dialect options are
64
+ passed, the first valid option is used, any subsequent options are ignored.
65
+
66
+ Examples:
67
+
68
+ `$ pygmentize -O full,dialect=m2iso -f html -o /path/to/output /path/to/input`
69
+ Use ISO dialect to render input to HTML output
70
+ `$ pygmentize -O full,dialect=m2iso+p1 -f rtf -o /path/to/output /path/to/input`
71
+ Use ISO dialect with p1 extensions to render input to RTF output
72
+
73
+
74
+ Embedding a Dialect Option within a source file
75
+
76
+ A dialect option may be embedded in a source file in form of a dialect
77
+ tag, a specially formatted comment that specifies a dialect option.
78
+
79
+ Dialect Tag EBNF::
80
+
81
+ dialectTag :
82
+ OpeningCommentDelim Prefix dialectOption ClosingCommentDelim ;
83
+
84
+ dialectOption :
85
+ 'm2pim' | 'm2iso' | 'm2r10' | 'objm2' |
86
+ 'm2iso+aglet' | 'm2pim+gm2' | 'm2iso+p1' | 'm2iso+xds' ;
87
+
88
+ Prefix : '!' ;
89
+
90
+ OpeningCommentDelim : '(*' ;
91
+
92
+ ClosingCommentDelim : '*)' ;
93
+
94
+ No whitespace is permitted between the tokens of a dialect tag.
95
+
96
+ In the event that a source file contains multiple dialect tags, the first
97
+ tag that contains a valid dialect option will be used and any subsequent
98
+ dialect tags will be ignored. Ideally, a dialect tag should be placed
99
+ at the beginning of a source file.
100
+
101
+ An embedded dialect tag overrides a dialect option set via command line.
102
+
103
+ Examples:
104
+
105
+ ``(*!m2r10*) DEFINITION MODULE Foobar; ...``
106
+ Use Modula2 R10 dialect to render this source file.
107
+ ``(*!m2pim+gm2*) DEFINITION MODULE Bazbam; ...``
108
+ Use PIM dialect with GNU extensions to render this source file.
109
+
110
+
111
+ Algol Publication Mode:
112
+
113
+ In Algol publication mode, source text is rendered for publication of
114
+ algorithms in scientific papers and academic texts, following the format
115
+ of the Revised Algol-60 Language Report. It is activated by passing
116
+ one of two corresponding styles as an option:
117
+
118
+ `algol`
119
+ render reserved words lowercase underline boldface
120
+ and builtins lowercase boldface italic
121
+ `algol_nu`
122
+ render reserved words lowercase boldface (no underlining)
123
+ and builtins lowercase boldface italic
124
+
125
+ The lexer automatically performs the required lowercase conversion when
126
+ this mode is activated.
127
+
128
+ Example:
129
+
130
+ ``$ pygmentize -O full,style=algol -f latex -o /path/to/output /path/to/input``
131
+ Render input file in Algol publication mode to LaTeX output.
132
+
133
+
134
+ Rendering Mode of First Class ADT Identifiers:
135
+
136
+ The rendering of standard library first class ADT identifiers is controlled
137
+ by option flag "treat_stdlib_adts_as_builtins".
138
+
139
+ When this option is turned on, standard library ADT identifiers are rendered
140
+ as builtins. When it is turned off, they are rendered as ordinary library
141
+ identifiers.
142
+
143
+ `treat_stdlib_adts_as_builtins` (default: On)
144
+
145
+ The option is useful for dialects that support ADTs as first class objects
146
+ and provide ADTs in the standard library that would otherwise be built-in.
147
+
148
+ At present, only Modula-2 R10 supports library ADTs as first class objects
149
+ and therefore, no ADT identifiers are defined for any other dialects.
150
+
151
+ Example:
152
+
153
+ ``$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...``
154
+ Render standard library ADTs as ordinary library types.
155
+
156
+ .. versionchanged:: 2.1
157
+ Added multi-dialect support.
158
+ """
159
+ name = 'Modula-2'
160
+ url = 'http://www.modula2.org/'
161
+ aliases = ['modula2', 'm2']
162
+ filenames = ['*.def', '*.mod']
163
+ mimetypes = ['text/x-modula2']
164
+ version_added = '1.3'
165
+
166
+ flags = re.MULTILINE | re.DOTALL
167
+
168
+ tokens = {
169
+ 'whitespace': [
170
+ (r'\n+', Text), # blank lines
171
+ (r'\s+', Text), # whitespace
172
+ ],
173
+ 'dialecttags': [
174
+ # PIM Dialect Tag
175
+ (r'\(\*!m2pim\*\)', Comment.Special),
176
+ # ISO Dialect Tag
177
+ (r'\(\*!m2iso\*\)', Comment.Special),
178
+ # M2R10 Dialect Tag
179
+ (r'\(\*!m2r10\*\)', Comment.Special),
180
+ # ObjM2 Dialect Tag
181
+ (r'\(\*!objm2\*\)', Comment.Special),
182
+ # Aglet Extensions Dialect Tag
183
+ (r'\(\*!m2iso\+aglet\*\)', Comment.Special),
184
+ # GNU Extensions Dialect Tag
185
+ (r'\(\*!m2pim\+gm2\*\)', Comment.Special),
186
+ # p1 Extensions Dialect Tag
187
+ (r'\(\*!m2iso\+p1\*\)', Comment.Special),
188
+ # XDS Extensions Dialect Tag
189
+ (r'\(\*!m2iso\+xds\*\)', Comment.Special),
190
+ ],
191
+ 'identifiers': [
192
+ (r'([a-zA-Z_$][\w$]*)', Name),
193
+ ],
194
+ 'prefixed_number_literals': [
195
+ #
196
+ # Base-2, whole number
197
+ (r'0b[01]+(\'[01]+)*', Number.Bin),
198
+ #
199
+ # Base-16, whole number
200
+ (r'0[ux][0-9A-F]+(\'[0-9A-F]+)*', Number.Hex),
201
+ ],
202
+ 'plain_number_literals': [
203
+ #
204
+ # Base-10, real number with exponent
205
+ (r'[0-9]+(\'[0-9]+)*' # integral part
206
+ r'\.[0-9]+(\'[0-9]+)*' # fractional part
207
+ r'[eE][+-]?[0-9]+(\'[0-9]+)*', # exponent
208
+ Number.Float),
209
+ #
210
+ # Base-10, real number without exponent
211
+ (r'[0-9]+(\'[0-9]+)*' # integral part
212
+ r'\.[0-9]+(\'[0-9]+)*', # fractional part
213
+ Number.Float),
214
+ #
215
+ # Base-10, whole number
216
+ (r'[0-9]+(\'[0-9]+)*', Number.Integer),
217
+ ],
218
+ 'suffixed_number_literals': [
219
+ #
220
+ # Base-8, whole number
221
+ (r'[0-7]+B', Number.Oct),
222
+ #
223
+ # Base-8, character code
224
+ (r'[0-7]+C', Number.Oct),
225
+ #
226
+ # Base-16, number
227
+ (r'[0-9A-F]+H', Number.Hex),
228
+ ],
229
+ 'string_literals': [
230
+ (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
231
+ (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
232
+ ],
233
+ 'digraph_operators': [
234
+ # Dot Product Operator
235
+ (r'\*\.', Operator),
236
+ # Array Concatenation Operator
237
+ (r'\+>', Operator), # M2R10 + ObjM2
238
+ # Inequality Operator
239
+ (r'<>', Operator), # ISO + PIM
240
+ # Less-Or-Equal, Subset
241
+ (r'<=', Operator),
242
+ # Greater-Or-Equal, Superset
243
+ (r'>=', Operator),
244
+ # Identity Operator
245
+ (r'==', Operator), # M2R10 + ObjM2
246
+ # Type Conversion Operator
247
+ (r'::', Operator), # M2R10 + ObjM2
248
+ # Assignment Symbol
249
+ (r':=', Operator),
250
+ # Postfix Increment Mutator
251
+ (r'\+\+', Operator), # M2R10 + ObjM2
252
+ # Postfix Decrement Mutator
253
+ (r'--', Operator), # M2R10 + ObjM2
254
+ ],
255
+ 'unigraph_operators': [
256
+ # Arithmetic Operators
257
+ (r'[+-]', Operator),
258
+ (r'[*/]', Operator),
259
+ # ISO 80000-2 compliant Set Difference Operator
260
+ (r'\\', Operator), # M2R10 + ObjM2
261
+ # Relational Operators
262
+ (r'[=#<>]', Operator),
263
+ # Dereferencing Operator
264
+ (r'\^', Operator),
265
+ # Dereferencing Operator Synonym
266
+ (r'@', Operator), # ISO
267
+ # Logical AND Operator Synonym
268
+ (r'&', Operator), # PIM + ISO
269
+ # Logical NOT Operator Synonym
270
+ (r'~', Operator), # PIM + ISO
271
+ # Smalltalk Message Prefix
272
+ (r'`', Operator), # ObjM2
273
+ ],
274
+ 'digraph_punctuation': [
275
+ # Range Constructor
276
+ (r'\.\.', Punctuation),
277
+ # Opening Chevron Bracket
278
+ (r'<<', Punctuation), # M2R10 + ISO
279
+ # Closing Chevron Bracket
280
+ (r'>>', Punctuation), # M2R10 + ISO
281
+ # Blueprint Punctuation
282
+ (r'->', Punctuation), # M2R10 + ISO
283
+ # Distinguish |# and # in M2 R10
284
+ (r'\|#', Punctuation),
285
+ # Distinguish ## and # in M2 R10
286
+ (r'##', Punctuation),
287
+ # Distinguish |* and * in M2 R10
288
+ (r'\|\*', Punctuation),
289
+ ],
290
+ 'unigraph_punctuation': [
291
+ # Common Punctuation
292
+ (r'[()\[\]{},.:;|]', Punctuation),
293
+ # Case Label Separator Synonym
294
+ (r'!', Punctuation), # ISO
295
+ # Blueprint Punctuation
296
+ (r'\?', Punctuation), # M2R10 + ObjM2
297
+ ],
298
+ 'comments': [
299
+ # Single Line Comment
300
+ (r'^//.*?\n', Comment.Single), # M2R10 + ObjM2
301
+ # Block Comment
302
+ (r'\(\*([^$].*?)\*\)', Comment.Multiline),
303
+ # Template Block Comment
304
+ (r'/\*(.*?)\*/', Comment.Multiline), # M2R10 + ObjM2
305
+ ],
306
+ 'pragmas': [
307
+ # ISO Style Pragmas
308
+ (r'<\*.*?\*>', Comment.Preproc), # ISO, M2R10 + ObjM2
309
+ # Pascal Style Pragmas
310
+ (r'\(\*\$.*?\*\)', Comment.Preproc), # PIM
311
+ ],
312
+ 'root': [
313
+ include('whitespace'),
314
+ include('dialecttags'),
315
+ include('pragmas'),
316
+ include('comments'),
317
+ include('identifiers'),
318
+ include('suffixed_number_literals'), # PIM + ISO
319
+ include('prefixed_number_literals'), # M2R10 + ObjM2
320
+ include('plain_number_literals'),
321
+ include('string_literals'),
322
+ include('digraph_punctuation'),
323
+ include('digraph_operators'),
324
+ include('unigraph_punctuation'),
325
+ include('unigraph_operators'),
326
+ ]
327
+ }
328
+
329
+ # C o m m o n D a t a s e t s
330
+
331
+ # Common Reserved Words Dataset
332
+ common_reserved_words = (
333
+ # 37 common reserved words
334
+ 'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
335
+ 'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'FOR', 'FROM', 'IF',
336
+ 'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD', 'MODULE', 'NOT',
337
+ 'OF', 'OR', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN',
338
+ 'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE',
339
+ )
340
+
341
+ # Common Builtins Dataset
342
+ common_builtins = (
343
+ # 16 common builtins
344
+ 'ABS', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'FALSE', 'INTEGER',
345
+ 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NIL', 'ODD', 'ORD', 'REAL',
346
+ 'TRUE',
347
+ )
348
+
349
+ # Common Pseudo-Module Builtins Dataset
350
+ common_pseudo_builtins = (
351
+ # 4 common pseudo builtins
352
+ 'ADDRESS', 'BYTE', 'WORD', 'ADR'
353
+ )
354
+
355
+ # P I M M o d u l a - 2 D a t a s e t s
356
+
357
+ # Lexemes to Mark as Error Tokens for PIM Modula-2
358
+ pim_lexemes_to_reject = (
359
+ '!', '`', '@', '$', '%', '?', '\\', '==', '++', '--', '::', '*.',
360
+ '+>', '->', '<<', '>>', '|#', '##',
361
+ )
362
+
363
+ # PIM Modula-2 Additional Reserved Words Dataset
364
+ pim_additional_reserved_words = (
365
+ # 3 additional reserved words
366
+ 'EXPORT', 'QUALIFIED', 'WITH',
367
+ )
368
+
369
+ # PIM Modula-2 Additional Builtins Dataset
370
+ pim_additional_builtins = (
371
+ # 16 additional builtins
372
+ 'BITSET', 'CAP', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT', 'HALT', 'HIGH',
373
+ 'INC', 'INCL', 'NEW', 'NIL', 'PROC', 'SIZE', 'TRUNC', 'VAL',
374
+ )
375
+
376
+ # PIM Modula-2 Additional Pseudo-Module Builtins Dataset
377
+ pim_additional_pseudo_builtins = (
378
+ # 5 additional pseudo builtins
379
+ 'SYSTEM', 'PROCESS', 'TSIZE', 'NEWPROCESS', 'TRANSFER',
380
+ )
381
+
382
+ # I S O M o d u l a - 2 D a t a s e t s
383
+
384
+ # Lexemes to Mark as Error Tokens for ISO Modula-2
385
+ iso_lexemes_to_reject = (
386
+ '`', '$', '%', '?', '\\', '==', '++', '--', '::', '*.', '+>', '->',
387
+ '<<', '>>', '|#', '##',
388
+ )
389
+
390
+ # ISO Modula-2 Additional Reserved Words Dataset
391
+ iso_additional_reserved_words = (
392
+ # 9 additional reserved words (ISO 10514-1)
393
+ 'EXCEPT', 'EXPORT', 'FINALLY', 'FORWARD', 'PACKEDSET', 'QUALIFIED',
394
+ 'REM', 'RETRY', 'WITH',
395
+ # 10 additional reserved words (ISO 10514-2 & ISO 10514-3)
396
+ 'ABSTRACT', 'AS', 'CLASS', 'GUARD', 'INHERIT', 'OVERRIDE', 'READONLY',
397
+ 'REVEAL', 'TRACED', 'UNSAFEGUARDED',
398
+ )
399
+
400
+ # ISO Modula-2 Additional Builtins Dataset
401
+ iso_additional_builtins = (
402
+ # 26 additional builtins (ISO 10514-1)
403
+ 'BITSET', 'CAP', 'CMPLX', 'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT',
404
+ 'HALT', 'HIGH', 'IM', 'INC', 'INCL', 'INT', 'INTERRUPTIBLE', 'LENGTH',
405
+ 'LFLOAT', 'LONGCOMPLEX', 'NEW', 'PROC', 'PROTECTION', 'RE', 'SIZE',
406
+ 'TRUNC', 'UNINTERRUBTIBLE', 'VAL',
407
+ # 5 additional builtins (ISO 10514-2 & ISO 10514-3)
408
+ 'CREATE', 'DESTROY', 'EMPTY', 'ISMEMBER', 'SELF',
409
+ )
410
+
411
+ # ISO Modula-2 Additional Pseudo-Module Builtins Dataset
412
+ iso_additional_pseudo_builtins = (
413
+ # 14 additional builtins (SYSTEM)
414
+ 'SYSTEM', 'BITSPERLOC', 'LOCSPERBYTE', 'LOCSPERWORD', 'LOC',
415
+ 'ADDADR', 'SUBADR', 'DIFADR', 'MAKEADR', 'ADR',
416
+ 'ROTATE', 'SHIFT', 'CAST', 'TSIZE',
417
+ # 13 additional builtins (COROUTINES)
418
+ 'COROUTINES', 'ATTACH', 'COROUTINE', 'CURRENT', 'DETACH', 'HANDLER',
419
+ 'INTERRUPTSOURCE', 'IOTRANSFER', 'IsATTACHED', 'LISTEN',
420
+ 'NEWCOROUTINE', 'PROT', 'TRANSFER',
421
+ # 9 additional builtins (EXCEPTIONS)
422
+ 'EXCEPTIONS', 'AllocateSource', 'CurrentNumber', 'ExceptionNumber',
423
+ 'ExceptionSource', 'GetMessage', 'IsCurrentSource',
424
+ 'IsExceptionalExecution', 'RAISE',
425
+ # 3 additional builtins (TERMINATION)
426
+ 'TERMINATION', 'IsTerminating', 'HasHalted',
427
+ # 4 additional builtins (M2EXCEPTION)
428
+ 'M2EXCEPTION', 'M2Exceptions', 'M2Exception', 'IsM2Exception',
429
+ 'indexException', 'rangeException', 'caseSelectException',
430
+ 'invalidLocation', 'functionException', 'wholeValueException',
431
+ 'wholeDivException', 'realValueException', 'realDivException',
432
+ 'complexValueException', 'complexDivException', 'protException',
433
+ 'sysException', 'coException', 'exException',
434
+ )
435
+
436
+ # M o d u l a - 2 R 1 0 D a t a s e t s
437
+
438
+ # Lexemes to Mark as Error Tokens for Modula-2 R10
439
+ m2r10_lexemes_to_reject = (
440
+ '!', '`', '@', '$', '%', '&', '<>',
441
+ )
442
+
443
+ # Modula-2 R10 reserved words in addition to the common set
444
+ m2r10_additional_reserved_words = (
445
+ # 12 additional reserved words
446
+ 'ALIAS', 'ARGLIST', 'BLUEPRINT', 'COPY', 'GENLIB', 'INDETERMINATE',
447
+ 'NEW', 'NONE', 'OPAQUE', 'REFERENTIAL', 'RELEASE', 'RETAIN',
448
+ # 2 additional reserved words with symbolic assembly option
449
+ 'ASM', 'REG',
450
+ )
451
+
452
+ # Modula-2 R10 builtins in addition to the common set
453
+ m2r10_additional_builtins = (
454
+ # 26 additional builtins
455
+ 'CARDINAL', 'COUNT', 'EMPTY', 'EXISTS', 'INSERT', 'LENGTH', 'LONGCARD',
456
+ 'OCTET', 'PTR', 'PRED', 'READ', 'READNEW', 'REMOVE', 'RETRIEVE', 'SORT',
457
+ 'STORE', 'SUBSET', 'SUCC', 'TLIMIT', 'TMAX', 'TMIN', 'TRUE', 'TSIZE',
458
+ 'UNICHAR', 'WRITE', 'WRITEF',
459
+ )
460
+
461
+ # Modula-2 R10 Additional Pseudo-Module Builtins Dataset
462
+ m2r10_additional_pseudo_builtins = (
463
+ # 13 additional builtins (TPROPERTIES)
464
+ 'TPROPERTIES', 'PROPERTY', 'LITERAL', 'TPROPERTY', 'TLITERAL',
465
+ 'TBUILTIN', 'TDYN', 'TREFC', 'TNIL', 'TBASE', 'TPRECISION',
466
+ 'TMAXEXP', 'TMINEXP',
467
+ # 4 additional builtins (CONVERSION)
468
+ 'CONVERSION', 'TSXFSIZE', 'SXF', 'VAL',
469
+ # 35 additional builtins (UNSAFE)
470
+ 'UNSAFE', 'CAST', 'INTRINSIC', 'AVAIL', 'ADD', 'SUB', 'ADDC', 'SUBC',
471
+ 'FETCHADD', 'FETCHSUB', 'SHL', 'SHR', 'ASHR', 'ROTL', 'ROTR', 'ROTLC',
472
+ 'ROTRC', 'BWNOT', 'BWAND', 'BWOR', 'BWXOR', 'BWNAND', 'BWNOR',
473
+ 'SETBIT', 'TESTBIT', 'LSBIT', 'MSBIT', 'CSBITS', 'BAIL', 'HALT',
474
+ 'TODO', 'FFI', 'ADDR', 'VARGLIST', 'VARGC',
475
+ # 11 additional builtins (ATOMIC)
476
+ 'ATOMIC', 'INTRINSIC', 'AVAIL', 'SWAP', 'CAS', 'INC', 'DEC', 'BWAND',
477
+ 'BWNAND', 'BWOR', 'BWXOR',
478
+ # 7 additional builtins (COMPILER)
479
+ 'COMPILER', 'DEBUG', 'MODNAME', 'PROCNAME', 'LINENUM', 'DEFAULT',
480
+ 'HASH',
481
+ # 5 additional builtins (ASSEMBLER)
482
+ 'ASSEMBLER', 'REGISTER', 'SETREG', 'GETREG', 'CODE',
483
+ )
484
+
485
+ # O b j e c t i v e M o d u l a - 2 D a t a s e t s
486
+
487
+ # Lexemes to Mark as Error Tokens for Objective Modula-2
488
+ objm2_lexemes_to_reject = (
489
+ '!', '$', '%', '&', '<>',
490
+ )
491
+
492
+ # Objective Modula-2 Extensions
493
+ # reserved words in addition to Modula-2 R10
494
+ objm2_additional_reserved_words = (
495
+ # 16 additional reserved words
496
+ 'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD',
497
+ 'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC',
498
+ 'SUPER', 'TRY',
499
+ )
500
+
501
+ # Objective Modula-2 Extensions
502
+ # builtins in addition to Modula-2 R10
503
+ objm2_additional_builtins = (
504
+ # 3 additional builtins
505
+ 'OBJECT', 'NO', 'YES',
506
+ )
507
+
508
+ # Objective Modula-2 Extensions
509
+ # pseudo-module builtins in addition to Modula-2 R10
510
+ objm2_additional_pseudo_builtins = (
511
+ # None
512
+ )
513
+
514
+ # A g l e t M o d u l a - 2 D a t a s e t s
515
+
516
+ # Aglet Extensions
517
+ # reserved words in addition to ISO Modula-2
518
+ aglet_additional_reserved_words = (
519
+ # None
520
+ )
521
+
522
+ # Aglet Extensions
523
+ # builtins in addition to ISO Modula-2
524
+ aglet_additional_builtins = (
525
+ # 9 additional builtins
526
+ 'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
527
+ 'CARDINAL32', 'INTEGER8', 'INTEGER16', 'INTEGER32',
528
+ )
529
+
530
+ # Aglet Modula-2 Extensions
531
+ # pseudo-module builtins in addition to ISO Modula-2
532
+ aglet_additional_pseudo_builtins = (
533
+ # None
534
+ )
535
+
536
+ # G N U M o d u l a - 2 D a t a s e t s
537
+
538
+ # GNU Extensions
539
+ # reserved words in addition to PIM Modula-2
540
+ gm2_additional_reserved_words = (
541
+ # 10 additional reserved words
542
+ 'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__',
543
+ '__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE',
544
+ )
545
+
546
+ # GNU Extensions
547
+ # builtins in addition to PIM Modula-2
548
+ gm2_additional_builtins = (
549
+ # 21 additional builtins
550
+ 'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
551
+ 'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96',
552
+ 'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64',
553
+ 'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW',
554
+ )
555
+
556
+ # GNU Extensions
557
+ # pseudo-module builtins in addition to PIM Modula-2
558
+ gm2_additional_pseudo_builtins = (
559
+ # None
560
+ )
561
+
562
+ # p 1 M o d u l a - 2 D a t a s e t s
563
+
564
+ # p1 Extensions
565
+ # reserved words in addition to ISO Modula-2
566
+ p1_additional_reserved_words = (
567
+ # None
568
+ )
569
+
570
+ # p1 Extensions
571
+ # builtins in addition to ISO Modula-2
572
+ p1_additional_builtins = (
573
+ # None
574
+ )
575
+
576
+ # p1 Modula-2 Extensions
577
+ # pseudo-module builtins in addition to ISO Modula-2
578
+ p1_additional_pseudo_builtins = (
579
+ # 1 additional builtin
580
+ 'BCD',
581
+ )
582
+
583
+ # X D S M o d u l a - 2 D a t a s e t s
584
+
585
+ # XDS Extensions
586
+ # reserved words in addition to ISO Modula-2
587
+ xds_additional_reserved_words = (
588
+ # 1 additional reserved word
589
+ 'SEQ',
590
+ )
591
+
592
+ # XDS Extensions
593
+ # builtins in addition to ISO Modula-2
594
+ xds_additional_builtins = (
595
+ # 9 additional builtins
596
+ 'ASH', 'ASSERT', 'DIFFADR_TYPE', 'ENTIER', 'INDEX', 'LEN',
597
+ 'LONGCARD', 'SHORTCARD', 'SHORTINT',
598
+ )
599
+
600
+ # XDS Modula-2 Extensions
601
+ # pseudo-module builtins in addition to ISO Modula-2
602
+ xds_additional_pseudo_builtins = (
603
+ # 22 additional builtins (SYSTEM)
604
+ 'PROCESS', 'NEWPROCESS', 'BOOL8', 'BOOL16', 'BOOL32', 'CARD8',
605
+ 'CARD16', 'CARD32', 'INT8', 'INT16', 'INT32', 'REF', 'MOVE',
606
+ 'FILL', 'GET', 'PUT', 'CC', 'int', 'unsigned', 'size_t', 'void'
607
+ # 3 additional builtins (COMPILER)
608
+ 'COMPILER', 'OPTION', 'EQUATION'
609
+ )
610
+
611
+ # P I M S t a n d a r d L i b r a r y D a t a s e t s
612
+
613
+ # PIM Modula-2 Standard Library Modules Dataset
614
+ pim_stdlib_module_identifiers = (
615
+ 'Terminal', 'FileSystem', 'InOut', 'RealInOut', 'MathLib0', 'Storage',
616
+ )
617
+
618
+ # PIM Modula-2 Standard Library Types Dataset
619
+ pim_stdlib_type_identifiers = (
620
+ 'Flag', 'FlagSet', 'Response', 'Command', 'Lock', 'Permission',
621
+ 'MediumType', 'File', 'FileProc', 'DirectoryProc', 'FileCommand',
622
+ 'DirectoryCommand',
623
+ )
624
+
625
+ # PIM Modula-2 Standard Library Procedures Dataset
626
+ pim_stdlib_proc_identifiers = (
627
+ 'Read', 'BusyRead', 'ReadAgain', 'Write', 'WriteString', 'WriteLn',
628
+ 'Create', 'Lookup', 'Close', 'Delete', 'Rename', 'SetRead', 'SetWrite',
629
+ 'SetModify', 'SetOpen', 'Doio', 'SetPos', 'GetPos', 'Length', 'Reset',
630
+ 'Again', 'ReadWord', 'WriteWord', 'ReadChar', 'WriteChar',
631
+ 'CreateMedium', 'DeleteMedium', 'AssignName', 'DeassignName',
632
+ 'ReadMedium', 'LookupMedium', 'OpenInput', 'OpenOutput', 'CloseInput',
633
+ 'CloseOutput', 'ReadString', 'ReadInt', 'ReadCard', 'ReadWrd',
634
+ 'WriteInt', 'WriteCard', 'WriteOct', 'WriteHex', 'WriteWrd',
635
+ 'ReadReal', 'WriteReal', 'WriteFixPt', 'WriteRealOct', 'sqrt', 'exp',
636
+ 'ln', 'sin', 'cos', 'arctan', 'entier', 'ALLOCATE', 'DEALLOCATE',
637
+ )
638
+
639
+ # PIM Modula-2 Standard Library Variables Dataset
640
+ pim_stdlib_var_identifiers = (
641
+ 'Done', 'termCH', 'in', 'out'
642
+ )
643
+
644
+ # PIM Modula-2 Standard Library Constants Dataset
645
+ pim_stdlib_const_identifiers = (
646
+ 'EOL',
647
+ )
648
+
649
+ # I S O S t a n d a r d L i b r a r y D a t a s e t s
650
+
651
+ # ISO Modula-2 Standard Library Modules Dataset
652
+ iso_stdlib_module_identifiers = (
653
+ # TO DO
654
+ )
655
+
656
+ # ISO Modula-2 Standard Library Types Dataset
657
+ iso_stdlib_type_identifiers = (
658
+ # TO DO
659
+ )
660
+
661
+ # ISO Modula-2 Standard Library Procedures Dataset
662
+ iso_stdlib_proc_identifiers = (
663
+ # TO DO
664
+ )
665
+
666
+ # ISO Modula-2 Standard Library Variables Dataset
667
+ iso_stdlib_var_identifiers = (
668
+ # TO DO
669
+ )
670
+
671
+ # ISO Modula-2 Standard Library Constants Dataset
672
+ iso_stdlib_const_identifiers = (
673
+ # TO DO
674
+ )
675
+
676
+ # M 2 R 1 0 S t a n d a r d L i b r a r y D a t a s e t s
677
+
678
+ # Modula-2 R10 Standard Library ADTs Dataset
679
+ m2r10_stdlib_adt_identifiers = (
680
+ 'BCD', 'LONGBCD', 'BITSET', 'SHORTBITSET', 'LONGBITSET',
681
+ 'LONGLONGBITSET', 'COMPLEX', 'LONGCOMPLEX', 'SHORTCARD', 'LONGLONGCARD',
682
+ 'SHORTINT', 'LONGLONGINT', 'POSINT', 'SHORTPOSINT', 'LONGPOSINT',
683
+ 'LONGLONGPOSINT', 'BITSET8', 'BITSET16', 'BITSET32', 'BITSET64',
684
+ 'BITSET128', 'BS8', 'BS16', 'BS32', 'BS64', 'BS128', 'CARDINAL8',
685
+ 'CARDINAL16', 'CARDINAL32', 'CARDINAL64', 'CARDINAL128', 'CARD8',
686
+ 'CARD16', 'CARD32', 'CARD64', 'CARD128', 'INTEGER8', 'INTEGER16',
687
+ 'INTEGER32', 'INTEGER64', 'INTEGER128', 'INT8', 'INT16', 'INT32',
688
+ 'INT64', 'INT128', 'STRING', 'UNISTRING',
689
+ )
690
+
691
+ # Modula-2 R10 Standard Library Blueprints Dataset
692
+ m2r10_stdlib_blueprint_identifiers = (
693
+ 'ProtoRoot', 'ProtoComputational', 'ProtoNumeric', 'ProtoScalar',
694
+ 'ProtoNonScalar', 'ProtoCardinal', 'ProtoInteger', 'ProtoReal',
695
+ 'ProtoComplex', 'ProtoVector', 'ProtoTuple', 'ProtoCompArray',
696
+ 'ProtoCollection', 'ProtoStaticArray', 'ProtoStaticSet',
697
+ 'ProtoStaticString', 'ProtoArray', 'ProtoString', 'ProtoSet',
698
+ 'ProtoMultiSet', 'ProtoDictionary', 'ProtoMultiDict', 'ProtoExtension',
699
+ 'ProtoIO', 'ProtoCardMath', 'ProtoIntMath', 'ProtoRealMath',
700
+ )
701
+
702
+ # Modula-2 R10 Standard Library Modules Dataset
703
+ m2r10_stdlib_module_identifiers = (
704
+ 'ASCII', 'BooleanIO', 'CharIO', 'UnicharIO', 'OctetIO',
705
+ 'CardinalIO', 'LongCardIO', 'IntegerIO', 'LongIntIO', 'RealIO',
706
+ 'LongRealIO', 'BCDIO', 'LongBCDIO', 'CardMath', 'LongCardMath',
707
+ 'IntMath', 'LongIntMath', 'RealMath', 'LongRealMath', 'BCDMath',
708
+ 'LongBCDMath', 'FileIO', 'FileSystem', 'Storage', 'IOSupport',
709
+ )
710
+
711
+ # Modula-2 R10 Standard Library Types Dataset
712
+ m2r10_stdlib_type_identifiers = (
713
+ 'File', 'Status',
714
+ # TO BE COMPLETED
715
+ )
716
+
717
+ # Modula-2 R10 Standard Library Procedures Dataset
718
+ m2r10_stdlib_proc_identifiers = (
719
+ 'ALLOCATE', 'DEALLOCATE', 'SIZE',
720
+ # TO BE COMPLETED
721
+ )
722
+
723
+ # Modula-2 R10 Standard Library Variables Dataset
724
+ m2r10_stdlib_var_identifiers = (
725
+ 'stdIn', 'stdOut', 'stdErr',
726
+ )
727
+
728
+ # Modula-2 R10 Standard Library Constants Dataset
729
+ m2r10_stdlib_const_identifiers = (
730
+ 'pi', 'tau',
731
+ )
732
+
733
+ # D i a l e c t s
734
+
735
+ # Dialect modes
736
+ dialects = (
737
+ 'unknown',
738
+ 'm2pim', 'm2iso', 'm2r10', 'objm2',
739
+ 'm2iso+aglet', 'm2pim+gm2', 'm2iso+p1', 'm2iso+xds',
740
+ )
741
+
742
+ # D a t a b a s e s
743
+
744
+ # Lexemes to Mark as Errors Database
745
+ lexemes_to_reject_db = {
746
+ # Lexemes to reject for unknown dialect
747
+ 'unknown': (
748
+ # LEAVE THIS EMPTY
749
+ ),
750
+ # Lexemes to reject for PIM Modula-2
751
+ 'm2pim': (
752
+ pim_lexemes_to_reject,
753
+ ),
754
+ # Lexemes to reject for ISO Modula-2
755
+ 'm2iso': (
756
+ iso_lexemes_to_reject,
757
+ ),
758
+ # Lexemes to reject for Modula-2 R10
759
+ 'm2r10': (
760
+ m2r10_lexemes_to_reject,
761
+ ),
762
+ # Lexemes to reject for Objective Modula-2
763
+ 'objm2': (
764
+ objm2_lexemes_to_reject,
765
+ ),
766
+ # Lexemes to reject for Aglet Modula-2
767
+ 'm2iso+aglet': (
768
+ iso_lexemes_to_reject,
769
+ ),
770
+ # Lexemes to reject for GNU Modula-2
771
+ 'm2pim+gm2': (
772
+ pim_lexemes_to_reject,
773
+ ),
774
+ # Lexemes to reject for p1 Modula-2
775
+ 'm2iso+p1': (
776
+ iso_lexemes_to_reject,
777
+ ),
778
+ # Lexemes to reject for XDS Modula-2
779
+ 'm2iso+xds': (
780
+ iso_lexemes_to_reject,
781
+ ),
782
+ }
783
+
784
+ # Reserved Words Database
785
+ reserved_words_db = {
786
+ # Reserved words for unknown dialect
787
+ 'unknown': (
788
+ common_reserved_words,
789
+ pim_additional_reserved_words,
790
+ iso_additional_reserved_words,
791
+ m2r10_additional_reserved_words,
792
+ ),
793
+
794
+ # Reserved words for PIM Modula-2
795
+ 'm2pim': (
796
+ common_reserved_words,
797
+ pim_additional_reserved_words,
798
+ ),
799
+
800
+ # Reserved words for Modula-2 R10
801
+ 'm2iso': (
802
+ common_reserved_words,
803
+ iso_additional_reserved_words,
804
+ ),
805
+
806
+ # Reserved words for ISO Modula-2
807
+ 'm2r10': (
808
+ common_reserved_words,
809
+ m2r10_additional_reserved_words,
810
+ ),
811
+
812
+ # Reserved words for Objective Modula-2
813
+ 'objm2': (
814
+ common_reserved_words,
815
+ m2r10_additional_reserved_words,
816
+ objm2_additional_reserved_words,
817
+ ),
818
+
819
+ # Reserved words for Aglet Modula-2 Extensions
820
+ 'm2iso+aglet': (
821
+ common_reserved_words,
822
+ iso_additional_reserved_words,
823
+ aglet_additional_reserved_words,
824
+ ),
825
+
826
+ # Reserved words for GNU Modula-2 Extensions
827
+ 'm2pim+gm2': (
828
+ common_reserved_words,
829
+ pim_additional_reserved_words,
830
+ gm2_additional_reserved_words,
831
+ ),
832
+
833
+ # Reserved words for p1 Modula-2 Extensions
834
+ 'm2iso+p1': (
835
+ common_reserved_words,
836
+ iso_additional_reserved_words,
837
+ p1_additional_reserved_words,
838
+ ),
839
+
840
+ # Reserved words for XDS Modula-2 Extensions
841
+ 'm2iso+xds': (
842
+ common_reserved_words,
843
+ iso_additional_reserved_words,
844
+ xds_additional_reserved_words,
845
+ ),
846
+ }
847
+
848
+ # Builtins Database
849
+ builtins_db = {
850
+ # Builtins for unknown dialect
851
+ 'unknown': (
852
+ common_builtins,
853
+ pim_additional_builtins,
854
+ iso_additional_builtins,
855
+ m2r10_additional_builtins,
856
+ ),
857
+
858
+ # Builtins for PIM Modula-2
859
+ 'm2pim': (
860
+ common_builtins,
861
+ pim_additional_builtins,
862
+ ),
863
+
864
+ # Builtins for ISO Modula-2
865
+ 'm2iso': (
866
+ common_builtins,
867
+ iso_additional_builtins,
868
+ ),
869
+
870
+ # Builtins for ISO Modula-2
871
+ 'm2r10': (
872
+ common_builtins,
873
+ m2r10_additional_builtins,
874
+ ),
875
+
876
+ # Builtins for Objective Modula-2
877
+ 'objm2': (
878
+ common_builtins,
879
+ m2r10_additional_builtins,
880
+ objm2_additional_builtins,
881
+ ),
882
+
883
+ # Builtins for Aglet Modula-2 Extensions
884
+ 'm2iso+aglet': (
885
+ common_builtins,
886
+ iso_additional_builtins,
887
+ aglet_additional_builtins,
888
+ ),
889
+
890
+ # Builtins for GNU Modula-2 Extensions
891
+ 'm2pim+gm2': (
892
+ common_builtins,
893
+ pim_additional_builtins,
894
+ gm2_additional_builtins,
895
+ ),
896
+
897
+ # Builtins for p1 Modula-2 Extensions
898
+ 'm2iso+p1': (
899
+ common_builtins,
900
+ iso_additional_builtins,
901
+ p1_additional_builtins,
902
+ ),
903
+
904
+ # Builtins for XDS Modula-2 Extensions
905
+ 'm2iso+xds': (
906
+ common_builtins,
907
+ iso_additional_builtins,
908
+ xds_additional_builtins,
909
+ ),
910
+ }
911
+
912
+ # Pseudo-Module Builtins Database
913
+ pseudo_builtins_db = {
914
+ # Builtins for unknown dialect
915
+ 'unknown': (
916
+ common_pseudo_builtins,
917
+ pim_additional_pseudo_builtins,
918
+ iso_additional_pseudo_builtins,
919
+ m2r10_additional_pseudo_builtins,
920
+ ),
921
+
922
+ # Builtins for PIM Modula-2
923
+ 'm2pim': (
924
+ common_pseudo_builtins,
925
+ pim_additional_pseudo_builtins,
926
+ ),
927
+
928
+ # Builtins for ISO Modula-2
929
+ 'm2iso': (
930
+ common_pseudo_builtins,
931
+ iso_additional_pseudo_builtins,
932
+ ),
933
+
934
+ # Builtins for ISO Modula-2
935
+ 'm2r10': (
936
+ common_pseudo_builtins,
937
+ m2r10_additional_pseudo_builtins,
938
+ ),
939
+
940
+ # Builtins for Objective Modula-2
941
+ 'objm2': (
942
+ common_pseudo_builtins,
943
+ m2r10_additional_pseudo_builtins,
944
+ objm2_additional_pseudo_builtins,
945
+ ),
946
+
947
+ # Builtins for Aglet Modula-2 Extensions
948
+ 'm2iso+aglet': (
949
+ common_pseudo_builtins,
950
+ iso_additional_pseudo_builtins,
951
+ aglet_additional_pseudo_builtins,
952
+ ),
953
+
954
+ # Builtins for GNU Modula-2 Extensions
955
+ 'm2pim+gm2': (
956
+ common_pseudo_builtins,
957
+ pim_additional_pseudo_builtins,
958
+ gm2_additional_pseudo_builtins,
959
+ ),
960
+
961
+ # Builtins for p1 Modula-2 Extensions
962
+ 'm2iso+p1': (
963
+ common_pseudo_builtins,
964
+ iso_additional_pseudo_builtins,
965
+ p1_additional_pseudo_builtins,
966
+ ),
967
+
968
+ # Builtins for XDS Modula-2 Extensions
969
+ 'm2iso+xds': (
970
+ common_pseudo_builtins,
971
+ iso_additional_pseudo_builtins,
972
+ xds_additional_pseudo_builtins,
973
+ ),
974
+ }
975
+
976
+ # Standard Library ADTs Database
977
+ stdlib_adts_db = {
978
+ # Empty entry for unknown dialect
979
+ 'unknown': (
980
+ # LEAVE THIS EMPTY
981
+ ),
982
+ # Standard Library ADTs for PIM Modula-2
983
+ 'm2pim': (
984
+ # No first class library types
985
+ ),
986
+
987
+ # Standard Library ADTs for ISO Modula-2
988
+ 'm2iso': (
989
+ # No first class library types
990
+ ),
991
+
992
+ # Standard Library ADTs for Modula-2 R10
993
+ 'm2r10': (
994
+ m2r10_stdlib_adt_identifiers,
995
+ ),
996
+
997
+ # Standard Library ADTs for Objective Modula-2
998
+ 'objm2': (
999
+ m2r10_stdlib_adt_identifiers,
1000
+ ),
1001
+
1002
+ # Standard Library ADTs for Aglet Modula-2
1003
+ 'm2iso+aglet': (
1004
+ # No first class library types
1005
+ ),
1006
+
1007
+ # Standard Library ADTs for GNU Modula-2
1008
+ 'm2pim+gm2': (
1009
+ # No first class library types
1010
+ ),
1011
+
1012
+ # Standard Library ADTs for p1 Modula-2
1013
+ 'm2iso+p1': (
1014
+ # No first class library types
1015
+ ),
1016
+
1017
+ # Standard Library ADTs for XDS Modula-2
1018
+ 'm2iso+xds': (
1019
+ # No first class library types
1020
+ ),
1021
+ }
1022
+
1023
+ # Standard Library Modules Database
1024
+ stdlib_modules_db = {
1025
+ # Empty entry for unknown dialect
1026
+ 'unknown': (
1027
+ # LEAVE THIS EMPTY
1028
+ ),
1029
+ # Standard Library Modules for PIM Modula-2
1030
+ 'm2pim': (
1031
+ pim_stdlib_module_identifiers,
1032
+ ),
1033
+
1034
+ # Standard Library Modules for ISO Modula-2
1035
+ 'm2iso': (
1036
+ iso_stdlib_module_identifiers,
1037
+ ),
1038
+
1039
+ # Standard Library Modules for Modula-2 R10
1040
+ 'm2r10': (
1041
+ m2r10_stdlib_blueprint_identifiers,
1042
+ m2r10_stdlib_module_identifiers,
1043
+ m2r10_stdlib_adt_identifiers,
1044
+ ),
1045
+
1046
+ # Standard Library Modules for Objective Modula-2
1047
+ 'objm2': (
1048
+ m2r10_stdlib_blueprint_identifiers,
1049
+ m2r10_stdlib_module_identifiers,
1050
+ ),
1051
+
1052
+ # Standard Library Modules for Aglet Modula-2
1053
+ 'm2iso+aglet': (
1054
+ iso_stdlib_module_identifiers,
1055
+ ),
1056
+
1057
+ # Standard Library Modules for GNU Modula-2
1058
+ 'm2pim+gm2': (
1059
+ pim_stdlib_module_identifiers,
1060
+ ),
1061
+
1062
+ # Standard Library Modules for p1 Modula-2
1063
+ 'm2iso+p1': (
1064
+ iso_stdlib_module_identifiers,
1065
+ ),
1066
+
1067
+ # Standard Library Modules for XDS Modula-2
1068
+ 'm2iso+xds': (
1069
+ iso_stdlib_module_identifiers,
1070
+ ),
1071
+ }
1072
+
1073
+ # Standard Library Types Database
1074
+ stdlib_types_db = {
1075
+ # Empty entry for unknown dialect
1076
+ 'unknown': (
1077
+ # LEAVE THIS EMPTY
1078
+ ),
1079
+ # Standard Library Types for PIM Modula-2
1080
+ 'm2pim': (
1081
+ pim_stdlib_type_identifiers,
1082
+ ),
1083
+
1084
+ # Standard Library Types for ISO Modula-2
1085
+ 'm2iso': (
1086
+ iso_stdlib_type_identifiers,
1087
+ ),
1088
+
1089
+ # Standard Library Types for Modula-2 R10
1090
+ 'm2r10': (
1091
+ m2r10_stdlib_type_identifiers,
1092
+ ),
1093
+
1094
+ # Standard Library Types for Objective Modula-2
1095
+ 'objm2': (
1096
+ m2r10_stdlib_type_identifiers,
1097
+ ),
1098
+
1099
+ # Standard Library Types for Aglet Modula-2
1100
+ 'm2iso+aglet': (
1101
+ iso_stdlib_type_identifiers,
1102
+ ),
1103
+
1104
+ # Standard Library Types for GNU Modula-2
1105
+ 'm2pim+gm2': (
1106
+ pim_stdlib_type_identifiers,
1107
+ ),
1108
+
1109
+ # Standard Library Types for p1 Modula-2
1110
+ 'm2iso+p1': (
1111
+ iso_stdlib_type_identifiers,
1112
+ ),
1113
+
1114
+ # Standard Library Types for XDS Modula-2
1115
+ 'm2iso+xds': (
1116
+ iso_stdlib_type_identifiers,
1117
+ ),
1118
+ }
1119
+
1120
+ # Standard Library Procedures Database
1121
+ stdlib_procedures_db = {
1122
+ # Empty entry for unknown dialect
1123
+ 'unknown': (
1124
+ # LEAVE THIS EMPTY
1125
+ ),
1126
+ # Standard Library Procedures for PIM Modula-2
1127
+ 'm2pim': (
1128
+ pim_stdlib_proc_identifiers,
1129
+ ),
1130
+
1131
+ # Standard Library Procedures for ISO Modula-2
1132
+ 'm2iso': (
1133
+ iso_stdlib_proc_identifiers,
1134
+ ),
1135
+
1136
+ # Standard Library Procedures for Modula-2 R10
1137
+ 'm2r10': (
1138
+ m2r10_stdlib_proc_identifiers,
1139
+ ),
1140
+
1141
+ # Standard Library Procedures for Objective Modula-2
1142
+ 'objm2': (
1143
+ m2r10_stdlib_proc_identifiers,
1144
+ ),
1145
+
1146
+ # Standard Library Procedures for Aglet Modula-2
1147
+ 'm2iso+aglet': (
1148
+ iso_stdlib_proc_identifiers,
1149
+ ),
1150
+
1151
+ # Standard Library Procedures for GNU Modula-2
1152
+ 'm2pim+gm2': (
1153
+ pim_stdlib_proc_identifiers,
1154
+ ),
1155
+
1156
+ # Standard Library Procedures for p1 Modula-2
1157
+ 'm2iso+p1': (
1158
+ iso_stdlib_proc_identifiers,
1159
+ ),
1160
+
1161
+ # Standard Library Procedures for XDS Modula-2
1162
+ 'm2iso+xds': (
1163
+ iso_stdlib_proc_identifiers,
1164
+ ),
1165
+ }
1166
+
1167
+ # Standard Library Variables Database
1168
+ stdlib_variables_db = {
1169
+ # Empty entry for unknown dialect
1170
+ 'unknown': (
1171
+ # LEAVE THIS EMPTY
1172
+ ),
1173
+ # Standard Library Variables for PIM Modula-2
1174
+ 'm2pim': (
1175
+ pim_stdlib_var_identifiers,
1176
+ ),
1177
+
1178
+ # Standard Library Variables for ISO Modula-2
1179
+ 'm2iso': (
1180
+ iso_stdlib_var_identifiers,
1181
+ ),
1182
+
1183
+ # Standard Library Variables for Modula-2 R10
1184
+ 'm2r10': (
1185
+ m2r10_stdlib_var_identifiers,
1186
+ ),
1187
+
1188
+ # Standard Library Variables for Objective Modula-2
1189
+ 'objm2': (
1190
+ m2r10_stdlib_var_identifiers,
1191
+ ),
1192
+
1193
+ # Standard Library Variables for Aglet Modula-2
1194
+ 'm2iso+aglet': (
1195
+ iso_stdlib_var_identifiers,
1196
+ ),
1197
+
1198
+ # Standard Library Variables for GNU Modula-2
1199
+ 'm2pim+gm2': (
1200
+ pim_stdlib_var_identifiers,
1201
+ ),
1202
+
1203
+ # Standard Library Variables for p1 Modula-2
1204
+ 'm2iso+p1': (
1205
+ iso_stdlib_var_identifiers,
1206
+ ),
1207
+
1208
+ # Standard Library Variables for XDS Modula-2
1209
+ 'm2iso+xds': (
1210
+ iso_stdlib_var_identifiers,
1211
+ ),
1212
+ }
1213
+
1214
+ # Standard Library Constants Database
1215
+ stdlib_constants_db = {
1216
+ # Empty entry for unknown dialect
1217
+ 'unknown': (
1218
+ # LEAVE THIS EMPTY
1219
+ ),
1220
+ # Standard Library Constants for PIM Modula-2
1221
+ 'm2pim': (
1222
+ pim_stdlib_const_identifiers,
1223
+ ),
1224
+
1225
+ # Standard Library Constants for ISO Modula-2
1226
+ 'm2iso': (
1227
+ iso_stdlib_const_identifiers,
1228
+ ),
1229
+
1230
+ # Standard Library Constants for Modula-2 R10
1231
+ 'm2r10': (
1232
+ m2r10_stdlib_const_identifiers,
1233
+ ),
1234
+
1235
+ # Standard Library Constants for Objective Modula-2
1236
+ 'objm2': (
1237
+ m2r10_stdlib_const_identifiers,
1238
+ ),
1239
+
1240
+ # Standard Library Constants for Aglet Modula-2
1241
+ 'm2iso+aglet': (
1242
+ iso_stdlib_const_identifiers,
1243
+ ),
1244
+
1245
+ # Standard Library Constants for GNU Modula-2
1246
+ 'm2pim+gm2': (
1247
+ pim_stdlib_const_identifiers,
1248
+ ),
1249
+
1250
+ # Standard Library Constants for p1 Modula-2
1251
+ 'm2iso+p1': (
1252
+ iso_stdlib_const_identifiers,
1253
+ ),
1254
+
1255
+ # Standard Library Constants for XDS Modula-2
1256
+ 'm2iso+xds': (
1257
+ iso_stdlib_const_identifiers,
1258
+ ),
1259
+ }
1260
+
1261
+ # M e t h o d s
1262
+
1263
+ # initialise a lexer instance
1264
+ def __init__(self, **options):
1265
+ #
1266
+ # check dialect options
1267
+ #
1268
+ dialects = get_list_opt(options, 'dialect', [])
1269
+ #
1270
+ for dialect_option in dialects:
1271
+ if dialect_option in self.dialects[1:-1]:
1272
+ # valid dialect option found
1273
+ self.set_dialect(dialect_option)
1274
+ break
1275
+ #
1276
+ # Fallback Mode (DEFAULT)
1277
+ else:
1278
+ # no valid dialect option
1279
+ self.set_dialect('unknown')
1280
+ #
1281
+ self.dialect_set_by_tag = False
1282
+ #
1283
+ # check style options
1284
+ #
1285
+ styles = get_list_opt(options, 'style', [])
1286
+ #
1287
+ # use lowercase mode for Algol style
1288
+ if 'algol' in styles or 'algol_nu' in styles:
1289
+ self.algol_publication_mode = True
1290
+ else:
1291
+ self.algol_publication_mode = False
1292
+ #
1293
+ # Check option flags
1294
+ #
1295
+ self.treat_stdlib_adts_as_builtins = get_bool_opt(
1296
+ options, 'treat_stdlib_adts_as_builtins', True)
1297
+ #
1298
+ # call superclass initialiser
1299
+ RegexLexer.__init__(self, **options)
1300
+
1301
+ # Set lexer to a specified dialect
1302
+ def set_dialect(self, dialect_id):
1303
+ #
1304
+ # if __debug__:
1305
+ # print 'entered set_dialect with arg: ', dialect_id
1306
+ #
1307
+ # check dialect name against known dialects
1308
+ if dialect_id not in self.dialects:
1309
+ dialect = 'unknown' # default
1310
+ else:
1311
+ dialect = dialect_id
1312
+ #
1313
+ # compose lexemes to reject set
1314
+ lexemes_to_reject_set = set()
1315
+ # add each list of reject lexemes for this dialect
1316
+ for list in self.lexemes_to_reject_db[dialect]:
1317
+ lexemes_to_reject_set.update(set(list))
1318
+ #
1319
+ # compose reserved words set
1320
+ reswords_set = set()
1321
+ # add each list of reserved words for this dialect
1322
+ for list in self.reserved_words_db[dialect]:
1323
+ reswords_set.update(set(list))
1324
+ #
1325
+ # compose builtins set
1326
+ builtins_set = set()
1327
+ # add each list of builtins for this dialect excluding reserved words
1328
+ for list in self.builtins_db[dialect]:
1329
+ builtins_set.update(set(list).difference(reswords_set))
1330
+ #
1331
+ # compose pseudo-builtins set
1332
+ pseudo_builtins_set = set()
1333
+ # add each list of builtins for this dialect excluding reserved words
1334
+ for list in self.pseudo_builtins_db[dialect]:
1335
+ pseudo_builtins_set.update(set(list).difference(reswords_set))
1336
+ #
1337
+ # compose ADTs set
1338
+ adts_set = set()
1339
+ # add each list of ADTs for this dialect excluding reserved words
1340
+ for list in self.stdlib_adts_db[dialect]:
1341
+ adts_set.update(set(list).difference(reswords_set))
1342
+ #
1343
+ # compose modules set
1344
+ modules_set = set()
1345
+ # add each list of builtins for this dialect excluding builtins
1346
+ for list in self.stdlib_modules_db[dialect]:
1347
+ modules_set.update(set(list).difference(builtins_set))
1348
+ #
1349
+ # compose types set
1350
+ types_set = set()
1351
+ # add each list of types for this dialect excluding builtins
1352
+ for list in self.stdlib_types_db[dialect]:
1353
+ types_set.update(set(list).difference(builtins_set))
1354
+ #
1355
+ # compose procedures set
1356
+ procedures_set = set()
1357
+ # add each list of procedures for this dialect excluding builtins
1358
+ for list in self.stdlib_procedures_db[dialect]:
1359
+ procedures_set.update(set(list).difference(builtins_set))
1360
+ #
1361
+ # compose variables set
1362
+ variables_set = set()
1363
+ # add each list of variables for this dialect excluding builtins
1364
+ for list in self.stdlib_variables_db[dialect]:
1365
+ variables_set.update(set(list).difference(builtins_set))
1366
+ #
1367
+ # compose constants set
1368
+ constants_set = set()
1369
+ # add each list of constants for this dialect excluding builtins
1370
+ for list in self.stdlib_constants_db[dialect]:
1371
+ constants_set.update(set(list).difference(builtins_set))
1372
+ #
1373
+ # update lexer state
1374
+ self.dialect = dialect
1375
+ self.lexemes_to_reject = lexemes_to_reject_set
1376
+ self.reserved_words = reswords_set
1377
+ self.builtins = builtins_set
1378
+ self.pseudo_builtins = pseudo_builtins_set
1379
+ self.adts = adts_set
1380
+ self.modules = modules_set
1381
+ self.types = types_set
1382
+ self.procedures = procedures_set
1383
+ self.variables = variables_set
1384
+ self.constants = constants_set
1385
+ #
1386
+ # if __debug__:
1387
+ # print 'exiting set_dialect'
1388
+ # print ' self.dialect: ', self.dialect
1389
+ # print ' self.lexemes_to_reject: ', self.lexemes_to_reject
1390
+ # print ' self.reserved_words: ', self.reserved_words
1391
+ # print ' self.builtins: ', self.builtins
1392
+ # print ' self.pseudo_builtins: ', self.pseudo_builtins
1393
+ # print ' self.adts: ', self.adts
1394
+ # print ' self.modules: ', self.modules
1395
+ # print ' self.types: ', self.types
1396
+ # print ' self.procedures: ', self.procedures
1397
+ # print ' self.variables: ', self.variables
1398
+ # print ' self.types: ', self.types
1399
+ # print ' self.constants: ', self.constants
1400
+
1401
+ # Extracts a dialect name from a dialect tag comment string and checks
1402
+ # the extracted name against known dialects. If a match is found, the
1403
+ # matching name is returned, otherwise dialect id 'unknown' is returned
1404
+ def get_dialect_from_dialect_tag(self, dialect_tag):
1405
+ #
1406
+ # if __debug__:
1407
+ # print 'entered get_dialect_from_dialect_tag with arg: ', dialect_tag
1408
+ #
1409
+ # constants
1410
+ left_tag_delim = '(*!'
1411
+ right_tag_delim = '*)'
1412
+ left_tag_delim_len = len(left_tag_delim)
1413
+ right_tag_delim_len = len(right_tag_delim)
1414
+ indicator_start = left_tag_delim_len
1415
+ indicator_end = -(right_tag_delim_len)
1416
+ #
1417
+ # check comment string for dialect indicator
1418
+ if len(dialect_tag) > (left_tag_delim_len + right_tag_delim_len) \
1419
+ and dialect_tag.startswith(left_tag_delim) \
1420
+ and dialect_tag.endswith(right_tag_delim):
1421
+ #
1422
+ # if __debug__:
1423
+ # print 'dialect tag found'
1424
+ #
1425
+ # extract dialect indicator
1426
+ indicator = dialect_tag[indicator_start:indicator_end]
1427
+ #
1428
+ # if __debug__:
1429
+ # print 'extracted: ', indicator
1430
+ #
1431
+ # check against known dialects
1432
+ for index in range(1, len(self.dialects)):
1433
+ #
1434
+ # if __debug__:
1435
+ # print 'dialects[', index, ']: ', self.dialects[index]
1436
+ #
1437
+ if indicator == self.dialects[index]:
1438
+ #
1439
+ # if __debug__:
1440
+ # print 'matching dialect found'
1441
+ #
1442
+ # indicator matches known dialect
1443
+ return indicator
1444
+ else:
1445
+ # indicator does not match any dialect
1446
+ return 'unknown' # default
1447
+ else:
1448
+ # invalid indicator string
1449
+ return 'unknown' # default
1450
+
1451
+ # intercept the token stream, modify token attributes and return them
1452
+ def get_tokens_unprocessed(self, text):
1453
+ for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
1454
+ #
1455
+ # check for dialect tag if dialect has not been set by tag
1456
+ if not self.dialect_set_by_tag and token == Comment.Special:
1457
+ indicated_dialect = self.get_dialect_from_dialect_tag(value)
1458
+ if indicated_dialect != 'unknown':
1459
+ # token is a dialect indicator
1460
+ # reset reserved words and builtins
1461
+ self.set_dialect(indicated_dialect)
1462
+ self.dialect_set_by_tag = True
1463
+ #
1464
+ # check for reserved words, predefined and stdlib identifiers
1465
+ if token is Name:
1466
+ if value in self.reserved_words:
1467
+ token = Keyword.Reserved
1468
+ if self.algol_publication_mode:
1469
+ value = value.lower()
1470
+ #
1471
+ elif value in self.builtins:
1472
+ token = Name.Builtin
1473
+ if self.algol_publication_mode:
1474
+ value = value.lower()
1475
+ #
1476
+ elif value in self.pseudo_builtins:
1477
+ token = Name.Builtin.Pseudo
1478
+ if self.algol_publication_mode:
1479
+ value = value.lower()
1480
+ #
1481
+ elif value in self.adts:
1482
+ if not self.treat_stdlib_adts_as_builtins:
1483
+ token = Name.Namespace
1484
+ else:
1485
+ token = Name.Builtin.Pseudo
1486
+ if self.algol_publication_mode:
1487
+ value = value.lower()
1488
+ #
1489
+ elif value in self.modules:
1490
+ token = Name.Namespace
1491
+ #
1492
+ elif value in self.types:
1493
+ token = Name.Class
1494
+ #
1495
+ elif value in self.procedures:
1496
+ token = Name.Function
1497
+ #
1498
+ elif value in self.variables:
1499
+ token = Name.Variable
1500
+ #
1501
+ elif value in self.constants:
1502
+ token = Name.Constant
1503
+ #
1504
+ elif token in Number:
1505
+ #
1506
+ # mark prefix number literals as error for PIM and ISO dialects
1507
+ if self.dialect not in ('unknown', 'm2r10', 'objm2'):
1508
+ if "'" in value or value[0:2] in ('0b', '0x', '0u'):
1509
+ token = Error
1510
+ #
1511
+ elif self.dialect in ('m2r10', 'objm2'):
1512
+ # mark base-8 number literals as errors for M2 R10 and ObjM2
1513
+ if token is Number.Oct:
1514
+ token = Error
1515
+ # mark suffix base-16 literals as errors for M2 R10 and ObjM2
1516
+ elif token is Number.Hex and 'H' in value:
1517
+ token = Error
1518
+ # mark real numbers with E as errors for M2 R10 and ObjM2
1519
+ elif token is Number.Float and 'E' in value:
1520
+ token = Error
1521
+ #
1522
+ elif token in Comment:
1523
+ #
1524
+ # mark single line comment as error for PIM and ISO dialects
1525
+ if token is Comment.Single:
1526
+ if self.dialect not in ('unknown', 'm2r10', 'objm2'):
1527
+ token = Error
1528
+ #
1529
+ if token is Comment.Preproc:
1530
+ # mark ISO pragma as error for PIM dialects
1531
+ if value.startswith('<*') and \
1532
+ self.dialect.startswith('m2pim'):
1533
+ token = Error
1534
+ # mark PIM pragma as comment for other dialects
1535
+ elif value.startswith('(*$') and \
1536
+ self.dialect != 'unknown' and \
1537
+ not self.dialect.startswith('m2pim'):
1538
+ token = Comment.Multiline
1539
+ #
1540
+ else: # token is neither Name nor Comment
1541
+ #
1542
+ # mark lexemes matching the dialect's error token set as errors
1543
+ if value in self.lexemes_to_reject:
1544
+ token = Error
1545
+ #
1546
+ # substitute lexemes when in Algol mode
1547
+ if self.algol_publication_mode:
1548
+ if value == '#':
1549
+ value = '≠'
1550
+ elif value == '<=':
1551
+ value = '≤'
1552
+ elif value == '>=':
1553
+ value = '≥'
1554
+ elif value == '==':
1555
+ value = '≡'
1556
+ elif value == '*.':
1557
+ value = '•'
1558
+
1559
+ # return result
1560
+ yield index, token, value
1561
+
1562
+ def analyse_text(text):
1563
+ """It's Pascal-like, but does not use FUNCTION -- uses PROCEDURE
1564
+ instead."""
1565
+
1566
+ # Check if this looks like Pascal, if not, bail out early
1567
+ if not ('(*' in text and '*)' in text and ':=' in text):
1568
+ return
1569
+
1570
+ result = 0
1571
+ # Procedure is in Modula2
1572
+ if re.search(r'\bPROCEDURE\b', text):
1573
+ result += 0.6
1574
+
1575
+ # FUNCTION is only valid in Pascal, but not in Modula2
1576
+ if re.search(r'\bFUNCTION\b', text):
1577
+ result = 0.0
1578
+
1579
+ return result
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mojo.py ADDED
@@ -0,0 +1,707 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.mojo
3
+ ~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for Mojo and related languages.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import keyword
12
+
13
+ from pygments import unistring as uni
14
+ from pygments.lexer import (
15
+ RegexLexer,
16
+ bygroups,
17
+ combined,
18
+ default,
19
+ include,
20
+ this,
21
+ using,
22
+ words,
23
+ )
24
+ from pygments.token import (
25
+ Comment,
26
+ # Error,
27
+ Keyword,
28
+ Name,
29
+ Number,
30
+ Operator,
31
+ Punctuation,
32
+ String,
33
+ Text,
34
+ Whitespace,
35
+ )
36
+ from pygments.util import shebang_matches
37
+
38
+ __all__ = ["MojoLexer"]
39
+
40
+
41
+ class MojoLexer(RegexLexer):
42
+ """
43
+ For Mojo source code (version 24.2.1).
44
+ """
45
+
46
+ name = "Mojo"
47
+ url = "https://docs.modular.com/mojo/"
48
+ aliases = ["mojo", "🔥"]
49
+ filenames = [
50
+ "*.mojo",
51
+ "*.🔥",
52
+ ]
53
+ mimetypes = [
54
+ "text/x-mojo",
55
+ "application/x-mojo",
56
+ ]
57
+ version_added = "2.18"
58
+
59
+ uni_name = f"[{uni.xid_start}][{uni.xid_continue}]*"
60
+
61
+ def innerstring_rules(ttype):
62
+ return [
63
+ # the old style '%s' % (...) string formatting (still valid in Py3)
64
+ (
65
+ r"%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?"
66
+ "[hlL]?[E-GXc-giorsaux%]",
67
+ String.Interpol,
68
+ ),
69
+ # the new style '{}'.format(...) string formatting
70
+ (
71
+ r"\{"
72
+ r"((\w+)((\.\w+)|(\[[^\]]+\]))*)?" # field name
73
+ r"(\![sra])?" # conversion
74
+ r"(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?"
75
+ r"\}",
76
+ String.Interpol,
77
+ ),
78
+ # backslashes, quotes and formatting signs must be parsed one at a time
79
+ (r'[^\\\'"%{\n]+', ttype),
80
+ (r'[\'"\\]', ttype),
81
+ # unhandled string formatting sign
82
+ (r"%|(\{{1,2})", ttype),
83
+ # newlines are an error (use "nl" state)
84
+ ]
85
+
86
+ def fstring_rules(ttype):
87
+ return [
88
+ # Assuming that a '}' is the closing brace after format specifier.
89
+ # Sadly, this means that we won't detect syntax error. But it's
90
+ # more important to parse correct syntax correctly, than to
91
+ # highlight invalid syntax.
92
+ (r"\}", String.Interpol),
93
+ (r"\{", String.Interpol, "expr-inside-fstring"),
94
+ # backslashes, quotes and formatting signs must be parsed one at a time
95
+ (r'[^\\\'"{}\n]+', ttype),
96
+ (r'[\'"\\]', ttype),
97
+ # newlines are an error (use "nl" state)
98
+ ]
99
+
100
+ tokens = {
101
+ "root": [
102
+ (r"\s+", Whitespace),
103
+ (
104
+ r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
105
+ bygroups(Whitespace, String.Affix, String.Doc),
106
+ ),
107
+ (
108
+ r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
109
+ bygroups(Whitespace, String.Affix, String.Doc),
110
+ ),
111
+ (r"\A#!.+$", Comment.Hashbang),
112
+ (r"#.*$", Comment.Single),
113
+ (r"\\\n", Whitespace),
114
+ (r"\\", Whitespace),
115
+ include("keywords"),
116
+ include("soft-keywords"),
117
+ # In the original PR, all the below here used ((?:\s|\\\s)+) to
118
+ # designate whitespace, but I can't find any example of this being
119
+ # needed in the example file, so we're replacing it with `\s+`.
120
+ (
121
+ r"(alias)(\s+)",
122
+ bygroups(Keyword, Whitespace),
123
+ "varname", # TODO varname the right fit?
124
+ ),
125
+ (r"(var)(\s+)", bygroups(Keyword, Whitespace), "varname"),
126
+ (r"(def)(\s+)", bygroups(Keyword, Whitespace), "funcname"),
127
+ (r"(fn)(\s+)", bygroups(Keyword, Whitespace), "funcname"),
128
+ (
129
+ r"(class)(\s+)",
130
+ bygroups(Keyword, Whitespace),
131
+ "classname",
132
+ ), # not implemented yet
133
+ (r"(struct)(\s+)", bygroups(Keyword, Whitespace), "structname"),
134
+ (r"(trait)(\s+)", bygroups(Keyword, Whitespace), "structname"),
135
+ (r"(from)(\s+)", bygroups(Keyword.Namespace, Whitespace), "fromimport"),
136
+ (r"(import)(\s+)", bygroups(Keyword.Namespace, Whitespace), "import"),
137
+ include("expr"),
138
+ ],
139
+ "expr": [
140
+ # raw f-strings
141
+ (
142
+ '(?i)(rf|fr)(""")',
143
+ bygroups(String.Affix, String.Double),
144
+ combined("rfstringescape", "tdqf"),
145
+ ),
146
+ (
147
+ "(?i)(rf|fr)(''')",
148
+ bygroups(String.Affix, String.Single),
149
+ combined("rfstringescape", "tsqf"),
150
+ ),
151
+ (
152
+ '(?i)(rf|fr)(")',
153
+ bygroups(String.Affix, String.Double),
154
+ combined("rfstringescape", "dqf"),
155
+ ),
156
+ (
157
+ "(?i)(rf|fr)(')",
158
+ bygroups(String.Affix, String.Single),
159
+ combined("rfstringescape", "sqf"),
160
+ ),
161
+ # non-raw f-strings
162
+ (
163
+ '([fF])(""")',
164
+ bygroups(String.Affix, String.Double),
165
+ combined("fstringescape", "tdqf"),
166
+ ),
167
+ (
168
+ "([fF])(''')",
169
+ bygroups(String.Affix, String.Single),
170
+ combined("fstringescape", "tsqf"),
171
+ ),
172
+ (
173
+ '([fF])(")',
174
+ bygroups(String.Affix, String.Double),
175
+ combined("fstringescape", "dqf"),
176
+ ),
177
+ (
178
+ "([fF])(')",
179
+ bygroups(String.Affix, String.Single),
180
+ combined("fstringescape", "sqf"),
181
+ ),
182
+ # raw bytes and strings
183
+ ('(?i)(rb|br|r)(""")', bygroups(String.Affix, String.Double), "tdqs"),
184
+ ("(?i)(rb|br|r)(''')", bygroups(String.Affix, String.Single), "tsqs"),
185
+ ('(?i)(rb|br|r)(")', bygroups(String.Affix, String.Double), "dqs"),
186
+ ("(?i)(rb|br|r)(')", bygroups(String.Affix, String.Single), "sqs"),
187
+ # non-raw strings
188
+ (
189
+ '([uU]?)(""")',
190
+ bygroups(String.Affix, String.Double),
191
+ combined("stringescape", "tdqs"),
192
+ ),
193
+ (
194
+ "([uU]?)(''')",
195
+ bygroups(String.Affix, String.Single),
196
+ combined("stringescape", "tsqs"),
197
+ ),
198
+ (
199
+ '([uU]?)(")',
200
+ bygroups(String.Affix, String.Double),
201
+ combined("stringescape", "dqs"),
202
+ ),
203
+ (
204
+ "([uU]?)(')",
205
+ bygroups(String.Affix, String.Single),
206
+ combined("stringescape", "sqs"),
207
+ ),
208
+ # non-raw bytes
209
+ (
210
+ '([bB])(""")',
211
+ bygroups(String.Affix, String.Double),
212
+ combined("bytesescape", "tdqs"),
213
+ ),
214
+ (
215
+ "([bB])(''')",
216
+ bygroups(String.Affix, String.Single),
217
+ combined("bytesescape", "tsqs"),
218
+ ),
219
+ (
220
+ '([bB])(")',
221
+ bygroups(String.Affix, String.Double),
222
+ combined("bytesescape", "dqs"),
223
+ ),
224
+ (
225
+ "([bB])(')",
226
+ bygroups(String.Affix, String.Single),
227
+ combined("bytesescape", "sqs"),
228
+ ),
229
+ (r"[^\S\n]+", Text),
230
+ include("numbers"),
231
+ (r"!=|==|<<|>>|:=|[-~+/*%=<>&^|.]", Operator),
232
+ (r"([]{}:\(\),;[])+", Punctuation),
233
+ (r"(in|is|and|or|not)\b", Operator.Word),
234
+ include("expr-keywords"),
235
+ include("builtins"),
236
+ include("magicfuncs"),
237
+ include("magicvars"),
238
+ include("name"),
239
+ ],
240
+ "expr-inside-fstring": [
241
+ (r"[{([]", Punctuation, "expr-inside-fstring-inner"),
242
+ # without format specifier
243
+ (
244
+ r"(=\s*)?" # debug (https://bugs.python.org/issue36817)
245
+ r"(\![sraf])?" # conversion
246
+ r"\}",
247
+ String.Interpol,
248
+ "#pop",
249
+ ),
250
+ # with format specifier
251
+ # we'll catch the remaining '}' in the outer scope
252
+ (
253
+ r"(=\s*)?" # debug (https://bugs.python.org/issue36817)
254
+ r"(\![sraf])?" # conversion
255
+ r":",
256
+ String.Interpol,
257
+ "#pop",
258
+ ),
259
+ (r"\s+", Whitespace), # allow new lines
260
+ include("expr"),
261
+ ],
262
+ "expr-inside-fstring-inner": [
263
+ (r"[{([]", Punctuation, "expr-inside-fstring-inner"),
264
+ (r"[])}]", Punctuation, "#pop"),
265
+ (r"\s+", Whitespace), # allow new lines
266
+ include("expr"),
267
+ ],
268
+ "expr-keywords": [
269
+ # Based on https://docs.python.org/3/reference/expressions.html
270
+ (
271
+ words(
272
+ (
273
+ "async for", # TODO https://docs.modular.com/mojo/roadmap#no-async-for-or-async-with
274
+ "async with", # TODO https://docs.modular.com/mojo/roadmap#no-async-for-or-async-with
275
+ "await",
276
+ "else",
277
+ "for",
278
+ "if",
279
+ "lambda",
280
+ "yield",
281
+ "yield from",
282
+ ),
283
+ suffix=r"\b",
284
+ ),
285
+ Keyword,
286
+ ),
287
+ (words(("True", "False", "None"), suffix=r"\b"), Keyword.Constant),
288
+ ],
289
+ "keywords": [
290
+ (
291
+ words(
292
+ (
293
+ "assert",
294
+ "async",
295
+ "await",
296
+ "borrowed",
297
+ "break",
298
+ "continue",
299
+ "del",
300
+ "elif",
301
+ "else",
302
+ "except",
303
+ "finally",
304
+ "for",
305
+ "global",
306
+ "if",
307
+ "lambda",
308
+ "pass",
309
+ "raise",
310
+ "nonlocal",
311
+ "return",
312
+ "try",
313
+ "while",
314
+ "yield",
315
+ "yield from",
316
+ "as",
317
+ "with",
318
+ ),
319
+ suffix=r"\b",
320
+ ),
321
+ Keyword,
322
+ ),
323
+ (words(("True", "False", "None"), suffix=r"\b"), Keyword.Constant),
324
+ ],
325
+ "soft-keywords": [
326
+ # `match`, `case` and `_` soft keywords
327
+ (
328
+ r"(^[ \t]*)" # at beginning of line + possible indentation
329
+ r"(match|case)\b" # a possible keyword
330
+ r"(?![ \t]*(?:" # not followed by...
331
+ r"[:,;=^&|@~)\]}]|(?:" + # characters and keywords that mean this isn't
332
+ # pattern matching (but None/True/False is ok)
333
+ r"|".join(k for k in keyword.kwlist if k[0].islower())
334
+ + r")\b))",
335
+ bygroups(Whitespace, Keyword),
336
+ "soft-keywords-inner",
337
+ ),
338
+ ],
339
+ "soft-keywords-inner": [
340
+ # optional `_` keyword
341
+ (r"(\s+)([^\n_]*)(_\b)", bygroups(Whitespace, using(this), Keyword)),
342
+ default("#pop"),
343
+ ],
344
+ "builtins": [
345
+ (
346
+ words(
347
+ (
348
+ "__import__",
349
+ "abs",
350
+ "aiter",
351
+ "all",
352
+ "any",
353
+ "bin",
354
+ "bool",
355
+ "bytearray",
356
+ "breakpoint",
357
+ "bytes",
358
+ "callable",
359
+ "chr",
360
+ "classmethod",
361
+ "compile",
362
+ "complex",
363
+ "delattr",
364
+ "dict",
365
+ "dir",
366
+ "divmod",
367
+ "enumerate",
368
+ "eval",
369
+ "filter",
370
+ "float",
371
+ "format",
372
+ "frozenset",
373
+ "getattr",
374
+ "globals",
375
+ "hasattr",
376
+ "hash",
377
+ "hex",
378
+ "id",
379
+ "input",
380
+ "int",
381
+ "isinstance",
382
+ "issubclass",
383
+ "iter",
384
+ "len",
385
+ "list",
386
+ "locals",
387
+ "map",
388
+ "max",
389
+ "memoryview",
390
+ "min",
391
+ "next",
392
+ "object",
393
+ "oct",
394
+ "open",
395
+ "ord",
396
+ "pow",
397
+ "print",
398
+ "property",
399
+ "range",
400
+ "repr",
401
+ "reversed",
402
+ "round",
403
+ "set",
404
+ "setattr",
405
+ "slice",
406
+ "sorted",
407
+ "staticmethod",
408
+ "str",
409
+ "sum",
410
+ "super",
411
+ "tuple",
412
+ "type",
413
+ "vars",
414
+ "zip",
415
+ # Mojo builtin types: https://docs.modular.com/mojo/stdlib/builtin/
416
+ "AnyType",
417
+ "Coroutine",
418
+ "DType",
419
+ "Error",
420
+ "Int",
421
+ "List",
422
+ "ListLiteral",
423
+ "Scalar",
424
+ "Int8",
425
+ "UInt8",
426
+ "Int16",
427
+ "UInt16",
428
+ "Int32",
429
+ "UInt32",
430
+ "Int64",
431
+ "UInt64",
432
+ "BFloat16",
433
+ "Float16",
434
+ "Float32",
435
+ "Float64",
436
+ "SIMD",
437
+ "String",
438
+ "Tensor",
439
+ "Tuple",
440
+ "Movable",
441
+ "Copyable",
442
+ "CollectionElement",
443
+ ),
444
+ prefix=r"(?<!\.)",
445
+ suffix=r"\b",
446
+ ),
447
+ Name.Builtin,
448
+ ),
449
+ (r"(?<!\.)(self|Ellipsis|NotImplemented|cls)\b", Name.Builtin.Pseudo),
450
+ (
451
+ words(
452
+ ("Error",),
453
+ prefix=r"(?<!\.)",
454
+ suffix=r"\b",
455
+ ),
456
+ Name.Exception,
457
+ ),
458
+ ],
459
+ "magicfuncs": [
460
+ (
461
+ words(
462
+ (
463
+ "__abs__",
464
+ "__add__",
465
+ "__aenter__",
466
+ "__aexit__",
467
+ "__aiter__",
468
+ "__and__",
469
+ "__anext__",
470
+ "__await__",
471
+ "__bool__",
472
+ "__bytes__",
473
+ "__call__",
474
+ "__complex__",
475
+ "__contains__",
476
+ "__del__",
477
+ "__delattr__",
478
+ "__delete__",
479
+ "__delitem__",
480
+ "__dir__",
481
+ "__divmod__",
482
+ "__enter__",
483
+ "__eq__",
484
+ "__exit__",
485
+ "__float__",
486
+ "__floordiv__",
487
+ "__format__",
488
+ "__ge__",
489
+ "__get__",
490
+ "__getattr__",
491
+ "__getattribute__",
492
+ "__getitem__",
493
+ "__gt__",
494
+ "__hash__",
495
+ "__iadd__",
496
+ "__iand__",
497
+ "__ifloordiv__",
498
+ "__ilshift__",
499
+ "__imatmul__",
500
+ "__imod__",
501
+ "__imul__",
502
+ "__index__",
503
+ "__init__",
504
+ "__instancecheck__",
505
+ "__int__",
506
+ "__invert__",
507
+ "__ior__",
508
+ "__ipow__",
509
+ "__irshift__",
510
+ "__isub__",
511
+ "__iter__",
512
+ "__itruediv__",
513
+ "__ixor__",
514
+ "__le__",
515
+ "__len__",
516
+ "__length_hint__",
517
+ "__lshift__",
518
+ "__lt__",
519
+ "__matmul__",
520
+ "__missing__",
521
+ "__mod__",
522
+ "__mul__",
523
+ "__ne__",
524
+ "__neg__",
525
+ "__new__",
526
+ "__next__",
527
+ "__or__",
528
+ "__pos__",
529
+ "__pow__",
530
+ "__prepare__",
531
+ "__radd__",
532
+ "__rand__",
533
+ "__rdivmod__",
534
+ "__repr__",
535
+ "__reversed__",
536
+ "__rfloordiv__",
537
+ "__rlshift__",
538
+ "__rmatmul__",
539
+ "__rmod__",
540
+ "__rmul__",
541
+ "__ror__",
542
+ "__round__",
543
+ "__rpow__",
544
+ "__rrshift__",
545
+ "__rshift__",
546
+ "__rsub__",
547
+ "__rtruediv__",
548
+ "__rxor__",
549
+ "__set__",
550
+ "__setattr__",
551
+ "__setitem__",
552
+ "__str__",
553
+ "__sub__",
554
+ "__subclasscheck__",
555
+ "__truediv__",
556
+ "__xor__",
557
+ ),
558
+ suffix=r"\b",
559
+ ),
560
+ Name.Function.Magic,
561
+ ),
562
+ ],
563
+ "magicvars": [
564
+ (
565
+ words(
566
+ (
567
+ "__annotations__",
568
+ "__bases__",
569
+ "__class__",
570
+ "__closure__",
571
+ "__code__",
572
+ "__defaults__",
573
+ "__dict__",
574
+ "__doc__",
575
+ "__file__",
576
+ "__func__",
577
+ "__globals__",
578
+ "__kwdefaults__",
579
+ "__module__",
580
+ "__mro__",
581
+ "__name__",
582
+ "__objclass__",
583
+ "__qualname__",
584
+ "__self__",
585
+ "__slots__",
586
+ "__weakref__",
587
+ ),
588
+ suffix=r"\b",
589
+ ),
590
+ Name.Variable.Magic,
591
+ ),
592
+ ],
593
+ "numbers": [
594
+ (
595
+ r"(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)"
596
+ r"([eE][+-]?\d(?:_?\d)*)?",
597
+ Number.Float,
598
+ ),
599
+ (r"\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?", Number.Float),
600
+ (r"0[oO](?:_?[0-7])+", Number.Oct),
601
+ (r"0[bB](?:_?[01])+", Number.Bin),
602
+ (r"0[xX](?:_?[a-fA-F0-9])+", Number.Hex),
603
+ (r"\d(?:_?\d)*", Number.Integer),
604
+ ],
605
+ "name": [
606
+ (r"@" + uni_name, Name.Decorator),
607
+ (r"@", Operator), # new matrix multiplication operator
608
+ (uni_name, Name),
609
+ ],
610
+ "varname": [
611
+ (uni_name, Name.Variable, "#pop"),
612
+ ],
613
+ "funcname": [
614
+ include("magicfuncs"),
615
+ (uni_name, Name.Function, "#pop"),
616
+ default("#pop"),
617
+ ],
618
+ "classname": [
619
+ (uni_name, Name.Class, "#pop"),
620
+ ],
621
+ "structname": [
622
+ (uni_name, Name.Struct, "#pop"),
623
+ ],
624
+ "import": [
625
+ (r"(\s+)(as)(\s+)", bygroups(Whitespace, Keyword, Whitespace)),
626
+ (r"\.", Name.Namespace),
627
+ (uni_name, Name.Namespace),
628
+ (r"(\s*)(,)(\s*)", bygroups(Whitespace, Operator, Whitespace)),
629
+ default("#pop"), # all else: go back
630
+ ],
631
+ "fromimport": [
632
+ (r"(\s+)(import)\b", bygroups(Whitespace, Keyword.Namespace), "#pop"),
633
+ (r"\.", Name.Namespace),
634
+ # if None occurs here, it's "raise x from None", since None can
635
+ # never be a module name
636
+ (r"None\b", Keyword.Constant, "#pop"),
637
+ (uni_name, Name.Namespace),
638
+ default("#pop"),
639
+ ],
640
+ "rfstringescape": [
641
+ (r"\{\{", String.Escape),
642
+ (r"\}\}", String.Escape),
643
+ ],
644
+ "fstringescape": [
645
+ include("rfstringescape"),
646
+ include("stringescape"),
647
+ ],
648
+ "bytesescape": [
649
+ (r'\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
650
+ ],
651
+ "stringescape": [
652
+ (r"\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})", String.Escape),
653
+ include("bytesescape"),
654
+ ],
655
+ "fstrings-single": fstring_rules(String.Single),
656
+ "fstrings-double": fstring_rules(String.Double),
657
+ "strings-single": innerstring_rules(String.Single),
658
+ "strings-double": innerstring_rules(String.Double),
659
+ "dqf": [
660
+ (r'"', String.Double, "#pop"),
661
+ (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
662
+ include("fstrings-double"),
663
+ ],
664
+ "sqf": [
665
+ (r"'", String.Single, "#pop"),
666
+ (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
667
+ include("fstrings-single"),
668
+ ],
669
+ "dqs": [
670
+ (r'"', String.Double, "#pop"),
671
+ (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
672
+ include("strings-double"),
673
+ ],
674
+ "sqs": [
675
+ (r"'", String.Single, "#pop"),
676
+ (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
677
+ include("strings-single"),
678
+ ],
679
+ "tdqf": [
680
+ (r'"""', String.Double, "#pop"),
681
+ include("fstrings-double"),
682
+ (r"\n", String.Double),
683
+ ],
684
+ "tsqf": [
685
+ (r"'''", String.Single, "#pop"),
686
+ include("fstrings-single"),
687
+ (r"\n", String.Single),
688
+ ],
689
+ "tdqs": [
690
+ (r'"""', String.Double, "#pop"),
691
+ include("strings-double"),
692
+ (r"\n", String.Double),
693
+ ],
694
+ "tsqs": [
695
+ (r"'''", String.Single, "#pop"),
696
+ include("strings-single"),
697
+ (r"\n", String.Single),
698
+ ],
699
+ }
700
+
701
+ def analyse_text(text):
702
+ # TODO supported?
703
+ if shebang_matches(text, r"mojo?"):
704
+ return 1.0
705
+ if "import " in text[:1000]:
706
+ return 0.9
707
+ return 0
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/monte.py ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.monte
3
+ ~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for the Monte programming language.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
12
+ Punctuation, String, Whitespace
13
+ from pygments.lexer import RegexLexer, include, words
14
+
15
+ __all__ = ['MonteLexer']
16
+
17
+
18
+ # `var` handled separately
19
+ # `interface` handled separately
20
+ _declarations = ['bind', 'def', 'fn', 'object']
21
+ _methods = ['method', 'to']
22
+ _keywords = [
23
+ 'as', 'break', 'catch', 'continue', 'else', 'escape', 'exit', 'exports',
24
+ 'extends', 'finally', 'for', 'guards', 'if', 'implements', 'import',
25
+ 'in', 'match', 'meta', 'pass', 'return', 'switch', 'try', 'via', 'when',
26
+ 'while',
27
+ ]
28
+ _operators = [
29
+ # Unary
30
+ '~', '!',
31
+ # Binary
32
+ '+', '-', '*', '/', '%', '**', '&', '|', '^', '<<', '>>',
33
+ # Binary augmented
34
+ '+=', '-=', '*=', '/=', '%=', '**=', '&=', '|=', '^=', '<<=', '>>=',
35
+ # Comparison
36
+ '==', '!=', '<', '<=', '>', '>=', '<=>',
37
+ # Patterns and assignment
38
+ ':=', '?', '=~', '!~', '=>',
39
+ # Calls and sends
40
+ '.', '<-', '->',
41
+ ]
42
+ _escape_pattern = (
43
+ r'(?:\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|'
44
+ r'\\["\'\\bftnr])')
45
+ # _char = _escape_chars + [('.', String.Char)]
46
+ _identifier = r'[_a-zA-Z]\w*'
47
+
48
+ _constants = [
49
+ # Void constants
50
+ 'null',
51
+ # Bool constants
52
+ 'false', 'true',
53
+ # Double constants
54
+ 'Infinity', 'NaN',
55
+ # Special objects
56
+ 'M', 'Ref', 'throw', 'traceln',
57
+ ]
58
+
59
+ _guards = [
60
+ 'Any', 'Binding', 'Bool', 'Bytes', 'Char', 'DeepFrozen', 'Double',
61
+ 'Empty', 'Int', 'List', 'Map', 'Near', 'NullOk', 'Same', 'Selfless',
62
+ 'Set', 'Str', 'SubrangeGuard', 'Transparent', 'Void',
63
+ ]
64
+
65
+ _safeScope = [
66
+ '_accumulateList', '_accumulateMap', '_auditedBy', '_bind',
67
+ '_booleanFlow', '_comparer', '_equalizer', '_iterForever', '_loop',
68
+ '_makeBytes', '_makeDouble', '_makeFinalSlot', '_makeInt', '_makeList',
69
+ '_makeMap', '_makeMessageDesc', '_makeOrderedSpace', '_makeParamDesc',
70
+ '_makeProtocolDesc', '_makeSourceSpan', '_makeString', '_makeVarSlot',
71
+ '_makeVerbFacet', '_mapExtract', '_matchSame', '_quasiMatcher',
72
+ '_slotToBinding', '_splitList', '_suchThat', '_switchFailed',
73
+ '_validateFor', 'b__quasiParser', 'eval', 'import', 'm__quasiParser',
74
+ 'makeBrandPair', 'makeLazySlot', 'safeScope', 'simple__quasiParser',
75
+ ]
76
+
77
+
78
+ class MonteLexer(RegexLexer):
79
+ """
80
+ Lexer for the Monte programming language.
81
+ """
82
+ name = 'Monte'
83
+ url = 'https://monte.readthedocs.io/'
84
+ aliases = ['monte']
85
+ filenames = ['*.mt']
86
+ version_added = '2.2'
87
+
88
+ tokens = {
89
+ 'root': [
90
+ # Comments
91
+ (r'#[^\n]*\n', Comment),
92
+
93
+ # Docstrings
94
+ # Apologies for the non-greedy matcher here.
95
+ (r'/\*\*.*?\*/', String.Doc),
96
+
97
+ # `var` declarations
98
+ (r'\bvar\b', Keyword.Declaration, 'var'),
99
+
100
+ # `interface` declarations
101
+ (r'\binterface\b', Keyword.Declaration, 'interface'),
102
+
103
+ # method declarations
104
+ (words(_methods, prefix='\\b', suffix='\\b'),
105
+ Keyword, 'method'),
106
+
107
+ # All other declarations
108
+ (words(_declarations, prefix='\\b', suffix='\\b'),
109
+ Keyword.Declaration),
110
+
111
+ # Keywords
112
+ (words(_keywords, prefix='\\b', suffix='\\b'), Keyword),
113
+
114
+ # Literals
115
+ ('[+-]?0x[_0-9a-fA-F]+', Number.Hex),
116
+ (r'[+-]?[_0-9]+\.[_0-9]*([eE][+-]?[_0-9]+)?', Number.Float),
117
+ ('[+-]?[_0-9]+', Number.Integer),
118
+ ("'", String.Double, 'char'),
119
+ ('"', String.Double, 'string'),
120
+
121
+ # Quasiliterals
122
+ ('`', String.Backtick, 'ql'),
123
+
124
+ # Operators
125
+ (words(_operators), Operator),
126
+
127
+ # Verb operators
128
+ (_identifier + '=', Operator.Word),
129
+
130
+ # Safe scope constants
131
+ (words(_constants, prefix='\\b', suffix='\\b'),
132
+ Keyword.Pseudo),
133
+
134
+ # Safe scope guards
135
+ (words(_guards, prefix='\\b', suffix='\\b'), Keyword.Type),
136
+
137
+ # All other safe scope names
138
+ (words(_safeScope, prefix='\\b', suffix='\\b'),
139
+ Name.Builtin),
140
+
141
+ # Identifiers
142
+ (_identifier, Name),
143
+
144
+ # Punctuation
145
+ (r'\(|\)|\{|\}|\[|\]|:|,', Punctuation),
146
+
147
+ # Whitespace
148
+ (' +', Whitespace),
149
+
150
+ # Definite lexer errors
151
+ ('=', Error),
152
+ ],
153
+ 'char': [
154
+ # It is definitely an error to have a char of width == 0.
155
+ ("'", Error, 'root'),
156
+ (_escape_pattern, String.Escape, 'charEnd'),
157
+ ('.', String.Char, 'charEnd'),
158
+ ],
159
+ 'charEnd': [
160
+ ("'", String.Char, '#pop:2'),
161
+ # It is definitely an error to have a char of width > 1.
162
+ ('.', Error),
163
+ ],
164
+ # The state of things coming into an interface.
165
+ 'interface': [
166
+ (' +', Whitespace),
167
+ (_identifier, Name.Class, '#pop'),
168
+ include('root'),
169
+ ],
170
+ # The state of things coming into a method.
171
+ 'method': [
172
+ (' +', Whitespace),
173
+ (_identifier, Name.Function, '#pop'),
174
+ include('root'),
175
+ ],
176
+ 'string': [
177
+ ('"', String.Double, 'root'),
178
+ (_escape_pattern, String.Escape),
179
+ (r'\n', String.Double),
180
+ ('.', String.Double),
181
+ ],
182
+ 'ql': [
183
+ ('`', String.Backtick, 'root'),
184
+ (r'\$' + _escape_pattern, String.Escape),
185
+ (r'\$\$', String.Escape),
186
+ (r'@@', String.Escape),
187
+ (r'\$\{', String.Interpol, 'qlNest'),
188
+ (r'@\{', String.Interpol, 'qlNest'),
189
+ (r'\$' + _identifier, Name),
190
+ ('@' + _identifier, Name),
191
+ ('.', String.Backtick),
192
+ ],
193
+ 'qlNest': [
194
+ (r'\}', String.Interpol, '#pop'),
195
+ include('root'),
196
+ ],
197
+ # The state of things immediately following `var`.
198
+ 'var': [
199
+ (' +', Whitespace),
200
+ (_identifier, Name.Variable, '#pop'),
201
+ include('root'),
202
+ ],
203
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/mosel.py ADDED
@@ -0,0 +1,447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.mosel
3
+ ~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for the mosel language.
6
+ http://www.fico.com/en/products/fico-xpress-optimization
7
+
8
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.lexer import RegexLexer, words
13
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
14
+ Number, Punctuation
15
+
16
+ __all__ = ['MoselLexer']
17
+
18
+ FUNCTIONS = (
19
+ # core functions
20
+ '_',
21
+ 'abs',
22
+ 'arctan',
23
+ 'asproc',
24
+ 'assert',
25
+ 'bitflip',
26
+ 'bitneg',
27
+ 'bitset',
28
+ 'bitshift',
29
+ 'bittest',
30
+ 'bitval',
31
+ 'ceil',
32
+ 'cos',
33
+ 'create',
34
+ 'currentdate',
35
+ 'currenttime',
36
+ 'cutelt',
37
+ 'cutfirst',
38
+ 'cuthead',
39
+ 'cutlast',
40
+ 'cuttail',
41
+ 'datablock',
42
+ 'delcell',
43
+ 'exists',
44
+ 'exit',
45
+ 'exp',
46
+ 'exportprob',
47
+ 'fclose',
48
+ 'fflush',
49
+ 'finalize',
50
+ 'findfirst',
51
+ 'findlast',
52
+ 'floor',
53
+ 'fopen',
54
+ 'fselect',
55
+ 'fskipline',
56
+ 'fwrite',
57
+ 'fwrite_',
58
+ 'fwriteln',
59
+ 'fwriteln_',
60
+ 'getact',
61
+ 'getcoeff',
62
+ 'getcoeffs',
63
+ 'getdual',
64
+ 'getelt',
65
+ 'getfid',
66
+ 'getfirst',
67
+ 'getfname',
68
+ 'gethead',
69
+ 'getlast',
70
+ 'getobjval',
71
+ 'getparam',
72
+ 'getrcost',
73
+ 'getreadcnt',
74
+ 'getreverse',
75
+ 'getsize',
76
+ 'getslack',
77
+ 'getsol',
78
+ 'gettail',
79
+ 'gettype',
80
+ 'getvars',
81
+ 'isdynamic',
82
+ 'iseof',
83
+ 'isfinite',
84
+ 'ishidden',
85
+ 'isinf',
86
+ 'isnan',
87
+ 'isodd',
88
+ 'ln',
89
+ 'localsetparam',
90
+ 'log',
91
+ 'makesos1',
92
+ 'makesos2',
93
+ 'maxlist',
94
+ 'memoryuse',
95
+ 'minlist',
96
+ 'newmuid',
97
+ 'publish',
98
+ 'random',
99
+ 'read',
100
+ 'readln',
101
+ 'reset',
102
+ 'restoreparam',
103
+ 'reverse',
104
+ 'round',
105
+ 'setcoeff',
106
+ 'sethidden',
107
+ 'setioerr',
108
+ 'setmatherr',
109
+ 'setname',
110
+ 'setparam',
111
+ 'setrandseed',
112
+ 'setrange',
113
+ 'settype',
114
+ 'sin',
115
+ 'splithead',
116
+ 'splittail',
117
+ 'sqrt',
118
+ 'strfmt',
119
+ 'substr',
120
+ 'timestamp',
121
+ 'unpublish',
122
+ 'versionnum',
123
+ 'versionstr',
124
+ 'write',
125
+ 'write_',
126
+ 'writeln',
127
+ 'writeln_',
128
+
129
+ # mosel exam mmxprs | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
130
+ 'addcut',
131
+ 'addcuts',
132
+ 'addmipsol',
133
+ 'basisstability',
134
+ 'calcsolinfo',
135
+ 'clearmipdir',
136
+ 'clearmodcut',
137
+ 'command',
138
+ 'copysoltoinit',
139
+ 'crossoverlpsol',
140
+ 'defdelayedrows',
141
+ 'defsecurevecs',
142
+ 'delcuts',
143
+ 'dropcuts',
144
+ 'estimatemarginals',
145
+ 'fixglobal',
146
+ 'flushmsgq',
147
+ 'getbstat',
148
+ 'getcnlist',
149
+ 'getcplist',
150
+ 'getdualray',
151
+ 'getiis',
152
+ 'getiissense',
153
+ 'getiistype',
154
+ 'getinfcause',
155
+ 'getinfeas',
156
+ 'getlb',
157
+ 'getlct',
158
+ 'getleft',
159
+ 'getloadedlinctrs',
160
+ 'getloadedmpvars',
161
+ 'getname',
162
+ 'getprimalray',
163
+ 'getprobstat',
164
+ 'getrange',
165
+ 'getright',
166
+ 'getsensrng',
167
+ 'getsize',
168
+ 'getsol',
169
+ 'gettype',
170
+ 'getub',
171
+ 'getvars',
172
+ 'gety',
173
+ 'hasfeature',
174
+ 'implies',
175
+ 'indicator',
176
+ 'initglobal',
177
+ 'ishidden',
178
+ 'isiisvalid',
179
+ 'isintegral',
180
+ 'loadbasis',
181
+ 'loadcuts',
182
+ 'loadlpsol',
183
+ 'loadmipsol',
184
+ 'loadprob',
185
+ 'maximise',
186
+ 'maximize',
187
+ 'minimise',
188
+ 'minimize',
189
+ 'postsolve',
190
+ 'readbasis',
191
+ 'readdirs',
192
+ 'readsol',
193
+ 'refinemipsol',
194
+ 'rejectintsol',
195
+ 'repairinfeas',
196
+ 'repairinfeas_deprec',
197
+ 'resetbasis',
198
+ 'resetiis',
199
+ 'resetsol',
200
+ 'savebasis',
201
+ 'savemipsol',
202
+ 'savesol',
203
+ 'savestate',
204
+ 'selectsol',
205
+ 'setarchconsistency',
206
+ 'setbstat',
207
+ 'setcallback',
208
+ 'setcbcutoff',
209
+ 'setgndata',
210
+ 'sethidden',
211
+ 'setlb',
212
+ 'setmipdir',
213
+ 'setmodcut',
214
+ 'setsol',
215
+ 'setub',
216
+ 'setucbdata',
217
+ 'stopoptimise',
218
+ 'stopoptimize',
219
+ 'storecut',
220
+ 'storecuts',
221
+ 'unloadprob',
222
+ 'uselastbarsol',
223
+ 'writebasis',
224
+ 'writedirs',
225
+ 'writeprob',
226
+ 'writesol',
227
+ 'xor',
228
+ 'xprs_addctr',
229
+ 'xprs_addindic',
230
+
231
+ # mosel exam mmsystem | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
232
+ 'addmonths',
233
+ 'copytext',
234
+ 'cuttext',
235
+ 'deltext',
236
+ 'endswith',
237
+ 'erase',
238
+ 'expandpath',
239
+ 'fcopy',
240
+ 'fdelete',
241
+ 'findfiles',
242
+ 'findtext',
243
+ 'fmove',
244
+ 'formattext',
245
+ 'getasnumber',
246
+ 'getchar',
247
+ 'getcwd',
248
+ 'getdate',
249
+ 'getday',
250
+ 'getdaynum',
251
+ 'getdays',
252
+ 'getdirsep',
253
+ 'getdsoparam',
254
+ 'getendparse',
255
+ 'getenv',
256
+ 'getfsize',
257
+ 'getfstat',
258
+ 'getftime',
259
+ 'gethour',
260
+ 'getminute',
261
+ 'getmonth',
262
+ 'getmsec',
263
+ 'getoserrmsg',
264
+ 'getoserror',
265
+ 'getpathsep',
266
+ 'getqtype',
267
+ 'getsecond',
268
+ 'getsepchar',
269
+ 'getsize',
270
+ 'getstart',
271
+ 'getsucc',
272
+ 'getsysinfo',
273
+ 'getsysstat',
274
+ 'gettime',
275
+ 'gettmpdir',
276
+ 'gettrim',
277
+ 'getweekday',
278
+ 'getyear',
279
+ 'inserttext',
280
+ 'isvalid',
281
+ 'jointext',
282
+ 'makedir',
283
+ 'makepath',
284
+ 'newtar',
285
+ 'newzip',
286
+ 'nextfield',
287
+ 'openpipe',
288
+ 'parseextn',
289
+ 'parseint',
290
+ 'parsereal',
291
+ 'parsetext',
292
+ 'pastetext',
293
+ 'pathmatch',
294
+ 'pathsplit',
295
+ 'qsort',
296
+ 'quote',
297
+ 'readtextline',
298
+ 'regmatch',
299
+ 'regreplace',
300
+ 'removedir',
301
+ 'removefiles',
302
+ 'setchar',
303
+ 'setdate',
304
+ 'setday',
305
+ 'setdsoparam',
306
+ 'setendparse',
307
+ 'setenv',
308
+ 'sethour',
309
+ 'setminute',
310
+ 'setmonth',
311
+ 'setmsec',
312
+ 'setoserror',
313
+ 'setqtype',
314
+ 'setsecond',
315
+ 'setsepchar',
316
+ 'setstart',
317
+ 'setsucc',
318
+ 'settime',
319
+ 'settrim',
320
+ 'setyear',
321
+ 'sleep',
322
+ 'splittext',
323
+ 'startswith',
324
+ 'system',
325
+ 'tarlist',
326
+ 'textfmt',
327
+ 'tolower',
328
+ 'toupper',
329
+ 'trim',
330
+ 'untar',
331
+ 'unzip',
332
+ 'ziplist',
333
+
334
+ # mosel exam mmjobs | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
335
+ 'canceltimer',
336
+ 'clearaliases',
337
+ 'compile',
338
+ 'connect',
339
+ 'detach',
340
+ 'disconnect',
341
+ 'dropnextevent',
342
+ 'findxsrvs',
343
+ 'getaliases',
344
+ 'getannidents',
345
+ 'getannotations',
346
+ 'getbanner',
347
+ 'getclass',
348
+ 'getdsoprop',
349
+ 'getdsopropnum',
350
+ 'getexitcode',
351
+ 'getfromgid',
352
+ 'getfromid',
353
+ 'getfromuid',
354
+ 'getgid',
355
+ 'gethostalias',
356
+ 'getid',
357
+ 'getmodprop',
358
+ 'getmodpropnum',
359
+ 'getnextevent',
360
+ 'getnode',
361
+ 'getrmtid',
362
+ 'getstatus',
363
+ 'getsysinfo',
364
+ 'gettimer',
365
+ 'getuid',
366
+ 'getvalue',
367
+ 'isqueueempty',
368
+ 'load',
369
+ 'nullevent',
370
+ 'peeknextevent',
371
+ 'resetmodpar',
372
+ 'run',
373
+ 'send',
374
+ 'setcontrol',
375
+ 'setdefstream',
376
+ 'setgid',
377
+ 'sethostalias',
378
+ 'setmodpar',
379
+ 'settimer',
380
+ 'setuid',
381
+ 'setworkdir',
382
+ 'stop',
383
+ 'unload',
384
+ 'wait',
385
+ 'waitexpired',
386
+ 'waitfor',
387
+ 'waitforend',
388
+ )
389
+
390
+
391
+ class MoselLexer(RegexLexer):
392
+ """
393
+ For the Mosel optimization language.
394
+ """
395
+ name = 'Mosel'
396
+ aliases = ['mosel']
397
+ filenames = ['*.mos']
398
+ url = 'https://www.fico.com/fico-xpress-optimization/docs/latest/mosel/mosel_lang/dhtml/moselreflang.html'
399
+ version_added = '2.6'
400
+
401
+ tokens = {
402
+ 'root': [
403
+ (r'\n', Text),
404
+ (r'\s+', Text.Whitespace),
405
+ (r'!.*?\n', Comment.Single),
406
+ (r'\(!(.|\n)*?!\)', Comment.Multiline),
407
+ (words((
408
+ 'and', 'as', 'break', 'case', 'count', 'declarations', 'do',
409
+ 'dynamic', 'elif', 'else', 'end-', 'end', 'evaluation', 'false',
410
+ 'forall', 'forward', 'from', 'function', 'hashmap', 'if',
411
+ 'imports', 'include', 'initialisations', 'initializations', 'inter',
412
+ 'max', 'min', 'model', 'namespace', 'next', 'not', 'nsgroup',
413
+ 'nssearch', 'of', 'options', 'or', 'package', 'parameters',
414
+ 'procedure', 'public', 'prod', 'record', 'repeat', 'requirements',
415
+ 'return', 'sum', 'then', 'to', 'true', 'union', 'until', 'uses',
416
+ 'version', 'while', 'with'), prefix=r'\b', suffix=r'\b'),
417
+ Keyword.Builtin),
418
+ (words((
419
+ 'range', 'array', 'set', 'list', 'mpvar', 'mpproblem', 'linctr',
420
+ 'nlctr', 'integer', 'string', 'real', 'boolean', 'text', 'time',
421
+ 'date', 'datetime', 'returned', 'Model', 'Mosel', 'counter',
422
+ 'xmldoc', 'is_sos1', 'is_sos2', 'is_integer', 'is_binary',
423
+ 'is_continuous', 'is_free', 'is_semcont', 'is_semint',
424
+ 'is_partint'), prefix=r'\b', suffix=r'\b'),
425
+ Keyword.Type),
426
+ (r'(\+|\-|\*|/|=|<=|>=|\||\^|<|>|<>|\.\.|\.|:=|::|:|in|mod|div)',
427
+ Operator),
428
+ (r'[()\[\]{},;]+', Punctuation),
429
+ (words(FUNCTIONS, prefix=r'\b', suffix=r'\b'), Name.Function),
430
+ (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float),
431
+ (r'\d+([eE][+-]?\d+)?', Number.Integer),
432
+ (r'[+-]?Infinity', Number.Integer),
433
+ (r'0[xX][0-9a-fA-F]+', Number),
434
+ (r'"', String.Double, 'double_quote'),
435
+ (r'\'', String.Single, 'single_quote'),
436
+ (r'(\w+|(\.(?!\.)))', Text),
437
+ ],
438
+ 'single_quote': [
439
+ (r'\'', String.Single, '#pop'),
440
+ (r'[^\']+', String.Single),
441
+ ],
442
+ 'double_quote': [
443
+ (r'(\\"|\\[0-7]{1,3}\D|\\[abfnrtv]|\\\\)', String.Escape),
444
+ (r'\"', String.Double, '#pop'),
445
+ (r'[^"\\]+', String.Double),
446
+ ],
447
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/ncl.py ADDED
@@ -0,0 +1,894 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.ncl
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for NCAR Command Language.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include, words
14
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
+ Number, Punctuation
16
+
17
+ __all__ = ['NCLLexer']
18
+
19
+
20
+ class NCLLexer(RegexLexer):
21
+ """
22
+ Lexer for NCL code.
23
+ """
24
+ name = 'NCL'
25
+ aliases = ['ncl']
26
+ filenames = ['*.ncl']
27
+ mimetypes = ['text/ncl']
28
+ url = 'https://www.ncl.ucar.edu'
29
+ version_added = '2.2'
30
+
31
+ flags = re.MULTILINE
32
+
33
+ tokens = {
34
+ 'root': [
35
+ (r';.*\n', Comment),
36
+ include('strings'),
37
+ include('core'),
38
+ (r'[a-zA-Z_]\w*', Name),
39
+ include('nums'),
40
+ (r'[\s]+', Text),
41
+ ],
42
+ 'core': [
43
+ # Statements
44
+ (words((
45
+ 'begin', 'break', 'continue', 'create', 'defaultapp', 'do',
46
+ 'else', 'end', 'external', 'exit', 'True', 'False', 'file', 'function',
47
+ 'getvalues', 'graphic', 'group', 'if', 'list', 'load', 'local',
48
+ 'new', '_Missing', 'Missing', 'noparent', 'procedure',
49
+ 'quit', 'QUIT', 'Quit', 'record', 'return', 'setvalues', 'stop',
50
+ 'then', 'while'), prefix=r'\b', suffix=r'\s*\b'),
51
+ Keyword),
52
+
53
+ # Data Types
54
+ (words((
55
+ 'ubyte', 'uint', 'uint64', 'ulong', 'string', 'byte',
56
+ 'character', 'double', 'float', 'integer', 'int64', 'logical',
57
+ 'long', 'short', 'ushort', 'enumeric', 'numeric', 'snumeric'),
58
+ prefix=r'\b', suffix=r'\s*\b'),
59
+ Keyword.Type),
60
+
61
+ # Operators
62
+ (r'[\%^*+\-/<>]', Operator),
63
+
64
+ # punctuation:
65
+ (r'[\[\]():@$!&|.,\\{}]', Punctuation),
66
+ (r'[=:]', Punctuation),
67
+
68
+ # Intrinsics
69
+ (words((
70
+ 'abs', 'acos', 'addfile', 'addfiles', 'all', 'angmom_atm', 'any',
71
+ 'area_conserve_remap', 'area_hi2lores', 'area_poly_sphere',
72
+ 'asciiread', 'asciiwrite', 'asin', 'atan', 'atan2', 'attsetvalues',
73
+ 'avg', 'betainc', 'bin_avg', 'bin_sum', 'bw_bandpass_filter',
74
+ 'cancor', 'cbinread', 'cbinwrite', 'cd_calendar', 'cd_inv_calendar',
75
+ 'cdfbin_p', 'cdfbin_pr', 'cdfbin_s', 'cdfbin_xn', 'cdfchi_p',
76
+ 'cdfchi_x', 'cdfgam_p', 'cdfgam_x', 'cdfnor_p', 'cdfnor_x',
77
+ 'cdft_p', 'cdft_t', 'ceil', 'center_finite_diff',
78
+ 'center_finite_diff_n', 'cfftb', 'cfftf', 'cfftf_frq_reorder',
79
+ 'charactertodouble', 'charactertofloat', 'charactertointeger',
80
+ 'charactertolong', 'charactertoshort', 'charactertostring',
81
+ 'chartodouble', 'chartofloat', 'chartoint', 'chartointeger',
82
+ 'chartolong', 'chartoshort', 'chartostring', 'chiinv', 'clear',
83
+ 'color_index_to_rgba', 'conform', 'conform_dims', 'cos', 'cosh',
84
+ 'count_unique_values', 'covcorm', 'covcorm_xy', 'craybinnumrec',
85
+ 'craybinrecread', 'create_graphic', 'csa1', 'csa1d', 'csa1s',
86
+ 'csa1x', 'csa1xd', 'csa1xs', 'csa2', 'csa2d', 'csa2l', 'csa2ld',
87
+ 'csa2ls', 'csa2lx', 'csa2lxd', 'csa2lxs', 'csa2s', 'csa2x',
88
+ 'csa2xd', 'csa2xs', 'csa3', 'csa3d', 'csa3l', 'csa3ld', 'csa3ls',
89
+ 'csa3lx', 'csa3lxd', 'csa3lxs', 'csa3s', 'csa3x', 'csa3xd',
90
+ 'csa3xs', 'csc2s', 'csgetp', 'css2c', 'cssetp', 'cssgrid', 'csstri',
91
+ 'csvoro', 'cumsum', 'cz2ccm', 'datatondc', 'day_of_week',
92
+ 'day_of_year', 'days_in_month', 'default_fillvalue', 'delete',
93
+ 'depth_to_pres', 'destroy', 'determinant', 'dewtemp_trh',
94
+ 'dgeevx_lapack', 'dim_acumrun_n', 'dim_avg', 'dim_avg_n',
95
+ 'dim_avg_wgt', 'dim_avg_wgt_n', 'dim_cumsum', 'dim_cumsum_n',
96
+ 'dim_gamfit_n', 'dim_gbits', 'dim_max', 'dim_max_n', 'dim_median',
97
+ 'dim_median_n', 'dim_min', 'dim_min_n', 'dim_num', 'dim_num_n',
98
+ 'dim_numrun_n', 'dim_pqsort', 'dim_pqsort_n', 'dim_product',
99
+ 'dim_product_n', 'dim_rmsd', 'dim_rmsd_n', 'dim_rmvmean',
100
+ 'dim_rmvmean_n', 'dim_rmvmed', 'dim_rmvmed_n', 'dim_spi_n',
101
+ 'dim_standardize', 'dim_standardize_n', 'dim_stat4', 'dim_stat4_n',
102
+ 'dim_stddev', 'dim_stddev_n', 'dim_sum', 'dim_sum_n', 'dim_sum_wgt',
103
+ 'dim_sum_wgt_n', 'dim_variance', 'dim_variance_n', 'dimsizes',
104
+ 'doubletobyte', 'doubletochar', 'doubletocharacter',
105
+ 'doubletofloat', 'doubletoint', 'doubletointeger', 'doubletolong',
106
+ 'doubletoshort', 'dpres_hybrid_ccm', 'dpres_plevel', 'draw',
107
+ 'draw_color_palette', 'dsgetp', 'dsgrid2', 'dsgrid2d', 'dsgrid2s',
108
+ 'dsgrid3', 'dsgrid3d', 'dsgrid3s', 'dspnt2', 'dspnt2d', 'dspnt2s',
109
+ 'dspnt3', 'dspnt3d', 'dspnt3s', 'dssetp', 'dtrend', 'dtrend_msg',
110
+ 'dtrend_msg_n', 'dtrend_n', 'dtrend_quadratic',
111
+ 'dtrend_quadratic_msg_n', 'dv2uvf', 'dv2uvg', 'dz_height',
112
+ 'echo_off', 'echo_on', 'eof2data', 'eof_varimax', 'eofcor',
113
+ 'eofcor_pcmsg', 'eofcor_ts', 'eofcov', 'eofcov_pcmsg', 'eofcov_ts',
114
+ 'eofunc', 'eofunc_ts', 'eofunc_varimax', 'equiv_sample_size', 'erf',
115
+ 'erfc', 'esacr', 'esacv', 'esccr', 'esccv', 'escorc', 'escorc_n',
116
+ 'escovc', 'exit', 'exp', 'exp_tapersh', 'exp_tapersh_wgts',
117
+ 'exp_tapershC', 'ezfftb', 'ezfftb_n', 'ezfftf', 'ezfftf_n',
118
+ 'f2fosh', 'f2foshv', 'f2fsh', 'f2fshv', 'f2gsh', 'f2gshv', 'fabs',
119
+ 'fbindirread', 'fbindirwrite', 'fbinnumrec', 'fbinread',
120
+ 'fbinrecread', 'fbinrecwrite', 'fbinwrite', 'fft2db', 'fft2df',
121
+ 'fftshift', 'fileattdef', 'filechunkdimdef', 'filedimdef',
122
+ 'fileexists', 'filegrpdef', 'filevarattdef', 'filevarchunkdef',
123
+ 'filevarcompressleveldef', 'filevardef', 'filevardimsizes',
124
+ 'filwgts_lancos', 'filwgts_lanczos', 'filwgts_normal',
125
+ 'floattobyte', 'floattochar', 'floattocharacter', 'floattoint',
126
+ 'floattointeger', 'floattolong', 'floattoshort', 'floor',
127
+ 'fluxEddy', 'fo2fsh', 'fo2fshv', 'fourier_info', 'frame', 'fspan',
128
+ 'ftcurv', 'ftcurvd', 'ftcurvi', 'ftcurvp', 'ftcurvpi', 'ftcurvps',
129
+ 'ftcurvs', 'ftest', 'ftgetp', 'ftkurv', 'ftkurvd', 'ftkurvp',
130
+ 'ftkurvpd', 'ftsetp', 'ftsurf', 'g2fsh', 'g2fshv', 'g2gsh',
131
+ 'g2gshv', 'gamma', 'gammainc', 'gaus', 'gaus_lobat',
132
+ 'gaus_lobat_wgt', 'gc_aangle', 'gc_clkwise', 'gc_dangle',
133
+ 'gc_inout', 'gc_latlon', 'gc_onarc', 'gc_pnt2gc', 'gc_qarea',
134
+ 'gc_tarea', 'generate_2d_array', 'get_color_index',
135
+ 'get_color_rgba', 'get_cpu_time', 'get_isolines', 'get_ncl_version',
136
+ 'get_script_name', 'get_script_prefix_name', 'get_sphere_radius',
137
+ 'get_unique_values', 'getbitsone', 'getenv', 'getfiledimsizes',
138
+ 'getfilegrpnames', 'getfilepath', 'getfilevaratts',
139
+ 'getfilevarchunkdimsizes', 'getfilevardims', 'getfilevardimsizes',
140
+ 'getfilevarnames', 'getfilevartypes', 'getvaratts', 'getvardims',
141
+ 'gradsf', 'gradsg', 'greg2jul', 'grid2triple', 'hlsrgb', 'hsvrgb',
142
+ 'hydro', 'hyi2hyo', 'idsfft', 'igradsf', 'igradsg', 'ilapsf',
143
+ 'ilapsg', 'ilapvf', 'ilapvg', 'ind', 'ind_resolve', 'int2p',
144
+ 'int2p_n', 'integertobyte', 'integertochar', 'integertocharacter',
145
+ 'integertoshort', 'inttobyte', 'inttochar', 'inttoshort',
146
+ 'inverse_matrix', 'isatt', 'isbigendian', 'isbyte', 'ischar',
147
+ 'iscoord', 'isdefined', 'isdim', 'isdimnamed', 'isdouble',
148
+ 'isenumeric', 'isfile', 'isfilepresent', 'isfilevar',
149
+ 'isfilevaratt', 'isfilevarcoord', 'isfilevardim', 'isfloat',
150
+ 'isfunc', 'isgraphic', 'isint', 'isint64', 'isinteger',
151
+ 'isleapyear', 'islogical', 'islong', 'ismissing', 'isnan_ieee',
152
+ 'isnumeric', 'ispan', 'isproc', 'isshort', 'issnumeric', 'isstring',
153
+ 'isubyte', 'isuint', 'isuint64', 'isulong', 'isunlimited',
154
+ 'isunsigned', 'isushort', 'isvar', 'jul2greg', 'kmeans_as136',
155
+ 'kolsm2_n', 'kron_product', 'lapsf', 'lapsg', 'lapvf', 'lapvg',
156
+ 'latlon2utm', 'lclvl', 'lderuvf', 'lderuvg', 'linint1', 'linint1_n',
157
+ 'linint2', 'linint2_points', 'linmsg', 'linmsg_n', 'linrood_latwgt',
158
+ 'linrood_wgt', 'list_files', 'list_filevars', 'list_hlus',
159
+ 'list_procfuncs', 'list_vars', 'ListAppend', 'ListCount',
160
+ 'ListGetType', 'ListIndex', 'ListIndexFromName', 'ListPop',
161
+ 'ListPush', 'ListSetType', 'loadscript', 'local_max', 'local_min',
162
+ 'log', 'log10', 'longtobyte', 'longtochar', 'longtocharacter',
163
+ 'longtoint', 'longtointeger', 'longtoshort', 'lspoly', 'lspoly_n',
164
+ 'mask', 'max', 'maxind', 'min', 'minind', 'mixed_layer_depth',
165
+ 'mixhum_ptd', 'mixhum_ptrh', 'mjo_cross_coh2pha',
166
+ 'mjo_cross_segment', 'moc_globe_atl', 'monthday', 'natgrid',
167
+ 'natgridd', 'natgrids', 'ncargpath', 'ncargversion', 'ndctodata',
168
+ 'ndtooned', 'new', 'NewList', 'ngezlogo', 'nggcog', 'nggetp',
169
+ 'nglogo', 'ngsetp', 'NhlAddAnnotation', 'NhlAddData',
170
+ 'NhlAddOverlay', 'NhlAddPrimitive', 'NhlAppGetDefaultParentId',
171
+ 'NhlChangeWorkstation', 'NhlClassName', 'NhlClearWorkstation',
172
+ 'NhlDataPolygon', 'NhlDataPolyline', 'NhlDataPolymarker',
173
+ 'NhlDataToNDC', 'NhlDestroy', 'NhlDraw', 'NhlFrame', 'NhlFreeColor',
174
+ 'NhlGetBB', 'NhlGetClassResources', 'NhlGetErrorObjectId',
175
+ 'NhlGetNamedColorIndex', 'NhlGetParentId',
176
+ 'NhlGetParentWorkstation', 'NhlGetWorkspaceObjectId',
177
+ 'NhlIsAllocatedColor', 'NhlIsApp', 'NhlIsDataComm', 'NhlIsDataItem',
178
+ 'NhlIsDataSpec', 'NhlIsTransform', 'NhlIsView', 'NhlIsWorkstation',
179
+ 'NhlName', 'NhlNDCPolygon', 'NhlNDCPolyline', 'NhlNDCPolymarker',
180
+ 'NhlNDCToData', 'NhlNewColor', 'NhlNewDashPattern', 'NhlNewMarker',
181
+ 'NhlPalGetDefined', 'NhlRemoveAnnotation', 'NhlRemoveData',
182
+ 'NhlRemoveOverlay', 'NhlRemovePrimitive', 'NhlSetColor',
183
+ 'NhlSetDashPattern', 'NhlSetMarker', 'NhlUpdateData',
184
+ 'NhlUpdateWorkstation', 'nice_mnmxintvl', 'nngetaspectd',
185
+ 'nngetaspects', 'nngetp', 'nngetsloped', 'nngetslopes', 'nngetwts',
186
+ 'nngetwtsd', 'nnpnt', 'nnpntd', 'nnpntend', 'nnpntendd',
187
+ 'nnpntinit', 'nnpntinitd', 'nnpntinits', 'nnpnts', 'nnsetp', 'num',
188
+ 'obj_anal_ic', 'omega_ccm', 'onedtond', 'overlay', 'paleo_outline',
189
+ 'pdfxy_bin', 'poisson_grid_fill', 'pop_remap', 'potmp_insitu_ocn',
190
+ 'prcwater_dp', 'pres2hybrid', 'pres_hybrid_ccm', 'pres_sigma',
191
+ 'print', 'print_table', 'printFileVarSummary', 'printVarSummary',
192
+ 'product', 'pslec', 'pslhor', 'pslhyp', 'qsort', 'rand',
193
+ 'random_chi', 'random_gamma', 'random_normal', 'random_setallseed',
194
+ 'random_uniform', 'rcm2points', 'rcm2rgrid', 'rdsstoi',
195
+ 'read_colormap_file', 'reg_multlin', 'regcoef', 'regCoef_n',
196
+ 'regline', 'relhum', 'replace_ieeenan', 'reshape', 'reshape_ind',
197
+ 'rgba_to_color_index', 'rgbhls', 'rgbhsv', 'rgbyiq', 'rgrid2rcm',
198
+ 'rhomb_trunc', 'rip_cape_2d', 'rip_cape_3d', 'round', 'rtest',
199
+ 'runave', 'runave_n', 'set_default_fillvalue', 'set_sphere_radius',
200
+ 'setfileoption', 'sfvp2uvf', 'sfvp2uvg', 'shaec', 'shagc',
201
+ 'shgetnp', 'shgetp', 'shgrid', 'shorttobyte', 'shorttochar',
202
+ 'shorttocharacter', 'show_ascii', 'shsec', 'shsetp', 'shsgc',
203
+ 'shsgc_R42', 'sigma2hybrid', 'simpeq', 'simpne', 'sin',
204
+ 'sindex_yrmo', 'sinh', 'sizeof', 'sleep', 'smth9', 'snindex_yrmo',
205
+ 'solve_linsys', 'span_color_indexes', 'span_color_rgba',
206
+ 'sparse_matrix_mult', 'spcorr', 'spcorr_n', 'specx_anal',
207
+ 'specxy_anal', 'spei', 'sprintf', 'sprinti', 'sqrt', 'sqsort',
208
+ 'srand', 'stat2', 'stat4', 'stat_medrng', 'stat_trim',
209
+ 'status_exit', 'stdatmus_p2tdz', 'stdatmus_z2tdp', 'stddev',
210
+ 'str_capital', 'str_concat', 'str_fields_count', 'str_get_cols',
211
+ 'str_get_dq', 'str_get_field', 'str_get_nl', 'str_get_sq',
212
+ 'str_get_tab', 'str_index_of_substr', 'str_insert', 'str_is_blank',
213
+ 'str_join', 'str_left_strip', 'str_lower', 'str_match',
214
+ 'str_match_ic', 'str_match_ic_regex', 'str_match_ind',
215
+ 'str_match_ind_ic', 'str_match_ind_ic_regex', 'str_match_ind_regex',
216
+ 'str_match_regex', 'str_right_strip', 'str_split',
217
+ 'str_split_by_length', 'str_split_csv', 'str_squeeze', 'str_strip',
218
+ 'str_sub_str', 'str_switch', 'str_upper', 'stringtochar',
219
+ 'stringtocharacter', 'stringtodouble', 'stringtofloat',
220
+ 'stringtoint', 'stringtointeger', 'stringtolong', 'stringtoshort',
221
+ 'strlen', 'student_t', 'sum', 'svd_lapack', 'svdcov', 'svdcov_sv',
222
+ 'svdstd', 'svdstd_sv', 'system', 'systemfunc', 'tan', 'tanh',
223
+ 'taper', 'taper_n', 'tdclrs', 'tdctri', 'tdcudp', 'tdcurv',
224
+ 'tddtri', 'tdez2d', 'tdez3d', 'tdgetp', 'tdgrds', 'tdgrid',
225
+ 'tdgtrs', 'tdinit', 'tditri', 'tdlbla', 'tdlblp', 'tdlbls',
226
+ 'tdline', 'tdlndp', 'tdlnpa', 'tdlpdp', 'tdmtri', 'tdotri',
227
+ 'tdpara', 'tdplch', 'tdprpa', 'tdprpi', 'tdprpt', 'tdsetp',
228
+ 'tdsort', 'tdstri', 'tdstrs', 'tdttri', 'thornthwaite', 'tobyte',
229
+ 'tochar', 'todouble', 'tofloat', 'toint', 'toint64', 'tointeger',
230
+ 'tolong', 'toshort', 'tosigned', 'tostring', 'tostring_with_format',
231
+ 'totype', 'toubyte', 'touint', 'touint64', 'toulong', 'tounsigned',
232
+ 'toushort', 'trend_manken', 'tri_trunc', 'triple2grid',
233
+ 'triple2grid2d', 'trop_wmo', 'ttest', 'typeof', 'undef',
234
+ 'unique_string', 'update', 'ushorttoint', 'ut_calendar',
235
+ 'ut_inv_calendar', 'utm2latlon', 'uv2dv_cfd', 'uv2dvf', 'uv2dvg',
236
+ 'uv2sfvpf', 'uv2sfvpg', 'uv2vr_cfd', 'uv2vrdvf', 'uv2vrdvg',
237
+ 'uv2vrf', 'uv2vrg', 'v5d_close', 'v5d_create', 'v5d_setLowLev',
238
+ 'v5d_setUnits', 'v5d_write', 'v5d_write_var', 'variance', 'vhaec',
239
+ 'vhagc', 'vhsec', 'vhsgc', 'vibeta', 'vinth2p', 'vinth2p_ecmwf',
240
+ 'vinth2p_ecmwf_nodes', 'vinth2p_nodes', 'vintp2p_ecmwf', 'vr2uvf',
241
+ 'vr2uvg', 'vrdv2uvf', 'vrdv2uvg', 'wavelet', 'wavelet_default',
242
+ 'weibull', 'wgt_area_smooth', 'wgt_areaave', 'wgt_areaave2',
243
+ 'wgt_arearmse', 'wgt_arearmse2', 'wgt_areasum2', 'wgt_runave',
244
+ 'wgt_runave_n', 'wgt_vert_avg_beta', 'wgt_volave', 'wgt_volave_ccm',
245
+ 'wgt_volrmse', 'wgt_volrmse_ccm', 'where', 'wk_smooth121', 'wmbarb',
246
+ 'wmbarbmap', 'wmdrft', 'wmgetp', 'wmlabs', 'wmsetp', 'wmstnm',
247
+ 'wmvect', 'wmvectmap', 'wmvlbl', 'wrf_avo', 'wrf_cape_2d',
248
+ 'wrf_cape_3d', 'wrf_dbz', 'wrf_eth', 'wrf_helicity', 'wrf_ij_to_ll',
249
+ 'wrf_interp_1d', 'wrf_interp_2d_xy', 'wrf_interp_3d_z',
250
+ 'wrf_latlon_to_ij', 'wrf_ll_to_ij', 'wrf_omega', 'wrf_pvo',
251
+ 'wrf_rh', 'wrf_slp', 'wrf_smooth_2d', 'wrf_td', 'wrf_tk',
252
+ 'wrf_updraft_helicity', 'wrf_uvmet', 'wrf_virtual_temp',
253
+ 'wrf_wetbulb', 'wrf_wps_close_int', 'wrf_wps_open_int',
254
+ 'wrf_wps_rddata_int', 'wrf_wps_rdhead_int', 'wrf_wps_read_int',
255
+ 'wrf_wps_write_int', 'write_matrix', 'write_table', 'yiqrgb',
256
+ 'z2geouv', 'zonal_mpsi', 'addfiles_GetVar', 'advect_variable',
257
+ 'area_conserve_remap_Wrap', 'area_hi2lores_Wrap',
258
+ 'array_append_record', 'assignFillValue', 'byte2flt',
259
+ 'byte2flt_hdf', 'calcDayAnomTLL', 'calcMonAnomLLLT',
260
+ 'calcMonAnomLLT', 'calcMonAnomTLL', 'calcMonAnomTLLL',
261
+ 'calculate_monthly_values', 'cd_convert', 'changeCase',
262
+ 'changeCaseChar', 'clmDayTLL', 'clmDayTLLL', 'clmMon2clmDay',
263
+ 'clmMonLLLT', 'clmMonLLT', 'clmMonTLL', 'clmMonTLLL', 'closest_val',
264
+ 'copy_VarAtts', 'copy_VarCoords', 'copy_VarCoords_1',
265
+ 'copy_VarCoords_2', 'copy_VarMeta', 'copyatt', 'crossp3',
266
+ 'cshstringtolist', 'cssgrid_Wrap', 'dble2flt', 'decimalPlaces',
267
+ 'delete_VarAtts', 'dim_avg_n_Wrap', 'dim_avg_wgt_n_Wrap',
268
+ 'dim_avg_wgt_Wrap', 'dim_avg_Wrap', 'dim_cumsum_n_Wrap',
269
+ 'dim_cumsum_Wrap', 'dim_max_n_Wrap', 'dim_min_n_Wrap',
270
+ 'dim_rmsd_n_Wrap', 'dim_rmsd_Wrap', 'dim_rmvmean_n_Wrap',
271
+ 'dim_rmvmean_Wrap', 'dim_rmvmed_n_Wrap', 'dim_rmvmed_Wrap',
272
+ 'dim_standardize_n_Wrap', 'dim_standardize_Wrap',
273
+ 'dim_stddev_n_Wrap', 'dim_stddev_Wrap', 'dim_sum_n_Wrap',
274
+ 'dim_sum_wgt_n_Wrap', 'dim_sum_wgt_Wrap', 'dim_sum_Wrap',
275
+ 'dim_variance_n_Wrap', 'dim_variance_Wrap', 'dpres_plevel_Wrap',
276
+ 'dtrend_leftdim', 'dv2uvF_Wrap', 'dv2uvG_Wrap', 'eof_north',
277
+ 'eofcor_Wrap', 'eofcov_Wrap', 'eofunc_north', 'eofunc_ts_Wrap',
278
+ 'eofunc_varimax_reorder', 'eofunc_varimax_Wrap', 'eofunc_Wrap',
279
+ 'epsZero', 'f2fosh_Wrap', 'f2foshv_Wrap', 'f2fsh_Wrap',
280
+ 'f2fshv_Wrap', 'f2gsh_Wrap', 'f2gshv_Wrap', 'fbindirSwap',
281
+ 'fbinseqSwap1', 'fbinseqSwap2', 'flt2dble', 'flt2string',
282
+ 'fo2fsh_Wrap', 'fo2fshv_Wrap', 'g2fsh_Wrap', 'g2fshv_Wrap',
283
+ 'g2gsh_Wrap', 'g2gshv_Wrap', 'generate_resample_indices',
284
+ 'generate_sample_indices', 'generate_unique_indices',
285
+ 'genNormalDist', 'get1Dindex', 'get1Dindex_Collapse',
286
+ 'get1Dindex_Exclude', 'get_file_suffix', 'GetFillColor',
287
+ 'GetFillColorIndex', 'getFillValue', 'getind_latlon2d',
288
+ 'getVarDimNames', 'getVarFillValue', 'grib_stime2itime',
289
+ 'hyi2hyo_Wrap', 'ilapsF_Wrap', 'ilapsG_Wrap', 'ind_nearest_coord',
290
+ 'indStrSubset', 'int2dble', 'int2flt', 'int2p_n_Wrap', 'int2p_Wrap',
291
+ 'isMonotonic', 'isStrSubset', 'latGau', 'latGauWgt', 'latGlobeF',
292
+ 'latGlobeFo', 'latRegWgt', 'linint1_n_Wrap', 'linint1_Wrap',
293
+ 'linint2_points_Wrap', 'linint2_Wrap', 'local_max_1d',
294
+ 'local_min_1d', 'lonFlip', 'lonGlobeF', 'lonGlobeFo', 'lonPivot',
295
+ 'merge_levels_sfc', 'mod', 'month_to_annual',
296
+ 'month_to_annual_weighted', 'month_to_season', 'month_to_season12',
297
+ 'month_to_seasonN', 'monthly_total_to_daily_mean', 'nameDim',
298
+ 'natgrid_Wrap', 'NewCosWeight', 'niceLatLon2D', 'NormCosWgtGlobe',
299
+ 'numAsciiCol', 'numAsciiRow', 'numeric2int',
300
+ 'obj_anal_ic_deprecated', 'obj_anal_ic_Wrap', 'omega_ccm_driver',
301
+ 'omega_to_w', 'oneDtostring', 'pack_values', 'pattern_cor', 'pdfx',
302
+ 'pdfxy', 'pdfxy_conform', 'pot_temp', 'pot_vort_hybrid',
303
+ 'pot_vort_isobaric', 'pres2hybrid_Wrap', 'print_clock',
304
+ 'printMinMax', 'quadroots', 'rcm2points_Wrap', 'rcm2rgrid_Wrap',
305
+ 'readAsciiHead', 'readAsciiTable', 'reg_multlin_stats',
306
+ 'region_ind', 'regline_stats', 'relhum_ttd', 'replaceSingleChar',
307
+ 'RGBtoCmap', 'rgrid2rcm_Wrap', 'rho_mwjf', 'rm_single_dims',
308
+ 'rmAnnCycle1D', 'rmInsufData', 'rmMonAnnCycLLLT', 'rmMonAnnCycLLT',
309
+ 'rmMonAnnCycTLL', 'runave_n_Wrap', 'runave_Wrap', 'short2flt',
310
+ 'short2flt_hdf', 'shsgc_R42_Wrap', 'sign_f90', 'sign_matlab',
311
+ 'smth9_Wrap', 'smthClmDayTLL', 'smthClmDayTLLL', 'SqrtCosWeight',
312
+ 'stat_dispersion', 'static_stability', 'stdMonLLLT', 'stdMonLLT',
313
+ 'stdMonTLL', 'stdMonTLLL', 'symMinMaxPlt', 'table_attach_columns',
314
+ 'table_attach_rows', 'time_to_newtime', 'transpose',
315
+ 'triple2grid_Wrap', 'ut_convert', 'uv2dvF_Wrap', 'uv2dvG_Wrap',
316
+ 'uv2vrF_Wrap', 'uv2vrG_Wrap', 'vr2uvF_Wrap', 'vr2uvG_Wrap',
317
+ 'w_to_omega', 'wallClockElapseTime', 'wave_number_spc',
318
+ 'wgt_areaave_Wrap', 'wgt_runave_leftdim', 'wgt_runave_n_Wrap',
319
+ 'wgt_runave_Wrap', 'wgt_vertical_n', 'wind_component',
320
+ 'wind_direction', 'yyyyddd_to_yyyymmdd', 'yyyymm_time',
321
+ 'yyyymm_to_yyyyfrac', 'yyyymmdd_time', 'yyyymmdd_to_yyyyddd',
322
+ 'yyyymmdd_to_yyyyfrac', 'yyyymmddhh_time', 'yyyymmddhh_to_yyyyfrac',
323
+ 'zonal_mpsi_Wrap', 'zonalAve', 'calendar_decode2', 'cd_string',
324
+ 'kf_filter', 'run_cor', 'time_axis_labels', 'ut_string',
325
+ 'wrf_contour', 'wrf_map', 'wrf_map_overlay', 'wrf_map_overlays',
326
+ 'wrf_map_resources', 'wrf_map_zoom', 'wrf_overlay', 'wrf_overlays',
327
+ 'wrf_user_getvar', 'wrf_user_ij_to_ll', 'wrf_user_intrp2d',
328
+ 'wrf_user_intrp3d', 'wrf_user_latlon_to_ij', 'wrf_user_list_times',
329
+ 'wrf_user_ll_to_ij', 'wrf_user_unstagger', 'wrf_user_vert_interp',
330
+ 'wrf_vector', 'gsn_add_annotation', 'gsn_add_polygon',
331
+ 'gsn_add_polyline', 'gsn_add_polymarker',
332
+ 'gsn_add_shapefile_polygons', 'gsn_add_shapefile_polylines',
333
+ 'gsn_add_shapefile_polymarkers', 'gsn_add_text', 'gsn_attach_plots',
334
+ 'gsn_blank_plot', 'gsn_contour', 'gsn_contour_map',
335
+ 'gsn_contour_shade', 'gsn_coordinates', 'gsn_create_labelbar',
336
+ 'gsn_create_legend', 'gsn_create_text',
337
+ 'gsn_csm_attach_zonal_means', 'gsn_csm_blank_plot',
338
+ 'gsn_csm_contour', 'gsn_csm_contour_map', 'gsn_csm_contour_map_ce',
339
+ 'gsn_csm_contour_map_overlay', 'gsn_csm_contour_map_polar',
340
+ 'gsn_csm_hov', 'gsn_csm_lat_time', 'gsn_csm_map', 'gsn_csm_map_ce',
341
+ 'gsn_csm_map_polar', 'gsn_csm_pres_hgt',
342
+ 'gsn_csm_pres_hgt_streamline', 'gsn_csm_pres_hgt_vector',
343
+ 'gsn_csm_streamline', 'gsn_csm_streamline_contour_map',
344
+ 'gsn_csm_streamline_contour_map_ce',
345
+ 'gsn_csm_streamline_contour_map_polar', 'gsn_csm_streamline_map',
346
+ 'gsn_csm_streamline_map_ce', 'gsn_csm_streamline_map_polar',
347
+ 'gsn_csm_streamline_scalar', 'gsn_csm_streamline_scalar_map',
348
+ 'gsn_csm_streamline_scalar_map_ce',
349
+ 'gsn_csm_streamline_scalar_map_polar', 'gsn_csm_time_lat',
350
+ 'gsn_csm_vector', 'gsn_csm_vector_map', 'gsn_csm_vector_map_ce',
351
+ 'gsn_csm_vector_map_polar', 'gsn_csm_vector_scalar',
352
+ 'gsn_csm_vector_scalar_map', 'gsn_csm_vector_scalar_map_ce',
353
+ 'gsn_csm_vector_scalar_map_polar', 'gsn_csm_x2y', 'gsn_csm_x2y2',
354
+ 'gsn_csm_xy', 'gsn_csm_xy2', 'gsn_csm_xy3', 'gsn_csm_y',
355
+ 'gsn_define_colormap', 'gsn_draw_colormap', 'gsn_draw_named_colors',
356
+ 'gsn_histogram', 'gsn_labelbar_ndc', 'gsn_legend_ndc', 'gsn_map',
357
+ 'gsn_merge_colormaps', 'gsn_open_wks', 'gsn_panel', 'gsn_polygon',
358
+ 'gsn_polygon_ndc', 'gsn_polyline', 'gsn_polyline_ndc',
359
+ 'gsn_polymarker', 'gsn_polymarker_ndc', 'gsn_retrieve_colormap',
360
+ 'gsn_reverse_colormap', 'gsn_streamline', 'gsn_streamline_map',
361
+ 'gsn_streamline_scalar', 'gsn_streamline_scalar_map', 'gsn_table',
362
+ 'gsn_text', 'gsn_text_ndc', 'gsn_vector', 'gsn_vector_map',
363
+ 'gsn_vector_scalar', 'gsn_vector_scalar_map', 'gsn_xy', 'gsn_y',
364
+ 'hsv2rgb', 'maximize_output', 'namedcolor2rgb', 'namedcolor2rgba',
365
+ 'reset_device_coordinates', 'span_named_colors'), prefix=r'\b'),
366
+ Name.Builtin),
367
+
368
+ # Resources
369
+ (words((
370
+ 'amDataXF', 'amDataYF', 'amJust', 'amOn', 'amOrthogonalPosF',
371
+ 'amParallelPosF', 'amResizeNotify', 'amSide', 'amTrackData',
372
+ 'amViewId', 'amZone', 'appDefaultParent', 'appFileSuffix',
373
+ 'appResources', 'appSysDir', 'appUsrDir', 'caCopyArrays',
374
+ 'caXArray', 'caXCast', 'caXMaxV', 'caXMinV', 'caXMissingV',
375
+ 'caYArray', 'caYCast', 'caYMaxV', 'caYMinV', 'caYMissingV',
376
+ 'cnCellFillEdgeColor', 'cnCellFillMissingValEdgeColor',
377
+ 'cnConpackParams', 'cnConstFEnableFill', 'cnConstFLabelAngleF',
378
+ 'cnConstFLabelBackgroundColor', 'cnConstFLabelConstantSpacingF',
379
+ 'cnConstFLabelFont', 'cnConstFLabelFontAspectF',
380
+ 'cnConstFLabelFontColor', 'cnConstFLabelFontHeightF',
381
+ 'cnConstFLabelFontQuality', 'cnConstFLabelFontThicknessF',
382
+ 'cnConstFLabelFormat', 'cnConstFLabelFuncCode', 'cnConstFLabelJust',
383
+ 'cnConstFLabelOn', 'cnConstFLabelOrthogonalPosF',
384
+ 'cnConstFLabelParallelPosF', 'cnConstFLabelPerimColor',
385
+ 'cnConstFLabelPerimOn', 'cnConstFLabelPerimSpaceF',
386
+ 'cnConstFLabelPerimThicknessF', 'cnConstFLabelSide',
387
+ 'cnConstFLabelString', 'cnConstFLabelTextDirection',
388
+ 'cnConstFLabelZone', 'cnConstFUseInfoLabelRes',
389
+ 'cnExplicitLabelBarLabelsOn', 'cnExplicitLegendLabelsOn',
390
+ 'cnExplicitLineLabelsOn', 'cnFillBackgroundColor', 'cnFillColor',
391
+ 'cnFillColors', 'cnFillDotSizeF', 'cnFillDrawOrder', 'cnFillMode',
392
+ 'cnFillOn', 'cnFillOpacityF', 'cnFillPalette', 'cnFillPattern',
393
+ 'cnFillPatterns', 'cnFillScaleF', 'cnFillScales', 'cnFixFillBleed',
394
+ 'cnGridBoundFillColor', 'cnGridBoundFillPattern',
395
+ 'cnGridBoundFillScaleF', 'cnGridBoundPerimColor',
396
+ 'cnGridBoundPerimDashPattern', 'cnGridBoundPerimOn',
397
+ 'cnGridBoundPerimThicknessF', 'cnHighLabelAngleF',
398
+ 'cnHighLabelBackgroundColor', 'cnHighLabelConstantSpacingF',
399
+ 'cnHighLabelCount', 'cnHighLabelFont', 'cnHighLabelFontAspectF',
400
+ 'cnHighLabelFontColor', 'cnHighLabelFontHeightF',
401
+ 'cnHighLabelFontQuality', 'cnHighLabelFontThicknessF',
402
+ 'cnHighLabelFormat', 'cnHighLabelFuncCode', 'cnHighLabelPerimColor',
403
+ 'cnHighLabelPerimOn', 'cnHighLabelPerimSpaceF',
404
+ 'cnHighLabelPerimThicknessF', 'cnHighLabelString', 'cnHighLabelsOn',
405
+ 'cnHighLowLabelOverlapMode', 'cnHighUseLineLabelRes',
406
+ 'cnInfoLabelAngleF', 'cnInfoLabelBackgroundColor',
407
+ 'cnInfoLabelConstantSpacingF', 'cnInfoLabelFont',
408
+ 'cnInfoLabelFontAspectF', 'cnInfoLabelFontColor',
409
+ 'cnInfoLabelFontHeightF', 'cnInfoLabelFontQuality',
410
+ 'cnInfoLabelFontThicknessF', 'cnInfoLabelFormat',
411
+ 'cnInfoLabelFuncCode', 'cnInfoLabelJust', 'cnInfoLabelOn',
412
+ 'cnInfoLabelOrthogonalPosF', 'cnInfoLabelParallelPosF',
413
+ 'cnInfoLabelPerimColor', 'cnInfoLabelPerimOn',
414
+ 'cnInfoLabelPerimSpaceF', 'cnInfoLabelPerimThicknessF',
415
+ 'cnInfoLabelSide', 'cnInfoLabelString', 'cnInfoLabelTextDirection',
416
+ 'cnInfoLabelZone', 'cnLabelBarEndLabelsOn', 'cnLabelBarEndStyle',
417
+ 'cnLabelDrawOrder', 'cnLabelMasking', 'cnLabelScaleFactorF',
418
+ 'cnLabelScaleValueF', 'cnLabelScalingMode', 'cnLegendLevelFlags',
419
+ 'cnLevelCount', 'cnLevelFlag', 'cnLevelFlags', 'cnLevelSelectionMode',
420
+ 'cnLevelSpacingF', 'cnLevels', 'cnLineColor', 'cnLineColors',
421
+ 'cnLineDashPattern', 'cnLineDashPatterns', 'cnLineDashSegLenF',
422
+ 'cnLineDrawOrder', 'cnLineLabelAngleF', 'cnLineLabelBackgroundColor',
423
+ 'cnLineLabelConstantSpacingF', 'cnLineLabelCount',
424
+ 'cnLineLabelDensityF', 'cnLineLabelFont', 'cnLineLabelFontAspectF',
425
+ 'cnLineLabelFontColor', 'cnLineLabelFontColors',
426
+ 'cnLineLabelFontHeightF', 'cnLineLabelFontQuality',
427
+ 'cnLineLabelFontThicknessF', 'cnLineLabelFormat',
428
+ 'cnLineLabelFuncCode', 'cnLineLabelInterval', 'cnLineLabelPerimColor',
429
+ 'cnLineLabelPerimOn', 'cnLineLabelPerimSpaceF',
430
+ 'cnLineLabelPerimThicknessF', 'cnLineLabelPlacementMode',
431
+ 'cnLineLabelStrings', 'cnLineLabelsOn', 'cnLinePalette',
432
+ 'cnLineThicknessF', 'cnLineThicknesses', 'cnLinesOn',
433
+ 'cnLowLabelAngleF', 'cnLowLabelBackgroundColor',
434
+ 'cnLowLabelConstantSpacingF', 'cnLowLabelCount', 'cnLowLabelFont',
435
+ 'cnLowLabelFontAspectF', 'cnLowLabelFontColor',
436
+ 'cnLowLabelFontHeightF', 'cnLowLabelFontQuality',
437
+ 'cnLowLabelFontThicknessF', 'cnLowLabelFormat', 'cnLowLabelFuncCode',
438
+ 'cnLowLabelPerimColor', 'cnLowLabelPerimOn', 'cnLowLabelPerimSpaceF',
439
+ 'cnLowLabelPerimThicknessF', 'cnLowLabelString', 'cnLowLabelsOn',
440
+ 'cnLowUseHighLabelRes', 'cnMaxDataValueFormat', 'cnMaxLevelCount',
441
+ 'cnMaxLevelValF', 'cnMaxPointDistanceF', 'cnMinLevelValF',
442
+ 'cnMissingValFillColor', 'cnMissingValFillPattern',
443
+ 'cnMissingValFillScaleF', 'cnMissingValPerimColor',
444
+ 'cnMissingValPerimDashPattern', 'cnMissingValPerimGridBoundOn',
445
+ 'cnMissingValPerimOn', 'cnMissingValPerimThicknessF',
446
+ 'cnMonoFillColor', 'cnMonoFillPattern', 'cnMonoFillScale',
447
+ 'cnMonoLevelFlag', 'cnMonoLineColor', 'cnMonoLineDashPattern',
448
+ 'cnMonoLineLabelFontColor', 'cnMonoLineThickness', 'cnNoDataLabelOn',
449
+ 'cnNoDataLabelString', 'cnOutOfRangeFillColor',
450
+ 'cnOutOfRangeFillPattern', 'cnOutOfRangeFillScaleF',
451
+ 'cnOutOfRangePerimColor', 'cnOutOfRangePerimDashPattern',
452
+ 'cnOutOfRangePerimOn', 'cnOutOfRangePerimThicknessF',
453
+ 'cnRasterCellSizeF', 'cnRasterMinCellSizeF', 'cnRasterModeOn',
454
+ 'cnRasterSampleFactorF', 'cnRasterSmoothingOn', 'cnScalarFieldData',
455
+ 'cnSmoothingDistanceF', 'cnSmoothingOn', 'cnSmoothingTensionF',
456
+ 'cnSpanFillPalette', 'cnSpanLinePalette', 'ctCopyTables',
457
+ 'ctXElementSize', 'ctXMaxV', 'ctXMinV', 'ctXMissingV', 'ctXTable',
458
+ 'ctXTableLengths', 'ctXTableType', 'ctYElementSize', 'ctYMaxV',
459
+ 'ctYMinV', 'ctYMissingV', 'ctYTable', 'ctYTableLengths',
460
+ 'ctYTableType', 'dcDelayCompute', 'errBuffer',
461
+ 'errFileName', 'errFilePtr', 'errLevel', 'errPrint', 'errUnitNumber',
462
+ 'gsClipOn', 'gsColors', 'gsEdgeColor', 'gsEdgeDashPattern',
463
+ 'gsEdgeDashSegLenF', 'gsEdgeThicknessF', 'gsEdgesOn',
464
+ 'gsFillBackgroundColor', 'gsFillColor', 'gsFillDotSizeF',
465
+ 'gsFillIndex', 'gsFillLineThicknessF', 'gsFillOpacityF',
466
+ 'gsFillScaleF', 'gsFont', 'gsFontAspectF', 'gsFontColor',
467
+ 'gsFontHeightF', 'gsFontOpacityF', 'gsFontQuality',
468
+ 'gsFontThicknessF', 'gsLineColor', 'gsLineDashPattern',
469
+ 'gsLineDashSegLenF', 'gsLineLabelConstantSpacingF', 'gsLineLabelFont',
470
+ 'gsLineLabelFontAspectF', 'gsLineLabelFontColor',
471
+ 'gsLineLabelFontHeightF', 'gsLineLabelFontQuality',
472
+ 'gsLineLabelFontThicknessF', 'gsLineLabelFuncCode',
473
+ 'gsLineLabelString', 'gsLineOpacityF', 'gsLineThicknessF',
474
+ 'gsMarkerColor', 'gsMarkerIndex', 'gsMarkerOpacityF', 'gsMarkerSizeF',
475
+ 'gsMarkerThicknessF', 'gsSegments', 'gsTextAngleF',
476
+ 'gsTextConstantSpacingF', 'gsTextDirection', 'gsTextFuncCode',
477
+ 'gsTextJustification', 'gsnAboveYRefLineBarColors',
478
+ 'gsnAboveYRefLineBarFillScales', 'gsnAboveYRefLineBarPatterns',
479
+ 'gsnAboveYRefLineColor', 'gsnAddCyclic', 'gsnAttachBorderOn',
480
+ 'gsnAttachPlotsXAxis', 'gsnBelowYRefLineBarColors',
481
+ 'gsnBelowYRefLineBarFillScales', 'gsnBelowYRefLineBarPatterns',
482
+ 'gsnBelowYRefLineColor', 'gsnBoxMargin', 'gsnCenterString',
483
+ 'gsnCenterStringFontColor', 'gsnCenterStringFontHeightF',
484
+ 'gsnCenterStringFuncCode', 'gsnCenterStringOrthogonalPosF',
485
+ 'gsnCenterStringParallelPosF', 'gsnContourLineThicknessesScale',
486
+ 'gsnContourNegLineDashPattern', 'gsnContourPosLineDashPattern',
487
+ 'gsnContourZeroLineThicknessF', 'gsnDebugWriteFileName', 'gsnDraw',
488
+ 'gsnFrame', 'gsnHistogramBarWidthPercent', 'gsnHistogramBinIntervals',
489
+ 'gsnHistogramBinMissing', 'gsnHistogramBinWidth',
490
+ 'gsnHistogramClassIntervals', 'gsnHistogramCompare',
491
+ 'gsnHistogramComputePercentages',
492
+ 'gsnHistogramComputePercentagesNoMissing',
493
+ 'gsnHistogramDiscreteBinValues', 'gsnHistogramDiscreteClassValues',
494
+ 'gsnHistogramHorizontal', 'gsnHistogramMinMaxBinsOn',
495
+ 'gsnHistogramNumberOfBins', 'gsnHistogramPercentSign',
496
+ 'gsnHistogramSelectNiceIntervals', 'gsnLeftString',
497
+ 'gsnLeftStringFontColor', 'gsnLeftStringFontHeightF',
498
+ 'gsnLeftStringFuncCode', 'gsnLeftStringOrthogonalPosF',
499
+ 'gsnLeftStringParallelPosF', 'gsnMajorLatSpacing',
500
+ 'gsnMajorLonSpacing', 'gsnMaskLambertConformal',
501
+ 'gsnMaskLambertConformalOutlineOn', 'gsnMaximize',
502
+ 'gsnMinorLatSpacing', 'gsnMinorLonSpacing', 'gsnPanelBottom',
503
+ 'gsnPanelCenter', 'gsnPanelDebug', 'gsnPanelFigureStrings',
504
+ 'gsnPanelFigureStringsBackgroundFillColor',
505
+ 'gsnPanelFigureStringsFontHeightF', 'gsnPanelFigureStringsJust',
506
+ 'gsnPanelFigureStringsPerimOn', 'gsnPanelLabelBar', 'gsnPanelLeft',
507
+ 'gsnPanelMainFont', 'gsnPanelMainFontColor',
508
+ 'gsnPanelMainFontHeightF', 'gsnPanelMainString', 'gsnPanelRight',
509
+ 'gsnPanelRowSpec', 'gsnPanelScalePlotIndex', 'gsnPanelTop',
510
+ 'gsnPanelXF', 'gsnPanelXWhiteSpacePercent', 'gsnPanelYF',
511
+ 'gsnPanelYWhiteSpacePercent', 'gsnPaperHeight', 'gsnPaperMargin',
512
+ 'gsnPaperOrientation', 'gsnPaperWidth', 'gsnPolar',
513
+ 'gsnPolarLabelDistance', 'gsnPolarLabelFont',
514
+ 'gsnPolarLabelFontHeightF', 'gsnPolarLabelSpacing', 'gsnPolarTime',
515
+ 'gsnPolarUT', 'gsnRightString', 'gsnRightStringFontColor',
516
+ 'gsnRightStringFontHeightF', 'gsnRightStringFuncCode',
517
+ 'gsnRightStringOrthogonalPosF', 'gsnRightStringParallelPosF',
518
+ 'gsnScalarContour', 'gsnScale', 'gsnShape', 'gsnSpreadColorEnd',
519
+ 'gsnSpreadColorStart', 'gsnSpreadColors', 'gsnStringFont',
520
+ 'gsnStringFontColor', 'gsnStringFontHeightF', 'gsnStringFuncCode',
521
+ 'gsnTickMarksOn', 'gsnXAxisIrregular2Linear', 'gsnXAxisIrregular2Log',
522
+ 'gsnXRefLine', 'gsnXRefLineColor', 'gsnXRefLineDashPattern',
523
+ 'gsnXRefLineThicknessF', 'gsnXYAboveFillColors', 'gsnXYBarChart',
524
+ 'gsnXYBarChartBarWidth', 'gsnXYBarChartColors',
525
+ 'gsnXYBarChartColors2', 'gsnXYBarChartFillDotSizeF',
526
+ 'gsnXYBarChartFillLineThicknessF', 'gsnXYBarChartFillOpacityF',
527
+ 'gsnXYBarChartFillScaleF', 'gsnXYBarChartOutlineOnly',
528
+ 'gsnXYBarChartOutlineThicknessF', 'gsnXYBarChartPatterns',
529
+ 'gsnXYBarChartPatterns2', 'gsnXYBelowFillColors', 'gsnXYFillColors',
530
+ 'gsnXYFillOpacities', 'gsnXYLeftFillColors', 'gsnXYRightFillColors',
531
+ 'gsnYAxisIrregular2Linear', 'gsnYAxisIrregular2Log', 'gsnYRefLine',
532
+ 'gsnYRefLineColor', 'gsnYRefLineColors', 'gsnYRefLineDashPattern',
533
+ 'gsnYRefLineDashPatterns', 'gsnYRefLineThicknessF',
534
+ 'gsnYRefLineThicknesses', 'gsnZonalMean', 'gsnZonalMeanXMaxF',
535
+ 'gsnZonalMeanXMinF', 'gsnZonalMeanYRefLine', 'lbAutoManage',
536
+ 'lbBottomMarginF', 'lbBoxCount', 'lbBoxEndCapStyle', 'lbBoxFractions',
537
+ 'lbBoxLineColor', 'lbBoxLineDashPattern', 'lbBoxLineDashSegLenF',
538
+ 'lbBoxLineThicknessF', 'lbBoxLinesOn', 'lbBoxMajorExtentF',
539
+ 'lbBoxMinorExtentF', 'lbBoxSeparatorLinesOn', 'lbBoxSizing',
540
+ 'lbFillBackground', 'lbFillColor', 'lbFillColors', 'lbFillDotSizeF',
541
+ 'lbFillLineThicknessF', 'lbFillPattern', 'lbFillPatterns',
542
+ 'lbFillScaleF', 'lbFillScales', 'lbJustification', 'lbLabelAlignment',
543
+ 'lbLabelAngleF', 'lbLabelAutoStride', 'lbLabelBarOn',
544
+ 'lbLabelConstantSpacingF', 'lbLabelDirection', 'lbLabelFont',
545
+ 'lbLabelFontAspectF', 'lbLabelFontColor', 'lbLabelFontHeightF',
546
+ 'lbLabelFontQuality', 'lbLabelFontThicknessF', 'lbLabelFuncCode',
547
+ 'lbLabelJust', 'lbLabelOffsetF', 'lbLabelPosition', 'lbLabelStride',
548
+ 'lbLabelStrings', 'lbLabelsOn', 'lbLeftMarginF', 'lbMaxLabelLenF',
549
+ 'lbMinLabelSpacingF', 'lbMonoFillColor', 'lbMonoFillPattern',
550
+ 'lbMonoFillScale', 'lbOrientation', 'lbPerimColor',
551
+ 'lbPerimDashPattern', 'lbPerimDashSegLenF', 'lbPerimFill',
552
+ 'lbPerimFillColor', 'lbPerimOn', 'lbPerimThicknessF',
553
+ 'lbRasterFillOn', 'lbRightMarginF', 'lbTitleAngleF',
554
+ 'lbTitleConstantSpacingF', 'lbTitleDirection', 'lbTitleExtentF',
555
+ 'lbTitleFont', 'lbTitleFontAspectF', 'lbTitleFontColor',
556
+ 'lbTitleFontHeightF', 'lbTitleFontQuality', 'lbTitleFontThicknessF',
557
+ 'lbTitleFuncCode', 'lbTitleJust', 'lbTitleOffsetF', 'lbTitleOn',
558
+ 'lbTitlePosition', 'lbTitleString', 'lbTopMarginF', 'lgAutoManage',
559
+ 'lgBottomMarginF', 'lgBoxBackground', 'lgBoxLineColor',
560
+ 'lgBoxLineDashPattern', 'lgBoxLineDashSegLenF', 'lgBoxLineThicknessF',
561
+ 'lgBoxLinesOn', 'lgBoxMajorExtentF', 'lgBoxMinorExtentF',
562
+ 'lgDashIndex', 'lgDashIndexes', 'lgItemCount', 'lgItemOrder',
563
+ 'lgItemPlacement', 'lgItemPositions', 'lgItemType', 'lgItemTypes',
564
+ 'lgJustification', 'lgLabelAlignment', 'lgLabelAngleF',
565
+ 'lgLabelAutoStride', 'lgLabelConstantSpacingF', 'lgLabelDirection',
566
+ 'lgLabelFont', 'lgLabelFontAspectF', 'lgLabelFontColor',
567
+ 'lgLabelFontHeightF', 'lgLabelFontQuality', 'lgLabelFontThicknessF',
568
+ 'lgLabelFuncCode', 'lgLabelJust', 'lgLabelOffsetF', 'lgLabelPosition',
569
+ 'lgLabelStride', 'lgLabelStrings', 'lgLabelsOn', 'lgLeftMarginF',
570
+ 'lgLegendOn', 'lgLineColor', 'lgLineColors', 'lgLineDashSegLenF',
571
+ 'lgLineDashSegLens', 'lgLineLabelConstantSpacingF', 'lgLineLabelFont',
572
+ 'lgLineLabelFontAspectF', 'lgLineLabelFontColor',
573
+ 'lgLineLabelFontColors', 'lgLineLabelFontHeightF',
574
+ 'lgLineLabelFontHeights', 'lgLineLabelFontQuality',
575
+ 'lgLineLabelFontThicknessF', 'lgLineLabelFuncCode',
576
+ 'lgLineLabelStrings', 'lgLineLabelsOn', 'lgLineThicknessF',
577
+ 'lgLineThicknesses', 'lgMarkerColor', 'lgMarkerColors',
578
+ 'lgMarkerIndex', 'lgMarkerIndexes', 'lgMarkerSizeF', 'lgMarkerSizes',
579
+ 'lgMarkerThicknessF', 'lgMarkerThicknesses', 'lgMonoDashIndex',
580
+ 'lgMonoItemType', 'lgMonoLineColor', 'lgMonoLineDashSegLen',
581
+ 'lgMonoLineLabelFontColor', 'lgMonoLineLabelFontHeight',
582
+ 'lgMonoLineThickness', 'lgMonoMarkerColor', 'lgMonoMarkerIndex',
583
+ 'lgMonoMarkerSize', 'lgMonoMarkerThickness', 'lgOrientation',
584
+ 'lgPerimColor', 'lgPerimDashPattern', 'lgPerimDashSegLenF',
585
+ 'lgPerimFill', 'lgPerimFillColor', 'lgPerimOn', 'lgPerimThicknessF',
586
+ 'lgRightMarginF', 'lgTitleAngleF', 'lgTitleConstantSpacingF',
587
+ 'lgTitleDirection', 'lgTitleExtentF', 'lgTitleFont',
588
+ 'lgTitleFontAspectF', 'lgTitleFontColor', 'lgTitleFontHeightF',
589
+ 'lgTitleFontQuality', 'lgTitleFontThicknessF', 'lgTitleFuncCode',
590
+ 'lgTitleJust', 'lgTitleOffsetF', 'lgTitleOn', 'lgTitlePosition',
591
+ 'lgTitleString', 'lgTopMarginF', 'mpAreaGroupCount',
592
+ 'mpAreaMaskingOn', 'mpAreaNames', 'mpAreaTypes', 'mpBottomAngleF',
593
+ 'mpBottomMapPosF', 'mpBottomNDCF', 'mpBottomNPCF',
594
+ 'mpBottomPointLatF', 'mpBottomPointLonF', 'mpBottomWindowF',
595
+ 'mpCenterLatF', 'mpCenterLonF', 'mpCenterRotF', 'mpCountyLineColor',
596
+ 'mpCountyLineDashPattern', 'mpCountyLineDashSegLenF',
597
+ 'mpCountyLineThicknessF', 'mpDataBaseVersion', 'mpDataResolution',
598
+ 'mpDataSetName', 'mpDefaultFillColor', 'mpDefaultFillPattern',
599
+ 'mpDefaultFillScaleF', 'mpDynamicAreaGroups', 'mpEllipticalBoundary',
600
+ 'mpFillAreaSpecifiers', 'mpFillBoundarySets', 'mpFillColor',
601
+ 'mpFillColors', 'mpFillColors-default', 'mpFillDotSizeF',
602
+ 'mpFillDrawOrder', 'mpFillOn', 'mpFillPatternBackground',
603
+ 'mpFillPattern', 'mpFillPatterns', 'mpFillPatterns-default',
604
+ 'mpFillScaleF', 'mpFillScales', 'mpFillScales-default',
605
+ 'mpFixedAreaGroups', 'mpGeophysicalLineColor',
606
+ 'mpGeophysicalLineDashPattern', 'mpGeophysicalLineDashSegLenF',
607
+ 'mpGeophysicalLineThicknessF', 'mpGreatCircleLinesOn',
608
+ 'mpGridAndLimbDrawOrder', 'mpGridAndLimbOn', 'mpGridLatSpacingF',
609
+ 'mpGridLineColor', 'mpGridLineDashPattern', 'mpGridLineDashSegLenF',
610
+ 'mpGridLineThicknessF', 'mpGridLonSpacingF', 'mpGridMaskMode',
611
+ 'mpGridMaxLatF', 'mpGridPolarLonSpacingF', 'mpGridSpacingF',
612
+ 'mpInlandWaterFillColor', 'mpInlandWaterFillPattern',
613
+ 'mpInlandWaterFillScaleF', 'mpLabelDrawOrder', 'mpLabelFontColor',
614
+ 'mpLabelFontHeightF', 'mpLabelsOn', 'mpLambertMeridianF',
615
+ 'mpLambertParallel1F', 'mpLambertParallel2F', 'mpLandFillColor',
616
+ 'mpLandFillPattern', 'mpLandFillScaleF', 'mpLeftAngleF',
617
+ 'mpLeftCornerLatF', 'mpLeftCornerLonF', 'mpLeftMapPosF',
618
+ 'mpLeftNDCF', 'mpLeftNPCF', 'mpLeftPointLatF',
619
+ 'mpLeftPointLonF', 'mpLeftWindowF', 'mpLimbLineColor',
620
+ 'mpLimbLineDashPattern', 'mpLimbLineDashSegLenF',
621
+ 'mpLimbLineThicknessF', 'mpLimitMode', 'mpMaskAreaSpecifiers',
622
+ 'mpMaskOutlineSpecifiers', 'mpMaxLatF', 'mpMaxLonF',
623
+ 'mpMinLatF', 'mpMinLonF', 'mpMonoFillColor', 'mpMonoFillPattern',
624
+ 'mpMonoFillScale', 'mpNationalLineColor', 'mpNationalLineDashPattern',
625
+ 'mpNationalLineThicknessF', 'mpOceanFillColor', 'mpOceanFillPattern',
626
+ 'mpOceanFillScaleF', 'mpOutlineBoundarySets', 'mpOutlineDrawOrder',
627
+ 'mpOutlineMaskingOn', 'mpOutlineOn', 'mpOutlineSpecifiers',
628
+ 'mpPerimDrawOrder', 'mpPerimLineColor', 'mpPerimLineDashPattern',
629
+ 'mpPerimLineDashSegLenF', 'mpPerimLineThicknessF', 'mpPerimOn',
630
+ 'mpPolyMode', 'mpProjection', 'mpProvincialLineColor',
631
+ 'mpProvincialLineDashPattern', 'mpProvincialLineDashSegLenF',
632
+ 'mpProvincialLineThicknessF', 'mpRelativeCenterLat',
633
+ 'mpRelativeCenterLon', 'mpRightAngleF', 'mpRightCornerLatF',
634
+ 'mpRightCornerLonF', 'mpRightMapPosF', 'mpRightNDCF',
635
+ 'mpRightNPCF', 'mpRightPointLatF', 'mpRightPointLonF',
636
+ 'mpRightWindowF', 'mpSatelliteAngle1F', 'mpSatelliteAngle2F',
637
+ 'mpSatelliteDistF', 'mpShapeMode', 'mpSpecifiedFillColors',
638
+ 'mpSpecifiedFillDirectIndexing', 'mpSpecifiedFillPatterns',
639
+ 'mpSpecifiedFillPriority', 'mpSpecifiedFillScales',
640
+ 'mpTopAngleF', 'mpTopMapPosF', 'mpTopNDCF', 'mpTopNPCF',
641
+ 'mpTopPointLatF', 'mpTopPointLonF', 'mpTopWindowF',
642
+ 'mpUSStateLineColor', 'mpUSStateLineDashPattern',
643
+ 'mpUSStateLineDashSegLenF', 'mpUSStateLineThicknessF',
644
+ 'pmAnnoManagers', 'pmAnnoViews', 'pmLabelBarDisplayMode',
645
+ 'pmLabelBarHeightF', 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF',
646
+ 'pmLabelBarParallelPosF', 'pmLabelBarSide', 'pmLabelBarWidthF',
647
+ 'pmLabelBarZone', 'pmLegendDisplayMode', 'pmLegendHeightF',
648
+ 'pmLegendKeepAspect', 'pmLegendOrthogonalPosF',
649
+ 'pmLegendParallelPosF', 'pmLegendSide', 'pmLegendWidthF',
650
+ 'pmLegendZone', 'pmOverlaySequenceIds', 'pmTickMarkDisplayMode',
651
+ 'pmTickMarkZone', 'pmTitleDisplayMode', 'pmTitleZone',
652
+ 'prGraphicStyle', 'prPolyType', 'prXArray', 'prYArray',
653
+ 'sfCopyData', 'sfDataArray', 'sfDataMaxV', 'sfDataMinV',
654
+ 'sfElementNodes', 'sfExchangeDimensions', 'sfFirstNodeIndex',
655
+ 'sfMissingValueV', 'sfXArray', 'sfXCActualEndF', 'sfXCActualStartF',
656
+ 'sfXCEndIndex', 'sfXCEndSubsetV', 'sfXCEndV', 'sfXCStartIndex',
657
+ 'sfXCStartSubsetV', 'sfXCStartV', 'sfXCStride', 'sfXCellBounds',
658
+ 'sfYArray', 'sfYCActualEndF', 'sfYCActualStartF', 'sfYCEndIndex',
659
+ 'sfYCEndSubsetV', 'sfYCEndV', 'sfYCStartIndex', 'sfYCStartSubsetV',
660
+ 'sfYCStartV', 'sfYCStride', 'sfYCellBounds', 'stArrowLengthF',
661
+ 'stArrowStride', 'stCrossoverCheckCount',
662
+ 'stExplicitLabelBarLabelsOn', 'stLabelBarEndLabelsOn',
663
+ 'stLabelFormat', 'stLengthCheckCount', 'stLevelColors',
664
+ 'stLevelCount', 'stLevelPalette', 'stLevelSelectionMode',
665
+ 'stLevelSpacingF', 'stLevels', 'stLineColor', 'stLineOpacityF',
666
+ 'stLineStartStride', 'stLineThicknessF', 'stMapDirection',
667
+ 'stMaxLevelCount', 'stMaxLevelValF', 'stMinArrowSpacingF',
668
+ 'stMinDistanceF', 'stMinLevelValF', 'stMinLineSpacingF',
669
+ 'stMinStepFactorF', 'stMonoLineColor', 'stNoDataLabelOn',
670
+ 'stNoDataLabelString', 'stScalarFieldData', 'stScalarMissingValColor',
671
+ 'stSpanLevelPalette', 'stStepSizeF', 'stStreamlineDrawOrder',
672
+ 'stUseScalarArray', 'stVectorFieldData', 'stZeroFLabelAngleF',
673
+ 'stZeroFLabelBackgroundColor', 'stZeroFLabelConstantSpacingF',
674
+ 'stZeroFLabelFont', 'stZeroFLabelFontAspectF',
675
+ 'stZeroFLabelFontColor', 'stZeroFLabelFontHeightF',
676
+ 'stZeroFLabelFontQuality', 'stZeroFLabelFontThicknessF',
677
+ 'stZeroFLabelFuncCode', 'stZeroFLabelJust', 'stZeroFLabelOn',
678
+ 'stZeroFLabelOrthogonalPosF', 'stZeroFLabelParallelPosF',
679
+ 'stZeroFLabelPerimColor', 'stZeroFLabelPerimOn',
680
+ 'stZeroFLabelPerimSpaceF', 'stZeroFLabelPerimThicknessF',
681
+ 'stZeroFLabelSide', 'stZeroFLabelString', 'stZeroFLabelTextDirection',
682
+ 'stZeroFLabelZone', 'tfDoNDCOverlay', 'tfPlotManagerOn',
683
+ 'tfPolyDrawList', 'tfPolyDrawOrder', 'tiDeltaF', 'tiMainAngleF',
684
+ 'tiMainConstantSpacingF', 'tiMainDirection', 'tiMainFont',
685
+ 'tiMainFontAspectF', 'tiMainFontColor', 'tiMainFontHeightF',
686
+ 'tiMainFontQuality', 'tiMainFontThicknessF', 'tiMainFuncCode',
687
+ 'tiMainJust', 'tiMainOffsetXF', 'tiMainOffsetYF', 'tiMainOn',
688
+ 'tiMainPosition', 'tiMainSide', 'tiMainString', 'tiUseMainAttributes',
689
+ 'tiXAxisAngleF', 'tiXAxisConstantSpacingF', 'tiXAxisDirection',
690
+ 'tiXAxisFont', 'tiXAxisFontAspectF', 'tiXAxisFontColor',
691
+ 'tiXAxisFontHeightF', 'tiXAxisFontQuality', 'tiXAxisFontThicknessF',
692
+ 'tiXAxisFuncCode', 'tiXAxisJust', 'tiXAxisOffsetXF',
693
+ 'tiXAxisOffsetYF', 'tiXAxisOn', 'tiXAxisPosition', 'tiXAxisSide',
694
+ 'tiXAxisString', 'tiYAxisAngleF', 'tiYAxisConstantSpacingF',
695
+ 'tiYAxisDirection', 'tiYAxisFont', 'tiYAxisFontAspectF',
696
+ 'tiYAxisFontColor', 'tiYAxisFontHeightF', 'tiYAxisFontQuality',
697
+ 'tiYAxisFontThicknessF', 'tiYAxisFuncCode', 'tiYAxisJust',
698
+ 'tiYAxisOffsetXF', 'tiYAxisOffsetYF', 'tiYAxisOn', 'tiYAxisPosition',
699
+ 'tiYAxisSide', 'tiYAxisString', 'tmBorderLineColor',
700
+ 'tmBorderThicknessF', 'tmEqualizeXYSizes', 'tmLabelAutoStride',
701
+ 'tmSciNoteCutoff', 'tmXBAutoPrecision', 'tmXBBorderOn',
702
+ 'tmXBDataLeftF', 'tmXBDataRightF', 'tmXBFormat', 'tmXBIrrTensionF',
703
+ 'tmXBIrregularPoints', 'tmXBLabelAngleF', 'tmXBLabelConstantSpacingF',
704
+ 'tmXBLabelDeltaF', 'tmXBLabelDirection', 'tmXBLabelFont',
705
+ 'tmXBLabelFontAspectF', 'tmXBLabelFontColor', 'tmXBLabelFontHeightF',
706
+ 'tmXBLabelFontQuality', 'tmXBLabelFontThicknessF',
707
+ 'tmXBLabelFuncCode', 'tmXBLabelJust', 'tmXBLabelStride', 'tmXBLabels',
708
+ 'tmXBLabelsOn', 'tmXBMajorLengthF', 'tmXBMajorLineColor',
709
+ 'tmXBMajorOutwardLengthF', 'tmXBMajorThicknessF', 'tmXBMaxLabelLenF',
710
+ 'tmXBMaxTicks', 'tmXBMinLabelSpacingF', 'tmXBMinorLengthF',
711
+ 'tmXBMinorLineColor', 'tmXBMinorOn', 'tmXBMinorOutwardLengthF',
712
+ 'tmXBMinorPerMajor', 'tmXBMinorThicknessF', 'tmXBMinorValues',
713
+ 'tmXBMode', 'tmXBOn', 'tmXBPrecision', 'tmXBStyle', 'tmXBTickEndF',
714
+ 'tmXBTickSpacingF', 'tmXBTickStartF', 'tmXBValues', 'tmXMajorGrid',
715
+ 'tmXMajorGridLineColor', 'tmXMajorGridLineDashPattern',
716
+ 'tmXMajorGridThicknessF', 'tmXMinorGrid', 'tmXMinorGridLineColor',
717
+ 'tmXMinorGridLineDashPattern', 'tmXMinorGridThicknessF',
718
+ 'tmXTAutoPrecision', 'tmXTBorderOn', 'tmXTDataLeftF',
719
+ 'tmXTDataRightF', 'tmXTFormat', 'tmXTIrrTensionF',
720
+ 'tmXTIrregularPoints', 'tmXTLabelAngleF', 'tmXTLabelConstantSpacingF',
721
+ 'tmXTLabelDeltaF', 'tmXTLabelDirection', 'tmXTLabelFont',
722
+ 'tmXTLabelFontAspectF', 'tmXTLabelFontColor', 'tmXTLabelFontHeightF',
723
+ 'tmXTLabelFontQuality', 'tmXTLabelFontThicknessF',
724
+ 'tmXTLabelFuncCode', 'tmXTLabelJust', 'tmXTLabelStride', 'tmXTLabels',
725
+ 'tmXTLabelsOn', 'tmXTMajorLengthF', 'tmXTMajorLineColor',
726
+ 'tmXTMajorOutwardLengthF', 'tmXTMajorThicknessF', 'tmXTMaxLabelLenF',
727
+ 'tmXTMaxTicks', 'tmXTMinLabelSpacingF', 'tmXTMinorLengthF',
728
+ 'tmXTMinorLineColor', 'tmXTMinorOn', 'tmXTMinorOutwardLengthF',
729
+ 'tmXTMinorPerMajor', 'tmXTMinorThicknessF', 'tmXTMinorValues',
730
+ 'tmXTMode', 'tmXTOn', 'tmXTPrecision', 'tmXTStyle', 'tmXTTickEndF',
731
+ 'tmXTTickSpacingF', 'tmXTTickStartF', 'tmXTValues', 'tmXUseBottom',
732
+ 'tmYLAutoPrecision', 'tmYLBorderOn', 'tmYLDataBottomF',
733
+ 'tmYLDataTopF', 'tmYLFormat', 'tmYLIrrTensionF',
734
+ 'tmYLIrregularPoints', 'tmYLLabelAngleF', 'tmYLLabelConstantSpacingF',
735
+ 'tmYLLabelDeltaF', 'tmYLLabelDirection', 'tmYLLabelFont',
736
+ 'tmYLLabelFontAspectF', 'tmYLLabelFontColor', 'tmYLLabelFontHeightF',
737
+ 'tmYLLabelFontQuality', 'tmYLLabelFontThicknessF',
738
+ 'tmYLLabelFuncCode', 'tmYLLabelJust', 'tmYLLabelStride', 'tmYLLabels',
739
+ 'tmYLLabelsOn', 'tmYLMajorLengthF', 'tmYLMajorLineColor',
740
+ 'tmYLMajorOutwardLengthF', 'tmYLMajorThicknessF', 'tmYLMaxLabelLenF',
741
+ 'tmYLMaxTicks', 'tmYLMinLabelSpacingF', 'tmYLMinorLengthF',
742
+ 'tmYLMinorLineColor', 'tmYLMinorOn', 'tmYLMinorOutwardLengthF',
743
+ 'tmYLMinorPerMajor', 'tmYLMinorThicknessF', 'tmYLMinorValues',
744
+ 'tmYLMode', 'tmYLOn', 'tmYLPrecision', 'tmYLStyle', 'tmYLTickEndF',
745
+ 'tmYLTickSpacingF', 'tmYLTickStartF', 'tmYLValues', 'tmYMajorGrid',
746
+ 'tmYMajorGridLineColor', 'tmYMajorGridLineDashPattern',
747
+ 'tmYMajorGridThicknessF', 'tmYMinorGrid', 'tmYMinorGridLineColor',
748
+ 'tmYMinorGridLineDashPattern', 'tmYMinorGridThicknessF',
749
+ 'tmYRAutoPrecision', 'tmYRBorderOn', 'tmYRDataBottomF',
750
+ 'tmYRDataTopF', 'tmYRFormat', 'tmYRIrrTensionF',
751
+ 'tmYRIrregularPoints', 'tmYRLabelAngleF', 'tmYRLabelConstantSpacingF',
752
+ 'tmYRLabelDeltaF', 'tmYRLabelDirection', 'tmYRLabelFont',
753
+ 'tmYRLabelFontAspectF', 'tmYRLabelFontColor', 'tmYRLabelFontHeightF',
754
+ 'tmYRLabelFontQuality', 'tmYRLabelFontThicknessF',
755
+ 'tmYRLabelFuncCode', 'tmYRLabelJust', 'tmYRLabelStride', 'tmYRLabels',
756
+ 'tmYRLabelsOn', 'tmYRMajorLengthF', 'tmYRMajorLineColor',
757
+ 'tmYRMajorOutwardLengthF', 'tmYRMajorThicknessF', 'tmYRMaxLabelLenF',
758
+ 'tmYRMaxTicks', 'tmYRMinLabelSpacingF', 'tmYRMinorLengthF',
759
+ 'tmYRMinorLineColor', 'tmYRMinorOn', 'tmYRMinorOutwardLengthF',
760
+ 'tmYRMinorPerMajor', 'tmYRMinorThicknessF', 'tmYRMinorValues',
761
+ 'tmYRMode', 'tmYROn', 'tmYRPrecision', 'tmYRStyle', 'tmYRTickEndF',
762
+ 'tmYRTickSpacingF', 'tmYRTickStartF', 'tmYRValues', 'tmYUseLeft',
763
+ 'trGridType', 'trLineInterpolationOn',
764
+ 'trXAxisType', 'trXCoordPoints', 'trXInterPoints', 'trXLog',
765
+ 'trXMaxF', 'trXMinF', 'trXReverse', 'trXSamples', 'trXTensionF',
766
+ 'trYAxisType', 'trYCoordPoints', 'trYInterPoints', 'trYLog',
767
+ 'trYMaxF', 'trYMinF', 'trYReverse', 'trYSamples', 'trYTensionF',
768
+ 'txAngleF', 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection',
769
+ 'txFont', 'HLU-Fonts', 'txFontAspectF', 'txFontColor',
770
+ 'txFontHeightF', 'txFontOpacityF', 'txFontQuality',
771
+ 'txFontThicknessF', 'txFuncCode', 'txJust', 'txPerimColor',
772
+ 'txPerimDashLengthF', 'txPerimDashPattern', 'txPerimOn',
773
+ 'txPerimSpaceF', 'txPerimThicknessF', 'txPosXF', 'txPosYF',
774
+ 'txString', 'vcExplicitLabelBarLabelsOn', 'vcFillArrowEdgeColor',
775
+ 'vcFillArrowEdgeThicknessF', 'vcFillArrowFillColor',
776
+ 'vcFillArrowHeadInteriorXF', 'vcFillArrowHeadMinFracXF',
777
+ 'vcFillArrowHeadMinFracYF', 'vcFillArrowHeadXF', 'vcFillArrowHeadYF',
778
+ 'vcFillArrowMinFracWidthF', 'vcFillArrowWidthF', 'vcFillArrowsOn',
779
+ 'vcFillOverEdge', 'vcGlyphOpacityF', 'vcGlyphStyle',
780
+ 'vcLabelBarEndLabelsOn', 'vcLabelFontColor', 'vcLabelFontHeightF',
781
+ 'vcLabelsOn', 'vcLabelsUseVectorColor', 'vcLevelColors',
782
+ 'vcLevelCount', 'vcLevelPalette', 'vcLevelSelectionMode',
783
+ 'vcLevelSpacingF', 'vcLevels', 'vcLineArrowColor',
784
+ 'vcLineArrowHeadMaxSizeF', 'vcLineArrowHeadMinSizeF',
785
+ 'vcLineArrowThicknessF', 'vcMagnitudeFormat',
786
+ 'vcMagnitudeScaleFactorF', 'vcMagnitudeScaleValueF',
787
+ 'vcMagnitudeScalingMode', 'vcMapDirection', 'vcMaxLevelCount',
788
+ 'vcMaxLevelValF', 'vcMaxMagnitudeF', 'vcMinAnnoAngleF',
789
+ 'vcMinAnnoArrowAngleF', 'vcMinAnnoArrowEdgeColor',
790
+ 'vcMinAnnoArrowFillColor', 'vcMinAnnoArrowLineColor',
791
+ 'vcMinAnnoArrowMinOffsetF', 'vcMinAnnoArrowSpaceF',
792
+ 'vcMinAnnoArrowUseVecColor', 'vcMinAnnoBackgroundColor',
793
+ 'vcMinAnnoConstantSpacingF', 'vcMinAnnoExplicitMagnitudeF',
794
+ 'vcMinAnnoFont', 'vcMinAnnoFontAspectF', 'vcMinAnnoFontColor',
795
+ 'vcMinAnnoFontHeightF', 'vcMinAnnoFontQuality',
796
+ 'vcMinAnnoFontThicknessF', 'vcMinAnnoFuncCode', 'vcMinAnnoJust',
797
+ 'vcMinAnnoOn', 'vcMinAnnoOrientation', 'vcMinAnnoOrthogonalPosF',
798
+ 'vcMinAnnoParallelPosF', 'vcMinAnnoPerimColor', 'vcMinAnnoPerimOn',
799
+ 'vcMinAnnoPerimSpaceF', 'vcMinAnnoPerimThicknessF', 'vcMinAnnoSide',
800
+ 'vcMinAnnoString1', 'vcMinAnnoString1On', 'vcMinAnnoString2',
801
+ 'vcMinAnnoString2On', 'vcMinAnnoTextDirection', 'vcMinAnnoZone',
802
+ 'vcMinDistanceF', 'vcMinFracLengthF', 'vcMinLevelValF',
803
+ 'vcMinMagnitudeF', 'vcMonoFillArrowEdgeColor',
804
+ 'vcMonoFillArrowFillColor', 'vcMonoLineArrowColor',
805
+ 'vcMonoWindBarbColor', 'vcNoDataLabelOn', 'vcNoDataLabelString',
806
+ 'vcPositionMode', 'vcRefAnnoAngleF', 'vcRefAnnoArrowAngleF',
807
+ 'vcRefAnnoArrowEdgeColor', 'vcRefAnnoArrowFillColor',
808
+ 'vcRefAnnoArrowLineColor', 'vcRefAnnoArrowMinOffsetF',
809
+ 'vcRefAnnoArrowSpaceF', 'vcRefAnnoArrowUseVecColor',
810
+ 'vcRefAnnoBackgroundColor', 'vcRefAnnoConstantSpacingF',
811
+ 'vcRefAnnoExplicitMagnitudeF', 'vcRefAnnoFont',
812
+ 'vcRefAnnoFontAspectF', 'vcRefAnnoFontColor', 'vcRefAnnoFontHeightF',
813
+ 'vcRefAnnoFontQuality', 'vcRefAnnoFontThicknessF',
814
+ 'vcRefAnnoFuncCode', 'vcRefAnnoJust', 'vcRefAnnoOn',
815
+ 'vcRefAnnoOrientation', 'vcRefAnnoOrthogonalPosF',
816
+ 'vcRefAnnoParallelPosF', 'vcRefAnnoPerimColor', 'vcRefAnnoPerimOn',
817
+ 'vcRefAnnoPerimSpaceF', 'vcRefAnnoPerimThicknessF', 'vcRefAnnoSide',
818
+ 'vcRefAnnoString1', 'vcRefAnnoString1On', 'vcRefAnnoString2',
819
+ 'vcRefAnnoString2On', 'vcRefAnnoTextDirection', 'vcRefAnnoZone',
820
+ 'vcRefLengthF', 'vcRefMagnitudeF', 'vcScalarFieldData',
821
+ 'vcScalarMissingValColor', 'vcScalarValueFormat',
822
+ 'vcScalarValueScaleFactorF', 'vcScalarValueScaleValueF',
823
+ 'vcScalarValueScalingMode', 'vcSpanLevelPalette', 'vcUseRefAnnoRes',
824
+ 'vcUseScalarArray', 'vcVectorDrawOrder', 'vcVectorFieldData',
825
+ 'vcWindBarbCalmCircleSizeF', 'vcWindBarbColor',
826
+ 'vcWindBarbLineThicknessF', 'vcWindBarbScaleFactorF',
827
+ 'vcWindBarbTickAngleF', 'vcWindBarbTickLengthF',
828
+ 'vcWindBarbTickSpacingF', 'vcZeroFLabelAngleF',
829
+ 'vcZeroFLabelBackgroundColor', 'vcZeroFLabelConstantSpacingF',
830
+ 'vcZeroFLabelFont', 'vcZeroFLabelFontAspectF',
831
+ 'vcZeroFLabelFontColor', 'vcZeroFLabelFontHeightF',
832
+ 'vcZeroFLabelFontQuality', 'vcZeroFLabelFontThicknessF',
833
+ 'vcZeroFLabelFuncCode', 'vcZeroFLabelJust', 'vcZeroFLabelOn',
834
+ 'vcZeroFLabelOrthogonalPosF', 'vcZeroFLabelParallelPosF',
835
+ 'vcZeroFLabelPerimColor', 'vcZeroFLabelPerimOn',
836
+ 'vcZeroFLabelPerimSpaceF', 'vcZeroFLabelPerimThicknessF',
837
+ 'vcZeroFLabelSide', 'vcZeroFLabelString', 'vcZeroFLabelTextDirection',
838
+ 'vcZeroFLabelZone', 'vfCopyData', 'vfDataArray',
839
+ 'vfExchangeDimensions', 'vfExchangeUVData', 'vfMagMaxV', 'vfMagMinV',
840
+ 'vfMissingUValueV', 'vfMissingVValueV', 'vfPolarData',
841
+ 'vfSingleMissingValue', 'vfUDataArray', 'vfUMaxV', 'vfUMinV',
842
+ 'vfVDataArray', 'vfVMaxV', 'vfVMinV', 'vfXArray', 'vfXCActualEndF',
843
+ 'vfXCActualStartF', 'vfXCEndIndex', 'vfXCEndSubsetV', 'vfXCEndV',
844
+ 'vfXCStartIndex', 'vfXCStartSubsetV', 'vfXCStartV', 'vfXCStride',
845
+ 'vfYArray', 'vfYCActualEndF', 'vfYCActualStartF', 'vfYCEndIndex',
846
+ 'vfYCEndSubsetV', 'vfYCEndV', 'vfYCStartIndex', 'vfYCStartSubsetV',
847
+ 'vfYCStartV', 'vfYCStride', 'vpAnnoManagerId', 'vpClipOn',
848
+ 'vpHeightF', 'vpKeepAspect', 'vpOn', 'vpUseSegments', 'vpWidthF',
849
+ 'vpXF', 'vpYF', 'wkAntiAlias', 'wkBackgroundColor', 'wkBackgroundOpacityF',
850
+ 'wkColorMapLen', 'wkColorMap', 'wkColorModel', 'wkDashTableLength',
851
+ 'wkDefGraphicStyleId', 'wkDeviceLowerX', 'wkDeviceLowerY',
852
+ 'wkDeviceUpperX', 'wkDeviceUpperY', 'wkFileName', 'wkFillTableLength',
853
+ 'wkForegroundColor', 'wkFormat', 'wkFullBackground', 'wkGksWorkId',
854
+ 'wkHeight', 'wkMarkerTableLength', 'wkMetaName', 'wkOrientation',
855
+ 'wkPDFFileName', 'wkPDFFormat', 'wkPDFResolution', 'wkPSFileName',
856
+ 'wkPSFormat', 'wkPSResolution', 'wkPaperHeightF', 'wkPaperSize',
857
+ 'wkPaperWidthF', 'wkPause', 'wkTopLevelViews', 'wkViews',
858
+ 'wkVisualType', 'wkWidth', 'wkWindowId', 'wkXColorMode', 'wsCurrentSize',
859
+ 'wsMaximumSize', 'wsThresholdSize', 'xyComputeXMax',
860
+ 'xyComputeXMin', 'xyComputeYMax', 'xyComputeYMin', 'xyCoordData',
861
+ 'xyCoordDataSpec', 'xyCurveDrawOrder', 'xyDashPattern',
862
+ 'xyDashPatterns', 'xyExplicitLabels', 'xyExplicitLegendLabels',
863
+ 'xyLabelMode', 'xyLineColor', 'xyLineColors', 'xyLineDashSegLenF',
864
+ 'xyLineLabelConstantSpacingF', 'xyLineLabelFont',
865
+ 'xyLineLabelFontAspectF', 'xyLineLabelFontColor',
866
+ 'xyLineLabelFontColors', 'xyLineLabelFontHeightF',
867
+ 'xyLineLabelFontQuality', 'xyLineLabelFontThicknessF',
868
+ 'xyLineLabelFuncCode', 'xyLineThicknessF', 'xyLineThicknesses',
869
+ 'xyMarkLineMode', 'xyMarkLineModes', 'xyMarker', 'xyMarkerColor',
870
+ 'xyMarkerColors', 'xyMarkerSizeF', 'xyMarkerSizes',
871
+ 'xyMarkerThicknessF', 'xyMarkerThicknesses', 'xyMarkers',
872
+ 'xyMonoDashPattern', 'xyMonoLineColor', 'xyMonoLineLabelFontColor',
873
+ 'xyMonoLineThickness', 'xyMonoMarkLineMode', 'xyMonoMarker',
874
+ 'xyMonoMarkerColor', 'xyMonoMarkerSize', 'xyMonoMarkerThickness',
875
+ 'xyXIrrTensionF', 'xyXIrregularPoints', 'xyXStyle', 'xyYIrrTensionF',
876
+ 'xyYIrregularPoints', 'xyYStyle'), prefix=r'\b'),
877
+ Name.Builtin),
878
+
879
+ # Booleans
880
+ (r'\.(True|False)\.', Name.Builtin),
881
+ # Comparing Operators
882
+ (r'\.(eq|ne|lt|le|gt|ge|not|and|or|xor)\.', Operator.Word),
883
+ ],
884
+
885
+ 'strings': [
886
+ (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
887
+ ],
888
+
889
+ 'nums': [
890
+ (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer),
891
+ (r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
892
+ (r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
893
+ ],
894
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nimrod.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.nimrod
3
+ ~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for the Nim language (formerly known as Nimrod).
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include, default, bygroups
14
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
+ Number, Punctuation, Error
16
+
17
+ __all__ = ['NimrodLexer']
18
+
19
+
20
+ class NimrodLexer(RegexLexer):
21
+ """
22
+ For Nim source code.
23
+ """
24
+
25
+ name = 'Nimrod'
26
+ url = 'http://nim-lang.org/'
27
+ aliases = ['nimrod', 'nim']
28
+ filenames = ['*.nim', '*.nimrod']
29
+ mimetypes = ['text/x-nim']
30
+ version_added = '1.5'
31
+
32
+ flags = re.MULTILINE | re.IGNORECASE
33
+
34
+ def underscorize(words):
35
+ newWords = []
36
+ new = []
37
+ for word in words:
38
+ for ch in word:
39
+ new.append(ch)
40
+ new.append("_?")
41
+ newWords.append(''.join(new))
42
+ new = []
43
+ return "|".join(newWords)
44
+
45
+ keywords = [
46
+ 'addr', 'and', 'as', 'asm', 'bind', 'block', 'break', 'case',
47
+ 'cast', 'concept', 'const', 'continue', 'converter', 'defer', 'discard',
48
+ 'distinct', 'div', 'do', 'elif', 'else', 'end', 'enum', 'except',
49
+ 'export', 'finally', 'for', 'if', 'in', 'yield', 'interface',
50
+ 'is', 'isnot', 'iterator', 'let', 'mixin', 'mod',
51
+ 'not', 'notin', 'object', 'of', 'or', 'out', 'ptr', 'raise',
52
+ 'ref', 'return', 'shl', 'shr', 'static', 'try',
53
+ 'tuple', 'type', 'using', 'when', 'while', 'xor'
54
+ ]
55
+
56
+ keywordsPseudo = [
57
+ 'nil', 'true', 'false'
58
+ ]
59
+
60
+ opWords = [
61
+ 'and', 'or', 'not', 'xor', 'shl', 'shr', 'div', 'mod', 'in',
62
+ 'notin', 'is', 'isnot'
63
+ ]
64
+
65
+ types = [
66
+ 'int', 'int8', 'int16', 'int32', 'int64', 'float', 'float32', 'float64',
67
+ 'bool', 'char', 'range', 'array', 'seq', 'set', 'string'
68
+ ]
69
+
70
+ tokens = {
71
+ 'root': [
72
+ # Comments
73
+ (r'##\[', String.Doc, 'doccomment'),
74
+ (r'##.*$', String.Doc),
75
+ (r'#\[', Comment.Multiline, 'comment'),
76
+ (r'#.*$', Comment),
77
+
78
+ # Pragmas
79
+ (r'\{\.', String.Other, 'pragma'),
80
+
81
+ # Operators
82
+ (r'[*=><+\-/@$~&%!?|\\\[\]]', Operator),
83
+ (r'\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;',
84
+ Punctuation),
85
+
86
+ # Case statement branch
87
+ (r'(\n\s*)(of)(\s)', bygroups(Text.Whitespace, Keyword,
88
+ Text.Whitespace), 'casebranch'),
89
+
90
+ # Strings
91
+ (r'(?:[\w]+)"', String, 'rdqs'),
92
+ (r'"""', String.Double, 'tdqs'),
93
+ ('"', String, 'dqs'),
94
+
95
+ # Char
96
+ ("'", String.Char, 'chars'),
97
+
98
+ # Keywords
99
+ (rf'({underscorize(opWords)})\b', Operator.Word),
100
+ (r'(proc|func|method|macro|template)(\s)(?![(\[\]])',
101
+ bygroups(Keyword, Text.Whitespace), 'funcname'),
102
+ (rf'({underscorize(keywords)})\b', Keyword),
103
+ (r'({})\b'.format(underscorize(['from', 'import', 'include', 'export'])),
104
+ Keyword.Namespace),
105
+ (r'(v_?a_?r)\b', Keyword.Declaration),
106
+ (rf'({underscorize(types)})\b', Name.Builtin),
107
+ (rf'({underscorize(keywordsPseudo)})\b', Keyword.Pseudo),
108
+
109
+ # Identifiers
110
+ (r'\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*', Name),
111
+
112
+ # Numbers
113
+ (r'[0-9][0-9_]*(?=([e.]|\'f(32|64)))',
114
+ Number.Float, ('float-suffix', 'float-number')),
115
+ (r'0x[a-f0-9][a-f0-9_]*', Number.Hex, 'int-suffix'),
116
+ (r'0b[01][01_]*', Number.Bin, 'int-suffix'),
117
+ (r'0o[0-7][0-7_]*', Number.Oct, 'int-suffix'),
118
+ (r'[0-9][0-9_]*', Number.Integer, 'int-suffix'),
119
+
120
+ # Whitespace
121
+ (r'\s+', Text.Whitespace),
122
+ (r'.+$', Error),
123
+ ],
124
+ 'chars': [
125
+ (r'\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})', String.Escape),
126
+ (r"'", String.Char, '#pop'),
127
+ (r".", String.Char)
128
+ ],
129
+ 'strings': [
130
+ (r'(?<!\$)\$(\d+|#|\w+)+', String.Interpol),
131
+ (r'[^\\\'"$\n]+', String),
132
+ # quotes, dollars and backslashes must be parsed one at a time
133
+ (r'[\'"\\]', String),
134
+ # unhandled string formatting sign
135
+ (r'\$', String)
136
+ # newlines are an error (use "nl" state)
137
+ ],
138
+ 'doccomment': [
139
+ (r'[^\]#]+', String.Doc),
140
+ (r'##\[', String.Doc, '#push'),
141
+ (r'\]##', String.Doc, '#pop'),
142
+ (r'[\]#]', String.Doc),
143
+ ],
144
+ 'comment': [
145
+ (r'[^\]#]+', Comment.Multiline),
146
+ (r'#\[', Comment.Multiline, '#push'),
147
+ (r'\]#', Comment.Multiline, '#pop'),
148
+ (r'[\]#]', Comment.Multiline),
149
+ ],
150
+ 'dqs': [
151
+ (r'\\([\\abcefnrtvl"\']|\n|x[a-f0-9]{2}|[0-9]{1,3})',
152
+ String.Escape),
153
+ (r'"', String, '#pop'),
154
+ include('strings')
155
+ ],
156
+ 'rdqs': [
157
+ (r'"(?!")', String, '#pop'),
158
+ (r'""', String.Escape),
159
+ include('strings')
160
+ ],
161
+ 'tdqs': [
162
+ (r'"""', String.Double, '#pop'),
163
+ include('strings'),
164
+ (r'\n', String.Double)
165
+ ],
166
+ 'funcname': [
167
+ (r'((?![\d_])\w)(((?!_)\w)|(_(?!_)\w))*', Name.Function, '#pop'),
168
+ (r'`.+`', Name.Function, '#pop')
169
+ ],
170
+ 'nl': [
171
+ (r'\n', String)
172
+ ],
173
+ 'float-number': [
174
+ (r'\.(?!\.)[0-9_]*[f]*', Number.Float),
175
+ (r'e[+-]?[0-9][0-9_]*', Number.Float),
176
+ default('#pop')
177
+ ],
178
+ 'float-suffix': [
179
+ (r'\'f(32|64)', Number.Float),
180
+ default('#pop')
181
+ ],
182
+ 'int-suffix': [
183
+ (r'\'i(32|64)', Number.Integer.Long),
184
+ (r'\'i(8|16)', Number.Integer),
185
+ default('#pop')
186
+ ],
187
+ 'casebranch': [
188
+ (r',', Punctuation),
189
+ (r'[\n ]+', Text.Whitespace),
190
+ (r':', Operator, '#pop'),
191
+ (r'\w+|[^:]', Name.Label),
192
+ ],
193
+ 'pragma': [
194
+ (r'[:,]', Text),
195
+ (r'[\n ]+', Text.Whitespace),
196
+ (r'\.\}', String.Other, '#pop'),
197
+ (r'\w+|\W+|[^.}]', String.Other),
198
+ ],
199
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nit.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.nit
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for the Nit language.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, words
12
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
13
+ Number, Punctuation
14
+
15
+ __all__ = ['NitLexer']
16
+
17
+
18
+ class NitLexer(RegexLexer):
19
+ """
20
+ For nit source.
21
+ """
22
+
23
+ name = 'Nit'
24
+ url = 'http://nitlanguage.org'
25
+ aliases = ['nit']
26
+ filenames = ['*.nit']
27
+ version_added = '2.0'
28
+ tokens = {
29
+ 'root': [
30
+ (r'#.*?$', Comment.Single),
31
+ (words((
32
+ 'package', 'module', 'import', 'class', 'abstract', 'interface',
33
+ 'universal', 'enum', 'end', 'fun', 'type', 'init', 'redef',
34
+ 'isa', 'do', 'readable', 'writable', 'var', 'intern', 'extern',
35
+ 'public', 'protected', 'private', 'intrude', 'if', 'then',
36
+ 'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not',
37
+ 'implies', 'return', 'continue', 'break', 'abort', 'assert',
38
+ 'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable',
39
+ 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'),
40
+ Keyword),
41
+ (r'[A-Z]\w*', Name.Class),
42
+ (r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string
43
+ (r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|'
44
+ r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt
45
+ (r'"""(([^\'\\]|\\.)|\\r|\\n)*((""?)?(\{\{?""?)*\{\{\{\{*)', String), # Start long string
46
+ (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(""?)?(\{\{?""?)*\{\{\{\{*', String), # Mid long string
47
+ (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(\{\{?)?(""?\{\{?)*""""*', String), # End long string
48
+ (r'"(\\.|([^"}{\\]))*"', String), # Simple String
49
+ (r'"(\\.|([^"}{\\]))*\{', String), # Start string
50
+ (r'\}(\\.|([^"}{\\]))*\{', String), # Mid String
51
+ (r'\}(\\.|([^"}{\\]))*"', String), # End String
52
+ (r'(\'[^\'\\]\')|(\'\\.\')', String.Char),
53
+ (r'[0-9]+', Number.Integer),
54
+ (r'[0-9]*.[0-9]+', Number.Float),
55
+ (r'0(x|X)[0-9A-Fa-f]+', Number.Hex),
56
+ (r'[a-z]\w*', Name),
57
+ (r'_\w+', Name.Variable.Instance),
58
+ (r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator),
59
+ (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation),
60
+ (r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit
61
+ (r'[\r\n\t ]+', Text),
62
+ ],
63
+ }
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/nix.py ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.nix
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for the NixOS Nix language.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.lexer import RegexLexer, include
14
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
+ Number, Punctuation, Literal
16
+
17
+ __all__ = ['NixLexer']
18
+
19
+
20
+ class NixLexer(RegexLexer):
21
+ """
22
+ For the Nix language.
23
+ """
24
+
25
+ name = 'Nix'
26
+ url = 'http://nixos.org/nix/'
27
+ aliases = ['nixos', 'nix']
28
+ filenames = ['*.nix']
29
+ mimetypes = ['text/x-nix']
30
+ version_added = '2.0'
31
+
32
+ keywords = ['rec', 'with', 'let', 'in', 'inherit', 'assert', 'if',
33
+ 'else', 'then', '...']
34
+ builtins = ['import', 'abort', 'baseNameOf', 'dirOf', 'isNull', 'builtins',
35
+ 'map', 'removeAttrs', 'throw', 'toString', 'derivation']
36
+ operators = ['++', '+', '?', '.', '!', '//', '==', '/',
37
+ '!=', '&&', '||', '->', '=', '<', '>', '*', '-']
38
+
39
+ punctuations = ["(", ")", "[", "]", ";", "{", "}", ":", ",", "@"]
40
+
41
+ tokens = {
42
+ 'root': [
43
+ # comments starting with #
44
+ (r'#.*$', Comment.Single),
45
+
46
+ # multiline comments
47
+ (r'/\*', Comment.Multiline, 'comment'),
48
+
49
+ # whitespace
50
+ (r'\s+', Text),
51
+
52
+ # keywords
53
+ ('({})'.format('|'.join(re.escape(entry) + '\\b' for entry in keywords)), Keyword),
54
+
55
+ # highlight the builtins
56
+ ('({})'.format('|'.join(re.escape(entry) + '\\b' for entry in builtins)),
57
+ Name.Builtin),
58
+
59
+ (r'\b(true|false|null)\b', Name.Constant),
60
+
61
+ # floats
62
+ (r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?', Number.Float),
63
+
64
+ # integers
65
+ (r'-?[0-9]+', Number.Integer),
66
+
67
+ # paths
68
+ (r'[\w.+-]*(\/[\w.+-]+)+', Literal),
69
+ (r'~(\/[\w.+-]+)+', Literal),
70
+ (r'\<[\w.+-]+(\/[\w.+-]+)*\>', Literal),
71
+
72
+ # operators
73
+ ('({})'.format('|'.join(re.escape(entry) for entry in operators)),
74
+ Operator),
75
+
76
+ # word operators
77
+ (r'\b(or|and)\b', Operator.Word),
78
+
79
+ (r'\{', Punctuation, 'block'),
80
+
81
+ # punctuations
82
+ ('({})'.format('|'.join(re.escape(entry) for entry in punctuations)), Punctuation),
83
+
84
+ # strings
85
+ (r'"', String.Double, 'doublequote'),
86
+ (r"''", String.Multiline, 'multiline'),
87
+
88
+ # urls
89
+ (r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+', Literal),
90
+
91
+ # names of variables
92
+ (r'[\w-]+(?=\s*=)', String.Symbol),
93
+ (r'[a-zA-Z_][\w\'-]*', Text),
94
+
95
+ (r"\$\{", String.Interpol, 'antiquote'),
96
+ ],
97
+ 'comment': [
98
+ (r'[^/*]+', Comment.Multiline),
99
+ (r'/\*', Comment.Multiline, '#push'),
100
+ (r'\*/', Comment.Multiline, '#pop'),
101
+ (r'[*/]', Comment.Multiline),
102
+ ],
103
+ 'multiline': [
104
+ (r"''(\$|'|\\n|\\r|\\t|\\)", String.Escape),
105
+ (r"''", String.Multiline, '#pop'),
106
+ (r'\$\{', String.Interpol, 'antiquote'),
107
+ (r"[^'\$]+", String.Multiline),
108
+ (r"\$[^\{']", String.Multiline),
109
+ (r"'[^']", String.Multiline),
110
+ (r"\$(?=')", String.Multiline),
111
+ ],
112
+ 'doublequote': [
113
+ (r'\\(\\|"|\$|n)', String.Escape),
114
+ (r'"', String.Double, '#pop'),
115
+ (r'\$\{', String.Interpol, 'antiquote'),
116
+ (r'[^"\\\$]+', String.Double),
117
+ (r'\$[^\{"]', String.Double),
118
+ (r'\$(?=")', String.Double),
119
+ (r'\\', String.Double),
120
+ ],
121
+ 'antiquote': [
122
+ (r"\}", String.Interpol, '#pop'),
123
+ # TODO: we should probably escape also here ''${ \${
124
+ (r"\$\{", String.Interpol, '#push'),
125
+ include('root'),
126
+ ],
127
+ 'block': [
128
+ (r"\}", Punctuation, '#pop'),
129
+ include('root'),
130
+ ],
131
+ }
132
+
133
+ def analyse_text(text):
134
+ rv = 0.0
135
+ # TODO: let/in
136
+ if re.search(r'import.+?<[^>]+>', text):
137
+ rv += 0.4
138
+ if re.search(r'mkDerivation\s+(\(|\{|rec)', text):
139
+ rv += 0.4
140
+ if re.search(r'=\s+mkIf\s+', text):
141
+ rv += 0.4
142
+ if re.search(r'\{[a-zA-Z,\s]+\}:', text):
143
+ rv += 0.1
144
+ return rv
.cache/uv/archive-v0/RMeM3AGJKqUJ7n75un4yi/pygments/lexers/numbair.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pygments.lexers.numbair
3
+ ~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for other Numba Intermediate Representation.
6
+
7
+ :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, include, bygroups, words
12
+ from pygments.token import Whitespace, Name, String, Punctuation, Keyword, \
13
+ Operator, Number
14
+
15
+ __all__ = ["NumbaIRLexer"]
16
+
17
+ class NumbaIRLexer(RegexLexer):
18
+ """
19
+ Lexer for Numba IR
20
+ """
21
+ name = 'Numba_IR'
22
+ url = "https://numba.readthedocs.io/en/stable/developer/architecture.html#stage-2-generate-the-numba-ir"
23
+ aliases = ['numba_ir', 'numbair']
24
+ filenames = ['*.numba_ir']
25
+ mimetypes = ['text/x-numba_ir', 'text/x-numbair']
26
+ version_added = '2.19'
27
+
28
+ identifier = r'\$[a-zA-Z0-9._]+'
29
+ fun_or_var = r'([a-zA-Z_]+[a-zA-Z0-9]*)'
30
+
31
+ tokens = {
32
+ 'root' : [
33
+ (r'(label)(\ [0-9]+)(:)$',
34
+ bygroups(Keyword, Name.Label, Punctuation)),
35
+
36
+ (r'=', Operator),
37
+ include('whitespace'),
38
+ include('keyword'),
39
+
40
+ (identifier, Name.Variable),
41
+ (fun_or_var + r'(\()',
42
+ bygroups(Name.Function, Punctuation)),
43
+ (fun_or_var + r'(\=)',
44
+ bygroups(Name.Attribute, Punctuation)),
45
+ (fun_or_var, Name.Constant),
46
+ (r'[0-9]+', Number),
47
+
48
+ # <built-in function some>
49
+ (r'<[^>\n]*>', String),
50
+
51
+ (r'[=<>{}\[\]()*.,!\':]|x\b', Punctuation)
52
+ ],
53
+
54
+ 'keyword':[
55
+ (words((
56
+ 'del', 'jump', 'call', 'branch',
57
+ ), suffix=' '), Keyword),
58
+ ],
59
+
60
+ 'whitespace': [
61
+ (r'(\n|\s)+', Whitespace),
62
+ ],
63
+ }