ThirdParty/Pygments/pygments/lexers/webmisc.py

changeset 5713
6762afd9f963
parent 4697
c2e9bf425554
child 6651
e8f3b5568b21
equal deleted inserted replaced
5712:f0d08bdeacf4 5713:6762afd9f963
3 pygments.lexers.webmisc 3 pygments.lexers.webmisc
4 ~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for misc. web stuff. 6 Lexers for misc. web stuff.
7 7
8 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
356 bygroups(Keyword, Text, Keyword), 'singletype'), 356 bygroups(Keyword, Text, Keyword), 'singletype'),
357 (r'(instance)(\s+)(of)\b', 357 (r'(instance)(\s+)(of)\b',
358 bygroups(Keyword, Text, Keyword), 'itemtype'), 358 bygroups(Keyword, Text, Keyword), 'itemtype'),
359 (r'(treat)(\s+)(as)\b', 359 (r'(treat)(\s+)(as)\b',
360 bygroups(Keyword, Text, Keyword), 'itemtype'), 360 bygroups(Keyword, Text, Keyword), 'itemtype'),
361 (r'(case)(\s+)(' + stringdouble + ')', bygroups(Keyword, Text, String.Double), 'itemtype'), 361 (r'(case)(\s+)(' + stringdouble + ')',
362 (r'(case)(\s+)(' + stringsingle + ')', bygroups(Keyword, Text, String.Single), 'itemtype'), 362 bygroups(Keyword, Text, String.Double), 'itemtype'),
363 (r'(case)(\s+)(' + stringsingle + ')',
364 bygroups(Keyword, Text, String.Single), 'itemtype'),
363 (r'(case|as)\b', Keyword, 'itemtype'), 365 (r'(case|as)\b', Keyword, 'itemtype'),
364 (r'(\))(\s*)(as)', 366 (r'(\))(\s*)(as)',
365 bygroups(Punctuation, Text, Keyword), 'itemtype'), 367 bygroups(Punctuation, Text, Keyword), 'itemtype'),
366 (r'\$', Name.Variable, 'varname'), 368 (r'\$', Name.Variable, 'varname'),
367 (r'(for|let|previous|next)(\s+)(\$)', 369 (r'(for|let|previous|next)(\s+)(\$)',
368 bygroups(Keyword, Text, Name.Variable), 'varname'), 370 bygroups(Keyword, Text, Name.Variable), 'varname'),
369 (r'(for)(\s+)(tumbling|sliding)(\s+)(window)(\s+)(\$)', 371 (r'(for)(\s+)(tumbling|sliding)(\s+)(window)(\s+)(\$)',
370 bygroups(Keyword, Text, Keyword, Text, Keyword, Text, Name.Variable), 'varname'), 372 bygroups(Keyword, Text, Keyword, Text, Keyword, Text, Name.Variable),
373 'varname'),
371 # (r'\)|\?|\]', Punctuation, '#push'), 374 # (r'\)|\?|\]', Punctuation, '#push'),
372 (r'\)|\?|\]', Punctuation), 375 (r'\)|\?|\]', Punctuation),
373 (r'(empty)(\s+)(greatest|least)', bygroups(Keyword, Text, Keyword)), 376 (r'(empty)(\s+)(greatest|least)', bygroups(Keyword, Text, Keyword)),
374 (r'ascending|descending|default', Keyword, '#push'), 377 (r'ascending|descending|default', Keyword, '#push'),
375 (r'(allowing)(\s+)(empty)', bygroups(Keyword, Text, Keyword)), 378 (r'(allowing)(\s+)(empty)', bygroups(Keyword, Text, Keyword)),
415 (r'namespace', Keyword, 'namespacedecl'), 418 (r'namespace', Keyword, 'namespacedecl'),
416 (r'(default)(\s+)(element)', bygroups(Keyword, Text, Keyword)), 419 (r'(default)(\s+)(element)', bygroups(Keyword, Text, Keyword)),
417 (r'preserve|no-preserve', Keyword), 420 (r'preserve|no-preserve', Keyword),
418 (r',', Punctuation), 421 (r',', Punctuation),
419 ], 422 ],
420 'annotationname':[ 423 'annotationname': [
421 (r'\(:', Comment, 'comment'), 424 (r'\(:', Comment, 'comment'),
422 (qname, Name.Decorator), 425 (qname, Name.Decorator),
423 (r'(\()(' + stringdouble + ')', bygroups(Punctuation, String.Double)), 426 (r'(\()(' + stringdouble + ')', bygroups(Punctuation, String.Double)),
424 (r'(\()(' + stringsingle + ')', bygroups(Punctuation, String.Single)), 427 (r'(\()(' + stringsingle + ')', bygroups(Punctuation, String.Single)),
425 (r'(\,)(\s+)(' + stringdouble + ')', bygroups(Punctuation, Text, String.Double)), 428 (r'(\,)(\s+)(' + stringdouble + ')',
426 (r'(\,)(\s+)(' + stringsingle + ')', bygroups(Punctuation, Text, String.Single)), 429 bygroups(Punctuation, Text, String.Double)),
430 (r'(\,)(\s+)(' + stringsingle + ')',
431 bygroups(Punctuation, Text, String.Single)),
427 (r'\)', Punctuation), 432 (r'\)', Punctuation),
428 (r'(\s+)(\%)', bygroups(Text, Name.Decorator), 'annotationname'), 433 (r'(\s+)(\%)', bygroups(Text, Name.Decorator), 'annotationname'),
429 (r'(\s+)(variable)(\s+)(\$)', bygroups(Text, Keyword.Declaration, Text, Name.Variable), 'varname'), 434 (r'(\s+)(variable)(\s+)(\$)',
430 (r'(\s+)(function)(\s+)', bygroups(Text, Keyword.Declaration, Text), 'root') 435 bygroups(Text, Keyword.Declaration, Text, Name.Variable), 'varname'),
436 (r'(\s+)(function)(\s+)',
437 bygroups(Text, Keyword.Declaration, Text), 'root')
431 ], 438 ],
432 'varname': [ 439 'varname': [
433 (r'\(:', Comment, 'comment'), 440 (r'\(:', Comment, 'comment'),
434 (r'(' + qname + ')(\()?', bygroups(Name, Punctuation), 'operator'), 441 (r'(' + qname + ')(\()?', bygroups(Name, Punctuation), 'operator'),
435 ], 442 ],
471 bygroups(Keyword, Text, Keyword, Text, Keyword), 'root'), 478 bygroups(Keyword, Text, Keyword, Text, Keyword), 'root'),
472 (r'(castable|cast)(\s+)(as)', 479 (r'(castable|cast)(\s+)(as)',
473 bygroups(Keyword, Text, Keyword), 'singletype'), 480 bygroups(Keyword, Text, Keyword), 'singletype'),
474 (r'(treat)(\s+)(as)', bygroups(Keyword, Text, Keyword)), 481 (r'(treat)(\s+)(as)', bygroups(Keyword, Text, Keyword)),
475 (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword)), 482 (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword)),
476 (r'(case)(\s+)(' + stringdouble + ')', bygroups(Keyword, Text, String.Double), 'itemtype'), 483 (r'(case)(\s+)(' + stringdouble + ')',
477 (r'(case)(\s+)(' + stringsingle + ')', bygroups(Keyword, Text, String.Single), 'itemtype'), 484 bygroups(Keyword, Text, String.Double), 'itemtype'),
485 (r'(case)(\s+)(' + stringsingle + ')',
486 bygroups(Keyword, Text, String.Single), 'itemtype'),
478 (r'case|as', Keyword, 'itemtype'), 487 (r'case|as', Keyword, 'itemtype'),
479 (r'(\))(\s*)(as)', bygroups(Operator, Text, Keyword), 'itemtype'), 488 (r'(\))(\s*)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
480 (ncname + r':\*', Keyword.Type, 'operator'), 489 (ncname + r':\*', Keyword.Type, 'operator'),
481 (r'(function|map|array)(\()', bygroups(Keyword.Type, Punctuation)), 490 (r'(function|map|array)(\()', bygroups(Keyword.Type, Punctuation)),
482 (qname, Keyword.Type, 'occurrenceindicator'), 491 (qname, Keyword.Type, 'occurrenceindicator'),

eric ide

mercurial