pygments.rb 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. data/lib/pygments/version.rb +1 -1
  2. data/vendor/pygments-main/AUTHORS +2 -0
  3. data/vendor/pygments-main/CHANGES +11 -3
  4. data/vendor/pygments-main/REVISION +1 -1
  5. data/vendor/pygments-main/TODO +0 -2
  6. data/vendor/pygments-main/docs/generate.py +1 -1
  7. data/vendor/pygments-main/docs/src/tokens.txt +1 -1
  8. data/vendor/pygments-main/pygments/__init__.py +1 -1
  9. data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -1
  10. data/vendor/pygments-main/pygments/lexers/_mapping.py +4 -2
  11. data/vendor/pygments-main/pygments/lexers/agile.py +15 -15
  12. data/vendor/pygments-main/pygments/lexers/asm.py +4 -4
  13. data/vendor/pygments-main/pygments/lexers/compiled.py +9 -9
  14. data/vendor/pygments-main/pygments/lexers/dotnet.py +5 -5
  15. data/vendor/pygments-main/pygments/lexers/functional.py +13 -9
  16. data/vendor/pygments-main/pygments/lexers/hdl.py +21 -22
  17. data/vendor/pygments-main/pygments/lexers/jvm.py +178 -9
  18. data/vendor/pygments-main/pygments/lexers/math.py +4 -4
  19. data/vendor/pygments-main/pygments/lexers/other.py +31 -31
  20. data/vendor/pygments-main/pygments/lexers/parsers.py +3 -3
  21. data/vendor/pygments-main/pygments/lexers/shell.py +7 -6
  22. data/vendor/pygments-main/pygments/lexers/sql.py +4 -4
  23. data/vendor/pygments-main/pygments/lexers/templates.py +68 -21
  24. data/vendor/pygments-main/pygments/lexers/text.py +22 -21
  25. data/vendor/pygments-main/pygments/lexers/web.py +82 -79
  26. data/vendor/pygments-main/setup.py +1 -1
  27. data/vendor/pygments-main/tests/examplefiles/antlr_throws +1 -0
  28. data/vendor/pygments-main/tests/examplefiles/example.kt +47 -0
  29. data/vendor/pygments-main/tests/examplefiles/example.sh-session +2 -0
  30. data/vendor/pygments-main/tests/examplefiles/example.tea +34 -0
  31. data/vendor/pygments-main/tests/examplefiles/function.mu +1 -0
  32. metadata +14 -10
@@ -72,8 +72,8 @@ class RagelLexer(RegexLexer):
72
72
  ],
73
73
  'operators': [
74
74
  (r',', Operator), # Join
75
- (r'\||&|-|--', Operator), # Union, Intersection and Subtraction
76
- (r'\.|<:|:>|:>>', Operator), # Concatention
75
+ (r'\||&|--?', Operator), # Union, Intersection and Subtraction
76
+ (r'\.|<:|:>>?', Operator), # Concatention
77
77
  (r':', Operator), # Label
78
78
  (r'->', Operator), # Epsilon Transition
79
79
  (r'(>|\$|%|<|@|<>)(/|eof\b)', Operator), # EOF Actions
@@ -393,7 +393,7 @@ class AntlrLexer(RegexLexer):
393
393
  # throwsSpec
394
394
  (r'(throws)(\s+)(' + _id + ')',
395
395
  bygroups(Keyword, Whitespace, Name.Label)),
396
- (r'(?:(,)(\s*)(' + _id + '))+',
396
+ (r'(,)(\s*)(' + _id + ')',
397
397
  bygroups(Punctuation, Whitespace, Name.Label)), # Additional throws
398
398
  # optionsSpec
399
399
  (r'options\b', Keyword, 'options'),
@@ -32,7 +32,8 @@ class BashLexer(RegexLexer):
32
32
 
33
33
  name = 'Bash'
34
34
  aliases = ['bash', 'sh', 'ksh']
35
- filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass']
35
+ filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass',
36
+ '.bashrc', 'bashrc', '.bash_*', 'bash_*']
36
37
  mimetypes = ['application/x-sh', 'application/x-shellscript']
37
38
 
38
39
  tokens = {
@@ -67,7 +68,7 @@ class BashLexer(RegexLexer):
67
68
  (r"(?s)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
68
69
  (r';', Text),
69
70
  (r'\s+', Text),
70
- (r'[^=\s\n\[\]{}()$"\'`\\<]+', Text),
71
+ (r'[^=\s\[\]{}()$"\'`\\<]+', Text),
71
72
  (r'\d+(?= |\Z)', Number),
72
73
  (r'\$#?(\w+|.)', Name.Variable),
73
74
  (r'<', Text),
@@ -121,8 +122,8 @@ class BashSessionLexer(Lexer):
121
122
 
122
123
  for match in line_re.finditer(text):
123
124
  line = match.group()
124
- m = re.match(r'^((?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)?|\[\S+[@:]'
125
- r'[^\n]+\].+)[$#%])(.*\n?)', line)
125
+ m = re.match(r'^((?:\(\S+\))?(?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)'
126
+ r'?|\[\S+[@:][^\n]+\].+)[$#%])(.*\n?)' , line)
126
127
  if m:
127
128
  # To support output lexers (say diff output), the output
128
129
  # needs to be broken by prompts whenever the output lexer
@@ -251,7 +252,7 @@ class TcshLexer(RegexLexer):
251
252
  (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
252
253
  (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
253
254
  (r'\s+', Text),
254
- (r'[^=\s\n\[\]{}()$"\'`\\]+', Text),
255
+ (r'[^=\s\[\]{}()$"\'`\\]+', Text),
255
256
  (r'\d+(?= |\Z)', Number),
256
257
  (r'\$#?(\w+|.)', Name.Variable),
257
258
  ],
@@ -315,7 +316,7 @@ class PowerShellLexer(RegexLexer):
315
316
 
316
317
  commenthelp = (
317
318
  'component description example externalhelp forwardhelpcategory '
318
- 'forwardhelptargetname forwardhelptargetname functionality inputs link '
319
+ 'forwardhelptargetname functionality inputs link '
319
320
  'notes outputs parameter remotehelprunspace role synopsis').split()
320
321
 
321
322
  tokens = {
@@ -147,14 +147,14 @@ class PostgresLexer(PostgresBase, RegexLexer):
147
147
  for s in DATATYPES + PSEUDO_TYPES])
148
148
  + r')\b', Name.Builtin),
149
149
  (r'(' + '|'.join(KEYWORDS) + r')\b', Keyword),
150
- (r'[+*/<>=~!@#%^&|`?^-]+', Operator),
150
+ (r'[+*/<>=~!@#%^&|`?-]+', Operator),
151
151
  (r'::', Operator), # cast
152
152
  (r'\$\d+', Name.Variable),
153
153
  (r'([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?', Number.Float),
154
154
  (r'[0-9]+', Number.Integer),
155
155
  (r"(E|U&)?'(''|[^'])*'", String.Single),
156
156
  (r'(U&)?"(""|[^"])*"', String.Name), # quoted identifier
157
- (r'(?ms)(\$[^\$]*\$)(.*?)(\1)', language_callback),
157
+ (r'(?s)(\$[^\$]*\$)(.*?)(\1)', language_callback),
158
158
  (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
159
159
 
160
160
  # psql variable in SQL
@@ -434,7 +434,7 @@ class SqlLexer(RegexLexer):
434
434
  r'DEC|DECIMAL|FLOAT|INT|INTEGER|INTERVAL|NUMBER|NUMERIC|REAL|'
435
435
  r'SERIAL|SMALLINT|VARCHAR|VARYING|INT8|SERIAL8|TEXT)\b',
436
436
  Name.Builtin),
437
- (r'[+*/<>=~!@#%^&|`?^-]', Operator),
437
+ (r'[+*/<>=~!@#%^&|`?-]', Operator),
438
438
  (r'[0-9]+', Number.Integer),
439
439
  # TODO: Backslash escapes?
440
440
  (r"'(''|[^'])*'", String.Single),
@@ -472,7 +472,7 @@ class MySqlLexer(RegexLexer):
472
472
  (r"'(''|[^'])*'", String.Single),
473
473
  (r'"(""|[^"])*"', String.Double),
474
474
  (r"`(``|[^`])*`", String.Symbol),
475
- (r'[+*/<>=~!@#%^&|`?^-]', Operator),
475
+ (r'[+*/<>=~!@#%^&|`?-]', Operator),
476
476
  (r'\b(tinyint|smallint|mediumint|int|integer|bigint|date|'
477
477
  r'datetime|time|bit|bool|tinytext|mediumtext|longtext|text|'
478
478
  r'tinyblob|mediumblob|longblob|blob|float|double|double\s+'
@@ -15,6 +15,7 @@ from pygments.lexers.web import \
15
15
  PhpLexer, HtmlLexer, XmlLexer, JavascriptLexer, CssLexer
16
16
  from pygments.lexers.agile import PythonLexer, PerlLexer
17
17
  from pygments.lexers.compiled import JavaLexer
18
+ from pygments.lexers.jvm import TeaLangLexer
18
19
  from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \
19
20
  include, using, this
20
21
  from pygments.token import Error, Punctuation, \
@@ -33,11 +34,10 @@ __all__ = ['HtmlPhpLexer', 'XmlPhpLexer', 'CssPhpLexer',
33
34
  'MyghtyCssLexer', 'MyghtyJavascriptLexer', 'MasonLexer', 'MakoLexer',
34
35
  'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
35
36
  'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
36
- 'CheetahXmlLexer', 'CheetahJavascriptLexer',
37
- 'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
38
- 'ColdfusionLexer', 'ColdfusionHtmlLexer',
39
- 'VelocityLexer', 'VelocityHtmlLexer', 'VelocityXmlLexer',
40
- 'SspLexer']
37
+ 'CheetahXmlLexer', 'CheetahJavascriptLexer', 'EvoqueLexer',
38
+ 'EvoqueHtmlLexer', 'EvoqueXmlLexer', 'ColdfusionLexer',
39
+ 'ColdfusionHtmlLexer', 'VelocityLexer', 'VelocityHtmlLexer',
40
+ 'VelocityXmlLexer', 'SspLexer', 'TeaTemplateLexer']
41
41
 
42
42
 
43
43
  class ErbLexer(Lexer):
@@ -168,7 +168,7 @@ class SmartyLexer(RegexLexer):
168
168
  (r'#[a-zA-Z_][a-zA-Z0-9_]*#', Name.Variable),
169
169
  (r'\$[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*', Name.Variable),
170
170
  (r'[~!%^&*()+=|\[\]:;,.<>/?{}@-]', Operator),
171
- ('(true|false|null)\b', Keyword.Constant),
171
+ (r'(true|false|null)\b', Keyword.Constant),
172
172
  (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
173
173
  r"0[xX][0-9a-fA-F]+[Ll]?", Number),
174
174
  (r'"(\\\\|\\"|[^"])*"', String.Double),
@@ -406,11 +406,11 @@ class MyghtyLexer(RegexLexer):
406
406
  tokens = {
407
407
  'root': [
408
408
  (r'\s+', Text),
409
- (r'(<%(def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
410
- bygroups(Name.Tag, None, Text, Name.Function, Name.Tag,
409
+ (r'(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
410
+ bygroups(Name.Tag, Text, Name.Function, Name.Tag,
411
411
  using(this), Name.Tag)),
412
- (r'(<%(\w+))(.*?)(>)(.*?)(</%\2\s*>)(?s)',
413
- bygroups(Name.Tag, None, Name.Function, Name.Tag,
412
+ (r'(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
413
+ bygroups(Name.Tag, Name.Function, Name.Tag,
414
414
  using(PythonLexer), Name.Tag)),
415
415
  (r'(<&[^|])(.*?)(,.*?)?(&>)',
416
416
  bygroups(Name.Tag, Name.Function, using(PythonLexer), Name.Tag)),
@@ -525,11 +525,11 @@ class MasonLexer(RegexLexer):
525
525
  (r'\s+', Text),
526
526
  (r'(<%doc>)(.*?)(</%doc>)(?s)',
527
527
  bygroups(Name.Tag, Comment.Multiline, Name.Tag)),
528
- (r'(<%(def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
529
- bygroups(Name.Tag, None, Text, Name.Function, Name.Tag,
528
+ (r'(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
529
+ bygroups(Name.Tag, Text, Name.Function, Name.Tag,
530
530
  using(this), Name.Tag)),
531
- (r'(<%(\w+))(.*?)(>)(.*?)(</%\2\s*>)(?s)',
532
- bygroups(Name.Tag, None, Name.Function, Name.Tag,
531
+ (r'(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
532
+ bygroups(Name.Tag, Name.Function, Name.Tag,
533
533
  using(PerlLexer), Name.Tag)),
534
534
  (r'(<&[^|])(.*?)(,.*?)?(&>)(?s)',
535
535
  bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
@@ -616,8 +616,8 @@ class MakoLexer(RegexLexer):
616
616
  include('tag'),
617
617
  ],
618
618
  'tag': [
619
- (r'((?:\w+)\s*=)\s*(".*?")',
620
- bygroups(Name.Attribute, String)),
619
+ (r'((?:\w+)\s*=)(\s*)(".*?")',
620
+ bygroups(Name.Attribute, Text, String)),
621
621
  (r'/?\s*>', Comment.Preproc, '#pop'),
622
622
  (r'\s+', Text),
623
623
  ],
@@ -1403,7 +1403,7 @@ class EvoqueLexer(RegexLexer):
1403
1403
  # directives: begin, end
1404
1404
  (r'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})',
1405
1405
  bygroups(Punctuation, Name.Builtin, Punctuation, None,
1406
- String, Punctuation, None)),
1406
+ String, Punctuation)),
1407
1407
  # directives: evoque, overlay
1408
1408
  # see doc for handling first name arg: /directives/evoque/
1409
1409
  #+ minor inconsistency: the "name" in e.g. $overlay{name=site_base}
@@ -1411,17 +1411,17 @@ class EvoqueLexer(RegexLexer):
1411
1411
  (r'(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?'
1412
1412
  r'(.*?)((?(4)%)\})',
1413
1413
  bygroups(Punctuation, Name.Builtin, Punctuation, None,
1414
- String, using(PythonLexer), Punctuation, None)),
1414
+ String, using(PythonLexer), Punctuation)),
1415
1415
  # directives: if, for, prefer, test
1416
1416
  (r'(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})',
1417
1417
  bygroups(Punctuation, Name.Builtin, Punctuation, None,
1418
- using(PythonLexer), Punctuation, None)),
1418
+ using(PythonLexer), Punctuation)),
1419
1419
  # directive clauses (no {} expression)
1420
1420
  (r'(\$)(else|rof|fi)', bygroups(Punctuation, Name.Builtin)),
1421
1421
  # expressions
1422
1422
  (r'(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})',
1423
1423
  bygroups(Punctuation, None, using(PythonLexer),
1424
- Name.Builtin, None, None, Punctuation, None)),
1424
+ Name.Builtin, None, None, Punctuation)),
1425
1425
  (r'#', Other),
1426
1426
  ],
1427
1427
  'comment': [
@@ -1489,7 +1489,8 @@ class ColdfusionLexer(RegexLexer):
1489
1489
  (r"'.*?'", String.Single),
1490
1490
  (r'\d+', Number),
1491
1491
  (r'(if|else|len|var|case|default|break|switch)\b', Keyword),
1492
- (r'([A-Za-z_$][A-Za-z0-9_.]*)\s*(\()', bygroups(Name.Function, Punctuation)),
1492
+ (r'([A-Za-z_$][A-Za-z0-9_.]*)(\s*)(\()',
1493
+ bygroups(Name.Function, Text, Punctuation)),
1493
1494
  (r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
1494
1495
  (r'[()\[\]{};:,.\\]', Punctuation),
1495
1496
  (r'\s+', Text),
@@ -1581,3 +1582,49 @@ class SspLexer(DelegatingLexer):
1581
1582
  if '<%' in text and '%>' in text:
1582
1583
  rv += 0.1
1583
1584
  return rv
1585
+
1586
+
1587
+ class TeaTemplateRootLexer(RegexLexer):
1588
+ """
1589
+ Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
1590
+ code blocks.
1591
+
1592
+ *New in Pygments 1.5.*
1593
+ """
1594
+
1595
+ tokens = {
1596
+ 'root': [
1597
+ (r'<%\S?', Keyword, 'sec'),
1598
+ (r'[^<]+', Other),
1599
+ (r'<', Other),
1600
+ ],
1601
+ 'sec': [
1602
+ (r'%>', Keyword, '#pop'),
1603
+ # note: '\w\W' != '.' without DOTALL.
1604
+ (r'[\w\W]+?(?=%>|\Z)', using(TeaLangLexer)),
1605
+ ],
1606
+ }
1607
+
1608
+
1609
+ class TeaTemplateLexer(DelegatingLexer):
1610
+ """
1611
+ Lexer for `Tea Templates <http://teatrove.org/>`_.
1612
+
1613
+ *New in Pygments 1.5.*
1614
+ """
1615
+ name = 'Tea'
1616
+ aliases = ['tea']
1617
+ filenames = ['*.tea']
1618
+ mimetypes = ['text/x-tea']
1619
+
1620
+ def __init__(self, **options):
1621
+ super(TeaTemplateLexer, self).__init__(XmlLexer,
1622
+ TeaTemplateRootLexer, **options)
1623
+
1624
+ def analyse_text(text):
1625
+ rv = TeaLangLexer.analyse_text(text) - 0.01
1626
+ if looks_like_xml(text):
1627
+ rv += 0.4
1628
+ if '<%' in text and '%>' in text:
1629
+ rv += 0.1
1630
+ return rv
@@ -292,12 +292,12 @@ class DarcsPatchLexer(RegexLexer):
292
292
  'insert': [
293
293
  include('specialText'),
294
294
  (r'\[', Generic.Inserted),
295
- (r'[^\n\[]*', Generic.Inserted),
295
+ (r'[^\n\[]+', Generic.Inserted),
296
296
  ],
297
297
  'delete': [
298
298
  include('specialText'),
299
299
  (r'\[', Generic.Deleted),
300
- (r'[^\n\[]*', Generic.Deleted),
300
+ (r'[^\n\[]+', Generic.Deleted),
301
301
  ],
302
302
  }
303
303
 
@@ -346,18 +346,18 @@ class IrcLogsLexer(RegexLexer):
346
346
  # /me msgs
347
347
  ("^" + timestamp + r"""
348
348
  (\s*[*]\s+) # Star
349
- ([^\s]+\s+.*?\n) # Nick + rest of message """,
349
+ (\S+\s+.*?\n) # Nick + rest of message """,
350
350
  bygroups(Comment.Preproc, Keyword, Generic.Inserted)),
351
351
  # join/part msgs
352
352
  ("^" + timestamp + r"""
353
353
  (\s*(?:\*{3}|<?-[!@=P]?->?)\s*) # Star(s) or symbols
354
- ([^\s]+\s+) # Nick + Space
354
+ (\S+\s+) # Nick + Space
355
355
  (.*?\n) # Rest of message """,
356
356
  bygroups(Comment.Preproc, Keyword, String, Comment)),
357
357
  (r"^.*?\n", Text),
358
358
  ],
359
359
  'msg': [
360
- (r"[^\s]+:(?!//)", Name.Attribute), # Prefix
360
+ (r"\S+:(?!//)", Name.Attribute), # Prefix
361
361
  (r".*\n", Text, '#pop'),
362
362
  ],
363
363
  }
@@ -468,7 +468,7 @@ class GroffLexer(RegexLexer):
468
468
 
469
469
  tokens = {
470
470
  'root': [
471
- (r'(?i)(\.)(\w+)', bygroups(Text, Keyword), 'request'),
471
+ (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'),
472
472
  (r'\.', Punctuation, 'request'),
473
473
  # Regular characters, slurp till we find a backslash or newline
474
474
  (r'[^\\\n]*', Text, 'textline'),
@@ -482,7 +482,7 @@ class GroffLexer(RegexLexer):
482
482
  # groff has many ways to write escapes.
483
483
  (r'\\"[^\n]*', Comment),
484
484
  (r'\\[fn]\w', String.Escape),
485
- (r'\\\(..', String.Escape),
485
+ (r'\\\(.{2}', String.Escape),
486
486
  (r'\\.\[.*\]', String.Escape),
487
487
  (r'\\.', String.Escape),
488
488
  (r'\\\n', Text, 'request'),
@@ -768,7 +768,7 @@ class VimLexer(RegexLexer):
768
768
  name = 'VimL'
769
769
  aliases = ['vim']
770
770
  filenames = ['*.vim', '.vimrc', '.exrc', '.gvimrc',
771
- '_vimrc', '_exrc', '_gvimrc']
771
+ '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc']
772
772
  mimetypes = ['text/x-vim']
773
773
  flags = re.MULTILINE
774
774
 
@@ -1018,11 +1018,11 @@ class DebianControlLexer(RegexLexer):
1018
1018
  (r'^(Description)', Keyword, 'description'),
1019
1019
  (r'^(Maintainer)(:\s*)', bygroups(Keyword, Text), 'maintainer'),
1020
1020
  (r'^((Build-)?Depends)', Keyword, 'depends'),
1021
- (r'^((?:Python-)?Version)(:\s*)([^\s]+)$',
1021
+ (r'^((?:Python-)?Version)(:\s*)(\S+)$',
1022
1022
  bygroups(Keyword, Text, Number)),
1023
- (r'^((?:Installed-)?Size)(:\s*)([^\s]+)$',
1023
+ (r'^((?:Installed-)?Size)(:\s*)(\S+)$',
1024
1024
  bygroups(Keyword, Text, Number)),
1025
- (r'^(MD5Sum|SHA1|SHA256)(:\s*)([^\s]+)$',
1025
+ (r'^(MD5Sum|SHA1|SHA256)(:\s*)(\S+)$',
1026
1026
  bygroups(Keyword, Text, Number)),
1027
1027
  (r'^([a-zA-Z\-0-9\.]*?)(:\s*)(.*?)$',
1028
1028
  bygroups(Keyword, Whitespace, String)),
@@ -1034,7 +1034,7 @@ class DebianControlLexer(RegexLexer):
1034
1034
  (r'.', Text),
1035
1035
  ],
1036
1036
  'description': [
1037
- (r'(.*)(Homepage)(: )([^\s]+)',
1037
+ (r'(.*)(Homepage)(: )(\S+)',
1038
1038
  bygroups(Text, String, Name, Name.Class)),
1039
1039
  (r':.*\n', Generic.Strong),
1040
1040
  (r' .*\n', Text),
@@ -1048,9 +1048,9 @@ class DebianControlLexer(RegexLexer):
1048
1048
  (r'\|', Operator),
1049
1049
  (r'[\s]+', Text),
1050
1050
  (r'[}\)]\s*$', Text, '#pop'),
1051
- (r'[}]', Text),
1051
+ (r'}', Text),
1052
1052
  (r'[^,]$', Name.Function, '#pop'),
1053
- (r'([\+\.a-zA-Z0-9-][\s\n]*)', Name.Function),
1053
+ (r'([\+\.a-zA-Z0-9-])(\s*)', bygroups(Name.Function, Text)),
1054
1054
  (r'\[.*?\]', Name.Entity),
1055
1055
  ],
1056
1056
  'depend_vers': [
@@ -1387,7 +1387,8 @@ class YamlLexer(ExtendedRegexLexer):
1387
1387
  # ignored and regular whitespaces in quoted scalars
1388
1388
  'quoted-scalar-whitespaces': [
1389
1389
  # leading and trailing whitespaces are ignored
1390
- (r'^[ ]+|[ ]+$', Text),
1390
+ (r'^[ ]+', Text),
1391
+ (r'[ ]+$', Text),
1391
1392
  # line breaks are ignored
1392
1393
  (r'\n+', Text),
1393
1394
  # other whitespaces are a part of the value
@@ -1456,7 +1457,8 @@ class YamlLexer(ExtendedRegexLexer):
1456
1457
  # the scalar ends with a comment
1457
1458
  (r'[ ]+(?=#)', Text, '#pop'),
1458
1459
  # leading and trailing whitespaces are ignored
1459
- (r'^[ ]+|[ ]+$', Text),
1460
+ (r'^[ ]+', Text),
1461
+ (r'[ ]+$', Text),
1460
1462
  # line breaks are ignored
1461
1463
  (r'\n+', Text),
1462
1464
  # other whitespaces are a part of the value
@@ -1702,7 +1704,7 @@ class PyPyLogLexer(RegexLexer):
1702
1704
  (r"^\+\d+: ", Comment),
1703
1705
  (r"[ifp]\d+", Name),
1704
1706
  (r"ptr\d+", Name),
1705
- (r"(\()([\w_]+(?:\.[\w_]+)?)(\))",
1707
+ (r"(\()(\w+(?:\.\w+)?)(\))",
1706
1708
  bygroups(Punctuation, Name.Builtin, Punctuation)),
1707
1709
  (r"[\[\]=,()]", Punctuation),
1708
1710
  (r"(\d+\.\d+|inf|-inf)", Number.Float),
@@ -1728,8 +1730,7 @@ class PyPyLogLexer(RegexLexer):
1728
1730
  r"arraylen_gc|"
1729
1731
  r"getarrayitem_gc_pure|getarrayitem_gc|setarrayitem_gc|"
1730
1732
  r"getarrayitem_raw|setarrayitem_raw|getfield_gc_pure|"
1731
- r"getfield_gc|getinteriorfield_gc|"
1732
- r"getinteriorfield_gc|setinteriorfield_gc|"
1733
+ r"getfield_gc|getinteriorfield_gc|setinteriorfield_gc|"
1733
1734
  r"getfield_raw|setfield_gc|setfield_raw|"
1734
1735
  r"strgetitem|strsetitem|strlen|copystrcontent|"
1735
1736
  r"unicodegetitem|unicodesetitem|unicodelen|"
@@ -1741,12 +1742,12 @@ class PyPyLogLexer(RegexLexer):
1741
1742
  ],
1742
1743
  "jit-backend-counts": [
1743
1744
  (r"\[\w+\] jit-backend-counts}$", Keyword, "#pop"),
1744
- (r"[:]", Punctuation),
1745
+ (r":", Punctuation),
1745
1746
  (r"\d+", Number),
1746
1747
  include("extra-stuff"),
1747
1748
  ],
1748
1749
  "extra-stuff": [
1749
- (r"[\n\s]+", Text),
1750
+ (r"\s+", Text),
1750
1751
  (r"#.*?$", Comment),
1751
1752
  ],
1752
1753
  }
@@ -56,7 +56,7 @@ class JavascriptLexer(RegexLexer):
56
56
  (r'', Text, '#pop')
57
57
  ],
58
58
  'badregex': [
59
- ('\n', Text, '#pop')
59
+ (r'\n', Text, '#pop')
60
60
  ],
61
61
  'root': [
62
62
  (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
@@ -296,7 +296,7 @@ class ActionScript3Lexer(RegexLexer):
296
296
  (r'[0-9]+', Number.Integer),
297
297
  (r'"(\\\\|\\"|[^"])*"', String.Double),
298
298
  (r"'(\\\\|\\'|[^'])*'", String.Single),
299
- (r'[~\^\*!%&<>\|+=:;,/?\\{}\[\]();.-]+', Operator),
299
+ (r'[~\^\*!%&<>\|+=:;,/?\\{}\[\]().-]+', Operator),
300
300
  ],
301
301
  'funcparams': [
302
302
  (r'\s+', Text),
@@ -383,7 +383,7 @@ class CssLexer(RegexLexer):
383
383
  r'list-style|margin-bottom|margin-left|margin-right|'
384
384
  r'margin-top|margin|marker-offset|marks|max-height|max-width|'
385
385
  r'min-height|min-width|opacity|orphans|outline|outline-color|'
386
- r'outline-style|outline-width|overflow(?:-x|-y|)|padding-bottom|'
386
+ r'outline-style|outline-width|overflow(?:-x|-y)?|padding-bottom|'
387
387
  r'padding-left|padding-right|padding-top|padding|page|'
388
388
  r'page-break-after|page-break-before|page-break-inside|'
389
389
  r'pause-after|pause-before|pause|pitch|pitch-range|'
@@ -499,13 +499,13 @@ class ObjectiveJLexer(RegexLexer):
499
499
  (';', Punctuation),
500
500
  ],
501
501
  'whitespace': [
502
- (r'(@import)(\s+)("(\\\\|\\"|[^"])*")',
502
+ (r'(@import)(\s+)("(?:\\\\|\\"|[^"])*")',
503
503
  bygroups(Comment.Preproc, Text, String.Double)),
504
- (r'(@import)(\s+)(<(\\\\|\\>|[^>])*>)',
504
+ (r'(@import)(\s+)(<(?:\\\\|\\>|[^>])*>)',
505
505
  bygroups(Comment.Preproc, Text, String.Double)),
506
- (r'(#(?:include|import))(\s+)("(\\\\|\\"|[^"])*")',
506
+ (r'(#(?:include|import))(\s+)("(?:\\\\|\\"|[^"])*")',
507
507
  bygroups(Comment.Preproc, Text, String.Double)),
508
- (r'(#(?:include|import))(\s+)(<(\\\\|\\>|[^>])*>)',
508
+ (r'(#(?:include|import))(\s+)(<(?:\\\\|\\>|[^>])*>)',
509
509
  bygroups(Comment.Preproc, Text, String.Double)),
510
510
 
511
511
  (r'#if\s+0', Comment.Preproc, 'if0'),
@@ -526,7 +526,7 @@ class ObjectiveJLexer(RegexLexer):
526
526
  (r'', Text, '#pop'),
527
527
  ],
528
528
  'badregex': [
529
- ('\n', Text, '#pop'),
529
+ (r'\n', Text, '#pop'),
530
530
  ],
531
531
  'statements': [
532
532
  (r'(L|@)?"', String, 'string'),
@@ -633,7 +633,7 @@ class ObjectiveJLexer(RegexLexer):
633
633
  # parameters
634
634
  (r'(\(' + _ws + ')' # open paren
635
635
  r'([^\)]+)' # type
636
- r'(' + _ws + r'\)' + _ws + r')+' # close paren
636
+ r'(' + _ws + r'\)' + _ws + r')' # close paren
637
637
  r'([$a-zA-Z_][a-zA-Z0-9_]+)', # param name
638
638
  bygroups(using(this), Keyword.Type, using(this), Text)),
639
639
 
@@ -645,7 +645,7 @@ class ObjectiveJLexer(RegexLexer):
645
645
  (r'(:)', Name.Function),
646
646
 
647
647
  # var args
648
- (r'(,' + _ws + r'...)', using(this)),
648
+ (r'(,' + _ws + r'\.\.\.)', using(this)),
649
649
 
650
650
  # param name
651
651
  (r'([$a-zA-Z_][a-zA-Z0-9_]+)', Text),
@@ -816,7 +816,7 @@ class PhpLexer(RegexLexer):
816
816
  r'array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|'
817
817
  r'implements|public|private|protected|abstract|clone|try|'
818
818
  r'catch|throw|this|use|namespace)\b', Keyword),
819
- ('(true|false|null)\b', Keyword.Constant),
819
+ (r'(true|false|null)\b', Keyword.Constant),
820
820
  (r'\$\{\$+[a-zA-Z_][a-zA-Z0-9_]*\}', Name.Variable),
821
821
  (r'\$+[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
822
822
  (r'[\\a-zA-Z_][\\a-zA-Z0-9_]*', Name.Other),
@@ -912,18 +912,18 @@ class DtdLexer(RegexLexer):
912
912
  'root': [
913
913
  include('common'),
914
914
 
915
- (r'(<!ELEMENT)(\s+)([^\s]+)',
915
+ (r'(<!ELEMENT)(\s+)(\S+)',
916
916
  bygroups(Keyword, Text, Name.Tag), 'element'),
917
- (r'(<!ATTLIST)(\s+)([^\s]+)',
917
+ (r'(<!ATTLIST)(\s+)(\S+)',
918
918
  bygroups(Keyword, Text, Name.Tag), 'attlist'),
919
- (r'(<!ENTITY)(\s+)([^\s]+)',
919
+ (r'(<!ENTITY)(\s+)(\S+)',
920
920
  bygroups(Keyword, Text, Name.Entity), 'entity'),
921
- (r'(<!NOTATION)(\s+)([^\s]+)',
921
+ (r'(<!NOTATION)(\s+)(\S+)',
922
922
  bygroups(Keyword, Text, Name.Tag), 'notation'),
923
923
  (r'(<!\[)([^\[\s]+)(\s*)(\[)', # conditional sections
924
924
  bygroups(Keyword, Name.Entity, Text, Keyword)),
925
925
 
926
- (r'(<!DOCTYPE)(\s+)([^>\s]+)',
926
+ (r'(<!DOCTYPE)(\s+)([^>\s]+)',
927
927
  bygroups(Keyword, Text, Name.Tag)),
928
928
  (r'PUBLIC|SYSTEM', Keyword.Constant),
929
929
  (r'[\[\]>]', Keyword),
@@ -937,7 +937,7 @@ class DtdLexer(RegexLexer):
937
937
  (r'"[^"]*"', String.Double),
938
938
  (r'\'[^\']*\'', String.Single),
939
939
  ],
940
-
940
+
941
941
  'comment': [
942
942
  ('[^-]+', Comment),
943
943
  ('-->', Comment, '#pop'),
@@ -966,7 +966,7 @@ class DtdLexer(RegexLexer):
966
966
  (r'[^>\s\|()?+*,]+', Name.Entity),
967
967
  (r'>', Keyword, '#pop'),
968
968
  ],
969
-
969
+
970
970
  'notation': [
971
971
  include('common'),
972
972
  (r'SYSTEM|PUBLIC', Keyword.Constant),
@@ -1169,7 +1169,7 @@ class HaxeLexer(RegexLexer):
1169
1169
  include('codekeywords'),
1170
1170
  (r'[();,\[\]]', Punctuation),
1171
1171
  (r'(?:=|\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|>>>=|\|\||&&|'
1172
- r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>|>>>|\+|\-|\*|/|%|'
1172
+ r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>>|>>|\+|\-|\*|/|%|'
1173
1173
  r'!|\+\+|\-\-|~|\.|\?|\:)',
1174
1174
  Operator),
1175
1175
  (ident, Name),
@@ -1395,7 +1395,7 @@ class HamlLexer(ExtendedRegexLexer):
1395
1395
 
1396
1396
  'eval-or-plain': [
1397
1397
  (r'[&!]?==', Punctuation, 'plain'),
1398
- (r'([&!]?[=~])(' + _comma_dot + '*\n)',
1398
+ (r'([&!]?[=~])(' + _comma_dot + r'*\n)',
1399
1399
  bygroups(Punctuation, using(RubyLexer)),
1400
1400
  'root'),
1401
1401
  (r'', Text, 'plain'),
@@ -1404,18 +1404,18 @@ class HamlLexer(ExtendedRegexLexer):
1404
1404
  'content': [
1405
1405
  include('css'),
1406
1406
  (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
1407
- (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
1408
- (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
1407
+ (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
1408
+ (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
1409
1409
  bygroups(Comment, Comment.Special, Comment),
1410
1410
  '#pop'),
1411
- (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
1411
+ (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
1412
1412
  '#pop'),
1413
- (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
1413
+ (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
1414
1414
  'haml-comment-block'), '#pop'),
1415
- (r'(-)(' + _comma_dot + '*\n)',
1415
+ (r'(-)(' + _comma_dot + r'*\n)',
1416
1416
  bygroups(Punctuation, using(RubyLexer)),
1417
1417
  '#pop'),
1418
- (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
1418
+ (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
1419
1419
  '#pop'),
1420
1420
  include('eval-or-plain'),
1421
1421
  ],
@@ -1690,7 +1690,7 @@ class SassLexer(ExtendedRegexLexer):
1690
1690
 
1691
1691
  'import': [
1692
1692
  (r'[ \t]+', Text),
1693
- (r'[^\s]+', String),
1693
+ (r'\S+', String),
1694
1694
  (r'\n', Text, 'root'),
1695
1695
  ],
1696
1696
 
@@ -1932,7 +1932,7 @@ class ScamlLexer(ExtendedRegexLexer):
1932
1932
 
1933
1933
  'eval-or-plain': [
1934
1934
  (r'[&!]?==', Punctuation, 'plain'),
1935
- (r'([&!]?[=~])(' + _dot + '*\n)',
1935
+ (r'([&!]?[=~])(' + _dot + r'*\n)',
1936
1936
  bygroups(Punctuation, using(ScalaLexer)),
1937
1937
  'root'),
1938
1938
  (r'', Text, 'plain'),
@@ -1941,21 +1941,21 @@ class ScamlLexer(ExtendedRegexLexer):
1941
1941
  'content': [
1942
1942
  include('css'),
1943
1943
  (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
1944
- (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
1945
- (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
1944
+ (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
1945
+ (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
1946
1946
  bygroups(Comment, Comment.Special, Comment),
1947
1947
  '#pop'),
1948
- (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
1948
+ (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
1949
1949
  '#pop'),
1950
- (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
1950
+ (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
1951
1951
  'scaml-comment-block'), '#pop'),
1952
- (r'(-@\s*)(import)?(' + _dot + '*\n)',
1952
+ (r'(-@\s*)(import)?(' + _dot + r'*\n)',
1953
1953
  bygroups(Punctuation, Keyword, using(ScalaLexer)),
1954
1954
  '#pop'),
1955
- (r'(-)(' + _dot + '*\n)',
1955
+ (r'(-)(' + _dot + r'*\n)',
1956
1956
  bygroups(Punctuation, using(ScalaLexer)),
1957
1957
  '#pop'),
1958
- (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
1958
+ (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
1959
1959
  '#pop'),
1960
1960
  include('eval-or-plain'),
1961
1961
  ],
@@ -2042,31 +2042,31 @@ class JadeLexer(ExtendedRegexLexer):
2042
2042
 
2043
2043
  'eval-or-plain': [
2044
2044
  (r'[&!]?==', Punctuation, 'plain'),
2045
- (r'([&!]?[=~])(' + _dot + '*\n)',
2045
+ (r'([&!]?[=~])(' + _dot + r'*\n)',
2046
2046
  bygroups(Punctuation, using(ScalaLexer)), 'root'),
2047
2047
  (r'', Text, 'plain'),
2048
2048
  ],
2049
2049
 
2050
2050
  'content': [
2051
2051
  include('css'),
2052
- (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
2053
- (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
2052
+ (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
2053
+ (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
2054
2054
  bygroups(Comment, Comment.Special, Comment),
2055
2055
  '#pop'),
2056
- (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
2056
+ (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
2057
2057
  '#pop'),
2058
- (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
2058
+ (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
2059
2059
  'scaml-comment-block'), '#pop'),
2060
- (r'(-@\s*)(import)?(' + _dot + '*\n)',
2060
+ (r'(-@\s*)(import)?(' + _dot + r'*\n)',
2061
2061
  bygroups(Punctuation, Keyword, using(ScalaLexer)),
2062
2062
  '#pop'),
2063
- (r'(-)(' + _dot + '*\n)',
2063
+ (r'(-)(' + _dot + r'*\n)',
2064
2064
  bygroups(Punctuation, using(ScalaLexer)),
2065
2065
  '#pop'),
2066
- (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
2066
+ (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
2067
2067
  '#pop'),
2068
2068
  (r'[a-z0-9_:-]+', Name.Tag, 'tag'),
2069
- (r'|', Text, 'eval-or-plain'),
2069
+ (r'\|', Text, 'eval-or-plain'),
2070
2070
  ],
2071
2071
 
2072
2072
  'tag': [
@@ -2142,24 +2142,24 @@ class XQueryLexer(ExtendedRegexLexer):
2142
2142
  # ur"[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD]|"
2143
2143
  # ur"[\u10000-\uEFFFF]"
2144
2144
  #)
2145
- ncnamestartchar = r"[A-Z]|_|[a-z]"
2145
+ ncnamestartchar = r"(?:[A-Z]|_|[a-z])"
2146
2146
  # FIX UNICODE LATER
2147
2147
  #ncnamechar = ncnamestartchar + (ur"|-|\.|[0-9]|\u00B7|[\u0300-\u036F]|"
2148
2148
  # ur"[\u203F-\u2040]")
2149
- ncnamechar = ncnamestartchar + r"|-|\.|[0-9]"
2150
- ncname = "((%s)+(%s)*)" % (ncnamestartchar, ncnamechar)
2151
- pitarget_namestartchar = r"[A-KN-WY-Z]|_|:|[a-kn-wy-z]"
2152
- pitarget_namechar = pitarget_namestartchar + r"|-|\.|[0-9]"
2153
- pitarget = "(%s)+(%s)*" % (pitarget_namestartchar, pitarget_namechar)
2149
+ ncnamechar = r"(?:" + ncnamestartchar + r"|-|\.|[0-9])"
2150
+ ncname = "(?:%s+%s*)" % (ncnamestartchar, ncnamechar)
2151
+ pitarget_namestartchar = r"(?:[A-KN-WY-Z]|_|:|[a-kn-wy-z])"
2152
+ pitarget_namechar = r"(?:" + pitarget_namestartchar + r"|-|\.|[0-9])"
2153
+ pitarget = "%s+%s*" % (pitarget_namestartchar, pitarget_namechar)
2154
2154
  prefixedname = "%s:%s" % (ncname, ncname)
2155
2155
  unprefixedname = ncname
2156
- qname = "((%s)|(%s))" %(prefixedname, unprefixedname)
2156
+ qname = "(?:%s|%s)" % (prefixedname, unprefixedname)
2157
2157
 
2158
- entityref = r'&(lt|gt|amp|quot|apos|nbsp);'
2159
- charref = r'&#[0-9]+;|&#x[0-9a-fA-F]+;'
2158
+ entityref = r'(?:&(?:lt|gt|amp|quot|apos|nbsp);)'
2159
+ charref = r'(?:&#[0-9]+;|&#x[0-9a-fA-F]+;)'
2160
2160
 
2161
- stringdouble = r'("((' + entityref + r')|(' + charref + r')|("")|([^&"]))*")'
2162
- stringsingle = r"('((" + entityref + r")|(" + charref + r")|('')|([^&']))*')"
2161
+ stringdouble = r'(?:"(?:' + entityref + r'|' + charref + r'|""|[^&"])*")'
2162
+ stringsingle = r"(?:'(?:" + entityref + r"|" + charref + r"|''|[^&'])*')"
2163
2163
 
2164
2164
  # FIX UNICODE LATER
2165
2165
  #elementcontentchar = (ur'\t|\r|\n|[\u0020-\u0025]|[\u0028-\u003b]|'
@@ -2407,11 +2407,13 @@ class XQueryLexer(ExtendedRegexLexer):
2407
2407
  operator_root_callback),
2408
2408
  (r'(::|;|\[|//|/|,)',
2409
2409
  punctuation_root_callback),
2410
- (r'(castable|cast)(\s+)(as)',
2410
+ (r'(castable|cast)(\s+)(as)\b',
2411
2411
  bygroups(Keyword, Text, Keyword), 'singletype'),
2412
- (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword), 'itemtype'),
2413
- (r'(treat)(\s+)(as)', bygroups(Keyword, Text, Keyword), 'itemtype'),
2414
- (r'case|as', Keyword, 'itemtype'),
2412
+ (r'(instance)(\s+)(of)\b',
2413
+ bygroups(Keyword, Text, Keyword), 'itemtype'),
2414
+ (r'(treat)(\s+)(as)\b',
2415
+ bygroups(Keyword, Text, Keyword), 'itemtype'),
2416
+ (r'(case|as)\b', Keyword, 'itemtype'),
2415
2417
  (r'(\))(\s*)(as)',
2416
2418
  bygroups(Punctuation, Text, Keyword), 'itemtype'),
2417
2419
  (r'\$', Name.Variable, 'varname'),
@@ -2436,8 +2438,8 @@ class XQueryLexer(ExtendedRegexLexer):
2436
2438
  'namespacedecl': [
2437
2439
  include('whitespace'),
2438
2440
  (r'\(:', Comment, 'comment'),
2439
- (r'(at)(\s+)'+stringdouble, bygroups(Keyword, Text, String.Double)),
2440
- (r"(at)(\s+)"+stringsingle, bygroups(Keyword, Text, String.Single)),
2441
+ (r'(at)(\s+)('+stringdouble+')', bygroups(Keyword, Text, String.Double)),
2442
+ (r"(at)(\s+)("+stringsingle+')', bygroups(Keyword, Text, String.Single)),
2441
2443
  (stringdouble, String.Double),
2442
2444
  (stringsingle, String.Single),
2443
2445
  (r',', Punctuation),
@@ -2484,9 +2486,9 @@ class XQueryLexer(ExtendedRegexLexer):
2484
2486
  (r'\(\#', Punctuation, 'pragma'),
2485
2487
  (r';', Punctuation, '#pop'),
2486
2488
  (r'then|else', Keyword, '#pop'),
2487
- (r'(at)(\s+)' + stringdouble,
2489
+ (r'(at)(\s+)(' + stringdouble + ')',
2488
2490
  bygroups(Keyword, Text, String.Double), 'namespacedecl'),
2489
- (r'(at)(\s+)' + stringsingle,
2491
+ (r'(at)(\s+)(' + stringsingle + ')',
2490
2492
  bygroups(Keyword, Text, String.Single), 'namespacedecl'),
2491
2493
  (r'except|intersect|in|is|return|satisfies|to|union|where',
2492
2494
  Keyword, 'root'),
@@ -2501,12 +2503,12 @@ class XQueryLexer(ExtendedRegexLexer):
2501
2503
  (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword)),
2502
2504
  (r'case|as', Keyword, 'itemtype'),
2503
2505
  (r'(\))(\s*)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
2504
- (ncname + r'(:\*)', Keyword.Type, 'operator'),
2506
+ (ncname + r':\*', Keyword.Type, 'operator'),
2505
2507
  (qname, Keyword.Type, 'occurrenceindicator'),
2506
2508
  ],
2507
2509
  'kindtest': [
2508
2510
  (r'\(:', Comment, 'comment'),
2509
- (r'({)', Punctuation, 'root'),
2511
+ (r'{', Punctuation, 'root'),
2510
2512
  (r'(\))([*+?]?)', popstate_kindtest_callback),
2511
2513
  (r'\*', Name, 'closekindtest'),
2512
2514
  (qname, Name, 'closekindtest'),
@@ -2515,7 +2517,7 @@ class XQueryLexer(ExtendedRegexLexer):
2515
2517
  'kindtestforpi': [
2516
2518
  (r'\(:', Comment, 'comment'),
2517
2519
  (r'\)', Punctuation, '#pop'),
2518
- (ncname, bygroups(Name.Variable, Name.Variable)),
2520
+ (ncname, Name.Variable),
2519
2521
  (stringdouble, String.Double),
2520
2522
  (stringsingle, String.Single),
2521
2523
  ],
@@ -2529,8 +2531,8 @@ class XQueryLexer(ExtendedRegexLexer):
2529
2531
  'xml_comment': [
2530
2532
  (r'(-->)', popstate_xmlcomment_callback),
2531
2533
  (r'[^-]{1,2}', Literal),
2532
- (r'\u009|\u00A|\u00D|[\u0020-\u00D7FF]|[\u00E000-\u00FFFD]|'
2533
- r'[\u0010000-\u0010FFFF]', Literal),
2534
+ (ur'\t|\r|\n|[\u0020-\U0000D7FF]|[\U0000E000-\U0000FFFD]|'
2535
+ ur'[\U00010000-\U0010FFFF]', Literal),
2534
2536
  ],
2535
2537
  'processing_instruction': [
2536
2538
  (r'\s+', Text, 'processing_instruction_content'),
@@ -2539,13 +2541,13 @@ class XQueryLexer(ExtendedRegexLexer):
2539
2541
  ],
2540
2542
  'processing_instruction_content': [
2541
2543
  (r'\?>', String.Doc, '#pop'),
2542
- (r'\u009|\u00A|\u00D|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
2543
- r'[\u10000-\u10FFFF]', Literal),
2544
+ (ur'\t|\r|\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
2545
+ ur'[\U00010000-\U0010FFFF]', Literal),
2544
2546
  ],
2545
2547
  'cdata_section': [
2546
2548
  (r']]>', String.Doc, '#pop'),
2547
- (r'\u009|\u00A|\u00D|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
2548
- r'[\u10000-\u10FFFF]', Literal),
2549
+ (ur'\t|\r|\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
2550
+ ur'[\U00010000-\U0010FFFF]', Literal),
2549
2551
  ],
2550
2552
  'start_tag': [
2551
2553
  include('whitespace'),
@@ -2613,9 +2615,9 @@ class XQueryLexer(ExtendedRegexLexer):
2613
2615
  ],
2614
2616
  'pragmacontents': [
2615
2617
  (r'#\)', Punctuation, 'operator'),
2616
- (r'\u009|\u00A|\u00D|[\u0020-\u00D7FF]|[\u00E000-\u00FFFD]|'
2617
- r'[\u0010000-\u0010FFFF]', Literal),
2618
- (r'(\s*)', Text),
2618
+ (ur'\t|\r|\n|[\u0020-\U0000D7FF]|[\U0000E000-\U0000FFFD]|'
2619
+ ur'[\U00010000-\U0010FFFF]', Literal),
2620
+ (r'(\s+)', Text),
2619
2621
  ],
2620
2622
  'occurrenceindicator': [
2621
2623
  include('whitespace'),
@@ -2721,8 +2723,9 @@ class XQueryLexer(ExtendedRegexLexer):
2721
2723
  (r'(element)(\s+)(?=' +qname+ r')',
2722
2724
  bygroups(Keyword, Text), 'element_qname'),
2723
2725
  #PROCESSING_INSTRUCTION
2724
- (r'(processing-instruction)(\s+)' + ncname + r'(\s*)(\{)',
2725
- bygroups(Keyword, Text, Name.Variable, Text, Punctuation), 'operator'),
2726
+ (r'(processing-instruction)(\s+)(' + ncname + r')(\s*)(\{)',
2727
+ bygroups(Keyword, Text, Name.Variable, Text, Punctuation),
2728
+ 'operator'),
2726
2729
 
2727
2730
  (r'(declare|define)(\s+)(function)',
2728
2731
  bygroups(Keyword, Text, Keyword)),
@@ -2771,8 +2774,8 @@ class XQueryLexer(ExtendedRegexLexer):
2771
2774
  (r'//|/|\+|-|;|,|\(|\)', Punctuation),
2772
2775
 
2773
2776
  # STANDALONE QNAMES
2774
- (qname + r'(?=\s*[{])', Name.Variable, 'qname_braren'),
2775
- (qname + r'(?=\s*[(])', Name.Function, 'qname_braren'),
2777
+ (qname + r'(?=\s*{)', Name.Variable, 'qname_braren'),
2778
+ (qname + r'(?=\s*\()', Name.Function, 'qname_braren'),
2776
2779
  (qname, Name.Variable, 'operator'),
2777
2780
  ]
2778
2781
  }