pygments.rb 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,3 +1,3 @@
1
1
  module Pygments
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
@@ -48,6 +48,7 @@ Other contributors, listed alphabetically, are:
48
48
  * Ben Hollis -- Mason lexer
49
49
  * Tim Howard -- BlitzMax lexer
50
50
  * Ivan Inozemtsev -- Fantom lexer
51
+ * Brian R. Jackson -- Tea lexer
51
52
  * Dennis Kaarsemaker -- sources.list lexer
52
53
  * Igor Kalnitsky -- vhdl lexer
53
54
  * Adam Koprowski -- Opa lexer
@@ -95,6 +96,7 @@ Other contributors, listed alphabetically, are:
95
96
  * Kirill Simonov -- YAML lexer
96
97
  * Steve Spigarelli -- XQuery lexer
97
98
  * Jerome St-Louis -- eC lexer
99
+ * James Strachan -- Kotlin lexer
98
100
  * Tiberius Teng -- default style overhaul
99
101
  * Jeremy Thurgood -- Erlang, Squid config lexers
100
102
  * Erick Tryzelaar -- Felix lexer
@@ -6,7 +6,7 @@ http://bitbucket.org/birkenfeld/pygments-main/issues.
6
6
 
7
7
  Version 1.5
8
8
  -----------
9
- (codename not decided, released 2012)
9
+ (codename Zeitdilatation, released Mar 10, 2012)
10
10
 
11
11
  - Lexers added:
12
12
 
@@ -42,6 +42,8 @@ Version 1.5
42
42
  * VHDL (PR#45)
43
43
  * Scilab (#740)
44
44
  * Elixir (PR#57)
45
+ * Tea (PR#56)
46
+ * Kotlin (PR#58)
45
47
 
46
48
  - Fix Python 3 terminal highlighting with pygmentize (#691).
47
49
 
@@ -78,6 +80,12 @@ Version 1.5
78
80
 
79
81
  - Add "rrt" style (#727).
80
82
 
83
+ - Fix infinite looping in Darcs Patch lexer.
84
+
85
+ - Lots of misc fixes to character-eating bugs and ordering problems in many
86
+ different lexers.
87
+
88
+
81
89
  Version 1.4
82
90
  -----------
83
91
  (codename Unschärfe, released Jan 03, 2011)
@@ -343,7 +351,7 @@ Version 1.0
343
351
 
344
352
  - Added Tango style, written by Andre Roberge for the Crunchy project.
345
353
 
346
- - Added Python3TracebackLexer and ``python3`` option to
354
+ - Added Python3TracebackLexer and ``python3`` option to
347
355
  PythonConsoleLexer.
348
356
 
349
357
  - Fixed a few bugs in the Haskell lexer.
@@ -681,7 +689,7 @@ Version 0.7
681
689
 
682
690
  - Added token stream filters, and a pygmentize option to use them.
683
691
 
684
- - Changed behavior of `in` Operator for tokens.
692
+ - Changed behavior of `in` Operator for tokens.
685
693
 
686
694
  - Added mimetypes for all lexers.
687
695
 
@@ -1 +1 @@
1
- 65df4880283d
1
+ eff3aee4abff
@@ -3,8 +3,6 @@ Todo
3
3
 
4
4
  - suggested new lexers
5
5
  * IPython sessions
6
- * PostgreSQL/SQLite
7
- * Nemerle
8
6
 
9
7
  - lexers that need work:
10
8
  * review perl lexer (numerous bugs, but so far no one had complaints ;)
@@ -56,7 +56,7 @@ def generate_lexer_docs():
56
56
  classname,
57
57
  cls.__doc__,
58
58
  ', '.join(data[2]) or 'None',
59
- ', '.join(data[3]).replace('*', '\\*') or 'None',
59
+ ', '.join(data[3]).replace('*', '\\*').replace('_', '\\') or 'None',
60
60
  ', '.join(data[4]) or 'None'))
61
61
  if module not in moduledocstrings:
62
62
  moduledocstrings[module] = mod.__doc__
@@ -303,7 +303,7 @@ Comments
303
303
 
304
304
  `Comment.Special`
305
305
  Special data in comments. For example code tags, author and license
306
- informations etc.
306
+ information, etc.
307
307
 
308
308
 
309
309
  Generic Tokens
@@ -26,7 +26,7 @@
26
26
  :license: BSD, see LICENSE for details.
27
27
  """
28
28
 
29
- __version__ = '1.4'
29
+ __version__ = '1.5'
30
30
  __docformat__ = 'restructuredtext'
31
31
 
32
32
  __all__ = ['lex', 'format', 'highlight']
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
3
  pygments.formatters._mapping
4
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
 
6
6
  Formatter mapping defintions. This file is generated by itself. Everytime
7
7
  you change something on a builtin formatter defintion, run this script from
@@ -34,7 +34,7 @@ LEXERS = {
34
34
  'AwkLexer': ('pygments.lexers.other', 'Awk', ('awk', 'gawk', 'mawk', 'nawk'), ('*.awk',), ('application/x-awk',)),
35
35
  'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
36
36
  'BaseMakefileLexer': ('pygments.lexers.text', 'Base Makefile', ('basemake',), (), ()),
37
- 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass'), ('application/x-sh', 'application/x-shellscript')),
37
+ 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '.bashrc', 'bashrc', '.bash_*', 'bash_*'), ('application/x-sh', 'application/x-shellscript')),
38
38
  'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console',), ('*.sh-session',), ('application/x-shell-session',)),
39
39
  'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat',), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
40
40
  'BefungeLexer': ('pygments.lexers.other', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
@@ -131,6 +131,7 @@ LEXERS = {
131
131
  'JavascriptPhpLexer': ('pygments.lexers.templates', 'JavaScript+PHP', ('js+php', 'javascript+php'), (), ('application/x-javascript+php', 'text/x-javascript+php', 'text/javascript+php')),
132
132
  'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ('application/x-javascript+smarty', 'text/x-javascript+smarty', 'text/javascript+smarty')),
133
133
  'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)),
134
+ 'KotlinLexer': ('pygments.lexers.jvm', 'Kotlin', ('kotlin',), ('*.kt',), ('text/x-kotlin',)),
134
135
  'LighttpdConfLexer': ('pygments.lexers.text', 'Lighttpd configuration file', ('lighty', 'lighttpd'), (), ('text/x-lighttpd-conf',)),
135
136
  'LiterateHaskellLexer': ('pygments.lexers.functional', 'Literate Haskell', ('lhs', 'literate-haskell'), ('*.lhs',), ('text/x-literate-haskell',)),
136
137
  'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)),
@@ -227,6 +228,7 @@ LEXERS = {
227
228
  'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('sv',), ('*.sv', '*.svh'), ('text/x-systemverilog',)),
228
229
  'TclLexer': ('pygments.lexers.agile', 'Tcl', ('tcl',), ('*.tcl',), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')),
229
230
  'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)),
231
+ 'TeaTemplateLexer': ('pygments.lexers.templates', 'Tea', ('tea',), ('*.tea',), ('text/x-tea',)),
230
232
  'TexLexer': ('pygments.lexers.text', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')),
231
233
  'TextLexer': ('pygments.lexers.special', 'Text only', ('text',), ('*.txt',), ('text/plain',)),
232
234
  'UrbiscriptLexer': ('pygments.lexers.other', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)),
@@ -238,7 +240,7 @@ LEXERS = {
238
240
  'VelocityXmlLexer': ('pygments.lexers.templates', 'XML+Velocity', ('xml+velocity',), (), ('application/xml+velocity',)),
239
241
  'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('v',), ('*.v',), ('text/x-verilog',)),
240
242
  'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)),
241
- 'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc'), ('text/x-vim',)),
243
+ 'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)),
242
244
  'XQueryLexer': ('pygments.lexers.web', 'XQuery', ('xquery', 'xqy'), ('*.xqy', '*.xquery'), ('text/xquery', 'application/xquery')),
243
245
  'XmlDjangoLexer': ('pygments.lexers.templates', 'XML+Django/Jinja', ('xml+django', 'xml+jinja'), (), ('application/xml+django', 'application/xml+jinja')),
244
246
  'XmlErbLexer': ('pygments.lexers.templates', 'XML+Ruby', ('xml+erb', 'xml+ruby'), (), ('application/xml+ruby',)),
@@ -381,7 +381,7 @@ class PythonTracebackLexer(RegexLexer):
381
381
  bygroups(Text, Name.Builtin, Text, Number, Text)),
382
382
  (r'^( )(.+)(\n)',
383
383
  bygroups(Text, using(PythonLexer), Text)),
384
- (r'^([ \t]*)(...)(\n)',
384
+ (r'^([ \t]*)(\.\.\.)(\n)',
385
385
  bygroups(Text, Comment, Text)), # for doctests...
386
386
  (r'^(.+)(: )(.+)(\n)',
387
387
  bygroups(Generic.Error, Text, Name, Text), '#pop'),
@@ -417,7 +417,7 @@ class Python3TracebackLexer(RegexLexer):
417
417
  bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
418
418
  (r'^( )(.+)(\n)',
419
419
  bygroups(Text, using(Python3Lexer), Text)),
420
- (r'^([ \t]*)(...)(\n)',
420
+ (r'^([ \t]*)(\.\.\.)(\n)',
421
421
  bygroups(Text, Comment, Text)), # for doctests...
422
422
  (r'^(.+)(: )(.+)(\n)',
423
423
  bygroups(Generic.Error, Text, Name, Text), '#pop'),
@@ -506,7 +506,7 @@ class RubyLexer(ExtendedRegexLexer):
506
506
  states = {}
507
507
  states['strings'] = [
508
508
  # easy ones
509
- (r'\:@{0,2}([a-zA-Z_][\w_]*[\!\?]?|\*\*?|[-+]@?|'
509
+ (r'\:@{0,2}([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
510
510
  r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)', String.Symbol),
511
511
  (r":'(\\\\|\\'|[^'])*'", String.Symbol),
512
512
  (r"'(\\\\|\\'|[^'])*'", String.Single),
@@ -703,7 +703,7 @@ class RubyLexer(ExtendedRegexLexer):
703
703
  # like keywords (class) or like this: ` ?!?
704
704
  (r'(\.|::)([a-zA-Z_]\w*[\!\?]?|[*%&^`~+-/\[<>=])',
705
705
  bygroups(Operator, Name)),
706
- (r'[a-zA-Z_][\w_]*[\!\?]?', Name),
706
+ (r'[a-zA-Z_]\w*[\!\?]?', Name),
707
707
  (r'(\[|\]|\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|'
708
708
  r'!~|&&?|\|\||\.{1,3})', Operator),
709
709
  (r'[-+/*%=<>&!^|~]=?', Operator),
@@ -713,7 +713,7 @@ class RubyLexer(ExtendedRegexLexer):
713
713
  'funcname': [
714
714
  (r'\(', Punctuation, 'defexpr'),
715
715
  (r'(?:([a-zA-Z_][a-zA-Z0-9_]*)(\.))?'
716
- r'([a-zA-Z_][\w_]*[\!\?]?|\*\*?|[-+]@?|'
716
+ r'([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
717
717
  r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
718
718
  bygroups(Name.Class, Operator, Name.Function), '#pop'),
719
719
  (r'', Text, '#pop')
@@ -721,7 +721,7 @@ class RubyLexer(ExtendedRegexLexer):
721
721
  'classname': [
722
722
  (r'\(', Punctuation, 'defexpr'),
723
723
  (r'<<', Operator, '#pop'),
724
- (r'[A-Z_][\w_]*', Name.Class, '#pop'),
724
+ (r'[A-Z_]\w*', Name.Class, '#pop'),
725
725
  (r'', Text, '#pop')
726
726
  ],
727
727
  'defexpr': [
@@ -924,7 +924,7 @@ class PerlLexer(RegexLexer):
924
924
  (r'(q|qq|qw|qr|qx)([^a-zA-Z0-9])(.|\n)*?\2', String.Other),
925
925
  (r'package\s+', Keyword, 'modulename'),
926
926
  (r'sub\s+', Keyword, 'funcname'),
927
- (r'(\[\]|\*\*|::|<<|>>|>=|<=|<=>|={3}|!=|=~|'
927
+ (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|'
928
928
  r'!~|&&?|\|\||\.{1,3})', Operator),
929
929
  (r'[-+/*%=<>&^|!\\~]=?', Operator),
930
930
  (r'[\(\)\[\]:;,<>/\?\{\}]', Punctuation), # yes, there's no shortage
@@ -949,10 +949,10 @@ class PerlLexer(RegexLexer):
949
949
  (r'(?=[^a-zA-Z0-9_])', Text, '#pop'),
950
950
  ],
951
951
  'modulename': [
952
- (r'[a-zA-Z_][\w_]*', Name.Namespace, '#pop')
952
+ (r'[a-zA-Z_]\w*', Name.Namespace, '#pop')
953
953
  ],
954
954
  'funcname': [
955
- (r'[a-zA-Z_][\w_]*[\!\?]?', Name.Function),
955
+ (r'[a-zA-Z_]\w*[\!\?]?', Name.Function),
956
956
  (r'\s+', Text),
957
957
  # argument declaration
958
958
  (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)),
@@ -1151,13 +1151,13 @@ class MoonScriptLexer(LuaLexer):
1151
1151
  (r'(?s)\[(=*)\[.*?\]\1\]', String),
1152
1152
  (r'(->|=>)', Name.Function),
1153
1153
  (r':[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
1154
- (r'(==|!=|~=|<=|>=|\.\.|\.\.\.|[=+\-*/%^<>#!.\\:])', Operator),
1154
+ (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator),
1155
1155
  (r'[;,]', Punctuation),
1156
1156
  (r'[\[\]\{\}\(\)]', Keyword.Type),
1157
1157
  (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Variable),
1158
1158
  (r"(class|extends|if|then|super|do|with|import|export|"
1159
- r"while|elseif|return|for|in|from|when|using|else|"
1160
- r"and|or|not|switch|break)\b", Keyword),
1159
+ r"while|elseif|return|for|in|from|when|using|else|"
1160
+ r"and|or|not|switch|break)\b", Keyword),
1161
1161
  (r'(true|false|nil)\b', Keyword.Constant),
1162
1162
  (r'(and|or|not)\b', Operator.Word),
1163
1163
  (r'(self)\b', Name.Builtin.Pseudo),
@@ -1286,7 +1286,7 @@ class IoLexer(RegexLexer):
1286
1286
  # constants
1287
1287
  (r'(nil|false|true)\b', Name.Constant),
1288
1288
  # names
1289
- ('(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
1289
+ (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
1290
1290
  Name.Builtin),
1291
1291
  ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1292
1292
  # numbers
@@ -1378,7 +1378,7 @@ class TclLexer(RegexLexer):
1378
1378
  'params': [
1379
1379
  (r';', Keyword, '#pop'),
1380
1380
  (r'\n', Text, '#pop'),
1381
- (r'(else|elseif|then)', Keyword),
1381
+ (r'(else|elseif|then)\b', Keyword),
1382
1382
  include('basic'),
1383
1383
  include('data'),
1384
1384
  ],
@@ -1785,7 +1785,7 @@ class FancyLexer(RegexLexer):
1785
1785
  ('[A-Z][a-zA-Z0-9_]*', Name.Constant),
1786
1786
  ('@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
1787
1787
  ('@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
1788
- ('(@|@@)', Operator),
1788
+ ('@@?', Operator),
1789
1789
  ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1790
1790
  # numbers - / checks are necessary to avoid mismarking regexes,
1791
1791
  # see comment in RubyLexer
@@ -136,17 +136,17 @@ class ObjdumpLexer(RegexLexer):
136
136
  ('( *)('+hex+r'+:)(\t)((?:'+hex+hex+' )+)$',
137
137
  bygroups(Text, Name.Label, Text, Number.Hex)),
138
138
  # Skipped a few bytes
139
- ('\t\.\.\.$', Text),
139
+ (r'\t\.\.\.$', Text),
140
140
  # Relocation line
141
141
  # (With offset)
142
- ('(\t\t\t)('+hex+'+:)( )([^\t]+)(\t)(.*?)([-+])(0x' + hex + '+)$',
142
+ (r'(\t\t\t)('+hex+r'+:)( )([^\t]+)(\t)(.*?)([-+])(0x' + hex + '+)$',
143
143
  bygroups(Text, Name.Label, Text, Name.Property, Text,
144
144
  Name.Constant, Punctuation, Number.Hex)),
145
145
  # (Without offset)
146
- ('(\t\t\t)('+hex+'+:)( )([^\t]+)(\t)(.*?)$',
146
+ (r'(\t\t\t)('+hex+r'+:)( )([^\t]+)(\t)(.*?)$',
147
147
  bygroups(Text, Name.Label, Text, Name.Property, Text,
148
148
  Name.Constant)),
149
- ('[^\n]+\n', Other)
149
+ (r'[^\n]+\n', Other)
150
150
  ]
151
151
  }
152
152
 
@@ -1058,7 +1058,7 @@ class DylanLexer(RegexLexer):
1058
1058
  tokens = {
1059
1059
  'root': [
1060
1060
  (r'\b(subclass|abstract|block|c(on(crete|stant)|lass)|domain'
1061
- r'|ex(c(eption|lude)|port)|f(unction(|al))|generic|handler'
1061
+ r'|ex(c(eption|lude)|port)|f(unction(al)?)|generic|handler'
1062
1062
  r'|i(n(herited|line|stance|terface)|mport)|library|m(acro|ethod)'
1063
1063
  r'|open|primary|sealed|si(deways|ngleton)|slot'
1064
1064
  r'|v(ariable|irtual))\b', Name.Builtin),
@@ -1068,7 +1068,7 @@ class DylanLexer(RegexLexer):
1068
1068
  (r'"', String, 'string'),
1069
1069
  (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
1070
1070
  (r'=>|\b(a(bove|fterwards)|b(e(gin|low)|y)|c(ase|leanup|reate)'
1071
- r'|define|else(|if)|end|f(inally|or|rom)|i[fn]|l(et|ocal)|otherwise'
1071
+ r'|define|else(if)?|end|f(inally|or|rom)|i[fn]|l(et|ocal)|otherwise'
1072
1072
  r'|rename|s(elect|ignal)|t(hen|o)|u(n(less|til)|se)|wh(en|ile))\b',
1073
1073
  Keyword),
1074
1074
  (r'([ \t])([!\$%&\*\/:<=>\?~_^a-zA-Z0-9.+\-]*:)',
@@ -2186,7 +2186,7 @@ class AdaLexer(RegexLexer):
2186
2186
  'end' : [
2187
2187
  ('(if|case|record|loop|select)', Keyword.Reserved),
2188
2188
  ('"[^"]+"|[a-zA-Z0-9_.]+', Name.Function),
2189
- ('[\n\s]+', Text),
2189
+ ('\s+', Text),
2190
2190
  (';', Punctuation, '#pop'),
2191
2191
  ],
2192
2192
  'type_def': [
@@ -2572,7 +2572,7 @@ class NimrodLexer(RegexLexer):
2572
2572
  (r'##.*$', String.Doc),
2573
2573
  (r'#.*$', Comment),
2574
2574
  (r'\*|=|>|<|\+|-|/|@|\$|~|&|%|\!|\?|\||\\|\[|\]', Operator),
2575
- (r'\.\.|\.|,|[\.|\.]|{\.|\.}|\(\.|\.\)|{|}|\(|\)|:|\^|`|;',
2575
+ (r'\.\.|\.|,|\[\.|\.\]|{\.|\.}|\(\.|\.\)|{|}|\(|\)|:|\^|`|;',
2576
2576
  Punctuation),
2577
2577
 
2578
2578
  # Strings
@@ -2679,7 +2679,7 @@ class FantomLexer(RegexLexer):
2679
2679
  id = r'[a-zA-Z_][a-zA-Z0-9_]*',
2680
2680
  # all chars which can be part of type definition. Starts with
2681
2681
  # either letter, or [ (maps), or | (funcs)
2682
- type = r'(?:\[|[a-zA-Z_]|\|)[:\w_\[\]\|\->\?]*?',
2682
+ type = r'(?:\[|[a-zA-Z_]|\|)[:\w\[\]\|\->\?]*?',
2683
2683
  )
2684
2684
  )
2685
2685
 
@@ -2810,7 +2810,7 @@ class FantomLexer(RegexLexer):
2810
2810
 
2811
2811
  ### ArgType argName, #####
2812
2812
  (s(r'($type)(\s+)($id)(\s*)(,)'),
2813
- bygroups(using(this, state= 'inType'), Text, Name.Variable,
2813
+ bygroups(using(this, state='inType'), Text, Name.Variable,
2814
2814
  Text, Punctuation)),
2815
2815
 
2816
2816
  #### ArgType argName) ####
@@ -2818,13 +2818,13 @@ class FantomLexer(RegexLexer):
2818
2818
 
2819
2819
  ### ArgType argName -> ArgType| ###
2820
2820
  (s(r'($type)(\s+)($id)(\s*)(\->)(\s*)($type)(\|)'),
2821
- bygroups(using(this, state= 'inType'), Text, Name.Variable,
2821
+ bygroups(using(this, state='inType'), Text, Name.Variable,
2822
2822
  Text, Punctuation, Text, using(this, state = 'inType'),
2823
2823
  Punctuation)),
2824
2824
 
2825
2825
  ### ArgType argName| ###
2826
2826
  (s(r'($type)(\s+)($id)(\s*)(\|)'),
2827
- bygroups(using(this, state= 'inType'), Text, Name.Variable,
2827
+ bygroups(using(this, state='inType'), Text, Name.Variable,
2828
2828
  Text, Punctuation)),
2829
2829
 
2830
2830
  ### Type var
@@ -2843,7 +2843,7 @@ class FantomLexer(RegexLexer):
2843
2843
  'insideMethodDeclArgs': [
2844
2844
  (r'\)', Punctuation, '#pop'),
2845
2845
  (s(r'($type)(\s+)($id)(\s*)(\))'),
2846
- bygroups(using(this, state= 'inType'), Text, Name.Variable,
2846
+ bygroups(using(this, state='inType'), Text, Name.Variable,
2847
2847
  Text, Punctuation), '#pop'),
2848
2848
  include('root'),
2849
2849
  ],
@@ -344,7 +344,7 @@ class BooLexer(RegexLexer):
344
344
  (r"'(\\\\|\\'|[^']*?)'", String.Single),
345
345
  (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
346
346
  (r'(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?', Number.Float),
347
- (r'[0-9][0-9\.]*(m|ms|d|h|s)', Number),
347
+ (r'[0-9][0-9\.]*(ms?|d|h|s)', Number),
348
348
  (r'0\d+', Number.Oct),
349
349
  (r'0x[a-fA-F0-9]+', Number.Hex),
350
350
  (r'\d+L', Number.Integer.Long),
@@ -559,10 +559,10 @@ class FSharpLexer(RegexLexer):
559
559
  'with', 'yield', 'yield!'
560
560
  ]
561
561
  keyopts = [
562
- '!=','#','&','&&','\(','\)','\*','\+',',','-',
563
- '-\.','->','\.','\.\.',':','::',':=',':>',';',';;','<',
564
- '<-','>','>]','\?','\?\?','\[','\[<','\[>','\[\|',
565
- ']','_','`','{','\|','\|]','}','~','<@','=','@>'
562
+ '!=','#','&&','&','\(','\)','\*','\+',',','-\.',
563
+ '->','-','\.\.','\.','::',':=',':>',':',';;',';','<-',
564
+ '<','>]','>','\?\?','\?','\[<','\[>','\[\|','\[',
565
+ ']','_','`','{','\|\]','\|','}','~','<@','=','@>'
566
566
  ]
567
567
 
568
568
  operators = r'[!$%&*+\./:<=>?@^|~-]'
@@ -113,7 +113,7 @@ class SchemeLexer(RegexLexer):
113
113
  # strings, symbols and characters
114
114
  (r'"(\\\\|\\"|[^"])*"', String),
115
115
  (r"'" + valid_name, String.Symbol),
116
- (r"#\\([()/'\".'_!§$%& ?=+-]{1}|[a-zA-Z0-9]+)", String.Char),
116
+ (r"#\\([()/'\"._!§$%& ?=+-]{1}|[a-zA-Z0-9]+)", String.Char),
117
117
 
118
118
  # constants
119
119
  (r'(#t|#f)', Name.Constant),
@@ -560,7 +560,10 @@ class SMLLexer(RegexLexer):
560
560
  return [
561
561
  (r'[^"\\]', whatkind),
562
562
  (r'\\[\\\"abtnvfr]', String.Escape),
563
- (r'\\\^[@-^]', String.Escape),
563
+ # Control-character notation is used for codes < 32,
564
+ # where \^@ == \000
565
+ (r'\\\^[\x40-\x5e]', String.Escape),
566
+ # Docs say 'decimal digits'
564
567
  (r'\\[0-9]{3}', String.Escape),
565
568
  (r'\\u[0-9a-fA-F]{4}', String.Escape),
566
569
  (r'\\\s+\\', String.Interpol),
@@ -885,9 +888,9 @@ class OcamlLexer(RegexLexer):
885
888
  (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)',
886
889
  Name.Namespace, 'dotted'),
887
890
  (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
888
- (r'\(\*', Comment, 'comment'),
891
+ (r'\(\*(?![)])', Comment, 'comment'),
889
892
  (r'\b(%s)\b' % '|'.join(keywords), Keyword),
890
- (r'(%s)' % '|'.join(keyopts), Operator),
893
+ (r'(%s)' % '|'.join(keyopts[::-1]), Operator),
891
894
  (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
892
895
  (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
893
896
  (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
@@ -980,7 +983,7 @@ class ErlangLexer(RegexLexer):
980
983
  'universaltime_to_localtime', 'unlink', 'unregister', 'whereis'
981
984
  ]
982
985
 
983
- operators = r'(\+|-|\*|/|<|>|=|==|/=|=:=|=/=|=<|>=|\+\+|--|<-|!|\?)'
986
+ operators = r'(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)'
984
987
  word_operators = [
985
988
  'and', 'andalso', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor',
986
989
  'div', 'not', 'or', 'orelse', 'rem', 'xor'
@@ -1494,7 +1497,7 @@ class CoqLexer(RegexLexer):
1494
1497
  (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)',
1495
1498
  Name.Namespace, 'dotted'),
1496
1499
  (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
1497
- (r'(%s)' % '|'.join(keyopts), Operator),
1500
+ (r'(%s)' % '|'.join(keyopts[::-1]), Operator),
1498
1501
  (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
1499
1502
  (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
1500
1503
  (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
@@ -1704,13 +1707,14 @@ class ElixirLexer(RegexLexer):
1704
1707
  r'<=>|&&?|%\(\)|%\[\]|%\{\}|\+\+?|\-\-?|\|\|?|\!|//|[%&`/\|]|'
1705
1708
  r'\*\*?|=?~|<\-)|([a-zA-Z_]\w*([?!])?)(:)(?!:)', String.Symbol),
1706
1709
  (r':"', String.Symbol, 'interpoling_symbol'),
1707
- (r'\b(nil|true|false)\b(?![?!])|\b[A-Z]\w*\b', Name.Constant),
1710
+ (r'\b(nil|true|false)\b(?![?!])', Name.Constant),
1711
+ (r'\b[A-Z]\w*\b', Name.Constant),
1708
1712
  (r'\b(__(FILE|LINE|MODULE|STOP_ITERATOR|EXCEPTION|OP|REF|FUNCTION|'
1709
1713
  r'BLOCK|KVBLOCK)__)\b(?![?!])', Name.Builtin.Pseudo),
1710
- (r'[a-zA-Z_][\w_]*[\!\?]?', Name),
1714
+ (r'[a-zA-Z_!]\w*[!\?]?', Name),
1711
1715
  (r'[(){};,/\|:\\\[\]]', Punctuation),
1712
1716
  (r'@[a-zA-Z_]\w*|&\d', Name.Variable),
1713
- (r'\b(0[xX][0-9A-Fa-f]+|\d(_?\d)*(\.(?![^[:space:][:digit:]])'
1717
+ (r'\b(0[xX][0-9A-Fa-f]+|\d(_?\d)*(\.(?![^\d\s])'
1714
1718
  r'(_?\d)*)?([eE][-+]?\d(_?\d)*)?|0[bB][01]+)\b', Number),
1715
1719
  include('strings'),
1716
1720
  ],