pygments.rb 0.5.2 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/README.md +2 -0
  2. data/lexers +0 -0
  3. data/lib/pygments/version.rb +1 -1
  4. data/test/test_pygments.rb +1 -1
  5. data/vendor/custom_lexers/github.py +15 -9
  6. data/vendor/pygments-main/AUTHORS +12 -2
  7. data/vendor/pygments-main/CHANGES +52 -2
  8. data/vendor/pygments-main/REVISION +1 -1
  9. data/vendor/pygments-main/docs/src/lexerdevelopment.txt +52 -0
  10. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +67 -44
  11. data/vendor/pygments-main/pygmentize +1 -1
  12. data/vendor/pygments-main/pygments/filters/__init__.py +2 -2
  13. data/vendor/pygments-main/pygments/formatter.py +3 -0
  14. data/vendor/pygments-main/pygments/lexers/__init__.py +11 -0
  15. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +2880 -3124
  16. data/vendor/pygments-main/pygments/lexers/_mapping.py +30 -20
  17. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +1 -1
  18. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +206 -20
  19. data/vendor/pygments-main/pygments/lexers/agile.py +378 -5
  20. data/vendor/pygments-main/pygments/lexers/asm.py +2 -2
  21. data/vendor/pygments-main/pygments/lexers/compiled.py +235 -8
  22. data/vendor/pygments-main/pygments/lexers/dotnet.py +88 -47
  23. data/vendor/pygments-main/pygments/lexers/functional.py +195 -62
  24. data/vendor/pygments-main/pygments/lexers/github.py +15 -9
  25. data/vendor/pygments-main/pygments/lexers/jvm.py +14 -11
  26. data/vendor/pygments-main/pygments/lexers/math.py +284 -18
  27. data/vendor/pygments-main/pygments/lexers/other.py +132 -21
  28. data/vendor/pygments-main/pygments/lexers/shell.py +29 -15
  29. data/vendor/pygments-main/pygments/lexers/sql.py +1 -1
  30. data/vendor/pygments-main/pygments/lexers/templates.py +8 -8
  31. data/vendor/pygments-main/pygments/lexers/text.py +59 -9
  32. data/vendor/pygments-main/pygments/lexers/web.py +832 -210
  33. data/vendor/pygments-main/pygments/modeline.py +40 -0
  34. data/vendor/pygments-main/tests/examplefiles/Deflate.fs +578 -0
  35. data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +66 -0
  36. data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +104 -0
  37. data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +671 -0
  38. data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +23 -0
  39. data/vendor/pygments-main/tests/examplefiles/example.ceylon +29 -10
  40. data/vendor/pygments-main/tests/examplefiles/example.clay +33 -0
  41. data/vendor/pygments-main/tests/examplefiles/example.hx +142 -0
  42. data/vendor/pygments-main/tests/examplefiles/example.lagda +19 -0
  43. data/vendor/pygments-main/tests/examplefiles/example.rexx +50 -0
  44. data/vendor/pygments-main/tests/examplefiles/example.stan +86 -75
  45. data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +40 -30
  46. data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +22 -0
  47. data/vendor/pygments-main/tests/examplefiles/objc_example.m +7 -0
  48. data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +4 -0
  49. data/vendor/pygments-main/tests/examplefiles/swig_java.swg +1329 -0
  50. data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +225 -0
  51. data/vendor/pygments-main/tests/examplefiles/test.agda +102 -0
  52. data/vendor/pygments-main/tests/examplefiles/test.bb +95 -0
  53. data/vendor/pygments-main/tests/examplefiles/test.ebnf +31 -0
  54. data/vendor/pygments-main/tests/examplefiles/test.p6 +252 -0
  55. data/vendor/pygments-main/tests/examplefiles/type.lisp +16 -0
  56. data/vendor/pygments-main/tests/test_basic_api.py +3 -3
  57. data/vendor/pygments-main/tests/test_lexers_other.py +68 -0
  58. metadata +21 -2
@@ -408,7 +408,7 @@ class SlashLanguageLexer(ExtendedRegexLexer):
408
408
  def right_angle_bracket(lexer, match, ctx):
409
409
  if len(ctx.stack) > 1 and ctx.stack[-2] == "string":
410
410
  ctx.stack.pop()
411
- yield match.start(), Punctuation, "}"
411
+ yield match.start(), String.Interpol, u"}"
412
412
  ctx.pos = match.end()
413
413
  pass
414
414
 
@@ -423,7 +423,7 @@ class SlashLanguageLexer(ExtendedRegexLexer):
423
423
  "string": [
424
424
  (r"\\", String.Escape, move_state("string_e")),
425
425
  (r"\"", String, move_state("slash")),
426
- (r"#\{", Punctuation, "slash"),
426
+ (r"#\{", String.Interpol, "slash"),
427
427
  (r'.|\n', String),
428
428
  ],
429
429
  "string_e": [
@@ -459,8 +459,14 @@ class SlashLanguageLexer(ExtendedRegexLexer):
459
459
  (r'true'+_nkw, Name.Builtin),
460
460
  (r'false'+_nkw, Name.Builtin),
461
461
  (r'self'+_nkw, Name.Builtin),
462
+ (r'(class)(\s+)([A-Z][a-zA-Z0-9_\']*)',
463
+ bygroups(Keyword, Whitespace, Name.Class)),
462
464
  (r'class'+_nkw, Keyword),
463
465
  (r'extends'+_nkw, Keyword),
466
+ (r'(def)(\s+)(self)(\s*)(\.)(\s*)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
467
+ bygroups(Keyword, Whitespace, Name.Builtin, Whitespace, Punctuation, Whitespace, Name.Function)),
468
+ (r'(def)(\s+)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
469
+ bygroups(Keyword, Whitespace, Name.Function)),
464
470
  (r'def'+_nkw, Keyword),
465
471
  (r'if'+_nkw, Keyword),
466
472
  (r'elsif'+_nkw, Keyword),
@@ -482,14 +488,14 @@ class SlashLanguageLexer(ExtendedRegexLexer):
482
488
  (r'throw'+_nkw, Keyword),
483
489
  (r'use'+_nkw, Keyword),
484
490
  (r'switch'+_nkw, Keyword),
485
- (r'\\'+_nkw, Keyword),
486
- (r'λ'+_nkw, Keyword),
491
+ (r'\\', Keyword),
492
+ (r'λ', Keyword),
487
493
  (r'__FILE__'+_nkw, Name.Builtin.Pseudo),
488
494
  (r'__LINE__'+_nkw, Name.Builtin.Pseudo),
489
- (r'[A-Z][a-zA-Z0-9_]*'+_nkw, Name.Constant),
490
- (r'[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable),
491
- (r'@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Instance),
492
- (r'@@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Class),
495
+ (r'[A-Z][a-zA-Z0-9_\']*'+_nkw, Name.Constant),
496
+ (r'[a-z_][a-zA-Z0-9_\']*'+_nkw, Name),
497
+ (r'@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Instance),
498
+ (r'@@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Class),
493
499
  (r'\(', Punctuation),
494
500
  (r'\)', Punctuation),
495
501
  (r'\[', Punctuation),
@@ -540,7 +546,7 @@ class SlashLanguageLexer(ExtendedRegexLexer):
540
546
  (r'::', Operator),
541
547
  (r':', Operator),
542
548
  (r'(\s|\n)+', Whitespace),
543
- (r'[a-z_][a-zA-Z0-9_]*', Name.Variable),
549
+ (r'[a-z_][a-zA-Z0-9_\']*', Name.Variable),
544
550
  ],
545
551
  }
546
552
 
@@ -888,11 +888,11 @@ class CeylonLexer(RegexLexer):
888
888
  (r'[^\S\n]+', Text),
889
889
  (r'//.*?\n', Comment.Single),
890
890
  (r'/\*.*?\*/', Comment.Multiline),
891
- (r'(variable|shared|abstract|doc|by|formal|actual)',
891
+ (r'(variable|shared|abstract|doc|by|formal|actual|late|native)',
892
892
  Name.Decorator),
893
893
  (r'(break|case|catch|continue|default|else|finally|for|in|'
894
- r'variable|if|return|switch|this|throw|try|while|is|exists|'
895
- r'nonempty|then|outer)\b', Keyword),
894
+ r'variable|if|return|switch|this|throw|try|while|is|exists|dynamic|'
895
+ r'nonempty|then|outer|assert)\b', Keyword),
896
896
  (r'(abstracts|extends|satisfies|adapts|'
897
897
  r'super|given|of|out|assign|'
898
898
  r'transient|volatile)\b', Keyword.Declaration),
@@ -900,16 +900,16 @@ class CeylonLexer(RegexLexer):
900
900
  Keyword.Type),
901
901
  (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
902
902
  (r'(true|false|null)\b', Keyword.Constant),
903
- (r'(class|interface|object)(\s+)',
903
+ (r'(class|interface|object|alias)(\s+)',
904
904
  bygroups(Keyword.Declaration, Text), 'class'),
905
905
  (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
906
906
  (r'"(\\\\|\\"|[^"])*"', String),
907
- (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Quoted),
908
- (r"`\\.`|`[^\\]`|`\\u[0-9a-fA-F]{4}`", String.Char),
909
- (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)',
907
+ (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char),
908
+ (r'".*``.*``.*"', String.Interpol),
909
+ (r'(\.)([a-z_][a-zA-Z0-9_]*)',
910
910
  bygroups(Operator, Name.Attribute)),
911
911
  (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
912
- (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
912
+ (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
913
913
  (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
914
914
  (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float),
915
915
  (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?',
@@ -917,16 +917,19 @@ class CeylonLexer(RegexLexer):
917
917
  (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float),
918
918
  (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?',
919
919
  Number.Float),
920
- (r'0x[0-9a-fA-F]+', Number.Hex),
920
+ (r'#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+', Number.Hex),
921
+ (r'#[0-9a-fA-F]+', Number.Hex),
922
+ (r'\$([01]{4})(_[01]{4})+', Number.Integer),
923
+ (r'\$[01]+', Number.Integer),
921
924
  (r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer),
922
925
  (r'[0-9]+[kMGTP]?', Number.Integer),
923
926
  (r'\n', Text)
924
927
  ],
925
928
  'class': [
926
- (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
929
+ (r'[A-Za-z_][a-zA-Z0-9_]*', Name.Class, '#pop')
927
930
  ],
928
931
  'import': [
929
- (r'[a-zA-Z0-9_.]+\w+ \{([a-zA-Z,]+|\.\.\.)\}',
932
+ (r'[a-z][a-zA-Z0-9_.]*',
930
933
  Name.Namespace, '#pop')
931
934
  ],
932
935
  }
@@ -24,7 +24,7 @@ from pygments.lexers import _stan_builtins
24
24
  __all__ = ['JuliaLexer', 'JuliaConsoleLexer', 'MuPADLexer', 'MatlabLexer',
25
25
  'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer', 'NumPyLexer',
26
26
  'RConsoleLexer', 'SLexer', 'JagsLexer', 'BugsLexer', 'StanLexer',
27
- 'IDLLexer', 'RdLexer']
27
+ 'IDLLexer', 'RdLexer', 'IgorLexer']
28
28
 
29
29
 
30
30
  class JuliaLexer(RegexLexer):
@@ -59,7 +59,7 @@ class JuliaLexer(RegexLexer):
59
59
  (r'(begin|while|for|in|return|break|continue|'
60
60
  r'macro|quote|let|if|elseif|else|try|catch|end|'
61
61
  r'bitstype|ccall|do|using|module|import|export|'
62
- r'importall|baremodule)\b', Keyword),
62
+ r'importall|baremodule|immutable)\b', Keyword),
63
63
  (r'(local|global|const)\b', Keyword.Declaration),
64
64
  (r'(Bool|Int|Int8|Int16|Int32|Int64|Uint|Uint8|Uint16|Uint32|Uint64'
65
65
  r'|Float32|Float64|Complex64|Complex128|Any|Nothing|None)\b',
@@ -99,11 +99,17 @@ class JuliaLexer(RegexLexer):
99
99
  (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
100
100
 
101
101
  # numbers
102
+ (r'(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?', Number.Float),
102
103
  (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
104
+ (r'\d+(_\d+)+[eEf][+-]?[0-9]+', Number.Float),
103
105
  (r'\d+[eEf][+-]?[0-9]+', Number.Float),
106
+ (r'0b[01]+(_[01]+)+', Number.Binary),
104
107
  (r'0b[01]+', Number.Binary),
108
+ (r'0o[0-7]+(_[0-7]+)+', Number.Oct),
105
109
  (r'0o[0-7]+', Number.Oct),
110
+ (r'0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+', Number.Hex),
106
111
  (r'0x[a-fA-F0-9]+', Number.Hex),
112
+ (r'\d+(_\d+)+', Number.Integer),
107
113
  (r'\d+', Number.Integer)
108
114
  ],
109
115
 
@@ -977,6 +983,11 @@ class NumPyLexer(PythonLexer):
977
983
  else:
978
984
  yield index, token, value
979
985
 
986
+ def analyse_text(text):
987
+ return (shebang_matches(text, r'pythonw?(2(\.\d)?)?') or
988
+ 'import ' in text[:1000]) \
989
+ and ('import numpy' in text or 'from numpy import' in text)
990
+
980
991
 
981
992
  class RConsoleLexer(Lexer):
982
993
  """
@@ -1107,7 +1118,8 @@ class SLexer(RegexLexer):
1107
1118
  }
1108
1119
 
1109
1120
  def analyse_text(text):
1110
- return '<-' in text
1121
+ if re.search(r'[a-z0-9_\])\s]<-(?!-)', text):
1122
+ return 0.11
1111
1123
 
1112
1124
 
1113
1125
  class BugsLexer(RegexLexer):
@@ -1294,8 +1306,11 @@ class JagsLexer(RegexLexer):
1294
1306
  return 0
1295
1307
 
1296
1308
  class StanLexer(RegexLexer):
1297
- """
1298
- Pygments Lexer for Stan models.
1309
+ """Pygments Lexer for Stan models.
1310
+
1311
+ The Stan modeling language is specified in the *Stan 1.3.0
1312
+ Modeling Language Manual* `pdf
1313
+ <http://code.google.com/p/stan/downloads/detail?name=stan-reference-1.3.0.pdf>`_.
1299
1314
 
1300
1315
  *New in Pygments 1.6.*
1301
1316
  """
@@ -1304,13 +1319,6 @@ class StanLexer(RegexLexer):
1304
1319
  aliases = ['stan']
1305
1320
  filenames = ['*.stan']
1306
1321
 
1307
- _RESERVED = ('for', 'in', 'while', 'repeat', 'until', 'if',
1308
- 'then', 'else', 'true', 'false', 'T',
1309
- 'lower', 'upper', 'print')
1310
-
1311
- _TYPES = ('int', 'real', 'vector', 'simplex', 'ordered', 'row_vector',
1312
- 'matrix', 'corr_matrix', 'cov_matrix', 'positive_ordered')
1313
-
1314
1322
  tokens = {
1315
1323
  'whitespace' : [
1316
1324
  (r"\s+", Text),
@@ -1334,20 +1342,21 @@ class StanLexer(RegexLexer):
1334
1342
  'model', r'generated\s+quantities')),
1335
1343
  bygroups(Keyword.Namespace, Text, Punctuation)),
1336
1344
  # Reserved Words
1337
- (r'(%s)\b' % r'|'.join(_RESERVED), Keyword.Reserved),
1345
+ (r'(%s)\b' % r'|'.join(_stan_builtins.KEYWORDS), Keyword),
1346
+ # Truncation
1347
+ (r'T(?=\s*\[)', Keyword),
1338
1348
  # Data types
1339
- (r'(%s)\b' % r'|'.join(_TYPES), Keyword.Type),
1349
+ (r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type),
1340
1350
  # Punctuation
1341
- (r"[;:,\[\]()<>]", Punctuation),
1351
+ (r"[;:,\[\]()]", Punctuation),
1342
1352
  # Builtin
1343
1353
  (r'(%s)(?=\s*\()'
1344
1354
  % r'|'.join(_stan_builtins.FUNCTIONS
1345
1355
  + _stan_builtins.DISTRIBUTIONS),
1346
1356
  Name.Builtin),
1347
- (r'(%s)(?=\s*\()'
1348
- % r'|'.join(_stan_builtins.CONSTANTS), Keyword.Constant),
1349
1357
  # Special names ending in __, like lp__
1350
1358
  (r'[A-Za-z][A-Za-z0-9_]*__\b', Name.Builtin.Pseudo),
1359
+ (r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved),
1351
1360
  # Regular variable names
1352
1361
  (r'[A-Za-z][A-Za-z0-9_]*\b', Name),
1353
1362
  # Real Literals
@@ -1359,7 +1368,7 @@ class StanLexer(RegexLexer):
1359
1368
  # SLexer makes these tokens Operators.
1360
1369
  (r'<-|~', Operator),
1361
1370
  # Infix and prefix operators (and = )
1362
- (r"\+|-|\.?\*|\.?/|\\|'|=", Operator),
1371
+ (r"\+|-|\.?\*|\.?/|\\|'|==?|!=?|<=?|>=?|\|\||&&", Operator),
1363
1372
  # Block delimiters
1364
1373
  (r'[{}]', Punctuation),
1365
1374
  ]
@@ -1650,3 +1659,260 @@ class RdLexer(RegexLexer):
1650
1659
  (r'.', Text),
1651
1660
  ]
1652
1661
  }
1662
+
1663
+
1664
+ class IgorLexer(RegexLexer):
1665
+ """
1666
+ Pygments Lexer for Igor Pro procedure files (.ipf).
1667
+ See http://www.wavemetrics.com/ and http://www.igorexchange.com/.
1668
+
1669
+ *New in Pygments 1.7.*
1670
+ """
1671
+
1672
+ name = 'Igor'
1673
+ aliases = ['igor', 'igorpro']
1674
+ filenames = ['*.ipf']
1675
+ mimetypes = ['text/ipf']
1676
+
1677
+ flags = re.IGNORECASE
1678
+
1679
+ flowControl = [
1680
+ 'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'strswitch', 'switch',
1681
+ 'case', 'endswitch', 'do', 'while', 'try', 'catch', 'endtry', 'break',
1682
+ 'continue', 'return',
1683
+ ]
1684
+ types = [
1685
+ 'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE',
1686
+ 'STRUCT', 'ThreadSafe', 'function', 'end', 'static', 'macro', 'window',
1687
+ 'graph', 'Structure', 'EndStructure', 'EndMacro', 'FuncFit', 'Proc',
1688
+ 'Picture', 'Menu', 'SubMenu', 'Prompt', 'DoPrompt',
1689
+ ]
1690
+ operations = [
1691
+ 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio',
1692
+ 'AddMovieFrame', 'APMath', 'Append', 'AppendImage',
1693
+ 'AppendLayoutObject', 'AppendMatrixContour', 'AppendText',
1694
+ 'AppendToGraph', 'AppendToLayout', 'AppendToTable', 'AppendXYZContour',
1695
+ 'AutoPositionWindow', 'BackgroundInfo', 'Beep', 'BoundingBall',
1696
+ 'BrowseURL', 'BuildMenu', 'Button', 'cd', 'Chart', 'CheckBox',
1697
+ 'CheckDisplayed', 'ChooseColor', 'Close', 'CloseMovie', 'CloseProc',
1698
+ 'ColorScale', 'ColorTab2Wave', 'Concatenate', 'ControlBar',
1699
+ 'ControlInfo', 'ControlUpdate', 'ConvexHull', 'Convolve', 'CopyFile',
1700
+ 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'Cross',
1701
+ 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor',
1702
+ 'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions',
1703
+ 'DefaultFont', 'DefaultGuiControls', 'DefaultGuiFont', 'DefineGuide',
1704
+ 'DelayUpdate', 'DeleteFile', 'DeleteFolder', 'DeletePoints',
1705
+ 'Differentiate', 'dir', 'Display', 'DisplayHelpTopic',
1706
+ 'DisplayProcedure', 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow',
1707
+ 'DoXOPIdle', 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine',
1708
+ 'DrawOval', 'DrawPICT', 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText',
1709
+ 'DSPDetrend', 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder',
1710
+ 'DWT', 'EdgeStats', 'Edit', 'ErrorBars', 'Execute', 'ExecuteScriptText',
1711
+ 'ExperimentModified', 'Extract', 'FastGaussTransform', 'FastOp',
1712
+ 'FBinRead', 'FBinWrite', 'FFT', 'FIFO2Wave', 'FIFOStatus', 'FilterFIR',
1713
+ 'FilterIIR', 'FindLevel', 'FindLevels', 'FindPeak', 'FindPointsInPoly',
1714
+ 'FindRoots', 'FindSequence', 'FindValue', 'FPClustering', 'fprintf',
1715
+ 'FReadLine', 'FSetPos', 'FStatus', 'FTPDelete', 'FTPDownload',
1716
+ 'FTPUpload', 'FuncFit', 'FuncFitMD', 'GetAxis', 'GetFileFolderInfo',
1717
+ 'GetLastUserMenuInfo', 'GetMarquee', 'GetSelection', 'GetWindow',
1718
+ 'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', 'GroupBox',
1719
+ 'Hanning', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools',
1720
+ 'HilbertTransform', 'Histogram', 'IFFT', 'ImageAnalyzeParticles',
1721
+ 'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection',
1722
+ 'ImageFileInfo', 'ImageFilter', 'ImageFocus', 'ImageGenerateROIMask',
1723
+ 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate',
1724
+ 'ImageLineProfile', 'ImageLoad', 'ImageMorphology', 'ImageRegistration',
1725
+ 'ImageRemoveBackground', 'ImageRestore', 'ImageRotate', 'ImageSave',
1726
+ 'ImageSeedFill', 'ImageSnake', 'ImageStats', 'ImageThreshold',
1727
+ 'ImageTransform', 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort',
1728
+ 'InsertPoints', 'Integrate', 'IntegrateODE', 'Interp3DPath',
1729
+ 'Interpolate3D', 'KillBackground', 'KillControl', 'KillDataFolder',
1730
+ 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', 'KillStrings',
1731
+ 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', 'Layout',
1732
+ 'Legend', 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData',
1733
+ 'LoadPackagePreferences', 'LoadPICT', 'LoadWave', 'Loess',
1734
+ 'LombPeriodogram', 'Make', 'MakeIndex', 'MarkPerfTestTime',
1735
+ 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', 'MatrixFilter',
1736
+ 'MatrixGaussJ', 'MatrixInverse', 'MatrixLinearSolve',
1737
+ 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD',
1738
+ 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve',
1739
+ 'MatrixSVBkSub', 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText',
1740
+ 'Modify', 'ModifyContour', 'ModifyControl', 'ModifyControlList',
1741
+ 'ModifyFreeAxis', 'ModifyGraph', 'ModifyImage', 'ModifyLayout',
1742
+ 'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', 'MoveDataFolder',
1743
+ 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', 'MoveVariable',
1744
+ 'MoveWave', 'MoveWindow', 'NeuralNetworkRun', 'NeuralNetworkTrain',
1745
+ 'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewImage',
1746
+ 'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath',
1747
+ 'NewWaterfall', 'Note', 'Notebook', 'NotebookAction', 'Open',
1748
+ 'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo',
1749
+ 'PauseForUser', 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction',
1750
+ 'PlaySnd', 'PlaySound', 'PopupContextualMenu', 'PopupMenu',
1751
+ 'Preferences', 'PrimeFactors', 'Print', 'printf', 'PrintGraphs',
1752
+ 'PrintLayout', 'PrintNotebook', 'PrintSettings', 'PrintTable',
1753
+ 'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit',
1754
+ 'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour',
1755
+ 'RemoveFromGraph', 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage',
1756
+ 'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder',
1757
+ 'RenamePath', 'RenamePICT', 'RenameWindow', 'ReorderImages',
1758
+ 'ReorderTraces', 'ReplaceText', 'ReplaceWave', 'Resample',
1759
+ 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', 'SaveData',
1760
+ 'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook',
1761
+ 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy',
1762
+ 'SetActiveSubwindow', 'SetAxis', 'SetBackground', 'SetDashPattern',
1763
+ 'SetDataFolder', 'SetDimLabel', 'SetDrawEnv', 'SetDrawLayer',
1764
+ 'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', 'SetIgorMenuMode',
1765
+ 'SetIgorOption', 'SetMarquee', 'SetProcessSleep', 'SetRandomSeed',
1766
+ 'SetScale', 'SetVariable', 'SetWaveLock', 'SetWindow', 'ShowIgorMenus',
1767
+ 'ShowInfo', 'ShowTools', 'Silent', 'Sleep', 'Slider', 'Smooth',
1768
+ 'SmoothCustom', 'Sort', 'SoundInRecord', 'SoundInSet',
1769
+ 'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart',
1770
+ 'SphericalInterpolate', 'SphericalTriangulate', 'SplitString',
1771
+ 'sprintf', 'sscanf', 'Stack', 'StackWindows',
1772
+ 'StatsAngularDistanceTest', 'StatsANOVA1Test', 'StatsANOVA2NRTest',
1773
+ 'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest',
1774
+ 'StatsCircularCorrelationTest', 'StatsCircularMeans',
1775
+ 'StatsCircularMoments', 'StatsCircularTwoSampleTest',
1776
+ 'StatsCochranTest', 'StatsContingencyTable', 'StatsDIPTest',
1777
+ 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest',
1778
+ 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKendallTauTest',
1779
+ 'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest',
1780
+ 'StatsLinearRegression', 'StatsMultiCorrelationTest',
1781
+ 'StatsNPMCTest', 'StatsNPNominalSRTest', 'StatsQuantiles',
1782
+ 'StatsRankCorrelationTest', 'StatsResample', 'StatsSample',
1783
+ 'StatsScheffeTest', 'StatsSignTest', 'StatsSRTest', 'StatsTTest',
1784
+ 'StatsTukeyTest', 'StatsVariancesTest', 'StatsWatsonUSquaredTest',
1785
+ 'StatsWatsonWilliamsTest', 'StatsWheelerWatsonTest',
1786
+ 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', 'String',
1787
+ 'StructGet', 'StructPut', 'TabControl', 'Tag', 'TextBox', 'Tile',
1788
+ 'TileWindows', 'TitleBox', 'ToCommandLine', 'ToolsGrid',
1789
+ 'Triangulate3d', 'Unwrap', 'ValDisplay', 'Variable', 'WaveMeanStdv',
1790
+ 'WaveStats', 'WaveTransform', 'wfprintf', 'WignerTransform',
1791
+ 'WindowFunction',
1792
+ ]
1793
+ functions = [
1794
+ 'abs', 'acos', 'acosh', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', 'alog',
1795
+ 'area', 'areaXY', 'asin', 'asinh', 'atan', 'atan2', 'atanh',
1796
+ 'AxisValFromPixel', 'Besseli', 'Besselj', 'Besselk', 'Bessely', 'bessi',
1797
+ 'bessj', 'bessk', 'bessy', 'beta', 'betai', 'BinarySearch',
1798
+ 'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise', 'cabs',
1799
+ 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', 'chebyshev',
1800
+ 'chebyshevU', 'CheckName', 'cmplx', 'cmpstr', 'conj', 'ContourZ', 'cos',
1801
+ 'cosh', 'cot', 'CountObjects', 'CountObjectsDFR', 'cpowi',
1802
+ 'CreationDate', 'csc', 'DataFolderExists', 'DataFolderRefsEqual',
1803
+ 'DataFolderRefStatus', 'date2secs', 'datetime', 'DateToJulian',
1804
+ 'Dawson', 'DDEExecute', 'DDEInitiate', 'DDEPokeString', 'DDEPokeWave',
1805
+ 'DDERequestWave', 'DDEStatus', 'DDETerminate', 'deltax', 'digamma',
1806
+ 'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', 'erf',
1807
+ 'erfc', 'exists', 'exp', 'expInt', 'expNoise', 'factorial', 'fakedata',
1808
+ 'faverage', 'faverageXY', 'FindDimLabel', 'FindListItem', 'floor',
1809
+ 'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin',
1810
+ 'gamma', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss',
1811
+ 'Gauss1D', 'Gauss2D', 'gcd', 'GetDefaultFontSize',
1812
+ 'GetDefaultFontStyle', 'GetKeyState', 'GetRTError', 'gnoise',
1813
+ 'GrepString', 'hcsr', 'hermite', 'hermiteGauss', 'HyperG0F1',
1814
+ 'HyperG1F1', 'HyperG2F1', 'HyperGNoise', 'HyperGPFQ', 'IgorVersion',
1815
+ 'ilim', 'imag', 'Inf', 'Integrate1D', 'interp', 'Interp2D', 'Interp3D',
1816
+ 'inverseERF', 'inverseERFC', 'ItemsInList', 'jlim', 'Laguerre',
1817
+ 'LaguerreA', 'LaguerreGauss', 'leftx', 'LegendreA', 'limit', 'ln',
1818
+ 'log', 'logNormalNoise', 'lorentzianNoise', 'magsqr', 'MandelbrotPoint',
1819
+ 'MarcumQ', 'MatrixDet', 'MatrixDot', 'MatrixRank', 'MatrixTrace', 'max',
1820
+ 'mean', 'min', 'mod', 'ModDate', 'NaN', 'norm', 'NumberByKey',
1821
+ 'numpnts', 'numtype', 'NumVarOrDefault', 'NVAR_Exists', 'p2rect',
1822
+ 'ParamIsDefault', 'pcsr', 'Pi', 'PixelFromAxisVal', 'pnt2x',
1823
+ 'poissonNoise', 'poly', 'poly2D', 'PolygonArea', 'qcsr', 'r2polar',
1824
+ 'real', 'rightx', 'round', 'sawtooth', 'ScreenResolution', 'sec',
1825
+ 'SelectNumber', 'sign', 'sin', 'sinc', 'sinh', 'SphericalBessJ',
1826
+ 'SphericalBessJD', 'SphericalBessY', 'SphericalBessYD',
1827
+ 'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF',
1828
+ 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF',
1829
+ 'StatsCauchyCDF', 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF',
1830
+ 'StatsCMSSDCDF', 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF',
1831
+ 'StatsErlangCDF', 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF',
1832
+ 'StatsEValuePDF', 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF',
1833
+ 'StatsFPDF', 'StatsFriedmanCDF', 'StatsGammaCDF', 'StatsGammaPDF',
1834
+ 'StatsGeometricCDF', 'StatsGeometricPDF', 'StatsHyperGCDF',
1835
+ 'StatsHyperGPDF', 'StatsInvBetaCDF', 'StatsInvBinomialCDF',
1836
+ 'StatsInvCauchyCDF', 'StatsInvChiCDF', 'StatsInvCMSSDCDF',
1837
+ 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF',
1838
+ 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF',
1839
+ 'StatsInvGeometricCDF', 'StatsInvKuiperCDF', 'StatsInvLogisticCDF',
1840
+ 'StatsInvLogNormalCDF', 'StatsInvMaxwellCDF', 'StatsInvMooreCDF',
1841
+ 'StatsInvNBinomialCDF', 'StatsInvNCChiCDF', 'StatsInvNCFCDF',
1842
+ 'StatsInvNormalCDF', 'StatsInvParetoCDF', 'StatsInvPoissonCDF',
1843
+ 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF',
1844
+ 'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF',
1845
+ 'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF',
1846
+ 'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF',
1847
+ 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF',
1848
+ 'StatsLogNormalCDF', 'StatsLogNormalPDF', 'StatsMaxwellCDF',
1849
+ 'StatsMaxwellPDF', 'StatsMedian', 'StatsMooreCDF', 'StatsNBinomialCDF',
1850
+ 'StatsNBinomialPDF', 'StatsNCChiCDF', 'StatsNCChiPDF', 'StatsNCFCDF',
1851
+ 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', 'StatsNormalCDF',
1852
+ 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', 'StatsPermute',
1853
+ 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF',
1854
+ 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF',
1855
+ 'StatsRayleighCDF', 'StatsRayleighPDF', 'StatsRectangularCDF',
1856
+ 'StatsRectangularPDF', 'StatsRunsCDF', 'StatsSpearmanRhoCDF',
1857
+ 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF',
1858
+ 'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean',
1859
+ 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise',
1860
+ 'StatsVonMisesPDF', 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF',
1861
+ 'StatsWeibullPDF', 'StopMSTimer', 'str2num', 'stringCRC', 'stringmatch',
1862
+ 'strlen', 'strsearch', 'StudentA', 'StudentT', 'sum', 'SVAR_Exists',
1863
+ 'TagVal', 'tan', 'tanh', 'ThreadGroupCreate', 'ThreadGroupRelease',
1864
+ 'ThreadGroupWait', 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks',
1865
+ 'trunc', 'Variance', 'vcsr', 'WaveCRC', 'WaveDims', 'WaveExists',
1866
+ 'WaveMax', 'WaveMin', 'WaveRefsEqual', 'WaveType', 'WhichListItem',
1867
+ 'WinType', 'WNoise', 'x', 'x2pnt', 'xcsr', 'y', 'z', 'zcsr', 'ZernikeR',
1868
+ ]
1869
+ functions += [
1870
+ 'AddListItem', 'AnnotationInfo', 'AnnotationList', 'AxisInfo',
1871
+ 'AxisList', 'CaptureHistory', 'ChildWindowList', 'CleanupName',
1872
+ 'ContourInfo', 'ContourNameList', 'ControlNameList', 'CsrInfo',
1873
+ 'CsrWave', 'CsrXWave', 'CTabList', 'DataFolderDir', 'date',
1874
+ 'DDERequestString', 'FontList', 'FuncRefInfo', 'FunctionInfo',
1875
+ 'FunctionList', 'FunctionPath', 'GetDataFolder', 'GetDefaultFont',
1876
+ 'GetDimLabel', 'GetErrMessage', 'GetFormula',
1877
+ 'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR',
1878
+ 'GetRTErrMessage', 'GetRTStackInfo', 'GetScrapText', 'GetUserData',
1879
+ 'GetWavesDataFolder', 'GrepList', 'GuideInfo', 'GuideNameList', 'Hash',
1880
+ 'IgorInfo', 'ImageInfo', 'ImageNameList', 'IndexedDir', 'IndexedFile',
1881
+ 'JulianToDate', 'LayoutInfo', 'ListMatch', 'LowerStr', 'MacroList',
1882
+ 'NameOfWave', 'note', 'num2char', 'num2istr', 'num2str',
1883
+ 'OperationList', 'PadString', 'ParseFilePath', 'PathList', 'PICTInfo',
1884
+ 'PICTList', 'PossiblyQuoteName', 'ProcedureText', 'RemoveByKey',
1885
+ 'RemoveEnding', 'RemoveFromList', 'RemoveListItem',
1886
+ 'ReplaceNumberByKey', 'ReplaceString', 'ReplaceStringByKey',
1887
+ 'Secs2Date', 'Secs2Time', 'SelectString', 'SortList',
1888
+ 'SpecialCharacterInfo', 'SpecialCharacterList', 'SpecialDirPath',
1889
+ 'StringByKey', 'StringFromList', 'StringList', 'StrVarOrDefault',
1890
+ 'TableInfo', 'TextFile', 'ThreadGroupGetDF', 'time', 'TraceFromPixel',
1891
+ 'TraceInfo', 'TraceNameList', 'UniqueName', 'UnPadString', 'UpperStr',
1892
+ 'VariableList', 'WaveInfo', 'WaveList', 'WaveName', 'WaveUnits',
1893
+ 'WinList', 'WinName', 'WinRecreation', 'XWaveName',
1894
+ 'ContourNameToWaveRef', 'CsrWaveRef', 'CsrXWaveRef',
1895
+ 'ImageNameToWaveRef', 'NewFreeWave', 'TagWaveRef', 'TraceNameToWaveRef',
1896
+ 'WaveRefIndexed', 'XWaveRefFromTrace', 'GetDataFolderDFR',
1897
+ 'GetWavesDataFolderDFR', 'NewFreeDataFolder', 'ThreadGroupGetDFR',
1898
+ ]
1899
+
1900
+ tokens = {
1901
+ 'root': [
1902
+ (r'//.*$', Comment.Single),
1903
+ (r'"([^"\\]|\\.)*"', String),
1904
+ # Flow Control.
1905
+ (r'\b(%s)\b' % '|'.join(flowControl), Keyword),
1906
+ # Types.
1907
+ (r'\b(%s)\b' % '|'.join(types), Keyword.Type),
1908
+ # Built-in operations.
1909
+ (r'\b(%s)\b' % '|'.join(operations), Name.Class),
1910
+ # Built-in functions.
1911
+ (r'\b(%s)\b' % '|'.join(functions), Name.Function),
1912
+ # Compiler directives.
1913
+ (r'^#(include|pragma|define|ifdef|ifndef|endif)',
1914
+ Name.Decorator),
1915
+ (r'[^a-zA-Z"/]+', Text),
1916
+ (r'.', Text),
1917
+ ],
1918
+ }