gitlab-pygments.rb 0.3.2 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +71 -0
  4. data/Gemfile +1 -1
  5. data/LICENSE +17 -0
  6. data/README.md +28 -1
  7. data/Rakefile +2 -5
  8. data/lexers +0 -0
  9. data/lib/pygments/mentos.py +19 -12
  10. data/lib/pygments/popen.rb +21 -4
  11. data/lib/pygments/version.rb +1 -1
  12. data/pygments.rb.gemspec +2 -0
  13. data/test/test_pygments.rb +13 -2
  14. data/vendor/custom_lexers/github.py +206 -3
  15. data/vendor/pygments-main/AUTHORS +41 -3
  16. data/vendor/pygments-main/CHANGES +132 -5
  17. data/vendor/pygments-main/LICENSE +1 -1
  18. data/vendor/pygments-main/Makefile +1 -1
  19. data/vendor/pygments-main/REVISION +1 -1
  20. data/vendor/pygments-main/docs/generate.py +1 -1
  21. data/vendor/pygments-main/docs/src/api.txt +1 -1
  22. data/vendor/pygments-main/docs/src/index.txt +1 -1
  23. data/vendor/pygments-main/docs/src/integrate.txt +5 -0
  24. data/vendor/pygments-main/docs/src/java.txt +70 -0
  25. data/vendor/pygments-main/docs/src/lexerdevelopment.txt +52 -0
  26. data/vendor/pygments-main/external/autopygmentize +64 -0
  27. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +144 -0
  28. data/vendor/pygments-main/external/markdown-processor.py +2 -2
  29. data/vendor/pygments-main/external/moin-parser.py +1 -1
  30. data/vendor/pygments-main/external/rst-directive-old.py +1 -1
  31. data/vendor/pygments-main/external/rst-directive.py +1 -1
  32. data/vendor/pygments-main/pygmentize +1 -1
  33. data/vendor/pygments-main/pygments/__init__.py +2 -2
  34. data/vendor/pygments-main/pygments/cmdline.py +14 -6
  35. data/vendor/pygments-main/pygments/console.py +1 -1
  36. data/vendor/pygments-main/pygments/filter.py +1 -1
  37. data/vendor/pygments-main/pygments/filters/__init__.py +3 -4
  38. data/vendor/pygments-main/pygments/formatter.py +4 -1
  39. data/vendor/pygments-main/pygments/formatters/__init__.py +1 -1
  40. data/vendor/pygments-main/pygments/formatters/_mapping.py +3 -3
  41. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  42. data/vendor/pygments-main/pygments/formatters/html.py +73 -2
  43. data/vendor/pygments-main/pygments/formatters/img.py +2 -2
  44. data/vendor/pygments-main/pygments/formatters/latex.py +9 -9
  45. data/vendor/pygments-main/pygments/formatters/other.py +1 -3
  46. data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
  47. data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
  48. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
  49. data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
  50. data/vendor/pygments-main/pygments/lexer.py +78 -10
  51. data/vendor/pygments-main/pygments/lexers/__init__.py +13 -2
  52. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +1 -1
  54. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +5172 -0
  55. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +1 -1
  56. data/vendor/pygments-main/pygments/lexers/_mapping.py +92 -36
  57. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +562 -0
  58. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +2 -2
  59. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +4 -3
  60. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +557 -0
  61. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +11 -0
  62. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +1072 -0
  63. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +360 -0
  64. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +13 -3
  65. data/vendor/pygments-main/pygments/lexers/agile.py +525 -38
  66. data/vendor/pygments-main/pygments/lexers/asm.py +45 -7
  67. data/vendor/pygments-main/pygments/lexers/compiled.py +1257 -425
  68. data/vendor/pygments-main/pygments/lexers/dalvik.py +104 -0
  69. data/vendor/pygments-main/pygments/lexers/dotnet.py +97 -62
  70. data/vendor/pygments-main/pygments/lexers/foxpro.py +428 -0
  71. data/vendor/pygments-main/pygments/lexers/functional.py +931 -32
  72. data/vendor/pygments-main/pygments/lexers/github.py +206 -3
  73. data/vendor/pygments-main/pygments/lexers/hdl.py +3 -3
  74. data/vendor/pygments-main/pygments/lexers/jvm.py +309 -44
  75. data/vendor/pygments-main/pygments/lexers/math.py +876 -30
  76. data/vendor/pygments-main/pygments/lexers/other.py +956 -517
  77. data/vendor/pygments-main/pygments/lexers/parsers.py +85 -2
  78. data/vendor/pygments-main/pygments/lexers/shell.py +81 -18
  79. data/vendor/pygments-main/pygments/lexers/special.py +1 -1
  80. data/vendor/pygments-main/pygments/lexers/sql.py +2 -2
  81. data/vendor/pygments-main/pygments/lexers/templates.py +119 -8
  82. data/vendor/pygments-main/pygments/lexers/text.py +155 -15
  83. data/vendor/pygments-main/pygments/lexers/web.py +1578 -397
  84. data/vendor/pygments-main/pygments/modeline.py +40 -0
  85. data/vendor/pygments-main/pygments/plugin.py +1 -1
  86. data/vendor/pygments-main/pygments/scanner.py +1 -1
  87. data/vendor/pygments-main/pygments/style.py +1 -1
  88. data/vendor/pygments-main/pygments/styles/__init__.py +1 -1
  89. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  90. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  91. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  92. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  93. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  94. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  95. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  96. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  97. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  98. data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
  99. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  100. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  101. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  102. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  103. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  104. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  105. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  106. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  107. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  108. data/vendor/pygments-main/pygments/token.py +1 -1
  109. data/vendor/pygments-main/pygments/unistring.py +36 -26
  110. data/vendor/pygments-main/pygments/util.py +46 -1
  111. data/vendor/pygments-main/scripts/check_sources.py +2 -2
  112. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +2 -0
  113. data/vendor/pygments-main/scripts/find_codetags.py +1 -1
  114. data/vendor/pygments-main/scripts/find_error.py +5 -6
  115. data/vendor/pygments-main/setup.cfg +1 -0
  116. data/vendor/pygments-main/setup.py +6 -4
  117. data/vendor/pygments-main/tests/examplefiles/BOM.js +1 -0
  118. data/vendor/pygments-main/tests/examplefiles/Config.in.cache +1973 -0
  119. data/vendor/pygments-main/tests/examplefiles/Deflate.fs +578 -0
  120. data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +66 -0
  121. data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +104 -0
  122. data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +671 -0
  123. data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +23 -0
  124. data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +25 -0
  125. data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +308 -0
  126. data/vendor/pygments-main/tests/examplefiles/ca65_example +284 -0
  127. data/vendor/pygments-main/tests/examplefiles/cbmbas_example +9 -0
  128. data/vendor/pygments-main/tests/examplefiles/classes.dylan +89 -4
  129. data/vendor/pygments-main/tests/examplefiles/example.Rd +78 -0
  130. data/vendor/pygments-main/tests/examplefiles/example.bug +54 -0
  131. data/vendor/pygments-main/tests/examplefiles/example.ceylon +52 -0
  132. data/vendor/pygments-main/tests/examplefiles/example.clay +33 -0
  133. data/vendor/pygments-main/tests/examplefiles/example.cob +3556 -0
  134. data/vendor/pygments-main/tests/examplefiles/example.hx +142 -0
  135. data/vendor/pygments-main/tests/examplefiles/example.jag +48 -0
  136. data/vendor/pygments-main/tests/examplefiles/example.lagda +19 -0
  137. data/vendor/pygments-main/tests/examplefiles/example.monkey +152 -0
  138. data/vendor/pygments-main/tests/examplefiles/example.msc +43 -0
  139. data/vendor/pygments-main/tests/examplefiles/example.prg +161 -0
  140. data/vendor/pygments-main/tests/examplefiles/example.reg +19 -0
  141. data/vendor/pygments-main/tests/examplefiles/example.rexx +50 -0
  142. data/vendor/pygments-main/tests/examplefiles/example.rkt +95 -0
  143. data/vendor/pygments-main/tests/examplefiles/example.rpf +4 -0
  144. data/vendor/pygments-main/tests/examplefiles/example.shell-session +45 -0
  145. data/vendor/pygments-main/tests/examplefiles/example.stan +108 -0
  146. data/vendor/pygments-main/tests/examplefiles/example.ts +28 -0
  147. data/vendor/pygments-main/tests/examplefiles/example.xtend +34 -0
  148. data/vendor/pygments-main/tests/examplefiles/example2.msc +79 -0
  149. data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +133 -0
  150. data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +22 -0
  151. data/vendor/pygments-main/tests/examplefiles/hello.smali +40 -0
  152. data/vendor/pygments-main/tests/examplefiles/hello.sp +9 -0
  153. data/vendor/pygments-main/tests/examplefiles/http_request_example +2 -1
  154. data/vendor/pygments-main/tests/examplefiles/http_response_example +4 -2
  155. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +71 -0
  156. data/vendor/pygments-main/tests/examplefiles/json.lasso +301 -0
  157. data/vendor/pygments-main/tests/examplefiles/json.lasso9 +213 -0
  158. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +41 -0
  159. data/vendor/pygments-main/tests/examplefiles/logos_example.xm +28 -0
  160. data/vendor/pygments-main/tests/examplefiles/matlab_sample +5 -2
  161. data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +455 -0
  162. data/vendor/pygments-main/tests/examplefiles/mg_sample.pro +73 -0
  163. data/vendor/pygments-main/tests/examplefiles/minehunt.qml +112 -0
  164. data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +95 -0
  165. data/vendor/pygments-main/tests/examplefiles/objc_example.m +7 -0
  166. data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +163 -0
  167. data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +4 -0
  168. data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +4 -0
  169. data/vendor/pygments-main/tests/examplefiles/robotframework.txt +39 -0
  170. data/vendor/pygments-main/tests/examplefiles/rust_example.rs +233 -0
  171. data/vendor/pygments-main/tests/examplefiles/session.dylan-console +9 -0
  172. data/vendor/pygments-main/tests/examplefiles/swig_java.swg +1329 -0
  173. data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +225 -0
  174. data/vendor/pygments-main/tests/examplefiles/test.R +149 -115
  175. data/vendor/pygments-main/tests/examplefiles/test.agda +102 -0
  176. data/vendor/pygments-main/tests/examplefiles/test.bb +95 -0
  177. data/vendor/pygments-main/tests/examplefiles/test.cu +36 -0
  178. data/vendor/pygments-main/tests/examplefiles/test.ebnf +31 -0
  179. data/vendor/pygments-main/tests/examplefiles/test.opa +10 -0
  180. data/vendor/pygments-main/tests/examplefiles/test.p6 +252 -0
  181. data/vendor/pygments-main/tests/examplefiles/test2.pypylog +120 -0
  182. data/vendor/pygments-main/tests/examplefiles/type.lisp +16 -0
  183. data/vendor/pygments-main/tests/examplefiles/unix-io.lid +37 -0
  184. data/vendor/pygments-main/tests/old_run.py +1 -1
  185. data/vendor/pygments-main/tests/run.py +3 -2
  186. data/vendor/pygments-main/tests/support/tags +36 -0
  187. data/vendor/pygments-main/tests/test_basic_api.py +4 -3
  188. data/vendor/pygments-main/tests/test_clexer.py +1 -1
  189. data/vendor/pygments-main/tests/test_cmdline.py +1 -1
  190. data/vendor/pygments-main/tests/test_examplefiles.py +3 -1
  191. data/vendor/pygments-main/tests/test_html_formatter.py +17 -1
  192. data/vendor/pygments-main/tests/test_latex_formatter.py +1 -1
  193. data/vendor/pygments-main/tests/test_lexers_other.py +68 -0
  194. data/vendor/pygments-main/tests/test_perllexer.py +1 -1
  195. data/vendor/pygments-main/tests/test_regexlexer.py +1 -1
  196. data/vendor/pygments-main/tests/test_token.py +1 -1
  197. data/vendor/pygments-main/tests/test_using_api.py +1 -1
  198. data/vendor/pygments-main/tests/test_util.py +22 -3
  199. metadata +84 -16
@@ -5,12 +5,13 @@
5
5
 
6
6
  Lexers for math languages.
7
7
 
8
- :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
12
12
  import re
13
13
 
14
+ from pygments.util import shebang_matches
14
15
  from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
15
16
  combined, do_insertions
16
17
  from pygments.token import Comment, String, Punctuation, Keyword, Name, \
@@ -18,13 +19,20 @@ from pygments.token import Comment, String, Punctuation, Keyword, Name, \
18
19
 
19
20
  from pygments.lexers.agile import PythonLexer
20
21
  from pygments.lexers import _scilab_builtins
22
+ from pygments.lexers import _stan_builtins
21
23
 
22
24
  __all__ = ['JuliaLexer', 'JuliaConsoleLexer', 'MuPADLexer', 'MatlabLexer',
23
25
  'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer', 'NumPyLexer',
24
- 'RConsoleLexer', 'SLexer']
26
+ 'RConsoleLexer', 'SLexer', 'JagsLexer', 'BugsLexer', 'StanLexer',
27
+ 'IDLLexer', 'RdLexer', 'IgorLexer']
25
28
 
26
29
 
27
30
  class JuliaLexer(RegexLexer):
31
+ """
32
+ For `Julia <http://julialang.org/>`_ source code.
33
+
34
+ *New in Pygments 1.6.*
35
+ """
28
36
  name = 'Julia'
29
37
  aliases = ['julia','jl']
30
38
  filenames = ['*.jl']
@@ -50,9 +58,9 @@ class JuliaLexer(RegexLexer):
50
58
  # keywords
51
59
  (r'(begin|while|for|in|return|break|continue|'
52
60
  r'macro|quote|let|if|elseif|else|try|catch|end|'
53
- r'bitstype|ccall|do)\b', Keyword),
61
+ r'bitstype|ccall|do|using|module|import|export|'
62
+ r'importall|baremodule|immutable)\b', Keyword),
54
63
  (r'(local|global|const)\b', Keyword.Declaration),
55
- (r'(module|import|export)\b', Keyword.Reserved),
56
64
  (r'(Bool|Int|Int8|Int16|Int32|Int64|Uint|Uint8|Uint16|Uint32|Uint64'
57
65
  r'|Float32|Float64|Complex64|Complex128|Any|Nothing|None)\b',
58
66
  Keyword.Type),
@@ -76,10 +84,11 @@ class JuliaLexer(RegexLexer):
76
84
  (r'`(?s).*?`', String.Backtick),
77
85
 
78
86
  # chars
79
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char),
87
+ (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|"
88
+ r"\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char),
80
89
 
81
90
  # try to match trailing transpose
82
- (r'(?<=[.\w\)\]])\'', Operator),
91
+ (r'(?<=[.\w\)\]])\'+', Operator),
83
92
 
84
93
  # strings
85
94
  (r'(?:[IL])"', String, 'string'),
@@ -90,10 +99,17 @@ class JuliaLexer(RegexLexer):
90
99
  (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
91
100
 
92
101
  # numbers
93
- (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
94
- (r'\d+[eE][+-]?[0-9]+', Number.Float),
95
- (r'0[0-7]+', Number.Oct),
96
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
102
+ (r'(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?', Number.Float),
103
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
104
+ (r'\d+(_\d+)+[eEf][+-]?[0-9]+', Number.Float),
105
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
106
+ (r'0b[01]+(_[01]+)+', Number.Binary),
107
+ (r'0b[01]+', Number.Binary),
108
+ (r'0o[0-7]+(_[0-7]+)+', Number.Oct),
109
+ (r'0o[0-7]+', Number.Oct),
110
+ (r'0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+', Number.Hex),
111
+ (r'0x[a-fA-F0-9]+', Number.Hex),
112
+ (r'\d+(_\d+)+', Number.Integer),
97
113
  (r'\d+', Number.Integer)
98
114
  ],
99
115
 
@@ -134,6 +150,8 @@ line_re = re.compile('.*?\n')
134
150
  class JuliaConsoleLexer(Lexer):
135
151
  """
136
152
  For Julia console sessions. Modeled after MatlabSessionLexer.
153
+
154
+ *New in Pygments 1.6.*
137
155
  """
138
156
  name = 'Julia console'
139
157
  aliases = ['jlcon']
@@ -251,7 +269,6 @@ class MuPADLexer(RegexLexer):
251
269
  class MatlabLexer(RegexLexer):
252
270
  """
253
271
  For Matlab source code.
254
- Contributed by Ken Schutte <kschutte@csail.mit.edu>.
255
272
 
256
273
  *New in Pygments 0.10.*
257
274
  """
@@ -306,6 +323,7 @@ class MatlabLexer(RegexLexer):
306
323
  # line starting with '!' is sent as a system command. not sure what
307
324
  # label to use...
308
325
  (r'^!.*', String.Other),
326
+ (r'%\{\s*\n', Comment.Multiline, 'blockcomment'),
309
327
  (r'%.*$', Comment),
310
328
  (r'^\s*function', Keyword, 'deffunc'),
311
329
 
@@ -316,6 +334,9 @@ class MatlabLexer(RegexLexer):
316
334
 
317
335
  ("(" + "|".join(elfun+specfun+elmat) + r')\b', Name.Builtin),
318
336
 
337
+ # line continuation with following comment:
338
+ (r'\.\.\..*$', Comment),
339
+
319
340
  # operators:
320
341
  (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
321
342
  # operators requiring escape for re:
@@ -329,6 +350,10 @@ class MatlabLexer(RegexLexer):
329
350
  # (not great, but handles common cases...)
330
351
  (r'(?<=[\w\)\]])\'', Operator),
331
352
 
353
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
354
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
355
+ (r'\d+', Number.Integer),
356
+
332
357
  (r'(?<![\w\)\]])\'', String, 'string'),
333
358
  ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
334
359
  (r'.', Text),
@@ -336,6 +361,11 @@ class MatlabLexer(RegexLexer):
336
361
  'string': [
337
362
  (r'[^\']*\'', String, '#pop')
338
363
  ],
364
+ 'blockcomment': [
365
+ (r'^\s*%\}', Comment.Multiline, '#pop'),
366
+ (r'^.*\n', Comment.Multiline),
367
+ (r'.', Comment.Multiline),
368
+ ],
339
369
  'deffunc': [
340
370
  (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
341
371
  bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
@@ -770,6 +800,10 @@ class OctaveLexer(RegexLexer):
770
800
 
771
801
  (r'"[^"]*"', String),
772
802
 
803
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
804
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
805
+ (r'\d+', Number.Integer),
806
+
773
807
  # quote can be transpose, instead of string:
774
808
  # (not great, but handles common cases...)
775
809
  (r'(?<=[\w\)\]])\'', Operator),
@@ -791,8 +825,7 @@ class OctaveLexer(RegexLexer):
791
825
 
792
826
  def analyse_text(text):
793
827
  if re.match('^\s*[%#]', text, re.M): #Comment
794
- return 0.9
795
- return 0.1
828
+ return 0.1
796
829
 
797
830
 
798
831
  class ScilabLexer(RegexLexer):
@@ -841,6 +874,10 @@ class ScilabLexer(RegexLexer):
841
874
  (r'(?<=[\w\)\]])\'', Operator),
842
875
  (r'(?<![\w\)\]])\'', String, 'string'),
843
876
 
877
+ (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
878
+ (r'\d+[eEf][+-]?[0-9]+', Number.Float),
879
+ (r'\d+', Number.Integer),
880
+
844
881
  ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
845
882
  (r'.', Text),
846
883
  ],
@@ -946,6 +983,11 @@ class NumPyLexer(PythonLexer):
946
983
  else:
947
984
  yield index, token, value
948
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
+
949
991
 
950
992
  class RConsoleLexer(Lexer):
951
993
  """
@@ -1002,43 +1044,50 @@ class SLexer(RegexLexer):
1002
1044
 
1003
1045
  name = 'S'
1004
1046
  aliases = ['splus', 's', 'r']
1005
- filenames = ['*.S', '*.R']
1006
- mimetypes = ['text/S-plus', 'text/S', 'text/R']
1047
+ filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile']
1048
+ mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r',
1049
+ 'text/x-R', 'text/x-r-history', 'text/x-r-profile']
1007
1050
 
1008
1051
  tokens = {
1009
1052
  'comments': [
1010
1053
  (r'#.*$', Comment.Single),
1011
1054
  ],
1012
1055
  'valid_name': [
1013
- (r'[a-zA-Z][0-9a-zA-Z\._]+', Text),
1014
- (r'`.+`', String.Backtick),
1056
+ (r'[a-zA-Z][0-9a-zA-Z\._]*', Text),
1057
+ # can begin with ., but not if that is followed by a digit
1058
+ (r'\.[a-zA-Z_][0-9a-zA-Z\._]*', Text),
1015
1059
  ],
1016
1060
  'punctuation': [
1017
- (r'\[|\]|\[\[|\]\]|\$|\(|\)|@|:::?|;|,', Punctuation),
1061
+ (r'\[{1,2}|\]{1,2}|\(|\)|;|,', Punctuation),
1018
1062
  ],
1019
1063
  'keywords': [
1020
- (r'for(?=\s*\()|while(?=\s*\()|if(?=\s*\()|(?<=\s)else|'
1021
- r'(?<=\s)break(?=;|$)|return(?=\s*\()|function(?=\s*\()',
1064
+ (r'(if|else|for|while|repeat|in|next|break|return|switch|function)'
1065
+ r'(?![0-9a-zA-Z\._])',
1022
1066
  Keyword.Reserved)
1023
1067
  ],
1024
1068
  'operators': [
1025
- (r'<-|-|==|<=|>=|<|>|&&|&|!=|\|\|?', Operator),
1026
- (r'\*|\+|\^|/|%%|%/%|=', Operator),
1027
- (r'%in%|%*%', Operator)
1069
+ (r'<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?', Operator),
1070
+ (r'\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}', Operator)
1028
1071
  ],
1029
1072
  'builtin_symbols': [
1030
- (r'(NULL|NA|TRUE|FALSE|NaN)\b', Keyword.Constant),
1073
+ (r'(NULL|NA(_(integer|real|complex|character)_)?|'
1074
+ r'Inf|TRUE|FALSE|NaN|\.\.(\.|[0-9]+))'
1075
+ r'(?![0-9a-zA-Z\._])',
1076
+ Keyword.Constant),
1031
1077
  (r'(T|F)\b', Keyword.Variable),
1032
1078
  ],
1033
1079
  'numbers': [
1034
- (r'(?<![0-9a-zA-Z\)\}\]`\"])(?=\s*)[-\+]?[0-9]+'
1035
- r'(\.[0-9]*)?(E[0-9][-\+]?(\.[0-9]*)?)?', Number),
1036
- (r'\.[0-9]*(E[0-9][-\+]?(\.[0-9]*)?)?', Number),
1080
+ # hex number
1081
+ (r'0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?', Number.Hex),
1082
+ # decimal number
1083
+ (r'[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?',
1084
+ Number),
1037
1085
  ],
1038
1086
  'statements': [
1039
1087
  include('comments'),
1040
1088
  # whitespaces
1041
1089
  (r'\s+', Text),
1090
+ (r'`.*?`', String.Backtick),
1042
1091
  (r'\'', String, 'string_squote'),
1043
1092
  (r'\"', String, 'string_dquote'),
1044
1093
  include('builtin_symbols'),
@@ -1061,12 +1110,809 @@ class SLexer(RegexLexer):
1061
1110
  # ('\}', Punctuation, '#pop')
1062
1111
  #],
1063
1112
  'string_squote': [
1064
- (r'[^\']*\'', String, '#pop'),
1113
+ (r'([^\'\\]|\\.)*\'', String, '#pop'),
1065
1114
  ],
1066
1115
  'string_dquote': [
1067
- (r'[^\"]*\"', String, '#pop'),
1116
+ (r'([^"\\]|\\.)*"', String, '#pop'),
1068
1117
  ],
1069
1118
  }
1070
1119
 
1071
1120
  def analyse_text(text):
1072
- return '<-' in text
1121
+ if re.search(r'[a-z0-9_\])\s]<-(?!-)', text):
1122
+ return 0.11
1123
+
1124
+
1125
+ class BugsLexer(RegexLexer):
1126
+ """
1127
+ Pygments Lexer for `OpenBugs <http://www.openbugs.info/w/>`_ and WinBugs
1128
+ models.
1129
+
1130
+ *New in Pygments 1.6.*
1131
+ """
1132
+
1133
+ name = 'BUGS'
1134
+ aliases = ['bugs', 'winbugs', 'openbugs']
1135
+ filenames = ['*.bug']
1136
+
1137
+ _FUNCTIONS = [
1138
+ # Scalar functions
1139
+ 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
1140
+ 'cloglog', 'cos', 'cosh', 'cumulative', 'cut', 'density', 'deviance',
1141
+ 'equals', 'expr', 'gammap', 'ilogit', 'icloglog', 'integral', 'log',
1142
+ 'logfact', 'loggam', 'logit', 'max', 'min', 'phi', 'post.p.value',
1143
+ 'pow', 'prior.p.value', 'probit', 'replicate.post', 'replicate.prior',
1144
+ 'round', 'sin', 'sinh', 'solution', 'sqrt', 'step', 'tan', 'tanh',
1145
+ 'trunc',
1146
+ # Vector functions
1147
+ 'inprod', 'interp.lin', 'inverse', 'logdet', 'mean', 'eigen.vals',
1148
+ 'ode', 'prod', 'p.valueM', 'rank', 'ranked', 'replicate.postM',
1149
+ 'sd', 'sort', 'sum',
1150
+ ## Special
1151
+ 'D', 'I', 'F', 'T', 'C']
1152
+ """ OpenBUGS built-in functions
1153
+
1154
+ From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAII
1155
+
1156
+ This also includes
1157
+
1158
+ - T, C, I : Truncation and censoring.
1159
+ ``T`` and ``C`` are in OpenBUGS. ``I`` in WinBUGS.
1160
+ - D : ODE
1161
+ - F : Functional http://www.openbugs.info/Examples/Functionals.html
1162
+
1163
+ """
1164
+
1165
+ _DISTRIBUTIONS = ['dbern', 'dbin', 'dcat', 'dnegbin', 'dpois',
1166
+ 'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
1167
+ 'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
1168
+ 'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
1169
+ 'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
1170
+ 'dmt', 'dwish']
1171
+ """ OpenBUGS built-in distributions
1172
+
1173
+ Functions from
1174
+ http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI
1175
+ """
1176
+
1177
+
1178
+ tokens = {
1179
+ 'whitespace' : [
1180
+ (r"\s+", Text),
1181
+ ],
1182
+ 'comments' : [
1183
+ # Comments
1184
+ (r'#.*$', Comment.Single),
1185
+ ],
1186
+ 'root': [
1187
+ # Comments
1188
+ include('comments'),
1189
+ include('whitespace'),
1190
+ # Block start
1191
+ (r'(model)(\s+)({)',
1192
+ bygroups(Keyword.Namespace, Text, Punctuation)),
1193
+ # Reserved Words
1194
+ (r'(for|in)(?![0-9a-zA-Z\._])', Keyword.Reserved),
1195
+ # Built-in Functions
1196
+ (r'(%s)(?=\s*\()'
1197
+ % r'|'.join(_FUNCTIONS + _DISTRIBUTIONS),
1198
+ Name.Builtin),
1199
+ # Regular variable names
1200
+ (r'[A-Za-z][A-Za-z0-9_.]*', Name),
1201
+ # Number Literals
1202
+ (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
1203
+ # Punctuation
1204
+ (r'\[|\]|\(|\)|:|,|;', Punctuation),
1205
+ # Assignment operators
1206
+ # SLexer makes these tokens Operators.
1207
+ (r'<-|~', Operator),
1208
+ # Infix and prefix operators
1209
+ (r'\+|-|\*|/', Operator),
1210
+ # Block
1211
+ (r'[{}]', Punctuation),
1212
+ ]
1213
+ }
1214
+
1215
+ def analyse_text(text):
1216
+ if re.search(r"^\s*model\s*{", text, re.M):
1217
+ return 0.7
1218
+ else:
1219
+ return 0.0
1220
+
1221
+ class JagsLexer(RegexLexer):
1222
+ """
1223
+ Pygments Lexer for JAGS.
1224
+
1225
+ *New in Pygments 1.6.*
1226
+ """
1227
+
1228
+ name = 'JAGS'
1229
+ aliases = ['jags']
1230
+ filenames = ['*.jag', '*.bug']
1231
+
1232
+ ## JAGS
1233
+ _FUNCTIONS = [
1234
+ 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
1235
+ 'cos', 'cosh', 'cloglog',
1236
+ 'equals', 'exp', 'icloglog', 'ifelse', 'ilogit', 'log', 'logfact',
1237
+ 'loggam', 'logit', 'phi', 'pow', 'probit', 'round', 'sin', 'sinh',
1238
+ 'sqrt', 'step', 'tan', 'tanh', 'trunc', 'inprod', 'interp.lin',
1239
+ 'logdet', 'max', 'mean', 'min', 'prod', 'sum', 'sd', 'inverse',
1240
+ 'rank', 'sort', 't', 'acos', 'acosh', 'asin', 'asinh', 'atan',
1241
+ # Truncation/Censoring (should I include)
1242
+ 'T', 'I']
1243
+ # Distributions with density, probability and quartile functions
1244
+ _DISTRIBUTIONS = ['[dpq]%s' % x for x in
1245
+ ['bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp',
1246
+ 'df', 'gamma', 'gen.gamma', 'logis', 'lnorm',
1247
+ 'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib']]
1248
+ # Other distributions without density and probability
1249
+ _OTHER_DISTRIBUTIONS = [
1250
+ 'dt', 'dunif', 'dbetabin', 'dbern', 'dbin', 'dcat', 'dhyper',
1251
+ 'ddirch', 'dmnorm', 'dwish', 'dmt', 'dmulti', 'dbinom', 'dchisq',
1252
+ 'dnbinom', 'dweibull', 'ddirich']
1253
+
1254
+ tokens = {
1255
+ 'whitespace' : [
1256
+ (r"\s+", Text),
1257
+ ],
1258
+ 'names' : [
1259
+ # Regular variable names
1260
+ (r'[a-zA-Z][a-zA-Z0-9_.]*\b', Name),
1261
+ ],
1262
+ 'comments' : [
1263
+ # do not use stateful comments
1264
+ (r'(?s)/\*.*?\*/', Comment.Multiline),
1265
+ # Comments
1266
+ (r'#.*$', Comment.Single),
1267
+ ],
1268
+ 'root': [
1269
+ # Comments
1270
+ include('comments'),
1271
+ include('whitespace'),
1272
+ # Block start
1273
+ (r'(model|data)(\s+)({)',
1274
+ bygroups(Keyword.Namespace, Text, Punctuation)),
1275
+ (r'var(?![0-9a-zA-Z\._])', Keyword.Declaration),
1276
+ # Reserved Words
1277
+ (r'(for|in)(?![0-9a-zA-Z\._])', Keyword.Reserved),
1278
+ # Builtins
1279
+ # Need to use lookahead because . is a valid char
1280
+ (r'(%s)(?=\s*\()' % r'|'.join(_FUNCTIONS
1281
+ + _DISTRIBUTIONS
1282
+ + _OTHER_DISTRIBUTIONS),
1283
+ Name.Builtin),
1284
+ # Names
1285
+ include('names'),
1286
+ # Number Literals
1287
+ (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
1288
+ (r'\[|\]|\(|\)|:|,|;', Punctuation),
1289
+ # Assignment operators
1290
+ (r'<-|~', Operator),
1291
+ # # JAGS includes many more than OpenBUGS
1292
+ (r'\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%', Operator),
1293
+ (r'[{}]', Punctuation),
1294
+ ]
1295
+ }
1296
+
1297
+ def analyse_text(text):
1298
+ if re.search(r'^\s*model\s*\{', text, re.M):
1299
+ if re.search(r'^\s*data\s*\{', text, re.M):
1300
+ return 0.9
1301
+ elif re.search(r'^\s*var', text, re.M):
1302
+ return 0.9
1303
+ else:
1304
+ return 0.3
1305
+ else:
1306
+ return 0
1307
+
1308
+ class StanLexer(RegexLexer):
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>`_.
1314
+
1315
+ *New in Pygments 1.6.*
1316
+ """
1317
+
1318
+ name = 'Stan'
1319
+ aliases = ['stan']
1320
+ filenames = ['*.stan']
1321
+
1322
+ tokens = {
1323
+ 'whitespace' : [
1324
+ (r"\s+", Text),
1325
+ ],
1326
+ 'comments' : [
1327
+ (r'(?s)/\*.*?\*/', Comment.Multiline),
1328
+ # Comments
1329
+ (r'(//|#).*$', Comment.Single),
1330
+ ],
1331
+ 'root': [
1332
+ # Stan is more restrictive on strings than this regex
1333
+ (r'"[^"]*"', String),
1334
+ # Comments
1335
+ include('comments'),
1336
+ # block start
1337
+ include('whitespace'),
1338
+ # Block start
1339
+ (r'(%s)(\s*)({)' %
1340
+ r'|'.join(('data', r'transformed\s+?data',
1341
+ 'parameters', r'transformed\s+parameters',
1342
+ 'model', r'generated\s+quantities')),
1343
+ bygroups(Keyword.Namespace, Text, Punctuation)),
1344
+ # Reserved Words
1345
+ (r'(%s)\b' % r'|'.join(_stan_builtins.KEYWORDS), Keyword),
1346
+ # Truncation
1347
+ (r'T(?=\s*\[)', Keyword),
1348
+ # Data types
1349
+ (r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type),
1350
+ # Punctuation
1351
+ (r"[;:,\[\]()]", Punctuation),
1352
+ # Builtin
1353
+ (r'(%s)(?=\s*\()'
1354
+ % r'|'.join(_stan_builtins.FUNCTIONS
1355
+ + _stan_builtins.DISTRIBUTIONS),
1356
+ Name.Builtin),
1357
+ # Special names ending in __, like lp__
1358
+ (r'[A-Za-z][A-Za-z0-9_]*__\b', Name.Builtin.Pseudo),
1359
+ (r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved),
1360
+ # Regular variable names
1361
+ (r'[A-Za-z][A-Za-z0-9_]*\b', Name),
1362
+ # Real Literals
1363
+ (r'-?[0-9]+(\.[0-9]+)?[eE]-?[0-9]+', Number.Float),
1364
+ (r'-?[0-9]*\.[0-9]*', Number.Float),
1365
+ # Integer Literals
1366
+ (r'-?[0-9]+', Number.Integer),
1367
+ # Assignment operators
1368
+ # SLexer makes these tokens Operators.
1369
+ (r'<-|~', Operator),
1370
+ # Infix and prefix operators (and = )
1371
+ (r"\+|-|\.?\*|\.?/|\\|'|==?|!=?|<=?|>=?|\|\||&&", Operator),
1372
+ # Block delimiters
1373
+ (r'[{}]', Punctuation),
1374
+ ]
1375
+ }
1376
+
1377
+ def analyse_text(text):
1378
+ if re.search(r'^\s*parameters\s*\{', text, re.M):
1379
+ return 1.0
1380
+ else:
1381
+ return 0.0
1382
+
1383
+
1384
+ class IDLLexer(RegexLexer):
1385
+ """
1386
+ Pygments Lexer for IDL (Interactive Data Language).
1387
+
1388
+ *New in Pygments 1.6.*
1389
+ """
1390
+ name = 'IDL'
1391
+ aliases = ['idl']
1392
+ filenames = ['*.pro']
1393
+ mimetypes = ['text/idl']
1394
+
1395
+ _RESERVED = ['and', 'begin', 'break', 'case', 'common', 'compile_opt',
1396
+ 'continue', 'do', 'else', 'end', 'endcase', 'elseelse',
1397
+ 'endfor', 'endforeach', 'endif', 'endrep', 'endswitch',
1398
+ 'endwhile', 'eq', 'for', 'foreach', 'forward_function',
1399
+ 'function', 'ge', 'goto', 'gt', 'if', 'inherits', 'le',
1400
+ 'lt', 'mod', 'ne', 'not', 'of', 'on_ioerror', 'or', 'pro',
1401
+ 'repeat', 'switch', 'then', 'until', 'while', 'xor']
1402
+ """Reserved words from: http://www.exelisvis.com/docs/reswords.html"""
1403
+
1404
+ _BUILTIN_LIB = ['abs', 'acos', 'adapt_hist_equal', 'alog', 'alog10',
1405
+ 'amoeba', 'annotate', 'app_user_dir', 'app_user_dir_query',
1406
+ 'arg_present', 'array_equal', 'array_indices', 'arrow',
1407
+ 'ascii_template', 'asin', 'assoc', 'atan', 'axis',
1408
+ 'a_correlate', 'bandpass_filter', 'bandreject_filter',
1409
+ 'barplot', 'bar_plot', 'beseli', 'beselj', 'beselk',
1410
+ 'besely', 'beta', 'bilinear', 'binary_template', 'bindgen',
1411
+ 'binomial', 'bin_date', 'bit_ffs', 'bit_population',
1412
+ 'blas_axpy', 'blk_con', 'box_cursor', 'breakpoint',
1413
+ 'broyden', 'butterworth', 'bytarr', 'byte', 'byteorder',
1414
+ 'bytscl', 'caldat', 'calendar', 'call_external',
1415
+ 'call_function', 'call_method', 'call_procedure', 'canny',
1416
+ 'catch', 'cd', 'cdf_[0-9a-za-z_]*', 'ceil', 'chebyshev',
1417
+ 'check_math',
1418
+ 'chisqr_cvf', 'chisqr_pdf', 'choldc', 'cholsol', 'cindgen',
1419
+ 'cir_3pnt', 'close', 'cluster', 'cluster_tree', 'clust_wts',
1420
+ 'cmyk_convert', 'colorbar', 'colorize_sample',
1421
+ 'colormap_applicable', 'colormap_gradient',
1422
+ 'colormap_rotation', 'colortable', 'color_convert',
1423
+ 'color_exchange', 'color_quan', 'color_range_map', 'comfit',
1424
+ 'command_line_args', 'complex', 'complexarr', 'complexround',
1425
+ 'compute_mesh_normals', 'cond', 'congrid', 'conj',
1426
+ 'constrained_min', 'contour', 'convert_coord', 'convol',
1427
+ 'convol_fft', 'coord2to3', 'copy_lun', 'correlate', 'cos',
1428
+ 'cosh', 'cpu', 'cramer', 'create_cursor', 'create_struct',
1429
+ 'create_view', 'crossp', 'crvlength', 'cti_test',
1430
+ 'ct_luminance', 'cursor', 'curvefit', 'cvttobm', 'cv_coord',
1431
+ 'cw_animate', 'cw_animate_getp', 'cw_animate_load',
1432
+ 'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index',
1433
+ 'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel',
1434
+ 'cw_form', 'cw_fslider', 'cw_light_editor',
1435
+ 'cw_light_editor_get', 'cw_light_editor_set', 'cw_orient',
1436
+ 'cw_palette_editor', 'cw_palette_editor_get',
1437
+ 'cw_palette_editor_set', 'cw_pdmenu', 'cw_rgbslider',
1438
+ 'cw_tmpl', 'cw_zoom', 'c_correlate', 'dblarr', 'db_exists',
1439
+ 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key',
1440
+ 'define_msgblk', 'define_msgblk_from_file', 'defroi',
1441
+ 'defsysv', 'delvar', 'dendrogram', 'dendro_plot', 'deriv',
1442
+ 'derivsig', 'determ', 'device', 'dfpmin', 'diag_matrix',
1443
+ 'dialog_dbconnect', 'dialog_message', 'dialog_pickfile',
1444
+ 'dialog_printersetup', 'dialog_printjob',
1445
+ 'dialog_read_image', 'dialog_write_image', 'digital_filter',
1446
+ 'dilate', 'dindgen', 'dissolve', 'dist', 'distance_measure',
1447
+ 'dlm_load', 'dlm_register', 'doc_library', 'double',
1448
+ 'draw_roi', 'edge_dog', 'efont', 'eigenql', 'eigenvec',
1449
+ 'ellipse', 'elmhes', 'emboss', 'empty', 'enable_sysrtn',
1450
+ 'eof', 'eos_[0-9a-za-z_]*', 'erase', 'erf', 'erfc', 'erfcx',
1451
+ 'erode', 'errorplot', 'errplot', 'estimator_filter',
1452
+ 'execute', 'exit', 'exp', 'expand', 'expand_path', 'expint',
1453
+ 'extrac', 'extract_slice', 'factorial', 'fft', 'filepath',
1454
+ 'file_basename', 'file_chmod', 'file_copy', 'file_delete',
1455
+ 'file_dirname', 'file_expand_path', 'file_info',
1456
+ 'file_lines', 'file_link', 'file_mkdir', 'file_move',
1457
+ 'file_poll_input', 'file_readlink', 'file_same',
1458
+ 'file_search', 'file_test', 'file_which', 'findgen',
1459
+ 'finite', 'fix', 'flick', 'float', 'floor', 'flow3',
1460
+ 'fltarr', 'flush', 'format_axis_values', 'free_lun',
1461
+ 'fstat', 'fulstr', 'funct', 'fv_test', 'fx_root',
1462
+ 'fz_roots', 'f_cvf', 'f_pdf', 'gamma', 'gamma_ct',
1463
+ 'gauss2dfit', 'gaussfit', 'gaussian_function', 'gaussint',
1464
+ 'gauss_cvf', 'gauss_pdf', 'gauss_smooth', 'getenv',
1465
+ 'getwindows', 'get_drive_list', 'get_dxf_objects',
1466
+ 'get_kbrd', 'get_login_info', 'get_lun', 'get_screen_size',
1467
+ 'greg2jul', 'grib_[0-9a-za-z_]*', 'grid3', 'griddata',
1468
+ 'grid_input', 'grid_tps', 'gs_iter',
1469
+ 'h5[adfgirst]_[0-9a-za-z_]*', 'h5_browser', 'h5_close',
1470
+ 'h5_create', 'h5_get_libversion', 'h5_open', 'h5_parse',
1471
+ 'hanning', 'hash', 'hdf_[0-9a-za-z_]*', 'heap_free',
1472
+ 'heap_gc', 'heap_nosave', 'heap_refcount', 'heap_save',
1473
+ 'help', 'hilbert', 'histogram', 'hist_2d', 'hist_equal',
1474
+ 'hls', 'hough', 'hqr', 'hsv', 'h_eq_ct', 'h_eq_int',
1475
+ 'i18n_multibytetoutf8', 'i18n_multibytetowidechar',
1476
+ 'i18n_utf8tomultibyte', 'i18n_widechartomultibyte',
1477
+ 'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity',
1478
+ 'idlexbr_assistant', 'idlitsys_createtool', 'idl_base64',
1479
+ 'idl_validname', 'iellipse', 'igamma', 'igetcurrent',
1480
+ 'igetdata', 'igetid', 'igetproperty', 'iimage', 'image',
1481
+ 'image_cont', 'image_statistics', 'imaginary', 'imap',
1482
+ 'indgen', 'intarr', 'interpol', 'interpolate',
1483
+ 'interval_volume', 'int_2d', 'int_3d', 'int_tabulated',
1484
+ 'invert', 'ioctl', 'iopen', 'iplot', 'ipolygon',
1485
+ 'ipolyline', 'iputdata', 'iregister', 'ireset', 'iresolve',
1486
+ 'irotate', 'ir_filter', 'isa', 'isave', 'iscale',
1487
+ 'isetcurrent', 'isetproperty', 'ishft', 'isocontour',
1488
+ 'isosurface', 'isurface', 'itext', 'itranslate', 'ivector',
1489
+ 'ivolume', 'izoom', 'i_beta', 'journal', 'json_parse',
1490
+ 'json_serialize', 'jul2greg', 'julday', 'keyword_set',
1491
+ 'krig2d', 'kurtosis', 'kw_test', 'l64indgen', 'label_date',
1492
+ 'label_region', 'ladfit', 'laguerre', 'laplacian',
1493
+ 'la_choldc', 'la_cholmprove', 'la_cholsol', 'la_determ',
1494
+ 'la_eigenproblem', 'la_eigenql', 'la_eigenvec', 'la_elmhes',
1495
+ 'la_gm_linear_model', 'la_hqr', 'la_invert',
1496
+ 'la_least_squares', 'la_least_square_equality',
1497
+ 'la_linear_equation', 'la_ludc', 'la_lumprove', 'la_lusol',
1498
+ 'la_svd', 'la_tridc', 'la_trimprove', 'la_triql',
1499
+ 'la_trired', 'la_trisol', 'least_squares_filter', 'leefilt',
1500
+ 'legend', 'legendre', 'linbcg', 'lindgen', 'linfit',
1501
+ 'linkimage', 'list', 'll_arc_distance', 'lmfit', 'lmgr',
1502
+ 'lngamma', 'lnp_test', 'loadct', 'locale_get',
1503
+ 'logical_and', 'logical_or', 'logical_true', 'lon64arr',
1504
+ 'lonarr', 'long', 'long64', 'lsode', 'ludc', 'lumprove',
1505
+ 'lusol', 'lu_complex', 'machar', 'make_array', 'make_dll',
1506
+ 'make_rt', 'map', 'mapcontinents', 'mapgrid', 'map_2points',
1507
+ 'map_continents', 'map_grid', 'map_image', 'map_patch',
1508
+ 'map_proj_forward', 'map_proj_image', 'map_proj_info',
1509
+ 'map_proj_init', 'map_proj_inverse', 'map_set',
1510
+ 'matrix_multiply', 'matrix_power', 'max', 'md_test',
1511
+ 'mean', 'meanabsdev', 'mean_filter', 'median', 'memory',
1512
+ 'mesh_clip', 'mesh_decimate', 'mesh_issolid', 'mesh_merge',
1513
+ 'mesh_numtriangles', 'mesh_obj', 'mesh_smooth',
1514
+ 'mesh_surfacearea', 'mesh_validate', 'mesh_volume',
1515
+ 'message', 'min', 'min_curve_surf', 'mk_html_help',
1516
+ 'modifyct', 'moment', 'morph_close', 'morph_distance',
1517
+ 'morph_gradient', 'morph_hitormiss', 'morph_open',
1518
+ 'morph_thin', 'morph_tophat', 'multi', 'm_correlate',
1519
+ 'ncdf_[0-9a-za-z_]*', 'newton', 'noise_hurl', 'noise_pick',
1520
+ 'noise_scatter', 'noise_slur', 'norm', 'n_elements',
1521
+ 'n_params', 'n_tags', 'objarr', 'obj_class', 'obj_destroy',
1522
+ 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid',
1523
+ 'online_help', 'on_error', 'open', 'oplot', 'oploterr',
1524
+ 'parse_url', 'particle_trace', 'path_cache', 'path_sep',
1525
+ 'pcomp', 'plot', 'plot3d', 'ploterr', 'plots', 'plot_3dbox',
1526
+ 'plot_field', 'pnt_line', 'point_lun', 'polarplot',
1527
+ 'polar_contour', 'polar_surface', 'poly', 'polyfill',
1528
+ 'polyfillv', 'polygon', 'polyline', 'polyshade', 'polywarp',
1529
+ 'poly_2d', 'poly_area', 'poly_fit', 'popd', 'powell',
1530
+ 'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes',
1531
+ 'print', 'printd', 'product', 'profile', 'profiler',
1532
+ 'profiles', 'project_vol', 'psafm', 'pseudo',
1533
+ 'ps_show_fonts', 'ptrarr', 'ptr_free', 'ptr_new',
1534
+ 'ptr_valid', 'pushd', 'p_correlate', 'qgrid3', 'qhull',
1535
+ 'qromb', 'qromo', 'qsimp', 'query_ascii', 'query_bmp',
1536
+ 'query_csv', 'query_dicom', 'query_gif', 'query_image',
1537
+ 'query_jpeg', 'query_jpeg2000', 'query_mrsid', 'query_pict',
1538
+ 'query_png', 'query_ppm', 'query_srf', 'query_tiff',
1539
+ 'query_wav', 'radon', 'randomn', 'randomu', 'ranks',
1540
+ 'rdpix', 'read', 'reads', 'readu', 'read_ascii',
1541
+ 'read_binary', 'read_bmp', 'read_csv', 'read_dicom',
1542
+ 'read_gif', 'read_image', 'read_interfile', 'read_jpeg',
1543
+ 'read_jpeg2000', 'read_mrsid', 'read_pict', 'read_png',
1544
+ 'read_ppm', 'read_spr', 'read_srf', 'read_sylk',
1545
+ 'read_tiff', 'read_wav', 'read_wave', 'read_x11_bitmap',
1546
+ 'read_xwd', 'real_part', 'rebin', 'recall_commands',
1547
+ 'recon3', 'reduce_colors', 'reform', 'region_grow',
1548
+ 'register_cursor', 'regress', 'replicate',
1549
+ 'replicate_inplace', 'resolve_all', 'resolve_routine',
1550
+ 'restore', 'retall', 'return', 'reverse', 'rk4', 'roberts',
1551
+ 'rot', 'rotate', 'round', 'routine_filepath',
1552
+ 'routine_info', 'rs_test', 'r_correlate', 'r_test',
1553
+ 'save', 'savgol', 'scale3', 'scale3d', 'scope_level',
1554
+ 'scope_traceback', 'scope_varfetch', 'scope_varname',
1555
+ 'search2d', 'search3d', 'sem_create', 'sem_delete',
1556
+ 'sem_lock', 'sem_release', 'setenv', 'set_plot',
1557
+ 'set_shading', 'sfit', 'shade_surf', 'shade_surf_irr',
1558
+ 'shade_volume', 'shift', 'shift_diff', 'shmdebug', 'shmmap',
1559
+ 'shmunmap', 'shmvar', 'show3', 'showfont', 'simplex', 'sin',
1560
+ 'sindgen', 'sinh', 'size', 'skewness', 'skip_lun',
1561
+ 'slicer3', 'slide_image', 'smooth', 'sobel', 'socket',
1562
+ 'sort', 'spawn', 'spher_harm', 'sph_4pnt', 'sph_scat',
1563
+ 'spline', 'spline_p', 'spl_init', 'spl_interp', 'sprsab',
1564
+ 'sprsax', 'sprsin', 'sprstp', 'sqrt', 'standardize',
1565
+ 'stddev', 'stop', 'strarr', 'strcmp', 'strcompress',
1566
+ 'streamline', 'stregex', 'stretch', 'string', 'strjoin',
1567
+ 'strlen', 'strlowcase', 'strmatch', 'strmessage', 'strmid',
1568
+ 'strpos', 'strput', 'strsplit', 'strtrim', 'struct_assign',
1569
+ 'struct_hide', 'strupcase', 'surface', 'surfr', 'svdc',
1570
+ 'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace',
1571
+ 'symbol', 'systime', 's_test', 't3d', 'tag_names', 'tan',
1572
+ 'tanh', 'tek_color', 'temporary', 'tetra_clip',
1573
+ 'tetra_surface', 'tetra_volume', 'text', 'thin', 'threed',
1574
+ 'timegen', 'time_test2', 'tm_test', 'total', 'trace',
1575
+ 'transpose', 'triangulate', 'trigrid', 'triql', 'trired',
1576
+ 'trisol', 'tri_surf', 'truncate_lun', 'ts_coef', 'ts_diff',
1577
+ 'ts_fcast', 'ts_smooth', 'tv', 'tvcrs', 'tvlct', 'tvrd',
1578
+ 'tvscl', 'typename', 't_cvt', 't_pdf', 'uindgen', 'uint',
1579
+ 'uintarr', 'ul64indgen', 'ulindgen', 'ulon64arr', 'ulonarr',
1580
+ 'ulong', 'ulong64', 'uniq', 'unsharp_mask', 'usersym',
1581
+ 'value_locate', 'variance', 'vector', 'vector_field', 'vel',
1582
+ 'velovect', 'vert_t3d', 'voigt', 'voronoi', 'voxel_proj',
1583
+ 'wait', 'warp_tri', 'watershed', 'wdelete', 'wf_draw',
1584
+ 'where', 'widget_base', 'widget_button', 'widget_combobox',
1585
+ 'widget_control', 'widget_displaycontextmen', 'widget_draw',
1586
+ 'widget_droplist', 'widget_event', 'widget_info',
1587
+ 'widget_label', 'widget_list', 'widget_propertysheet',
1588
+ 'widget_slider', 'widget_tab', 'widget_table',
1589
+ 'widget_text', 'widget_tree', 'widget_tree_move',
1590
+ 'widget_window', 'wiener_filter', 'window', 'writeu',
1591
+ 'write_bmp', 'write_csv', 'write_gif', 'write_image',
1592
+ 'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict',
1593
+ 'write_png', 'write_ppm', 'write_spr', 'write_srf',
1594
+ 'write_sylk', 'write_tiff', 'write_wav', 'write_wave',
1595
+ 'wset', 'wshow', 'wtn', 'wv_applet', 'wv_cwt',
1596
+ 'wv_cw_wavelet', 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet',
1597
+ 'wv_fn_daubechies', 'wv_fn_gaussian', 'wv_fn_haar',
1598
+ 'wv_fn_morlet', 'wv_fn_paul', 'wv_fn_symlet',
1599
+ 'wv_import_data', 'wv_import_wavelet', 'wv_plot3d_wps',
1600
+ 'wv_plot_multires', 'wv_pwt', 'wv_tool_denoise',
1601
+ 'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont',
1602
+ 'xinteranimate', 'xloadct', 'xmanager', 'xmng_tmpl',
1603
+ 'xmtool', 'xobjview', 'xobjview_rotate',
1604
+ 'xobjview_write_image', 'xpalette', 'xpcolor', 'xplot3d',
1605
+ 'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit',
1606
+ 'xvolume', 'xvolume_rotate', 'xvolume_write_image',
1607
+ 'xyouts', 'zoom', 'zoom_24']
1608
+ """Functions from: http://www.exelisvis.com/docs/routines-1.html"""
1609
+
1610
+ tokens = {
1611
+ 'root': [
1612
+ (r'^\s*;.*?\n', Comment.Singleline),
1613
+ (r'\b(' + '|'.join(_RESERVED) + r')\b', Keyword),
1614
+ (r'\b(' + '|'.join(_BUILTIN_LIB) + r')\b', Name.Builtin),
1615
+ (r'\+=|-=|\^=|\*=|/=|#=|##=|<=|>=|=', Operator),
1616
+ (r'\+\+|--|->|\+|-|##|#|\*|/|<|>|&&|\^|~|\|\|\?|:', Operator),
1617
+ (r'\b(mod=|lt=|le=|eq=|ne=|ge=|gt=|not=|and=|or=|xor=)', Operator),
1618
+ (r'\b(mod|lt|le|eq|ne|ge|gt|not|and|or|xor)\b', Operator),
1619
+ (r'\b[0-9](L|B|S|UL|ULL|LL)?\b', Number),
1620
+ (r'.', Text),
1621
+ ]
1622
+ }
1623
+
1624
+
1625
+ class RdLexer(RegexLexer):
1626
+ """
1627
+ Pygments Lexer for R documentation (Rd) files
1628
+
1629
+ This is a very minimal implementation, highlighting little more
1630
+ than the macros. A description of Rd syntax is found in `Writing R
1631
+ Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
1632
+ and `Parsing Rd files <developer.r-project.org/parseRd.pdf>`_.
1633
+
1634
+ *New in Pygments 1.6.*
1635
+ """
1636
+ name = 'Rd'
1637
+ aliases = ['rd']
1638
+ filenames = ['*.Rd']
1639
+ mimetypes = ['text/x-r-doc']
1640
+
1641
+ # To account for verbatim / LaTeX-like / and R-like areas
1642
+ # would require parsing.
1643
+ tokens = {
1644
+ 'root' : [
1645
+ # catch escaped brackets and percent sign
1646
+ (r'\\[\\{}%]', String.Escape),
1647
+ # comments
1648
+ (r'%.*$', Comment),
1649
+ # special macros with no arguments
1650
+ (r'\\(?:cr|l?dots|R|tab)\b', Keyword.Constant),
1651
+ # macros
1652
+ (r'\\[a-zA-Z]+\b', Keyword),
1653
+ # special preprocessor macros
1654
+ (r'^\s*#(?:ifn?def|endif).*\b', Comment.Preproc),
1655
+ # non-escaped brackets
1656
+ (r'[{}]', Name.Builtin),
1657
+ # everything else
1658
+ (r'[^\\%\n{}]+', Text),
1659
+ (r'.', Text),
1660
+ ]
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
+ }