pygments.rb 0.6.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (606) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +6 -6
  4. data/Rakefile +2 -1
  5. data/cache-lexers.rb +1 -1
  6. data/circle.yml +7 -0
  7. data/lib/pygments/lexer.rb +3 -3
  8. data/lib/pygments/popen.rb +67 -30
  9. data/lib/pygments/version.rb +1 -1
  10. data/pygments.rb.gemspec +2 -1
  11. data/test/test_pygments.rb +16 -16
  12. data/vendor/pygments-main/AUTHORS +54 -8
  13. data/vendor/pygments-main/CHANGES +247 -25
  14. data/vendor/pygments-main/LICENSE +1 -1
  15. data/vendor/pygments-main/Makefile +15 -6
  16. data/vendor/pygments-main/README.rst +39 -0
  17. data/vendor/pygments-main/REVISION +1 -1
  18. data/vendor/pygments-main/TODO +0 -3
  19. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +1 -1
  20. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +1 -1
  21. data/vendor/pygments-main/doc/conf.py +3 -11
  22. data/vendor/pygments-main/doc/docs/api.rst +15 -0
  23. data/vendor/pygments-main/doc/docs/cmdline.rst +6 -2
  24. data/vendor/pygments-main/doc/docs/filterdevelopment.rst +4 -3
  25. data/vendor/pygments-main/doc/docs/integrate.rst +11 -15
  26. data/vendor/pygments-main/doc/docs/java.rst +7 -7
  27. data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +258 -171
  28. data/vendor/pygments-main/doc/docs/lexers.rst +2 -2
  29. data/vendor/pygments-main/doc/docs/styles.rst +58 -0
  30. data/vendor/pygments-main/doc/docs/tokens.rst +22 -2
  31. data/vendor/pygments-main/doc/docs/unicode.rst +15 -7
  32. data/vendor/pygments-main/doc/faq.rst +17 -21
  33. data/vendor/pygments-main/doc/index.rst +12 -11
  34. data/vendor/pygments-main/doc/languages.rst +10 -7
  35. data/vendor/pygments-main/external/autopygmentize +9 -6
  36. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +70 -52
  37. data/vendor/pygments-main/external/markdown-processor.py +1 -1
  38. data/vendor/pygments-main/external/moin-parser.py +1 -1
  39. data/vendor/pygments-main/external/rst-directive.py +1 -1
  40. data/vendor/pygments-main/pygmentize +2 -1
  41. data/vendor/pygments-main/pygments/__init__.py +14 -15
  42. data/vendor/pygments-main/pygments/cmdline.py +188 -113
  43. data/vendor/pygments-main/pygments/console.py +13 -13
  44. data/vendor/pygments-main/pygments/filter.py +7 -7
  45. data/vendor/pygments-main/pygments/filters/__init__.py +24 -32
  46. data/vendor/pygments-main/pygments/formatter.py +5 -5
  47. data/vendor/pygments-main/pygments/formatters/__init__.py +92 -44
  48. data/vendor/pygments-main/pygments/formatters/_mapping.py +51 -69
  49. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  50. data/vendor/pygments-main/pygments/formatters/html.py +63 -51
  51. data/vendor/pygments-main/pygments/formatters/img.py +25 -22
  52. data/vendor/pygments-main/pygments/formatters/irc.py +182 -0
  53. data/vendor/pygments-main/pygments/formatters/latex.py +34 -22
  54. data/vendor/pygments-main/pygments/formatters/other.py +5 -7
  55. data/vendor/pygments-main/pygments/formatters/rtf.py +28 -31
  56. data/vendor/pygments-main/pygments/formatters/svg.py +1 -2
  57. data/vendor/pygments-main/pygments/formatters/terminal.py +29 -45
  58. data/vendor/pygments-main/pygments/formatters/terminal256.py +118 -31
  59. data/vendor/pygments-main/pygments/lexer.py +120 -34
  60. data/vendor/pygments-main/pygments/lexers/__init__.py +85 -53
  61. data/vendor/pygments-main/pygments/lexers/{_asybuiltins.py → _asy_builtins.py} +7 -7
  62. data/vendor/pygments-main/pygments/lexers/{_clbuiltins.py → _cl_builtins.py} +17 -17
  63. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +72 -0
  64. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1346 -0
  65. data/vendor/pygments-main/pygments/lexers/{_lassobuiltins.py → _lasso_builtins.py} +4699 -4561
  66. data/vendor/pygments-main/pygments/lexers/{_luabuiltins.py → _lua_builtins.py} +91 -51
  67. data/vendor/pygments-main/pygments/lexers/_mapping.py +342 -242
  68. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1172 -0
  69. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2547 -0
  70. data/vendor/pygments-main/pygments/lexers/{_phpbuiltins.py → _php_builtins.py} +350 -353
  71. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +600 -212
  72. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3084 -30
  73. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1163 -0
  74. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +91 -13
  75. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +419 -0
  76. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1004 -0
  77. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1939 -0
  78. data/vendor/pygments-main/pygments/lexers/actionscript.py +240 -0
  79. data/vendor/pygments-main/pygments/lexers/agile.py +14 -2542
  80. data/vendor/pygments-main/pygments/lexers/algebra.py +221 -0
  81. data/vendor/pygments-main/pygments/lexers/ambient.py +76 -0
  82. data/vendor/pygments-main/pygments/lexers/ampl.py +87 -0
  83. data/vendor/pygments-main/pygments/lexers/apl.py +101 -0
  84. data/vendor/pygments-main/pygments/lexers/archetype.py +318 -0
  85. data/vendor/pygments-main/pygments/lexers/asm.py +276 -81
  86. data/vendor/pygments-main/pygments/lexers/automation.py +374 -0
  87. data/vendor/pygments-main/pygments/lexers/basic.py +500 -0
  88. data/vendor/pygments-main/pygments/lexers/bibtex.py +156 -0
  89. data/vendor/pygments-main/pygments/lexers/business.py +594 -0
  90. data/vendor/pygments-main/pygments/lexers/c_cpp.py +252 -0
  91. data/vendor/pygments-main/pygments/lexers/c_like.py +541 -0
  92. data/vendor/pygments-main/pygments/lexers/capnproto.py +79 -0
  93. data/vendor/pygments-main/pygments/lexers/chapel.py +101 -0
  94. data/vendor/pygments-main/pygments/lexers/clean.py +288 -0
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +24 -5182
  96. data/vendor/pygments-main/pygments/lexers/configs.py +833 -0
  97. data/vendor/pygments-main/pygments/lexers/console.py +114 -0
  98. data/vendor/pygments-main/pygments/lexers/crystal.py +384 -0
  99. data/vendor/pygments-main/pygments/lexers/csound.py +366 -0
  100. data/vendor/pygments-main/pygments/lexers/css.py +689 -0
  101. data/vendor/pygments-main/pygments/lexers/d.py +251 -0
  102. data/vendor/pygments-main/pygments/lexers/dalvik.py +6 -6
  103. data/vendor/pygments-main/pygments/lexers/data.py +555 -0
  104. data/vendor/pygments-main/pygments/lexers/diff.py +165 -0
  105. data/vendor/pygments-main/pygments/lexers/dotnet.py +96 -88
  106. data/vendor/pygments-main/pygments/lexers/dsls.py +878 -0
  107. data/vendor/pygments-main/pygments/lexers/dylan.py +289 -0
  108. data/vendor/pygments-main/pygments/lexers/ecl.py +125 -0
  109. data/vendor/pygments-main/pygments/lexers/eiffel.py +65 -0
  110. data/vendor/pygments-main/pygments/lexers/elm.py +121 -0
  111. data/vendor/pygments-main/pygments/lexers/erlang.py +533 -0
  112. data/vendor/pygments-main/pygments/lexers/esoteric.py +275 -0
  113. data/vendor/pygments-main/pygments/lexers/ezhil.py +68 -0
  114. data/vendor/pygments-main/pygments/lexers/factor.py +344 -0
  115. data/vendor/pygments-main/pygments/lexers/fantom.py +250 -0
  116. data/vendor/pygments-main/pygments/lexers/felix.py +273 -0
  117. data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
  118. data/vendor/pygments-main/pygments/lexers/fortran.py +205 -0
  119. data/vendor/pygments-main/pygments/lexers/foxpro.py +1 -1
  120. data/vendor/pygments-main/pygments/lexers/functional.py +11 -3661
  121. data/vendor/pygments-main/pygments/lexers/go.py +101 -0
  122. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +213 -0
  123. data/vendor/pygments-main/pygments/lexers/graph.py +7 -8
  124. data/vendor/pygments-main/pygments/lexers/graphics.py +553 -0
  125. data/vendor/pygments-main/pygments/lexers/haskell.py +840 -0
  126. data/vendor/pygments-main/pygments/lexers/haxe.py +936 -0
  127. data/vendor/pygments-main/pygments/lexers/hdl.py +172 -145
  128. data/vendor/pygments-main/pygments/lexers/hexdump.py +97 -0
  129. data/vendor/pygments-main/pygments/lexers/html.py +602 -0
  130. data/vendor/pygments-main/pygments/lexers/idl.py +270 -0
  131. data/vendor/pygments-main/pygments/lexers/igor.py +288 -0
  132. data/vendor/pygments-main/pygments/lexers/inferno.py +3 -3
  133. data/vendor/pygments-main/pygments/lexers/installers.py +322 -0
  134. data/vendor/pygments-main/pygments/lexers/int_fiction.py +1343 -0
  135. data/vendor/pygments-main/pygments/lexers/iolang.py +63 -0
  136. data/vendor/pygments-main/pygments/lexers/j.py +146 -0
  137. data/vendor/pygments-main/pygments/lexers/javascript.py +1506 -0
  138. data/vendor/pygments-main/pygments/lexers/julia.py +333 -0
  139. data/vendor/pygments-main/pygments/lexers/jvm.py +232 -186
  140. data/vendor/pygments-main/pygments/lexers/lisp.py +2621 -0
  141. data/vendor/pygments-main/pygments/lexers/make.py +202 -0
  142. data/vendor/pygments-main/pygments/lexers/markup.py +595 -0
  143. data/vendor/pygments-main/pygments/lexers/math.py +11 -2276
  144. data/vendor/pygments-main/pygments/lexers/matlab.py +663 -0
  145. data/vendor/pygments-main/pygments/lexers/ml.py +769 -0
  146. data/vendor/pygments-main/pygments/lexers/modeling.py +358 -0
  147. data/vendor/pygments-main/pygments/lexers/modula2.py +1561 -0
  148. data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
  149. data/vendor/pygments-main/pygments/lexers/ncl.py +1053 -0
  150. data/vendor/pygments-main/pygments/lexers/nimrod.py +159 -0
  151. data/vendor/pygments-main/pygments/lexers/nit.py +64 -0
  152. data/vendor/pygments-main/pygments/lexers/nix.py +136 -0
  153. data/vendor/pygments-main/pygments/lexers/oberon.py +105 -0
  154. data/vendor/pygments-main/pygments/lexers/objective.py +504 -0
  155. data/vendor/pygments-main/pygments/lexers/ooc.py +85 -0
  156. data/vendor/pygments-main/pygments/lexers/other.py +30 -4481
  157. data/vendor/pygments-main/pygments/lexers/parasail.py +79 -0
  158. data/vendor/pygments-main/pygments/lexers/parsers.py +171 -114
  159. data/vendor/pygments-main/pygments/lexers/pascal.py +644 -0
  160. data/vendor/pygments-main/pygments/lexers/pawn.py +199 -0
  161. data/vendor/pygments-main/pygments/lexers/perl.py +616 -0
  162. data/vendor/pygments-main/pygments/lexers/php.py +267 -0
  163. data/vendor/pygments-main/pygments/lexers/praat.py +294 -0
  164. data/vendor/pygments-main/pygments/lexers/prolog.py +306 -0
  165. data/vendor/pygments-main/pygments/lexers/python.py +938 -0
  166. data/vendor/pygments-main/pygments/lexers/qvt.py +152 -0
  167. data/vendor/pygments-main/pygments/lexers/r.py +453 -0
  168. data/vendor/pygments-main/pygments/lexers/rdf.py +195 -24
  169. data/vendor/pygments-main/pygments/lexers/rebol.py +431 -0
  170. data/vendor/pygments-main/pygments/lexers/resource.py +85 -0
  171. data/vendor/pygments-main/pygments/lexers/rnc.py +67 -0
  172. data/vendor/pygments-main/pygments/lexers/roboconf.py +82 -0
  173. data/vendor/pygments-main/pygments/lexers/{_robotframeworklexer.py → robotframework.py} +20 -18
  174. data/vendor/pygments-main/pygments/lexers/ruby.py +519 -0
  175. data/vendor/pygments-main/pygments/lexers/rust.py +209 -0
  176. data/vendor/pygments-main/pygments/lexers/sas.py +228 -0
  177. data/vendor/pygments-main/pygments/lexers/scripting.py +1222 -0
  178. data/vendor/pygments-main/pygments/lexers/shell.py +478 -115
  179. data/vendor/pygments-main/pygments/lexers/smalltalk.py +195 -0
  180. data/vendor/pygments-main/pygments/lexers/smv.py +75 -0
  181. data/vendor/pygments-main/pygments/lexers/snobol.py +83 -0
  182. data/vendor/pygments-main/pygments/lexers/special.py +6 -2
  183. data/vendor/pygments-main/pygments/lexers/sql.py +209 -120
  184. data/vendor/pygments-main/pygments/lexers/stata.py +106 -0
  185. data/vendor/pygments-main/pygments/lexers/supercollider.py +90 -0
  186. data/vendor/pygments-main/pygments/lexers/tcl.py +145 -0
  187. data/vendor/pygments-main/pygments/lexers/templates.py +282 -90
  188. data/vendor/pygments-main/pygments/lexers/testing.py +207 -0
  189. data/vendor/pygments-main/pygments/lexers/text.py +15 -2045
  190. data/vendor/pygments-main/pygments/lexers/textedit.py +169 -0
  191. data/vendor/pygments-main/pygments/lexers/textfmts.py +297 -0
  192. data/vendor/pygments-main/pygments/lexers/theorem.py +458 -0
  193. data/vendor/pygments-main/pygments/lexers/trafficscript.py +54 -0
  194. data/vendor/pygments-main/pygments/lexers/typoscript.py +225 -0
  195. data/vendor/pygments-main/pygments/lexers/urbi.py +133 -0
  196. data/vendor/pygments-main/pygments/lexers/varnish.py +190 -0
  197. data/vendor/pygments-main/pygments/lexers/verification.py +111 -0
  198. data/vendor/pygments-main/pygments/lexers/web.py +13 -4499
  199. data/vendor/pygments-main/pygments/lexers/webmisc.py +979 -0
  200. data/vendor/pygments-main/pygments/lexers/whiley.py +117 -0
  201. data/vendor/pygments-main/pygments/lexers/x10.py +69 -0
  202. data/vendor/pygments-main/pygments/modeline.py +5 -2
  203. data/vendor/pygments-main/pygments/plugin.py +1 -1
  204. data/vendor/pygments-main/pygments/regexopt.py +92 -0
  205. data/vendor/pygments-main/pygments/scanner.py +3 -2
  206. data/vendor/pygments-main/pygments/sphinxext.py +11 -6
  207. data/vendor/pygments-main/pygments/style.py +41 -4
  208. data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
  209. data/vendor/pygments-main/pygments/styles/algol.py +63 -0
  210. data/vendor/pygments-main/pygments/styles/algol_nu.py +63 -0
  211. data/vendor/pygments-main/pygments/styles/arduino.py +98 -0
  212. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  213. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  214. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  215. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  216. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  217. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  218. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  219. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  220. data/vendor/pygments-main/pygments/styles/igor.py +1 -1
  221. data/vendor/pygments-main/pygments/styles/lovelace.py +97 -0
  222. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  223. data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
  224. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  225. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  226. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
  227. data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
  228. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  229. data/vendor/pygments-main/pygments/styles/perldoc.py +2 -2
  230. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  231. data/vendor/pygments-main/pygments/styles/sas.py +41 -0
  232. data/vendor/pygments-main/pygments/styles/stata.py +37 -0
  233. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  234. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  235. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  236. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  237. data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
  238. data/vendor/pygments-main/pygments/token.py +31 -16
  239. data/vendor/pygments-main/pygments/unistring.py +141 -65
  240. data/vendor/pygments-main/pygments/util.py +129 -33
  241. data/vendor/pygments-main/requirements.txt +5 -0
  242. data/vendor/pygments-main/scripts/check_sources.py +25 -40
  243. data/vendor/pygments-main/scripts/debug_lexer.py +246 -0
  244. data/vendor/pygments-main/scripts/find_error.py +1 -0
  245. data/vendor/pygments-main/scripts/get_vimkw.py +35 -4
  246. data/vendor/pygments-main/setup.cfg +3 -0
  247. data/vendor/pygments-main/setup.py +17 -30
  248. data/vendor/pygments-main/tox.ini +7 -0
  249. metadata +159 -387
  250. data/vendor/pygments-main/ez_setup.py +0 -382
  251. data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +0 -73
  252. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +0 -562
  253. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +0 -1077
  254. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +0 -13
  255. data/vendor/pygments-main/pygments/lexers/qbasic.py +0 -157
  256. data/vendor/pygments-main/scripts/find_codetags.py +0 -213
  257. data/vendor/pygments-main/scripts/find_error.py +0 -173
  258. data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +0 -37
  259. data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +0 -869
  260. data/vendor/pygments-main/tests/dtds/HTML4.dcl +0 -88
  261. data/vendor/pygments-main/tests/dtds/HTML4.dtd +0 -1092
  262. data/vendor/pygments-main/tests/dtds/HTML4.soc +0 -9
  263. data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +0 -195
  264. data/vendor/pygments-main/tests/dtds/HTMLspec.ent +0 -77
  265. data/vendor/pygments-main/tests/dtds/HTMLsym.ent +0 -241
  266. data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +0 -118
  267. data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +0 -209
  268. data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +0 -102
  269. data/vendor/pygments-main/tests/examplefiles/BOM.js +0 -1
  270. data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +0 -611
  271. data/vendor/pygments-main/tests/examplefiles/Config.in.cache +0 -1973
  272. data/vendor/pygments-main/tests/examplefiles/Constants.mo +0 -158
  273. data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +0 -411
  274. data/vendor/pygments-main/tests/examplefiles/Deflate.fs +0 -578
  275. data/vendor/pygments-main/tests/examplefiles/Error.pmod +0 -38
  276. data/vendor/pygments-main/tests/examplefiles/Errors.scala +0 -18
  277. data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +0 -360
  278. data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +0 -66
  279. data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +0 -104
  280. data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +0 -671
  281. data/vendor/pygments-main/tests/examplefiles/Intro.java +0 -1660
  282. data/vendor/pygments-main/tests/examplefiles/Makefile +0 -1131
  283. data/vendor/pygments-main/tests/examplefiles/Object.st +0 -4394
  284. data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +0 -584
  285. data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +0 -23
  286. data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +0 -378
  287. data/vendor/pygments-main/tests/examplefiles/Sorting.mod +0 -470
  288. data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +0 -382
  289. data/vendor/pygments-main/tests/examplefiles/addressbook.proto +0 -30
  290. data/vendor/pygments-main/tests/examplefiles/antlr_ANTLRv3.g +0 -608
  291. data/vendor/pygments-main/tests/examplefiles/antlr_throws +0 -1
  292. data/vendor/pygments-main/tests/examplefiles/apache2.conf +0 -393
  293. data/vendor/pygments-main/tests/examplefiles/as3_test.as +0 -143
  294. data/vendor/pygments-main/tests/examplefiles/as3_test2.as +0 -46
  295. data/vendor/pygments-main/tests/examplefiles/as3_test3.as +0 -3
  296. data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +0 -27
  297. data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +0 -25
  298. data/vendor/pygments-main/tests/examplefiles/badcase.java +0 -2
  299. data/vendor/pygments-main/tests/examplefiles/batchfile.bat +0 -49
  300. data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +0 -308
  301. data/vendor/pygments-main/tests/examplefiles/boot-9.scm +0 -1557
  302. data/vendor/pygments-main/tests/examplefiles/ca65_example +0 -284
  303. data/vendor/pygments-main/tests/examplefiles/cbmbas_example +0 -9
  304. data/vendor/pygments-main/tests/examplefiles/cells.ps +0 -515
  305. data/vendor/pygments-main/tests/examplefiles/ceval.c +0 -2604
  306. data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +0 -13
  307. data/vendor/pygments-main/tests/examplefiles/classes.dylan +0 -125
  308. data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +0 -5
  309. data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +0 -10
  310. data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +0 -447
  311. data/vendor/pygments-main/tests/examplefiles/core.cljs +0 -52
  312. data/vendor/pygments-main/tests/examplefiles/database.pytb +0 -20
  313. data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +0 -2461
  314. data/vendor/pygments-main/tests/examplefiles/demo.ahk +0 -181
  315. data/vendor/pygments-main/tests/examplefiles/demo.cfm +0 -50
  316. data/vendor/pygments-main/tests/examplefiles/demo.hbs +0 -12
  317. data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +0 -68
  318. data/vendor/pygments-main/tests/examplefiles/dwarf.cw +0 -17
  319. data/vendor/pygments-main/tests/examplefiles/ember.handlebars +0 -33
  320. data/vendor/pygments-main/tests/examplefiles/erl_session +0 -10
  321. data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +0 -1
  322. data/vendor/pygments-main/tests/examplefiles/evil_regex.js +0 -48
  323. data/vendor/pygments-main/tests/examplefiles/example.Rd +0 -78
  324. data/vendor/pygments-main/tests/examplefiles/example.als +0 -217
  325. data/vendor/pygments-main/tests/examplefiles/example.bug +0 -54
  326. data/vendor/pygments-main/tests/examplefiles/example.c +0 -2080
  327. data/vendor/pygments-main/tests/examplefiles/example.ceylon +0 -52
  328. data/vendor/pygments-main/tests/examplefiles/example.chai +0 -6
  329. data/vendor/pygments-main/tests/examplefiles/example.clay +0 -33
  330. data/vendor/pygments-main/tests/examplefiles/example.cls +0 -15
  331. data/vendor/pygments-main/tests/examplefiles/example.cob +0 -3556
  332. data/vendor/pygments-main/tests/examplefiles/example.coffee +0 -27
  333. data/vendor/pygments-main/tests/examplefiles/example.cpp +0 -2363
  334. data/vendor/pygments-main/tests/examplefiles/example.e +0 -124
  335. data/vendor/pygments-main/tests/examplefiles/example.f90 +0 -8
  336. data/vendor/pygments-main/tests/examplefiles/example.feature +0 -16
  337. data/vendor/pygments-main/tests/examplefiles/example.gd +0 -23
  338. data/vendor/pygments-main/tests/examplefiles/example.gi +0 -64
  339. data/vendor/pygments-main/tests/examplefiles/example.groovy +0 -2
  340. data/vendor/pygments-main/tests/examplefiles/example.gs +0 -106
  341. data/vendor/pygments-main/tests/examplefiles/example.gst +0 -7
  342. data/vendor/pygments-main/tests/examplefiles/example.hs +0 -27
  343. data/vendor/pygments-main/tests/examplefiles/example.hx +0 -185
  344. data/vendor/pygments-main/tests/examplefiles/example.i6t +0 -32
  345. data/vendor/pygments-main/tests/examplefiles/example.i7x +0 -45
  346. data/vendor/pygments-main/tests/examplefiles/example.inf +0 -374
  347. data/vendor/pygments-main/tests/examplefiles/example.j +0 -564
  348. data/vendor/pygments-main/tests/examplefiles/example.jag +0 -48
  349. data/vendor/pygments-main/tests/examplefiles/example.java +0 -16
  350. data/vendor/pygments-main/tests/examplefiles/example.kal +0 -75
  351. data/vendor/pygments-main/tests/examplefiles/example.kt +0 -47
  352. data/vendor/pygments-main/tests/examplefiles/example.lagda +0 -19
  353. data/vendor/pygments-main/tests/examplefiles/example.liquid +0 -42
  354. data/vendor/pygments-main/tests/examplefiles/example.lua +0 -250
  355. data/vendor/pygments-main/tests/examplefiles/example.ma +0 -8
  356. data/vendor/pygments-main/tests/examplefiles/example.monkey +0 -152
  357. data/vendor/pygments-main/tests/examplefiles/example.moo +0 -26
  358. data/vendor/pygments-main/tests/examplefiles/example.moon +0 -629
  359. data/vendor/pygments-main/tests/examplefiles/example.mq4 +0 -187
  360. data/vendor/pygments-main/tests/examplefiles/example.mqh +0 -123
  361. data/vendor/pygments-main/tests/examplefiles/example.msc +0 -43
  362. data/vendor/pygments-main/tests/examplefiles/example.ni +0 -57
  363. data/vendor/pygments-main/tests/examplefiles/example.nim +0 -1010
  364. data/vendor/pygments-main/tests/examplefiles/example.nix +0 -80
  365. data/vendor/pygments-main/tests/examplefiles/example.ns2 +0 -69
  366. data/vendor/pygments-main/tests/examplefiles/example.pas +0 -2708
  367. data/vendor/pygments-main/tests/examplefiles/example.pp +0 -8
  368. data/vendor/pygments-main/tests/examplefiles/example.prg +0 -161
  369. data/vendor/pygments-main/tests/examplefiles/example.rb +0 -1852
  370. data/vendor/pygments-main/tests/examplefiles/example.red +0 -257
  371. data/vendor/pygments-main/tests/examplefiles/example.reds +0 -150
  372. data/vendor/pygments-main/tests/examplefiles/example.reg +0 -19
  373. data/vendor/pygments-main/tests/examplefiles/example.rexx +0 -50
  374. data/vendor/pygments-main/tests/examplefiles/example.rhtml +0 -561
  375. data/vendor/pygments-main/tests/examplefiles/example.rkt +0 -743
  376. data/vendor/pygments-main/tests/examplefiles/example.rpf +0 -4
  377. data/vendor/pygments-main/tests/examplefiles/example.sh +0 -22
  378. data/vendor/pygments-main/tests/examplefiles/example.sh-session +0 -19
  379. data/vendor/pygments-main/tests/examplefiles/example.shell-session +0 -45
  380. data/vendor/pygments-main/tests/examplefiles/example.slim +0 -31
  381. data/vendor/pygments-main/tests/examplefiles/example.sls +0 -51
  382. data/vendor/pygments-main/tests/examplefiles/example.sml +0 -156
  383. data/vendor/pygments-main/tests/examplefiles/example.snobol +0 -15
  384. data/vendor/pygments-main/tests/examplefiles/example.stan +0 -110
  385. data/vendor/pygments-main/tests/examplefiles/example.tea +0 -34
  386. data/vendor/pygments-main/tests/examplefiles/example.todotxt +0 -9
  387. data/vendor/pygments-main/tests/examplefiles/example.ts +0 -28
  388. data/vendor/pygments-main/tests/examplefiles/example.u +0 -548
  389. data/vendor/pygments-main/tests/examplefiles/example.weechatlog +0 -9
  390. data/vendor/pygments-main/tests/examplefiles/example.xhtml +0 -376
  391. data/vendor/pygments-main/tests/examplefiles/example.xtend +0 -34
  392. data/vendor/pygments-main/tests/examplefiles/example.yaml +0 -302
  393. data/vendor/pygments-main/tests/examplefiles/example2.aspx +0 -29
  394. data/vendor/pygments-main/tests/examplefiles/example2.msc +0 -79
  395. data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +0 -241
  396. data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +0 -18
  397. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +0 -205
  398. data/vendor/pygments-main/tests/examplefiles/example_file.fy +0 -128
  399. data/vendor/pygments-main/tests/examplefiles/firefox.mak +0 -586
  400. data/vendor/pygments-main/tests/examplefiles/flipflop.sv +0 -19
  401. data/vendor/pygments-main/tests/examplefiles/foo.sce +0 -6
  402. data/vendor/pygments-main/tests/examplefiles/format.ml +0 -1213
  403. data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +0 -77
  404. data/vendor/pygments-main/tests/examplefiles/function.mu +0 -1
  405. data/vendor/pygments-main/tests/examplefiles/functional.rst +0 -1472
  406. data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +0 -133
  407. data/vendor/pygments-main/tests/examplefiles/genclass.clj +0 -510
  408. data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +0 -193
  409. data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +0 -33
  410. data/vendor/pygments-main/tests/examplefiles/glsl.frag +0 -7
  411. data/vendor/pygments-main/tests/examplefiles/glsl.vert +0 -13
  412. data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +0 -22
  413. data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +0 -5
  414. data/vendor/pygments-main/tests/examplefiles/hello.at +0 -6
  415. data/vendor/pygments-main/tests/examplefiles/hello.golo +0 -5
  416. data/vendor/pygments-main/tests/examplefiles/hello.lsl +0 -12
  417. data/vendor/pygments-main/tests/examplefiles/hello.smali +0 -40
  418. data/vendor/pygments-main/tests/examplefiles/hello.sp +0 -9
  419. data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +0 -1
  420. data/vendor/pygments-main/tests/examplefiles/http_request_example +0 -15
  421. data/vendor/pygments-main/tests/examplefiles/http_response_example +0 -29
  422. data/vendor/pygments-main/tests/examplefiles/hybris_File.hy +0 -174
  423. data/vendor/pygments-main/tests/examplefiles/idl_sample.pro +0 -73
  424. data/vendor/pygments-main/tests/examplefiles/iex_example +0 -23
  425. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +0 -71
  426. data/vendor/pygments-main/tests/examplefiles/intro.ik +0 -24
  427. data/vendor/pygments-main/tests/examplefiles/ints.php +0 -10
  428. data/vendor/pygments-main/tests/examplefiles/intsyn.fun +0 -675
  429. data/vendor/pygments-main/tests/examplefiles/intsyn.sig +0 -286
  430. data/vendor/pygments-main/tests/examplefiles/irb_heredoc +0 -8
  431. data/vendor/pygments-main/tests/examplefiles/irc.lsp +0 -214
  432. data/vendor/pygments-main/tests/examplefiles/java.properties +0 -16
  433. data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +0 -28
  434. data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +0 -45
  435. data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +0 -713
  436. data/vendor/pygments-main/tests/examplefiles/json.lasso +0 -301
  437. data/vendor/pygments-main/tests/examplefiles/json.lasso9 +0 -213
  438. data/vendor/pygments-main/tests/examplefiles/language.hy +0 -165
  439. data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +0 -13
  440. data/vendor/pygments-main/tests/examplefiles/limbo.b +0 -456
  441. data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +0 -47
  442. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +0 -43
  443. data/vendor/pygments-main/tests/examplefiles/logos_example.xm +0 -28
  444. data/vendor/pygments-main/tests/examplefiles/ltmain.sh +0 -2849
  445. data/vendor/pygments-main/tests/examplefiles/main.cmake +0 -44
  446. data/vendor/pygments-main/tests/examplefiles/markdown.lsp +0 -679
  447. data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +0 -3
  448. data/vendor/pygments-main/tests/examplefiles/matlab_sample +0 -30
  449. data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +0 -37
  450. data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +0 -455
  451. data/vendor/pygments-main/tests/examplefiles/minehunt.qml +0 -112
  452. data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +0 -4
  453. data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +0 -340
  454. data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +0 -38
  455. data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +0 -95
  456. data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +0 -96
  457. data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +0 -30
  458. data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +0 -87
  459. data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +0 -118
  460. data/vendor/pygments-main/tests/examplefiles/numbers.c +0 -12
  461. data/vendor/pygments-main/tests/examplefiles/objc_example.m +0 -179
  462. data/vendor/pygments-main/tests/examplefiles/openedge_example +0 -34
  463. data/vendor/pygments-main/tests/examplefiles/pawn_example +0 -25
  464. data/vendor/pygments-main/tests/examplefiles/perl_misc +0 -62
  465. data/vendor/pygments-main/tests/examplefiles/perl_perl5db +0 -998
  466. data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +0 -120
  467. data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +0 -856
  468. data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +0 -163
  469. data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +0 -567
  470. data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +0 -1223
  471. data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +0 -47
  472. data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +0 -10
  473. data/vendor/pygments-main/tests/examplefiles/psql_session.txt +0 -122
  474. data/vendor/pygments-main/tests/examplefiles/py3_test.txt +0 -2
  475. data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +0 -4
  476. data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +0 -14
  477. data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +0 -2
  478. data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +0 -4
  479. data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +0 -234
  480. data/vendor/pygments-main/tests/examplefiles/qbasic_example +0 -2
  481. data/vendor/pygments-main/tests/examplefiles/qsort.prolog +0 -13
  482. data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +0 -38
  483. data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +0 -23
  484. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +0 -280
  485. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +0 -2
  486. data/vendor/pygments-main/tests/examplefiles/regex.js +0 -22
  487. data/vendor/pygments-main/tests/examplefiles/reversi.lsp +0 -427
  488. data/vendor/pygments-main/tests/examplefiles/robotframework_test.txt +0 -39
  489. data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +0 -34
  490. data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +0 -11
  491. data/vendor/pygments-main/tests/examplefiles/rust_example.rs +0 -233
  492. data/vendor/pygments-main/tests/examplefiles/scilab.sci +0 -30
  493. data/vendor/pygments-main/tests/examplefiles/scope.cirru +0 -43
  494. data/vendor/pygments-main/tests/examplefiles/session.dylan-console +0 -9
  495. data/vendor/pygments-main/tests/examplefiles/sibling.prolog +0 -19
  496. data/vendor/pygments-main/tests/examplefiles/simple.md +0 -747
  497. data/vendor/pygments-main/tests/examplefiles/smarty_example.html +0 -209
  498. data/vendor/pygments-main/tests/examplefiles/source.lgt +0 -343
  499. data/vendor/pygments-main/tests/examplefiles/sources.list +0 -62
  500. data/vendor/pygments-main/tests/examplefiles/sparql.rq +0 -23
  501. data/vendor/pygments-main/tests/examplefiles/sphere.pov +0 -18
  502. data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +0 -27
  503. data/vendor/pygments-main/tests/examplefiles/squid.conf +0 -30
  504. data/vendor/pygments-main/tests/examplefiles/string.jl +0 -1031
  505. data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +0 -21
  506. data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +0 -3
  507. data/vendor/pygments-main/tests/examplefiles/swig_java.swg +0 -1329
  508. data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +0 -225
  509. data/vendor/pygments-main/tests/examplefiles/test.R +0 -185
  510. data/vendor/pygments-main/tests/examplefiles/test.adb +0 -211
  511. data/vendor/pygments-main/tests/examplefiles/test.agda +0 -102
  512. data/vendor/pygments-main/tests/examplefiles/test.apl +0 -26
  513. data/vendor/pygments-main/tests/examplefiles/test.asy +0 -131
  514. data/vendor/pygments-main/tests/examplefiles/test.awk +0 -121
  515. data/vendor/pygments-main/tests/examplefiles/test.bb +0 -95
  516. data/vendor/pygments-main/tests/examplefiles/test.bmx +0 -145
  517. data/vendor/pygments-main/tests/examplefiles/test.boo +0 -39
  518. data/vendor/pygments-main/tests/examplefiles/test.bro +0 -250
  519. data/vendor/pygments-main/tests/examplefiles/test.cs +0 -374
  520. data/vendor/pygments-main/tests/examplefiles/test.css +0 -54
  521. data/vendor/pygments-main/tests/examplefiles/test.cu +0 -36
  522. data/vendor/pygments-main/tests/examplefiles/test.cyp +0 -123
  523. data/vendor/pygments-main/tests/examplefiles/test.d +0 -135
  524. data/vendor/pygments-main/tests/examplefiles/test.dart +0 -23
  525. data/vendor/pygments-main/tests/examplefiles/test.dtd +0 -89
  526. data/vendor/pygments-main/tests/examplefiles/test.ebnf +0 -31
  527. data/vendor/pygments-main/tests/examplefiles/test.ec +0 -605
  528. data/vendor/pygments-main/tests/examplefiles/test.ecl +0 -58
  529. data/vendor/pygments-main/tests/examplefiles/test.eh +0 -315
  530. data/vendor/pygments-main/tests/examplefiles/test.erl +0 -169
  531. data/vendor/pygments-main/tests/examplefiles/test.evoque +0 -33
  532. data/vendor/pygments-main/tests/examplefiles/test.fan +0 -818
  533. data/vendor/pygments-main/tests/examplefiles/test.flx +0 -57
  534. data/vendor/pygments-main/tests/examplefiles/test.gdc +0 -13
  535. data/vendor/pygments-main/tests/examplefiles/test.groovy +0 -97
  536. data/vendor/pygments-main/tests/examplefiles/test.html +0 -339
  537. data/vendor/pygments-main/tests/examplefiles/test.idr +0 -93
  538. data/vendor/pygments-main/tests/examplefiles/test.ini +0 -10
  539. data/vendor/pygments-main/tests/examplefiles/test.java +0 -653
  540. data/vendor/pygments-main/tests/examplefiles/test.jsp +0 -24
  541. data/vendor/pygments-main/tests/examplefiles/test.maql +0 -45
  542. data/vendor/pygments-main/tests/examplefiles/test.mask +0 -41
  543. data/vendor/pygments-main/tests/examplefiles/test.mod +0 -374
  544. data/vendor/pygments-main/tests/examplefiles/test.moo +0 -51
  545. data/vendor/pygments-main/tests/examplefiles/test.myt +0 -166
  546. data/vendor/pygments-main/tests/examplefiles/test.nim +0 -93
  547. data/vendor/pygments-main/tests/examplefiles/test.opa +0 -10
  548. data/vendor/pygments-main/tests/examplefiles/test.p6 +0 -252
  549. data/vendor/pygments-main/tests/examplefiles/test.pan +0 -54
  550. data/vendor/pygments-main/tests/examplefiles/test.pas +0 -743
  551. data/vendor/pygments-main/tests/examplefiles/test.php +0 -507
  552. data/vendor/pygments-main/tests/examplefiles/test.pig +0 -148
  553. data/vendor/pygments-main/tests/examplefiles/test.plot +0 -333
  554. data/vendor/pygments-main/tests/examplefiles/test.ps1 +0 -108
  555. data/vendor/pygments-main/tests/examplefiles/test.pwn +0 -253
  556. data/vendor/pygments-main/tests/examplefiles/test.pypylog +0 -1839
  557. data/vendor/pygments-main/tests/examplefiles/test.r3 +0 -114
  558. data/vendor/pygments-main/tests/examplefiles/test.rb +0 -177
  559. data/vendor/pygments-main/tests/examplefiles/test.rhtml +0 -43
  560. data/vendor/pygments-main/tests/examplefiles/test.rsl +0 -111
  561. data/vendor/pygments-main/tests/examplefiles/test.scaml +0 -8
  562. data/vendor/pygments-main/tests/examplefiles/test.ssp +0 -12
  563. data/vendor/pygments-main/tests/examplefiles/test.swift +0 -65
  564. data/vendor/pygments-main/tests/examplefiles/test.tcsh +0 -830
  565. data/vendor/pygments-main/tests/examplefiles/test.vb +0 -407
  566. data/vendor/pygments-main/tests/examplefiles/test.vhdl +0 -161
  567. data/vendor/pygments-main/tests/examplefiles/test.xqy +0 -138
  568. data/vendor/pygments-main/tests/examplefiles/test.xsl +0 -23
  569. data/vendor/pygments-main/tests/examplefiles/test.zep +0 -33
  570. data/vendor/pygments-main/tests/examplefiles/test2.pypylog +0 -120
  571. data/vendor/pygments-main/tests/examplefiles/truncated.pytb +0 -15
  572. data/vendor/pygments-main/tests/examplefiles/type.lisp +0 -1218
  573. data/vendor/pygments-main/tests/examplefiles/underscore.coffee +0 -603
  574. data/vendor/pygments-main/tests/examplefiles/unicode.applescript +0 -5
  575. data/vendor/pygments-main/tests/examplefiles/unicode.go +0 -10
  576. data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +0 -11
  577. data/vendor/pygments-main/tests/examplefiles/unix-io.lid +0 -37
  578. data/vendor/pygments-main/tests/examplefiles/vbnet_test.bas +0 -29
  579. data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +0 -4
  580. data/vendor/pygments-main/tests/examplefiles/vimrc +0 -21
  581. data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +0 -3
  582. data/vendor/pygments-main/tests/examplefiles/while.pov +0 -13
  583. data/vendor/pygments-main/tests/examplefiles/wiki.factor +0 -384
  584. data/vendor/pygments-main/tests/examplefiles/xml_example +0 -1897
  585. data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +0 -798
  586. data/vendor/pygments-main/tests/run.py +0 -44
  587. data/vendor/pygments-main/tests/string_asserts.py +0 -22
  588. data/vendor/pygments-main/tests/support.py +0 -15
  589. data/vendor/pygments-main/tests/support/tags +0 -36
  590. data/vendor/pygments-main/tests/test_basic_api.py +0 -309
  591. data/vendor/pygments-main/tests/test_cfm.py +0 -46
  592. data/vendor/pygments-main/tests/test_clexer.py +0 -236
  593. data/vendor/pygments-main/tests/test_cmdline.py +0 -106
  594. data/vendor/pygments-main/tests/test_examplefiles.py +0 -110
  595. data/vendor/pygments-main/tests/test_html_formatter.py +0 -180
  596. data/vendor/pygments-main/tests/test_latex_formatter.py +0 -57
  597. data/vendor/pygments-main/tests/test_lexers_other.py +0 -68
  598. data/vendor/pygments-main/tests/test_objectiveclexer.py +0 -81
  599. data/vendor/pygments-main/tests/test_perllexer.py +0 -137
  600. data/vendor/pygments-main/tests/test_qbasiclexer.py +0 -43
  601. data/vendor/pygments-main/tests/test_regexlexer.py +0 -54
  602. data/vendor/pygments-main/tests/test_rtf_formatter.py +0 -109
  603. data/vendor/pygments-main/tests/test_string_asserts.py +0 -39
  604. data/vendor/pygments-main/tests/test_token.py +0 -46
  605. data/vendor/pygments-main/tests/test_using_api.py +0 -40
  606. data/vendor/pygments-main/tests/test_util.py +0 -135
@@ -0,0 +1,63 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.lexers.iolang
4
+ ~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Lexers for the Io language.
7
+
8
+ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.lexer import RegexLexer
13
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
14
+ Number
15
+
16
+ __all__ = ['IoLexer']
17
+
18
+
19
+ class IoLexer(RegexLexer):
20
+ """
21
+ For `Io <http://iolanguage.com/>`_ (a small, prototype-based
22
+ programming language) source.
23
+
24
+ .. versionadded:: 0.10
25
+ """
26
+ name = 'Io'
27
+ filenames = ['*.io']
28
+ aliases = ['io']
29
+ mimetypes = ['text/x-iosrc']
30
+ tokens = {
31
+ 'root': [
32
+ (r'\n', Text),
33
+ (r'\s+', Text),
34
+ # Comments
35
+ (r'//(.*?)\n', Comment.Single),
36
+ (r'#(.*?)\n', Comment.Single),
37
+ (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
38
+ (r'/\+', Comment.Multiline, 'nestedcomment'),
39
+ # DoubleQuotedString
40
+ (r'"(\\\\|\\"|[^"])*"', String),
41
+ # Operators
42
+ (r'::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}',
43
+ Operator),
44
+ # keywords
45
+ (r'(clone|do|doFile|doString|method|for|if|else|elseif|then)\b',
46
+ Keyword),
47
+ # constants
48
+ (r'(nil|false|true)\b', Name.Constant),
49
+ # names
50
+ (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
51
+ Name.Builtin),
52
+ ('[a-zA-Z_]\w*', Name),
53
+ # numbers
54
+ (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
55
+ (r'\d+', Number.Integer)
56
+ ],
57
+ 'nestedcomment': [
58
+ (r'[^+/]+', Comment.Multiline),
59
+ (r'/\+', Comment.Multiline, '#push'),
60
+ (r'\+/', Comment.Multiline, '#pop'),
61
+ (r'[+/]', Comment.Multiline),
62
+ ]
63
+ }
@@ -0,0 +1,146 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.lexers.j
4
+ ~~~~~~~~~~~~~~~~~
5
+
6
+ Lexer for the J programming language.
7
+
8
+ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.lexer import RegexLexer, words, include
13
+ from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, \
14
+ String, Text
15
+
16
+ __all__ = ['JLexer']
17
+
18
+
19
+ class JLexer(RegexLexer):
20
+ """
21
+ For `J <http://jsoftware.com/>`_ source code.
22
+
23
+ .. versionadded:: 2.1
24
+ """
25
+
26
+ name = 'J'
27
+ aliases = ['j']
28
+ filenames = ['*.ijs']
29
+ mimetypes = ['text/x-j']
30
+
31
+ validName = r'\b[a-zA-Z]\w*'
32
+
33
+ tokens = {
34
+ 'root': [
35
+ # Shebang script
36
+ (r'#!.*$', Comment.Preproc),
37
+
38
+ # Comments
39
+ (r'NB\..*', Comment.Single),
40
+ (r'\n+\s*Note', Comment.Multiline, 'comment'),
41
+ (r'\s*Note.*', Comment.Single),
42
+
43
+ # Whitespace
44
+ (r'\s+', Text),
45
+
46
+ # Strings
47
+ (r"'", String, 'singlequote'),
48
+
49
+ # Definitions
50
+ (r'0\s+:\s*0|noun\s+define\s*$', Name.Entity, 'nounDefinition'),
51
+ (r'(([1-4]|13)\s+:\s*0|(adverb|conjunction|dyad|monad|verb)\s+define)\b',
52
+ Name.Function, 'explicitDefinition'),
53
+
54
+ # Flow Control
55
+ (words(('for_', 'goto_', 'label_'), suffix=validName+'\.'), Name.Label),
56
+ (words((
57
+ 'assert', 'break', 'case', 'catch', 'catchd',
58
+ 'catcht', 'continue', 'do', 'else', 'elseif',
59
+ 'end', 'fcase', 'for', 'if', 'return',
60
+ 'select', 'throw', 'try', 'while', 'whilst',
61
+ ), suffix='\.'), Name.Label),
62
+
63
+ # Variable Names
64
+ (validName, Name.Variable),
65
+
66
+ # Standard Library
67
+ (words((
68
+ 'ARGV', 'CR', 'CRLF', 'DEL', 'Debug',
69
+ 'EAV', 'EMPTY', 'FF', 'JVERSION', 'LF',
70
+ 'LF2', 'Note', 'TAB', 'alpha17', 'alpha27',
71
+ 'apply', 'bind', 'boxopen', 'boxxopen', 'bx',
72
+ 'clear', 'cutLF', 'cutopen', 'datatype', 'def',
73
+ 'dfh', 'drop', 'each', 'echo', 'empty',
74
+ 'erase', 'every', 'evtloop', 'exit', 'expand',
75
+ 'fetch', 'file2url', 'fixdotdot', 'fliprgb', 'getargs',
76
+ 'getenv', 'hfd', 'inv', 'inverse', 'iospath',
77
+ 'isatty', 'isutf8', 'items', 'leaf', 'list',
78
+ 'nameclass', 'namelist', 'names', 'nc',
79
+ 'nl', 'on', 'pick', 'rows',
80
+ 'script', 'scriptd', 'sign', 'sminfo', 'smoutput',
81
+ 'sort', 'split', 'stderr', 'stdin', 'stdout',
82
+ 'table', 'take', 'timespacex', 'timex', 'tmoutput',
83
+ 'toCRLF', 'toHOST', 'toJ', 'tolower', 'toupper',
84
+ 'type', 'ucp', 'ucpcount', 'usleep', 'utf8',
85
+ 'uucp',
86
+ )), Name.Function),
87
+
88
+ # Copula
89
+ (r'=[.:]', Operator),
90
+
91
+ # Builtins
92
+ (r'[-=+*#$%@!~`^&";:.,<>{}\[\]\\|/]', Operator),
93
+
94
+ # Short Keywords
95
+ (r'[abCdDeEfHiIjLMoprtT]\.', Keyword.Reserved),
96
+ (r'[aDiLpqsStux]\:', Keyword.Reserved),
97
+ (r'(_[0-9])\:', Keyword.Constant),
98
+
99
+ # Parens
100
+ (r'\(', Punctuation, 'parentheses'),
101
+
102
+ # Numbers
103
+ include('numbers'),
104
+ ],
105
+
106
+ 'comment': [
107
+ (r'[^)]', Comment.Multiline),
108
+ (r'^\)', Comment.Multiline, '#pop'),
109
+ (r'[)]', Comment.Multiline),
110
+ ],
111
+
112
+ 'explicitDefinition': [
113
+ (r'\b[nmuvxy]\b', Name.Decorator),
114
+ include('root'),
115
+ (r'[^)]', Name),
116
+ (r'^\)', Name.Label, '#pop'),
117
+ (r'[)]', Name),
118
+ ],
119
+
120
+ 'numbers': [
121
+ (r'\b_{1,2}\b', Number),
122
+ (r'_?\d+(\.\d+)?(\s*[ejr]\s*)_?\d+(\.?=\d+)?', Number),
123
+ (r'_?\d+\.(?=\d+)', Number.Float),
124
+ (r'_?\d+x', Number.Integer.Long),
125
+ (r'_?\d+', Number.Integer),
126
+ ],
127
+
128
+ 'nounDefinition': [
129
+ (r'[^)]', String),
130
+ (r'^\)', Name.Label, '#pop'),
131
+ (r'[)]', String),
132
+ ],
133
+
134
+ 'parentheses': [
135
+ (r'\)', Punctuation, '#pop'),
136
+ # include('nounDefinition'),
137
+ include('explicitDefinition'),
138
+ include('root'),
139
+ ],
140
+
141
+ 'singlequote': [
142
+ (r"[^']", String),
143
+ (r"''", String),
144
+ (r"'", String, '#pop'),
145
+ ],
146
+ }
@@ -0,0 +1,1506 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.lexers.javascript
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Lexers for JavaScript and related languages.
7
+
8
+ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ import re
13
+
14
+ from pygments.lexer import RegexLexer, include, bygroups, default, using, \
15
+ this, words, combined
16
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
17
+ Number, Punctuation, Other
18
+ from pygments.util import get_bool_opt, iteritems
19
+ import pygments.unistring as uni
20
+
21
+ __all__ = ['JavascriptLexer', 'KalLexer', 'LiveScriptLexer', 'DartLexer',
22
+ 'TypeScriptLexer', 'LassoLexer', 'ObjectiveJLexer',
23
+ 'CoffeeScriptLexer', 'MaskLexer', 'EarlGreyLexer', 'JuttleLexer']
24
+
25
+ JS_IDENT_START = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') +
26
+ ']|\\\\u[a-fA-F0-9]{4})')
27
+ JS_IDENT_PART = ('(?:[$' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
28
+ 'Mn', 'Mc', 'Nd', 'Pc') +
29
+ u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})')
30
+ JS_IDENT = JS_IDENT_START + '(?:' + JS_IDENT_PART + ')*'
31
+
32
+
33
+ class JavascriptLexer(RegexLexer):
34
+ """
35
+ For JavaScript source code.
36
+ """
37
+
38
+ name = 'JavaScript'
39
+ aliases = ['js', 'javascript']
40
+ filenames = ['*.js', '*.jsm']
41
+ mimetypes = ['application/javascript', 'application/x-javascript',
42
+ 'text/x-javascript', 'text/javascript']
43
+
44
+ flags = re.DOTALL | re.UNICODE | re.MULTILINE
45
+
46
+ tokens = {
47
+ 'commentsandwhitespace': [
48
+ (r'\s+', Text),
49
+ (r'<!--', Comment),
50
+ (r'//.*?\n', Comment.Single),
51
+ (r'/\*.*?\*/', Comment.Multiline)
52
+ ],
53
+ 'slashstartsregex': [
54
+ include('commentsandwhitespace'),
55
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
56
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
57
+ (r'(?=/)', Text, ('#pop', 'badregex')),
58
+ default('#pop')
59
+ ],
60
+ 'badregex': [
61
+ (r'\n', Text, '#pop')
62
+ ],
63
+ 'root': [
64
+ (r'\A#! ?/.*?\n', Comment.Hashbang), # recognized by node.js
65
+ (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
66
+ include('commentsandwhitespace'),
67
+ (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
68
+ r'(<<|>>>?|=>|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
69
+ (r'\.\.\.', Punctuation),
70
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
71
+ (r'[})\].]', Punctuation),
72
+ (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
73
+ r'throw|try|catch|finally|new|delete|typeof|instanceof|void|yield|'
74
+ r'this|of)\b', Keyword, 'slashstartsregex'),
75
+ (r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
76
+ (r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
77
+ r'extends|final|float|goto|implements|import|int|interface|long|native|'
78
+ r'package|private|protected|public|short|static|super|synchronized|throws|'
79
+ r'transient|volatile)\b', Keyword.Reserved),
80
+ (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
81
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
82
+ r'Number|Object|Packages|RegExp|String|Promise|Proxy|sun|decodeURI|'
83
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
84
+ r'Error|eval|isFinite|isNaN|isSafeInteger|parseFloat|parseInt|'
85
+ r'document|this|window)\b', Name.Builtin),
86
+ (JS_IDENT, Name.Other),
87
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
88
+ (r'0b[01]+', Number.Bin),
89
+ (r'0o[0-7]+', Number.Oct),
90
+ (r'0x[0-9a-fA-F]+', Number.Hex),
91
+ (r'[0-9]+', Number.Integer),
92
+ (r'"(\\\\|\\"|[^"])*"', String.Double),
93
+ (r"'(\\\\|\\'|[^'])*'", String.Single),
94
+ (r'`', String.Backtick, 'interp'),
95
+ ],
96
+ 'interp': [
97
+ (r'`', String.Backtick, '#pop'),
98
+ (r'\\\\', String.Backtick),
99
+ (r'\\`', String.Backtick),
100
+ (r'\$\{', String.Interpol, 'interp-inside'),
101
+ (r'\$', String.Backtick),
102
+ (r'[^`\\$]+', String.Backtick),
103
+ ],
104
+ 'interp-inside': [
105
+ # TODO: should this include single-line comments and allow nesting strings?
106
+ (r'\}', String.Interpol, '#pop'),
107
+ include('root'),
108
+ ],
109
+ # (\\\\|\\`|[^`])*`', String.Backtick),
110
+ }
111
+
112
+
113
+ class KalLexer(RegexLexer):
114
+ """
115
+ For `Kal`_ source code.
116
+
117
+ .. _Kal: http://rzimmerman.github.io/kal
118
+
119
+
120
+ .. versionadded:: 2.0
121
+ """
122
+
123
+ name = 'Kal'
124
+ aliases = ['kal']
125
+ filenames = ['*.kal']
126
+ mimetypes = ['text/kal', 'application/kal']
127
+
128
+ flags = re.DOTALL
129
+ tokens = {
130
+ 'commentsandwhitespace': [
131
+ (r'\s+', Text),
132
+ (r'###[^#].*?###', Comment.Multiline),
133
+ (r'#(?!##[^#]).*?\n', Comment.Single),
134
+ ],
135
+ 'functiondef': [
136
+ (r'[$a-zA-Z_][\w$]*\s*', Name.Function, '#pop'),
137
+ include('commentsandwhitespace'),
138
+ ],
139
+ 'classdef': [
140
+ (r'\binherits\s+from\b', Keyword),
141
+ (r'[$a-zA-Z_][\w$]*\s*\n', Name.Class, '#pop'),
142
+ (r'[$a-zA-Z_][\w$]*\s*', Name.Class),
143
+ include('commentsandwhitespace'),
144
+ ],
145
+ 'listcomprehension': [
146
+ (r'\]', Punctuation, '#pop'),
147
+ (r'\b(property|value)\b', Keyword),
148
+ include('root'),
149
+ ],
150
+ 'waitfor': [
151
+ (r'\n', Punctuation, '#pop'),
152
+ (r'\bfrom\b', Keyword),
153
+ include('root'),
154
+ ],
155
+ 'root': [
156
+ include('commentsandwhitespace'),
157
+ (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
158
+ r'([gim]+\b|\B)', String.Regex),
159
+ (r'\?|:|_(?=\n)|==?|!=|-(?!>)|[<>+*/-]=?',
160
+ Operator),
161
+ (r'\b(and|or|isnt|is|not|but|bitwise|mod|\^|xor|exists|'
162
+ r'doesnt\s+exist)\b', Operator.Word),
163
+ (r'(?:\([^()]+\))?\s*>', Name.Function),
164
+ (r'[{(]', Punctuation),
165
+ (r'\[', Punctuation, 'listcomprehension'),
166
+ (r'[})\].,]', Punctuation),
167
+ (r'\b(function|method|task)\b', Keyword.Declaration, 'functiondef'),
168
+ (r'\bclass\b', Keyword.Declaration, 'classdef'),
169
+ (r'\b(safe\s+)?wait\s+for\b', Keyword, 'waitfor'),
170
+ (r'\b(me|this)(\.[$a-zA-Z_][\w.$]*)?\b', Name.Variable.Instance),
171
+ (r'(?<![.$])(for(\s+(parallel|series))?|in|of|while|until|'
172
+ r'break|return|continue|'
173
+ r'when|if|unless|else|otherwise|except\s+when|'
174
+ r'throw|raise|fail\s+with|try|catch|finally|new|delete|'
175
+ r'typeof|instanceof|super|run\s+in\s+parallel|'
176
+ r'inherits\s+from)\b', Keyword),
177
+ (r'(?<![.$])(true|false|yes|no|on|off|null|nothing|none|'
178
+ r'NaN|Infinity|undefined)\b',
179
+ Keyword.Constant),
180
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
181
+ r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
182
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
183
+ r'eval|isFinite|isNaN|isSafeInteger|parseFloat|parseInt|document|'
184
+ r'window|'
185
+ r'print)\b',
186
+ Name.Builtin),
187
+ (r'[$a-zA-Z_][\w.$]*\s*(:|[+\-*/]?\=)?\b', Name.Variable),
188
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
189
+ (r'0x[0-9a-fA-F]+', Number.Hex),
190
+ (r'[0-9]+', Number.Integer),
191
+ ('"""', String, 'tdqs'),
192
+ ("'''", String, 'tsqs'),
193
+ ('"', String, 'dqs'),
194
+ ("'", String, 'sqs'),
195
+ ],
196
+ 'strings': [
197
+ (r'[^#\\\'"]+', String),
198
+ # note that all kal strings are multi-line.
199
+ # hashmarks, quotes and backslashes must be parsed one at a time
200
+ ],
201
+ 'interpoling_string': [
202
+ (r'\}', String.Interpol, "#pop"),
203
+ include('root')
204
+ ],
205
+ 'dqs': [
206
+ (r'"', String, '#pop'),
207
+ (r'\\.|\'', String), # double-quoted string don't need ' escapes
208
+ (r'#\{', String.Interpol, "interpoling_string"),
209
+ include('strings')
210
+ ],
211
+ 'sqs': [
212
+ (r"'", String, '#pop'),
213
+ (r'#|\\.|"', String), # single quoted strings don't need " escapses
214
+ include('strings')
215
+ ],
216
+ 'tdqs': [
217
+ (r'"""', String, '#pop'),
218
+ (r'\\.|\'|"', String), # no need to escape quotes in triple-string
219
+ (r'#\{', String.Interpol, "interpoling_string"),
220
+ include('strings'),
221
+ ],
222
+ 'tsqs': [
223
+ (r"'''", String, '#pop'),
224
+ (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
225
+ include('strings')
226
+ ],
227
+ }
228
+
229
+
230
+ class LiveScriptLexer(RegexLexer):
231
+ """
232
+ For `LiveScript`_ source code.
233
+
234
+ .. _LiveScript: http://gkz.github.com/LiveScript/
235
+
236
+ .. versionadded:: 1.6
237
+ """
238
+
239
+ name = 'LiveScript'
240
+ aliases = ['live-script', 'livescript']
241
+ filenames = ['*.ls']
242
+ mimetypes = ['text/livescript']
243
+
244
+ flags = re.DOTALL
245
+ tokens = {
246
+ 'commentsandwhitespace': [
247
+ (r'\s+', Text),
248
+ (r'/\*.*?\*/', Comment.Multiline),
249
+ (r'#.*?\n', Comment.Single),
250
+ ],
251
+ 'multilineregex': [
252
+ include('commentsandwhitespace'),
253
+ (r'//([gim]+\b|\B)', String.Regex, '#pop'),
254
+ (r'/', String.Regex),
255
+ (r'[^/#]+', String.Regex)
256
+ ],
257
+ 'slashstartsregex': [
258
+ include('commentsandwhitespace'),
259
+ (r'//', String.Regex, ('#pop', 'multilineregex')),
260
+ (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
261
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
262
+ default('#pop'),
263
+ ],
264
+ 'root': [
265
+ # this next expr leads to infinite loops root -> slashstartsregex
266
+ # (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
267
+ include('commentsandwhitespace'),
268
+ (r'(?:\([^()]+\))?[ ]*[~-]{1,2}>|'
269
+ r'(?:\(?[^()\n]+\)?)?[ ]*<[~-]{1,2}', Name.Function),
270
+ (r'\+\+|&&|(?<![.$])\b(?:and|x?or|is|isnt|not)\b|\?|:|=|'
271
+ r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|'
272
+ r'~(?!\~?>)|-(?!\-?>)|<(?!\[)|(?<!\])>|'
273
+ r'[+*`%&|^/])=?',
274
+ Operator, 'slashstartsregex'),
275
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
276
+ (r'[})\].]', Punctuation),
277
+ (r'(?<![.$])(for|own|in|of|while|until|loop|break|'
278
+ r'return|continue|switch|when|then|if|unless|else|'
279
+ r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
280
+ r'extends|this|class|by|const|var|to|til)\b', Keyword,
281
+ 'slashstartsregex'),
282
+ (r'(?<![.$])(true|false|yes|no|on|off|'
283
+ r'null|NaN|Infinity|undefined|void)\b',
284
+ Keyword.Constant),
285
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
286
+ r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
287
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
288
+ r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b',
289
+ Name.Builtin),
290
+ (r'[$a-zA-Z_][\w.\-:$]*\s*[:=]\s', Name.Variable,
291
+ 'slashstartsregex'),
292
+ (r'@[$a-zA-Z_][\w.\-:$]*\s*[:=]\s', Name.Variable.Instance,
293
+ 'slashstartsregex'),
294
+ (r'@', Name.Other, 'slashstartsregex'),
295
+ (r'@?[$a-zA-Z_][\w-]*', Name.Other, 'slashstartsregex'),
296
+ (r'[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?(?:[a-zA-Z_]+)?', Number.Float),
297
+ (r'[0-9]+(~[0-9a-z]+)?(?:[a-zA-Z_]+)?', Number.Integer),
298
+ ('"""', String, 'tdqs'),
299
+ ("'''", String, 'tsqs'),
300
+ ('"', String, 'dqs'),
301
+ ("'", String, 'sqs'),
302
+ (r'\\\S+', String),
303
+ (r'<\[.*?\]>', String),
304
+ ],
305
+ 'strings': [
306
+ (r'[^#\\\'"]+', String),
307
+ # note that all coffee script strings are multi-line.
308
+ # hashmarks, quotes and backslashes must be parsed one at a time
309
+ ],
310
+ 'interpoling_string': [
311
+ (r'\}', String.Interpol, "#pop"),
312
+ include('root')
313
+ ],
314
+ 'dqs': [
315
+ (r'"', String, '#pop'),
316
+ (r'\\.|\'', String), # double-quoted string don't need ' escapes
317
+ (r'#\{', String.Interpol, "interpoling_string"),
318
+ (r'#', String),
319
+ include('strings')
320
+ ],
321
+ 'sqs': [
322
+ (r"'", String, '#pop'),
323
+ (r'#|\\.|"', String), # single quoted strings don't need " escapses
324
+ include('strings')
325
+ ],
326
+ 'tdqs': [
327
+ (r'"""', String, '#pop'),
328
+ (r'\\.|\'|"', String), # no need to escape quotes in triple-string
329
+ (r'#\{', String.Interpol, "interpoling_string"),
330
+ (r'#', String),
331
+ include('strings'),
332
+ ],
333
+ 'tsqs': [
334
+ (r"'''", String, '#pop'),
335
+ (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
336
+ include('strings')
337
+ ],
338
+ }
339
+
340
+
341
+ class DartLexer(RegexLexer):
342
+ """
343
+ For `Dart <http://dartlang.org/>`_ source code.
344
+
345
+ .. versionadded:: 1.5
346
+ """
347
+
348
+ name = 'Dart'
349
+ aliases = ['dart']
350
+ filenames = ['*.dart']
351
+ mimetypes = ['text/x-dart']
352
+
353
+ flags = re.MULTILINE | re.DOTALL
354
+
355
+ tokens = {
356
+ 'root': [
357
+ include('string_literal'),
358
+ (r'#!(.*?)$', Comment.Preproc),
359
+ (r'\b(import|export)\b', Keyword, 'import_decl'),
360
+ (r'\b(library|source|part of|part)\b', Keyword),
361
+ (r'[^\S\n]+', Text),
362
+ (r'//.*?\n', Comment.Single),
363
+ (r'/\*.*?\*/', Comment.Multiline),
364
+ (r'\b(class)\b(\s+)',
365
+ bygroups(Keyword.Declaration, Text), 'class'),
366
+ (r'\b(assert|break|case|catch|continue|default|do|else|finally|for|'
367
+ r'if|in|is|new|return|super|switch|this|throw|try|while)\b',
368
+ Keyword),
369
+ (r'\b(abstract|const|extends|factory|final|get|implements|'
370
+ r'native|operator|set|static|typedef|var)\b', Keyword.Declaration),
371
+ (r'\b(bool|double|Dynamic|int|num|Object|String|void)\b', Keyword.Type),
372
+ (r'\b(false|null|true)\b', Keyword.Constant),
373
+ (r'[~!%^&*+=|?:<>/-]|as\b', Operator),
374
+ (r'[a-zA-Z_$]\w*:', Name.Label),
375
+ (r'[a-zA-Z_$]\w*', Name),
376
+ (r'[(){}\[\],.;]', Punctuation),
377
+ (r'0[xX][0-9a-fA-F]+', Number.Hex),
378
+ # DIGIT+ (‘.’ DIGIT*)? EXPONENT?
379
+ (r'\d+(\.\d*)?([eE][+-]?\d+)?', Number),
380
+ (r'\.\d+([eE][+-]?\d+)?', Number), # ‘.’ DIGIT+ EXPONENT?
381
+ (r'\n', Text)
382
+ # pseudo-keyword negate intentionally left out
383
+ ],
384
+ 'class': [
385
+ (r'[a-zA-Z_$]\w*', Name.Class, '#pop')
386
+ ],
387
+ 'import_decl': [
388
+ include('string_literal'),
389
+ (r'\s+', Text),
390
+ (r'\b(as|show|hide)\b', Keyword),
391
+ (r'[a-zA-Z_$]\w*', Name),
392
+ (r'\,', Punctuation),
393
+ (r'\;', Punctuation, '#pop')
394
+ ],
395
+ 'string_literal': [
396
+ # Raw strings.
397
+ (r'r"""([\w\W]*?)"""', String.Double),
398
+ (r"r'''([\w\W]*?)'''", String.Single),
399
+ (r'r"(.*?)"', String.Double),
400
+ (r"r'(.*?)'", String.Single),
401
+ # Normal Strings.
402
+ (r'"""', String.Double, 'string_double_multiline'),
403
+ (r"'''", String.Single, 'string_single_multiline'),
404
+ (r'"', String.Double, 'string_double'),
405
+ (r"'", String.Single, 'string_single')
406
+ ],
407
+ 'string_common': [
408
+ (r"\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]*\}|[a-z'\"$\\])",
409
+ String.Escape),
410
+ (r'(\$)([a-zA-Z_]\w*)', bygroups(String.Interpol, Name)),
411
+ (r'(\$\{)(.*?)(\})',
412
+ bygroups(String.Interpol, using(this), String.Interpol))
413
+ ],
414
+ 'string_double': [
415
+ (r'"', String.Double, '#pop'),
416
+ (r'[^"$\\\n]+', String.Double),
417
+ include('string_common'),
418
+ (r'\$+', String.Double)
419
+ ],
420
+ 'string_double_multiline': [
421
+ (r'"""', String.Double, '#pop'),
422
+ (r'[^"$\\]+', String.Double),
423
+ include('string_common'),
424
+ (r'(\$|\")+', String.Double)
425
+ ],
426
+ 'string_single': [
427
+ (r"'", String.Single, '#pop'),
428
+ (r"[^'$\\\n]+", String.Single),
429
+ include('string_common'),
430
+ (r'\$+', String.Single)
431
+ ],
432
+ 'string_single_multiline': [
433
+ (r"'''", String.Single, '#pop'),
434
+ (r'[^\'$\\]+', String.Single),
435
+ include('string_common'),
436
+ (r'(\$|\')+', String.Single)
437
+ ]
438
+ }
439
+
440
+
441
+ class TypeScriptLexer(RegexLexer):
442
+ """
443
+ For `TypeScript <http://typescriptlang.org/>`_ source code.
444
+
445
+ .. versionadded:: 1.6
446
+ """
447
+
448
+ name = 'TypeScript'
449
+ aliases = ['ts', 'typescript']
450
+ filenames = ['*.ts']
451
+ mimetypes = ['text/x-typescript']
452
+
453
+ flags = re.DOTALL | re.MULTILINE
454
+
455
+ tokens = {
456
+ 'commentsandwhitespace': [
457
+ (r'\s+', Text),
458
+ (r'<!--', Comment),
459
+ (r'//.*?\n', Comment.Single),
460
+ (r'/\*.*?\*/', Comment.Multiline)
461
+ ],
462
+ 'slashstartsregex': [
463
+ include('commentsandwhitespace'),
464
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
465
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
466
+ (r'(?=/)', Text, ('#pop', 'badregex')),
467
+ default('#pop')
468
+ ],
469
+ 'badregex': [
470
+ (r'\n', Text, '#pop')
471
+ ],
472
+ 'root': [
473
+ (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
474
+ include('commentsandwhitespace'),
475
+ (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
476
+ r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
477
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
478
+ (r'[})\].]', Punctuation),
479
+ (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
480
+ r'throw|try|catch|finally|new|delete|typeof|instanceof|void|'
481
+ r'this)\b', Keyword, 'slashstartsregex'),
482
+ (r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
483
+ (r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
484
+ r'extends|final|float|goto|implements|import|int|interface|long|native|'
485
+ r'package|private|protected|public|short|static|super|synchronized|throws|'
486
+ r'transient|volatile)\b', Keyword.Reserved),
487
+ (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
488
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
489
+ r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
490
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
491
+ r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
492
+ r'window)\b', Name.Builtin),
493
+ # Match stuff like: module name {...}
494
+ (r'\b(module)(\s*)(\s*[\w?.$][\w?.$]*)(\s*)',
495
+ bygroups(Keyword.Reserved, Text, Name.Other, Text), 'slashstartsregex'),
496
+ # Match variable type keywords
497
+ (r'\b(string|bool|number)\b', Keyword.Type),
498
+ # Match stuff like: constructor
499
+ (r'\b(constructor|declare|interface|as|AS)\b', Keyword.Reserved),
500
+ # Match stuff like: super(argument, list)
501
+ (r'(super)(\s*)(\([\w,?.$\s]+\s*\))',
502
+ bygroups(Keyword.Reserved, Text), 'slashstartsregex'),
503
+ # Match stuff like: function() {...}
504
+ (r'([a-zA-Z_?.$][\w?.$]*)\(\) \{', Name.Other, 'slashstartsregex'),
505
+ # Match stuff like: (function: return type)
506
+ (r'([\w?.$][\w?.$]*)(\s*:\s*)([\w?.$][\w?.$]*)',
507
+ bygroups(Name.Other, Text, Keyword.Type)),
508
+ (r'[$a-zA-Z_]\w*', Name.Other),
509
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
510
+ (r'0x[0-9a-fA-F]+', Number.Hex),
511
+ (r'[0-9]+', Number.Integer),
512
+ (r'"(\\\\|\\"|[^"])*"', String.Double),
513
+ (r"'(\\\\|\\'|[^'])*'", String.Single),
514
+ # Match stuff like: Decorators
515
+ (r'@\w+', Keyword.Declaration),
516
+ ]
517
+ }
518
+
519
+
520
+ class LassoLexer(RegexLexer):
521
+ """
522
+ For `Lasso <http://www.lassosoft.com/>`_ source code, covering both Lasso 9
523
+ syntax and LassoScript for Lasso 8.6 and earlier. For Lasso embedded in
524
+ HTML, use the `LassoHtmlLexer`.
525
+
526
+ Additional options accepted:
527
+
528
+ `builtinshighlighting`
529
+ If given and ``True``, highlight builtin types, traits, methods, and
530
+ members (default: ``True``).
531
+ `requiredelimiters`
532
+ If given and ``True``, only highlight code between delimiters as Lasso
533
+ (default: ``False``).
534
+
535
+ .. versionadded:: 1.6
536
+ """
537
+
538
+ name = 'Lasso'
539
+ aliases = ['lasso', 'lassoscript']
540
+ filenames = ['*.lasso', '*.lasso[89]']
541
+ alias_filenames = ['*.incl', '*.inc', '*.las']
542
+ mimetypes = ['text/x-lasso']
543
+ flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
544
+
545
+ tokens = {
546
+ 'root': [
547
+ (r'^#![ \S]+lasso9\b', Comment.Preproc, 'lasso'),
548
+ (r'\[no_square_brackets\]', Comment.Preproc, 'nosquarebrackets'),
549
+ (r'\[noprocess\]', Comment.Preproc, ('delimiters', 'noprocess')),
550
+ (r'\[', Comment.Preproc, ('delimiters', 'squarebrackets')),
551
+ (r'<\?(LassoScript|lasso|=)', Comment.Preproc,
552
+ ('delimiters', 'anglebrackets')),
553
+ (r'<(!--.*?-->)?', Other, 'delimiters'),
554
+ (r'\s+', Other),
555
+ default(('delimiters', 'lassofile')),
556
+ ],
557
+ 'delimiters': [
558
+ (r'\[no_square_brackets\]', Comment.Preproc, 'nosquarebrackets'),
559
+ (r'\[noprocess\]', Comment.Preproc, 'noprocess'),
560
+ (r'\[', Comment.Preproc, 'squarebrackets'),
561
+ (r'<\?(LassoScript|lasso|=)', Comment.Preproc, 'anglebrackets'),
562
+ (r'<(!--.*?-->)?', Other),
563
+ (r'[^[<]+', Other),
564
+ ],
565
+ 'nosquarebrackets': [
566
+ (r'\[noprocess\]', Comment.Preproc, 'noprocess'),
567
+ (r'\[', Other),
568
+ (r'<\?(LassoScript|lasso|=)', Comment.Preproc, 'anglebrackets'),
569
+ (r'<(!--.*?-->)?', Other),
570
+ (r'[^[<]+', Other),
571
+ ],
572
+ 'noprocess': [
573
+ (r'\[/noprocess\]', Comment.Preproc, '#pop'),
574
+ (r'\[', Other),
575
+ (r'[^[]', Other),
576
+ ],
577
+ 'squarebrackets': [
578
+ (r'\]', Comment.Preproc, '#pop'),
579
+ include('lasso'),
580
+ ],
581
+ 'anglebrackets': [
582
+ (r'\?>', Comment.Preproc, '#pop'),
583
+ include('lasso'),
584
+ ],
585
+ 'lassofile': [
586
+ (r'\]|\?>', Comment.Preproc, '#pop'),
587
+ include('lasso'),
588
+ ],
589
+ 'whitespacecomments': [
590
+ (r'\s+', Text),
591
+ (r'//.*?\n', Comment.Single),
592
+ (r'/\*\*!.*?\*/', String.Doc),
593
+ (r'/\*.*?\*/', Comment.Multiline),
594
+ ],
595
+ 'lasso': [
596
+ # whitespace/comments
597
+ include('whitespacecomments'),
598
+
599
+ # literals
600
+ (r'\d*\.\d+(e[+-]?\d+)?', Number.Float),
601
+ (r'0x[\da-f]+', Number.Hex),
602
+ (r'\d+', Number.Integer),
603
+ (r'(infinity|NaN)\b', Number),
604
+ (r"'", String.Single, 'singlestring'),
605
+ (r'"', String.Double, 'doublestring'),
606
+ (r'`[^`]*`', String.Backtick),
607
+
608
+ # names
609
+ (r'\$[a-z_][\w.]*', Name.Variable),
610
+ (r'#([a-z_][\w.]*|\d+)', Name.Variable.Instance),
611
+ (r"(\.\s*)('[a-z_][\w.]*')",
612
+ bygroups(Name.Builtin.Pseudo, Name.Variable.Class)),
613
+ (r"(self)(\s*->\s*)('[a-z_][\w.]*')",
614
+ bygroups(Name.Builtin.Pseudo, Operator, Name.Variable.Class)),
615
+ (r'(\.\.?\s*)([a-z_][\w.]*(=(?!=))?)',
616
+ bygroups(Name.Builtin.Pseudo, Name.Other.Member)),
617
+ (r'(->\\?\s*|&\s*)([a-z_][\w.]*(=(?!=))?)',
618
+ bygroups(Operator, Name.Other.Member)),
619
+ (r'(?<!->)(self|inherited|currentcapture|givenblock)\b',
620
+ Name.Builtin.Pseudo),
621
+ (r'-(?!infinity)[a-z_][\w.]*', Name.Attribute),
622
+ (r'::\s*[a-z_][\w.]*', Name.Label),
623
+ (r'(error_(code|msg)_\w+|Error_AddError|Error_ColumnRestriction|'
624
+ r'Error_DatabaseConnectionUnavailable|Error_DatabaseTimeout|'
625
+ r'Error_DeleteError|Error_FieldRestriction|Error_FileNotFound|'
626
+ r'Error_InvalidDatabase|Error_InvalidPassword|'
627
+ r'Error_InvalidUsername|Error_ModuleNotFound|'
628
+ r'Error_NoError|Error_NoPermission|Error_OutOfMemory|'
629
+ r'Error_ReqColumnMissing|Error_ReqFieldMissing|'
630
+ r'Error_RequiredColumnMissing|Error_RequiredFieldMissing|'
631
+ r'Error_UpdateError)\b', Name.Exception),
632
+
633
+ # definitions
634
+ (r'(define)(\s+)([a-z_][\w.]*)(\s*=>\s*)(type|trait|thread)\b',
635
+ bygroups(Keyword.Declaration, Text, Name.Class, Operator, Keyword)),
636
+ (r'(define)(\s+)([a-z_][\w.]*)(\s*->\s*)([a-z_][\w.]*=?|[-+*/%])',
637
+ bygroups(Keyword.Declaration, Text, Name.Class, Operator,
638
+ Name.Function), 'signature'),
639
+ (r'(define)(\s+)([a-z_][\w.]*)',
640
+ bygroups(Keyword.Declaration, Text, Name.Function), 'signature'),
641
+ (r'(public|protected|private|provide)(\s+)(([a-z_][\w.]*=?|[-+*/%])'
642
+ r'(?=\s*\())', bygroups(Keyword, Text, Name.Function),
643
+ 'signature'),
644
+ (r'(public|protected|private|provide)(\s+)([a-z_][\w.]*)',
645
+ bygroups(Keyword, Text, Name.Function)),
646
+
647
+ # keywords
648
+ (r'(true|false|none|minimal|full|all|void)\b', Keyword.Constant),
649
+ (r'(local|var|variable|global|data(?=\s))\b', Keyword.Declaration),
650
+ (r'(array|date|decimal|duration|integer|map|pair|string|tag|xml|'
651
+ r'null|boolean|bytes|keyword|list|locale|queue|set|stack|'
652
+ r'staticarray)\b', Keyword.Type),
653
+ (r'([a-z_][\w.]*)(\s+)(in)\b', bygroups(Name, Text, Keyword)),
654
+ (r'(let|into)(\s+)([a-z_][\w.]*)', bygroups(Keyword, Text, Name)),
655
+ (r'require\b', Keyword, 'requiresection'),
656
+ (r'(/?)(Namespace_Using)\b', bygroups(Punctuation, Keyword.Namespace)),
657
+ (r'(/?)(Cache|Database_Names|Database_SchemaNames|'
658
+ r'Database_TableNames|Define_Tag|Define_Type|Email_Batch|'
659
+ r'Encode_Set|HTML_Comment|Handle|Handle_Error|Header|If|Inline|'
660
+ r'Iterate|LJAX_Target|Link|Link_CurrentAction|Link_CurrentGroup|'
661
+ r'Link_CurrentRecord|Link_Detail|Link_FirstGroup|'
662
+ r'Link_FirstRecord|Link_LastGroup|Link_LastRecord|Link_NextGroup|'
663
+ r'Link_NextRecord|Link_PrevGroup|Link_PrevRecord|Log|Loop|'
664
+ r'NoProcess|Output_None|Portal|Private|Protect|Records|Referer|'
665
+ r'Referrer|Repeating|ResultSet|Rows|Search_Args|Search_Arguments|'
666
+ r'Select|Sort_Args|Sort_Arguments|Thread_Atomic|Value_List|While|'
667
+ r'Abort|Case|Else|If_Empty|If_False|If_Null|If_True|Loop_Abort|'
668
+ r'Loop_Continue|Loop_Count|Params|Params_Up|Return|Return_Value|'
669
+ r'Run_Children|SOAP_DefineTag|SOAP_LastRequest|SOAP_LastResponse|'
670
+ r'Tag_Name|ascending|average|by|define|descending|do|equals|'
671
+ r'frozen|group|handle_failure|import|in|into|join|let|match|max|'
672
+ r'min|on|order|parent|protected|provide|public|require|returnhome|'
673
+ r'skip|split_thread|sum|take|thread|to|trait|type|where|with|'
674
+ r'yield|yieldhome)\b',
675
+ bygroups(Punctuation, Keyword)),
676
+
677
+ # other
678
+ (r',', Punctuation, 'commamember'),
679
+ (r'(and|or|not)\b', Operator.Word),
680
+ (r'([a-z_][\w.]*)(\s*::\s*[a-z_][\w.]*)?(\s*=(?!=))',
681
+ bygroups(Name, Name.Label, Operator)),
682
+ (r'(/?)([\w.]+)', bygroups(Punctuation, Name.Other)),
683
+ (r'(=)(n?bw|n?ew|n?cn|lte?|gte?|n?eq|n?rx|ft)\b',
684
+ bygroups(Operator, Operator.Word)),
685
+ (r':=|[-+*/%=<>&|!?\\]+', Operator),
686
+ (r'[{}():;,@^]', Punctuation),
687
+ ],
688
+ 'singlestring': [
689
+ (r"'", String.Single, '#pop'),
690
+ (r"[^'\\]+", String.Single),
691
+ include('escape'),
692
+ (r"\\", String.Single),
693
+ ],
694
+ 'doublestring': [
695
+ (r'"', String.Double, '#pop'),
696
+ (r'[^"\\]+', String.Double),
697
+ include('escape'),
698
+ (r'\\', String.Double),
699
+ ],
700
+ 'escape': [
701
+ (r'\\(U[\da-f]{8}|u[\da-f]{4}|x[\da-f]{1,2}|[0-7]{1,3}|:[^:\n\r]+:|'
702
+ r'[abefnrtv?"\'\\]|$)', String.Escape),
703
+ ],
704
+ 'signature': [
705
+ (r'=>', Operator, '#pop'),
706
+ (r'\)', Punctuation, '#pop'),
707
+ (r'[(,]', Punctuation, 'parameter'),
708
+ include('lasso'),
709
+ ],
710
+ 'parameter': [
711
+ (r'\)', Punctuation, '#pop'),
712
+ (r'-?[a-z_][\w.]*', Name.Attribute, '#pop'),
713
+ (r'\.\.\.', Name.Builtin.Pseudo),
714
+ include('lasso'),
715
+ ],
716
+ 'requiresection': [
717
+ (r'(([a-z_][\w.]*=?|[-+*/%])(?=\s*\())', Name, 'requiresignature'),
718
+ (r'(([a-z_][\w.]*=?|[-+*/%])(?=(\s*::\s*[\w.]+)?\s*,))', Name),
719
+ (r'[a-z_][\w.]*=?|[-+*/%]', Name, '#pop'),
720
+ (r'::\s*[a-z_][\w.]*', Name.Label),
721
+ (r',', Punctuation),
722
+ include('whitespacecomments'),
723
+ ],
724
+ 'requiresignature': [
725
+ (r'(\)(?=(\s*::\s*[\w.]+)?\s*,))', Punctuation, '#pop'),
726
+ (r'\)', Punctuation, '#pop:2'),
727
+ (r'-?[a-z_][\w.]*', Name.Attribute),
728
+ (r'::\s*[a-z_][\w.]*', Name.Label),
729
+ (r'\.\.\.', Name.Builtin.Pseudo),
730
+ (r'[(,]', Punctuation),
731
+ include('whitespacecomments'),
732
+ ],
733
+ 'commamember': [
734
+ (r'(([a-z_][\w.]*=?|[-+*/%])'
735
+ r'(?=\s*(\(([^()]*\([^()]*\))*[^)]*\)\s*)?(::[\w.\s]+)?=>))',
736
+ Name.Function, 'signature'),
737
+ include('whitespacecomments'),
738
+ default('#pop'),
739
+ ],
740
+ }
741
+
742
+ def __init__(self, **options):
743
+ self.builtinshighlighting = get_bool_opt(
744
+ options, 'builtinshighlighting', True)
745
+ self.requiredelimiters = get_bool_opt(
746
+ options, 'requiredelimiters', False)
747
+
748
+ self._builtins = set()
749
+ self._members = set()
750
+ if self.builtinshighlighting:
751
+ from pygments.lexers._lasso_builtins import BUILTINS, MEMBERS
752
+ for key, value in iteritems(BUILTINS):
753
+ self._builtins.update(value)
754
+ for key, value in iteritems(MEMBERS):
755
+ self._members.update(value)
756
+ RegexLexer.__init__(self, **options)
757
+
758
+ def get_tokens_unprocessed(self, text):
759
+ stack = ['root']
760
+ if self.requiredelimiters:
761
+ stack.append('delimiters')
762
+ for index, token, value in \
763
+ RegexLexer.get_tokens_unprocessed(self, text, stack):
764
+ if (token is Name.Other and value.lower() in self._builtins or
765
+ token is Name.Other.Member and
766
+ value.lower().rstrip('=') in self._members):
767
+ yield index, Name.Builtin, value
768
+ continue
769
+ yield index, token, value
770
+
771
+ def analyse_text(text):
772
+ rv = 0.0
773
+ if 'bin/lasso9' in text:
774
+ rv += 0.8
775
+ if re.search(r'<\?lasso', text, re.I):
776
+ rv += 0.4
777
+ if re.search(r'local\(', text, re.I):
778
+ rv += 0.4
779
+ return rv
780
+
781
+
782
+ class ObjectiveJLexer(RegexLexer):
783
+ """
784
+ For Objective-J source code with preprocessor directives.
785
+
786
+ .. versionadded:: 1.3
787
+ """
788
+
789
+ name = 'Objective-J'
790
+ aliases = ['objective-j', 'objectivej', 'obj-j', 'objj']
791
+ filenames = ['*.j']
792
+ mimetypes = ['text/x-objective-j']
793
+
794
+ #: optional Comment or Whitespace
795
+ _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)*'
796
+
797
+ flags = re.DOTALL | re.MULTILINE
798
+
799
+ tokens = {
800
+ 'root': [
801
+ include('whitespace'),
802
+
803
+ # function definition
804
+ (r'^(' + _ws + r'[+-]' + _ws + r')([(a-zA-Z_].*?[^(])(' + _ws + r'\{)',
805
+ bygroups(using(this), using(this, state='function_signature'),
806
+ using(this))),
807
+
808
+ # class definition
809
+ (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
810
+ 'classname'),
811
+ (r'(@class|@protocol)(\s*)', bygroups(Keyword, Text),
812
+ 'forward_classname'),
813
+ (r'(\s*)(@end)(\s*)', bygroups(Text, Keyword, Text)),
814
+
815
+ include('statements'),
816
+ ('[{()}]', Punctuation),
817
+ (';', Punctuation),
818
+ ],
819
+ 'whitespace': [
820
+ (r'(@import)(\s+)("(?:\\\\|\\"|[^"])*")',
821
+ bygroups(Comment.Preproc, Text, String.Double)),
822
+ (r'(@import)(\s+)(<(?:\\\\|\\>|[^>])*>)',
823
+ bygroups(Comment.Preproc, Text, String.Double)),
824
+ (r'(#(?:include|import))(\s+)("(?:\\\\|\\"|[^"])*")',
825
+ bygroups(Comment.Preproc, Text, String.Double)),
826
+ (r'(#(?:include|import))(\s+)(<(?:\\\\|\\>|[^>])*>)',
827
+ bygroups(Comment.Preproc, Text, String.Double)),
828
+
829
+ (r'#if\s+0', Comment.Preproc, 'if0'),
830
+ (r'#', Comment.Preproc, 'macro'),
831
+
832
+ (r'\n', Text),
833
+ (r'\s+', Text),
834
+ (r'\\\n', Text), # line continuation
835
+ (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
836
+ (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
837
+ (r'<!--', Comment),
838
+ ],
839
+ 'slashstartsregex': [
840
+ include('whitespace'),
841
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
842
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
843
+ (r'(?=/)', Text, ('#pop', 'badregex')),
844
+ default('#pop'),
845
+ ],
846
+ 'badregex': [
847
+ (r'\n', Text, '#pop'),
848
+ ],
849
+ 'statements': [
850
+ (r'(L|@)?"', String, 'string'),
851
+ (r"(L|@)?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
852
+ String.Char),
853
+ (r'"(\\\\|\\"|[^"])*"', String.Double),
854
+ (r"'(\\\\|\\'|[^'])*'", String.Single),
855
+ (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
856
+ (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
857
+ (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
858
+ (r'0[0-7]+[Ll]?', Number.Oct),
859
+ (r'\d+[Ll]?', Number.Integer),
860
+
861
+ (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
862
+
863
+ (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
864
+ r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?',
865
+ Operator, 'slashstartsregex'),
866
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
867
+ (r'[})\].]', Punctuation),
868
+
869
+ (r'(for|in|while|do|break|return|continue|switch|case|default|if|'
870
+ r'else|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
871
+ r'prototype|__proto__)\b', Keyword, 'slashstartsregex'),
872
+
873
+ (r'(var|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
874
+
875
+ (r'(@selector|@private|@protected|@public|@encode|'
876
+ r'@synchronized|@try|@throw|@catch|@finally|@end|@property|'
877
+ r'@synthesize|@dynamic|@for|@accessors|new)\b', Keyword),
878
+
879
+ (r'(int|long|float|short|double|char|unsigned|signed|void|'
880
+ r'id|BOOL|bool|boolean|IBOutlet|IBAction|SEL|@outlet|@action)\b',
881
+ Keyword.Type),
882
+
883
+ (r'(self|super)\b', Name.Builtin),
884
+
885
+ (r'(TRUE|YES|FALSE|NO|Nil|nil|NULL)\b', Keyword.Constant),
886
+ (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
887
+ (r'(ABS|ASIN|ACOS|ATAN|ATAN2|SIN|COS|TAN|EXP|POW|CEIL|FLOOR|ROUND|'
888
+ r'MIN|MAX|RAND|SQRT|E|LN2|LN10|LOG2E|LOG10E|PI|PI2|PI_2|SQRT1_2|'
889
+ r'SQRT2)\b', Keyword.Constant),
890
+
891
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
892
+ r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
893
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
894
+ r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
895
+ r'window)\b', Name.Builtin),
896
+
897
+ (r'([$a-zA-Z_]\w*)(' + _ws + r')(?=\()',
898
+ bygroups(Name.Function, using(this))),
899
+
900
+ (r'[$a-zA-Z_]\w*', Name),
901
+ ],
902
+ 'classname': [
903
+ # interface definition that inherits
904
+ (r'([a-zA-Z_]\w*)(' + _ws + r':' + _ws +
905
+ r')([a-zA-Z_]\w*)?',
906
+ bygroups(Name.Class, using(this), Name.Class), '#pop'),
907
+ # interface definition for a category
908
+ (r'([a-zA-Z_]\w*)(' + _ws + r'\()([a-zA-Z_]\w*)(\))',
909
+ bygroups(Name.Class, using(this), Name.Label, Text), '#pop'),
910
+ # simple interface / implementation
911
+ (r'([a-zA-Z_]\w*)', Name.Class, '#pop'),
912
+ ],
913
+ 'forward_classname': [
914
+ (r'([a-zA-Z_]\w*)(\s*,\s*)',
915
+ bygroups(Name.Class, Text), '#push'),
916
+ (r'([a-zA-Z_]\w*)(\s*;?)',
917
+ bygroups(Name.Class, Text), '#pop'),
918
+ ],
919
+ 'function_signature': [
920
+ include('whitespace'),
921
+
922
+ # start of a selector w/ parameters
923
+ (r'(\(' + _ws + r')' # open paren
924
+ r'([a-zA-Z_]\w+)' # return type
925
+ r'(' + _ws + r'\)' + _ws + r')' # close paren
926
+ r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
927
+ bygroups(using(this), Keyword.Type, using(this),
928
+ Name.Function), 'function_parameters'),
929
+
930
+ # no-param function
931
+ (r'(\(' + _ws + r')' # open paren
932
+ r'([a-zA-Z_]\w+)' # return type
933
+ r'(' + _ws + r'\)' + _ws + r')' # close paren
934
+ r'([$a-zA-Z_]\w+)', # function name
935
+ bygroups(using(this), Keyword.Type, using(this),
936
+ Name.Function), "#pop"),
937
+
938
+ # no return type given, start of a selector w/ parameters
939
+ (r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
940
+ bygroups(Name.Function), 'function_parameters'),
941
+
942
+ # no return type given, no-param function
943
+ (r'([$a-zA-Z_]\w+)', # function name
944
+ bygroups(Name.Function), "#pop"),
945
+
946
+ default('#pop'),
947
+ ],
948
+ 'function_parameters': [
949
+ include('whitespace'),
950
+
951
+ # parameters
952
+ (r'(\(' + _ws + ')' # open paren
953
+ r'([^)]+)' # type
954
+ r'(' + _ws + r'\)' + _ws + r')' # close paren
955
+ r'([$a-zA-Z_]\w+)', # param name
956
+ bygroups(using(this), Keyword.Type, using(this), Text)),
957
+
958
+ # one piece of a selector name
959
+ (r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
960
+ Name.Function),
961
+
962
+ # smallest possible selector piece
963
+ (r'(:)', Name.Function),
964
+
965
+ # var args
966
+ (r'(,' + _ws + r'\.\.\.)', using(this)),
967
+
968
+ # param name
969
+ (r'([$a-zA-Z_]\w+)', Text),
970
+ ],
971
+ 'expression': [
972
+ (r'([$a-zA-Z_]\w*)(\()', bygroups(Name.Function,
973
+ Punctuation)),
974
+ (r'(\))', Punctuation, "#pop"),
975
+ ],
976
+ 'string': [
977
+ (r'"', String, '#pop'),
978
+ (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
979
+ (r'[^\\"\n]+', String), # all other characters
980
+ (r'\\\n', String), # line continuation
981
+ (r'\\', String), # stray backslash
982
+ ],
983
+ 'macro': [
984
+ (r'[^/\n]+', Comment.Preproc),
985
+ (r'/[*](.|\n)*?[*]/', Comment.Multiline),
986
+ (r'//.*?\n', Comment.Single, '#pop'),
987
+ (r'/', Comment.Preproc),
988
+ (r'(?<=\\)\n', Comment.Preproc),
989
+ (r'\n', Comment.Preproc, '#pop'),
990
+ ],
991
+ 'if0': [
992
+ (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
993
+ (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
994
+ (r'.*?\n', Comment),
995
+ ]
996
+ }
997
+
998
+ def analyse_text(text):
999
+ if re.search('^\s*@import\s+[<"]', text, re.MULTILINE):
1000
+ # special directive found in most Objective-J files
1001
+ return True
1002
+ return False
1003
+
1004
+
1005
+ class CoffeeScriptLexer(RegexLexer):
1006
+ """
1007
+ For `CoffeeScript`_ source code.
1008
+
1009
+ .. _CoffeeScript: http://coffeescript.org
1010
+
1011
+ .. versionadded:: 1.3
1012
+ """
1013
+
1014
+ name = 'CoffeeScript'
1015
+ aliases = ['coffee-script', 'coffeescript', 'coffee']
1016
+ filenames = ['*.coffee']
1017
+ mimetypes = ['text/coffeescript']
1018
+
1019
+
1020
+ _operator_re = (
1021
+ r'\+\+|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|'
1022
+ r'\|\||\\(?=\n)|'
1023
+ r'(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\|\^/])=?')
1024
+
1025
+ flags = re.DOTALL
1026
+ tokens = {
1027
+ 'commentsandwhitespace': [
1028
+ (r'\s+', Text),
1029
+ (r'###[^#].*?###', Comment.Multiline),
1030
+ (r'#(?!##[^#]).*?\n', Comment.Single),
1031
+ ],
1032
+ 'multilineregex': [
1033
+ (r'[^/#]+', String.Regex),
1034
+ (r'///([gim]+\b|\B)', String.Regex, '#pop'),
1035
+ (r'#\{', String.Interpol, 'interpoling_string'),
1036
+ (r'[/#]', String.Regex),
1037
+ ],
1038
+ 'slashstartsregex': [
1039
+ include('commentsandwhitespace'),
1040
+ (r'///', String.Regex, ('#pop', 'multilineregex')),
1041
+ (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
1042
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
1043
+ # This isn't really guarding against mishighlighting well-formed
1044
+ # code, just the ability to infinite-loop between root and
1045
+ # slashstartsregex.
1046
+ (r'/', Operator),
1047
+ default('#pop'),
1048
+ ],
1049
+ 'root': [
1050
+ include('commentsandwhitespace'),
1051
+ (r'^(?=\s|/)', Text, 'slashstartsregex'),
1052
+ (_operator_re, Operator, 'slashstartsregex'),
1053
+ (r'(?:\([^()]*\))?\s*[=-]>', Name.Function, 'slashstartsregex'),
1054
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
1055
+ (r'[})\].]', Punctuation),
1056
+ (r'(?<![.$])(for|own|in|of|while|until|'
1057
+ r'loop|break|return|continue|'
1058
+ r'switch|when|then|if|unless|else|'
1059
+ r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
1060
+ r'extends|this|class|by)\b', Keyword, 'slashstartsregex'),
1061
+ (r'(?<![.$])(true|false|yes|no|on|off|null|'
1062
+ r'NaN|Infinity|undefined)\b',
1063
+ Keyword.Constant),
1064
+ (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
1065
+ r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
1066
+ r'decodeURIComponent|encodeURI|encodeURIComponent|'
1067
+ r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b',
1068
+ Name.Builtin),
1069
+ (r'[$a-zA-Z_][\w.:$]*\s*[:=]\s', Name.Variable,
1070
+ 'slashstartsregex'),
1071
+ (r'@[$a-zA-Z_][\w.:$]*\s*[:=]\s', Name.Variable.Instance,
1072
+ 'slashstartsregex'),
1073
+ (r'@', Name.Other, 'slashstartsregex'),
1074
+ (r'@?[$a-zA-Z_][\w$]*', Name.Other),
1075
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
1076
+ (r'0x[0-9a-fA-F]+', Number.Hex),
1077
+ (r'[0-9]+', Number.Integer),
1078
+ ('"""', String, 'tdqs'),
1079
+ ("'''", String, 'tsqs'),
1080
+ ('"', String, 'dqs'),
1081
+ ("'", String, 'sqs'),
1082
+ ],
1083
+ 'strings': [
1084
+ (r'[^#\\\'"]+', String),
1085
+ # note that all coffee script strings are multi-line.
1086
+ # hashmarks, quotes and backslashes must be parsed one at a time
1087
+ ],
1088
+ 'interpoling_string': [
1089
+ (r'\}', String.Interpol, "#pop"),
1090
+ include('root')
1091
+ ],
1092
+ 'dqs': [
1093
+ (r'"', String, '#pop'),
1094
+ (r'\\.|\'', String), # double-quoted string don't need ' escapes
1095
+ (r'#\{', String.Interpol, "interpoling_string"),
1096
+ (r'#', String),
1097
+ include('strings')
1098
+ ],
1099
+ 'sqs': [
1100
+ (r"'", String, '#pop'),
1101
+ (r'#|\\.|"', String), # single quoted strings don't need " escapses
1102
+ include('strings')
1103
+ ],
1104
+ 'tdqs': [
1105
+ (r'"""', String, '#pop'),
1106
+ (r'\\.|\'|"', String), # no need to escape quotes in triple-string
1107
+ (r'#\{', String.Interpol, "interpoling_string"),
1108
+ (r'#', String),
1109
+ include('strings'),
1110
+ ],
1111
+ 'tsqs': [
1112
+ (r"'''", String, '#pop'),
1113
+ (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
1114
+ include('strings')
1115
+ ],
1116
+ }
1117
+
1118
+
1119
+ class MaskLexer(RegexLexer):
1120
+ """
1121
+ For `Mask <http://github.com/atmajs/MaskJS>`__ markup.
1122
+
1123
+ .. versionadded:: 2.0
1124
+ """
1125
+ name = 'Mask'
1126
+ aliases = ['mask']
1127
+ filenames = ['*.mask']
1128
+ mimetypes = ['text/x-mask']
1129
+
1130
+ flags = re.MULTILINE | re.IGNORECASE | re.DOTALL
1131
+ tokens = {
1132
+ 'root': [
1133
+ (r'\s+', Text),
1134
+ (r'//.*?\n', Comment.Single),
1135
+ (r'/\*.*?\*/', Comment.Multiline),
1136
+ (r'[{};>]', Punctuation),
1137
+ (r"'''", String, 'string-trpl-single'),
1138
+ (r'"""', String, 'string-trpl-double'),
1139
+ (r"'", String, 'string-single'),
1140
+ (r'"', String, 'string-double'),
1141
+ (r'([\w-]+)', Name.Tag, 'node'),
1142
+ (r'([^.#;{>\s]+)', Name.Class, 'node'),
1143
+ (r'(#[\w-]+)', Name.Function, 'node'),
1144
+ (r'(\.[\w-]+)', Name.Variable.Class, 'node')
1145
+ ],
1146
+ 'string-base': [
1147
+ (r'\\.', String.Escape),
1148
+ (r'~\[', String.Interpol, 'interpolation'),
1149
+ (r'.', String.Single),
1150
+ ],
1151
+ 'string-single': [
1152
+ (r"'", String.Single, '#pop'),
1153
+ include('string-base')
1154
+ ],
1155
+ 'string-double': [
1156
+ (r'"', String.Single, '#pop'),
1157
+ include('string-base')
1158
+ ],
1159
+ 'string-trpl-single': [
1160
+ (r"'''", String.Single, '#pop'),
1161
+ include('string-base')
1162
+ ],
1163
+ 'string-trpl-double': [
1164
+ (r'"""', String.Single, '#pop'),
1165
+ include('string-base')
1166
+ ],
1167
+ 'interpolation': [
1168
+ (r'\]', String.Interpol, '#pop'),
1169
+ (r'\s*:', String.Interpol, 'expression'),
1170
+ (r'\s*\w+:', Name.Other),
1171
+ (r'[^\]]+', String.Interpol)
1172
+ ],
1173
+ 'expression': [
1174
+ (r'[^\]]+', using(JavascriptLexer), '#pop')
1175
+ ],
1176
+ 'node': [
1177
+ (r'\s+', Text),
1178
+ (r'\.', Name.Variable.Class, 'node-class'),
1179
+ (r'\#', Name.Function, 'node-id'),
1180
+ (r'style[ \t]*=', Name.Attribute, 'node-attr-style-value'),
1181
+ (r'[\w:-]+[ \t]*=', Name.Attribute, 'node-attr-value'),
1182
+ (r'[\w:-]+', Name.Attribute),
1183
+ (r'[>{;]', Punctuation, '#pop')
1184
+ ],
1185
+ 'node-class': [
1186
+ (r'[\w-]+', Name.Variable.Class),
1187
+ (r'~\[', String.Interpol, 'interpolation'),
1188
+ default('#pop')
1189
+ ],
1190
+ 'node-id': [
1191
+ (r'[\w-]+', Name.Function),
1192
+ (r'~\[', String.Interpol, 'interpolation'),
1193
+ default('#pop')
1194
+ ],
1195
+ 'node-attr-value': [
1196
+ (r'\s+', Text),
1197
+ (r'\w+', Name.Variable, '#pop'),
1198
+ (r"'", String, 'string-single-pop2'),
1199
+ (r'"', String, 'string-double-pop2'),
1200
+ default('#pop')
1201
+ ],
1202
+ 'node-attr-style-value': [
1203
+ (r'\s+', Text),
1204
+ (r"'", String.Single, 'css-single-end'),
1205
+ (r'"', String.Single, 'css-double-end'),
1206
+ include('node-attr-value')
1207
+ ],
1208
+ 'css-base': [
1209
+ (r'\s+', Text),
1210
+ (r";", Punctuation),
1211
+ (r"[\w\-]+\s*:", Name.Builtin)
1212
+ ],
1213
+ 'css-single-end': [
1214
+ include('css-base'),
1215
+ (r"'", String.Single, '#pop:2'),
1216
+ (r"[^;']+", Name.Entity)
1217
+ ],
1218
+ 'css-double-end': [
1219
+ include('css-base'),
1220
+ (r'"', String.Single, '#pop:2'),
1221
+ (r'[^;"]+', Name.Entity)
1222
+ ],
1223
+ 'string-single-pop2': [
1224
+ (r"'", String.Single, '#pop:2'),
1225
+ include('string-base')
1226
+ ],
1227
+ 'string-double-pop2': [
1228
+ (r'"', String.Single, '#pop:2'),
1229
+ include('string-base')
1230
+ ],
1231
+ }
1232
+
1233
+
1234
+ class EarlGreyLexer(RegexLexer):
1235
+ """
1236
+ For `Earl-Grey`_ source code.
1237
+
1238
+ .. _Earl-Grey: https://breuleux.github.io/earl-grey/
1239
+
1240
+ .. versionadded: 2.1
1241
+ """
1242
+
1243
+ name = 'Earl Grey'
1244
+ aliases = ['earl-grey', 'earlgrey', 'eg']
1245
+ filenames = ['*.eg']
1246
+ mimetypes = ['text/x-earl-grey']
1247
+
1248
+ tokens = {
1249
+ 'root': [
1250
+ (r'\n', Text),
1251
+ include('control'),
1252
+ (r'[^\S\n]+', Text),
1253
+ (r';;.*\n', Comment),
1254
+ (r'[\[\]{}:(),;]', Punctuation),
1255
+ (r'\\\n', Text),
1256
+ (r'\\', Text),
1257
+ include('errors'),
1258
+ (words((
1259
+ 'with', 'where', 'when', 'and', 'not', 'or', 'in',
1260
+ 'as', 'of', 'is'),
1261
+ prefix=r'(?<=\s|\[)', suffix=r'(?![\w$\-])'),
1262
+ Operator.Word),
1263
+ (r'[*@]?->', Name.Function),
1264
+ (r'[+\-*/~^<>%&|?!@#.]*=', Operator.Word),
1265
+ (r'\.{2,3}', Operator.Word), # Range Operator
1266
+ (r'([+*/~^<>&|?!]+)|([#\-](?=\s))|@@+(?=\s)|=+', Operator),
1267
+ (r'(?<![\w$\-])(var|let)(?:[^\w$])', Keyword.Declaration),
1268
+ include('keywords'),
1269
+ include('builtins'),
1270
+ include('assignment'),
1271
+ (r'''(?x)
1272
+ (?:()([a-zA-Z$_](?:[\w$\-]*[\w$])?)|
1273
+ (?<=[\s{\[(])(\.)([a-zA-Z$_](?:[\w$\-]*[\w$])?))
1274
+ (?=.*%)''',
1275
+ bygroups(Punctuation, Name.Tag, Punctuation, Name.Class.Start), 'dbs'),
1276
+ (r'[rR]?`', String.Backtick, 'bt'),
1277
+ (r'[rR]?```', String.Backtick, 'tbt'),
1278
+ (r'(?<=[\s\[{(,;])\.([a-zA-Z$_](?:[\w$\-]*[\w$])?)'
1279
+ r'(?=[\s\]}),;])', String.Symbol),
1280
+ include('nested'),
1281
+ (r'(?:[rR]|[rR]\.[gmi]{1,3})?"', String, combined('stringescape', 'dqs')),
1282
+ (r'(?:[rR]|[rR]\.[gmi]{1,3})?\'', String, combined('stringescape', 'sqs')),
1283
+ (r'"""', String, combined('stringescape', 'tdqs')),
1284
+ include('tuple'),
1285
+ include('import_paths'),
1286
+ include('name'),
1287
+ include('numbers'),
1288
+ ],
1289
+ 'dbs': [
1290
+ (r'(\.)([a-zA-Z$_](?:[\w$\-]*[\w$])?)(?=[.\[\s])',
1291
+ bygroups(Punctuation, Name.Class.DBS)),
1292
+ (r'(\[)([\^#][a-zA-Z$_](?:[\w$\-]*[\w$])?)(\])',
1293
+ bygroups(Punctuation, Name.Entity.DBS, Punctuation)),
1294
+ (r'\s+', Text),
1295
+ (r'%', Operator.DBS, '#pop'),
1296
+ ],
1297
+ 'import_paths': [
1298
+ (r'(?<=[\s:;,])(\.{1,3}(?:[\w\-]*/)*)(\w(?:[\w\-]*\w)*)(?=[\s;,])',
1299
+ bygroups(Text.Whitespace, Text)),
1300
+ ],
1301
+ 'assignment': [
1302
+ (r'(\.)?([a-zA-Z$_](?:[\w$\-]*[\w$])?)'
1303
+ r'(?=\s+[+\-*/~^<>%&|?!@#.]*\=\s)',
1304
+ bygroups(Punctuation, Name.Variable))
1305
+ ],
1306
+ 'errors': [
1307
+ (words(('Error', 'TypeError', 'ReferenceError'),
1308
+ prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
1309
+ Name.Exception),
1310
+ (r'''(?x)
1311
+ (?<![\w$])
1312
+ E\.[\w$](?:[\w$\-]*[\w$])?
1313
+ (?:\.[\w$](?:[\w$\-]*[\w$])?)*
1314
+ (?=[({\[?!\s])''',
1315
+ Name.Exception),
1316
+ ],
1317
+ 'control': [
1318
+ (r'''(?x)
1319
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)
1320
+ (?!\n)\s+
1321
+ (?!and|as|each\*|each|in|is|mod|of|or|when|where|with)
1322
+ (?=(?:[+\-*/~^<>%&|?!@#.])?[a-zA-Z$_](?:[\w$-]*[\w$])?)''',
1323
+ Keyword.Control),
1324
+ (r'([a-zA-Z$_](?:[\w$-]*[\w$])?)(?!\n)\s+(?=[\'"\d{\[(])',
1325
+ Keyword.Control),
1326
+ (r'''(?x)
1327
+ (?:
1328
+ (?<=[%=])|
1329
+ (?<=[=\-]>)|
1330
+ (?<=with|each|with)|
1331
+ (?<=each\*|where)
1332
+ )(\s+)
1333
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)(:)''',
1334
+ bygroups(Text, Keyword.Control, Punctuation)),
1335
+ (r'''(?x)
1336
+ (?<![+\-*/~^<>%&|?!@#.])(\s+)
1337
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)(:)''',
1338
+ bygroups(Text, Keyword.Control, Punctuation)),
1339
+ ],
1340
+ 'nested': [
1341
+ (r'''(?x)
1342
+ (?<=[\w$\]})])(\.)
1343
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)
1344
+ (?=\s+with(?:\s|\n))''',
1345
+ bygroups(Punctuation, Name.Function)),
1346
+ (r'''(?x)
1347
+ (?<!\s)(\.)
1348
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)
1349
+ (?=[}\]).,;:\s])''',
1350
+ bygroups(Punctuation, Name.Field)),
1351
+ (r'''(?x)
1352
+ (?<=[\w$\]})])(\.)
1353
+ ([a-zA-Z$_](?:[\w$-]*[\w$])?)
1354
+ (?=[\[{(:])''',
1355
+ bygroups(Punctuation, Name.Function)),
1356
+ ],
1357
+ 'keywords': [
1358
+ (words((
1359
+ 'each', 'each*', 'mod', 'await', 'break', 'chain',
1360
+ 'continue', 'elif', 'expr-value', 'if', 'match',
1361
+ 'return', 'yield', 'pass', 'else', 'require', 'var',
1362
+ 'let', 'async', 'method', 'gen'),
1363
+ prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
1364
+ Keyword.Pseudo),
1365
+ (words(('this', 'self', '@'),
1366
+ prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$])'),
1367
+ Keyword.Constant),
1368
+ (words((
1369
+ 'Function', 'Object', 'Array', 'String', 'Number',
1370
+ 'Boolean', 'ErrorFactory', 'ENode', 'Promise'),
1371
+ prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$])'),
1372
+ Keyword.Type),
1373
+ ],
1374
+ 'builtins': [
1375
+ (words((
1376
+ 'send', 'object', 'keys', 'items', 'enumerate', 'zip',
1377
+ 'product', 'neighbours', 'predicate', 'equal',
1378
+ 'nequal', 'contains', 'repr', 'clone', 'range',
1379
+ 'getChecker', 'get-checker', 'getProperty', 'get-property',
1380
+ 'getProjector', 'get-projector', 'consume', 'take',
1381
+ 'promisify', 'spawn', 'constructor'),
1382
+ prefix=r'(?<![\w\-#.])', suffix=r'(?![\w\-.])'),
1383
+ Name.Builtin),
1384
+ (words((
1385
+ 'true', 'false', 'null', 'undefined'),
1386
+ prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
1387
+ Name.Constant),
1388
+ ],
1389
+ 'name': [
1390
+ (r'@([a-zA-Z$_](?:[\w$-]*[\w$])?)', Name.Variable.Instance),
1391
+ (r'([a-zA-Z$_](?:[\w$-]*[\w$])?)(\+\+|\-\-)?',
1392
+ bygroups(Name.Symbol, Operator.Word))
1393
+ ],
1394
+ 'tuple': [
1395
+ (r'#[a-zA-Z_][\w\-]*(?=[\s{(,;])', Name.Namespace)
1396
+ ],
1397
+ 'interpoling_string': [
1398
+ (r'\}', String.Interpol, '#pop'),
1399
+ include('root')
1400
+ ],
1401
+ 'stringescape': [
1402
+ (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
1403
+ r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
1404
+ ],
1405
+ 'strings': [
1406
+ (r'[^\\\'"]', String),
1407
+ (r'[\'"\\]', String),
1408
+ (r'\n', String) # All strings are multiline in EG
1409
+ ],
1410
+ 'dqs': [
1411
+ (r'"', String, '#pop'),
1412
+ (r'\\\\|\\"|\\\n', String.Escape),
1413
+ include('strings')
1414
+ ],
1415
+ 'sqs': [
1416
+ (r"'", String, '#pop'),
1417
+ (r"\\\\|\\'|\\\n", String.Escape),
1418
+ (r'\{', String.Interpol, 'interpoling_string'),
1419
+ include('strings')
1420
+ ],
1421
+ 'tdqs': [
1422
+ (r'"""', String, '#pop'),
1423
+ include('strings'),
1424
+ ],
1425
+ 'bt': [
1426
+ (r'`', String.Backtick, '#pop'),
1427
+ (r'(?<!`)\n', String.Backtick),
1428
+ (r'\^=?', String.Escape),
1429
+ (r'.+', String.Backtick),
1430
+ ],
1431
+ 'tbt': [
1432
+ (r'```', String.Backtick, '#pop'),
1433
+ (r'\n', String.Backtick),
1434
+ (r'\^=?', String.Escape),
1435
+ (r'[^`]+', String.Backtick),
1436
+ ],
1437
+ 'numbers': [
1438
+ (r'\d+\.(?!\.)\d*([eE][+-]?[0-9]+)?', Number.Float),
1439
+ (r'\d+[eE][+-]?[0-9]+', Number.Float),
1440
+ (r'8r[0-7]+', Number.Oct),
1441
+ (r'2r[01]+', Number.Bin),
1442
+ (r'16r[a-fA-F0-9]+', Number.Hex),
1443
+ (r'([3-79]|[12][0-9]|3[0-6])r[a-zA-Z\d]+(\.[a-zA-Z\d]+)?', Number.Radix),
1444
+ (r'\d+', Number.Integer)
1445
+ ],
1446
+ }
1447
+
1448
+ class JuttleLexer(RegexLexer):
1449
+ """
1450
+ For `Juttle`_ source code.
1451
+
1452
+ .. _Juttle: https://github.com/juttle/juttle
1453
+
1454
+ """
1455
+
1456
+ name = 'Juttle'
1457
+ aliases = ['juttle', 'juttle']
1458
+ filenames = ['*.juttle']
1459
+ mimetypes = ['application/juttle', 'application/x-juttle',
1460
+ 'text/x-juttle', 'text/juttle']
1461
+
1462
+ flags = re.DOTALL | re.UNICODE | re.MULTILINE
1463
+
1464
+ tokens = {
1465
+ 'commentsandwhitespace': [
1466
+ (r'\s+', Text),
1467
+ (r'//.*?\n', Comment.Single),
1468
+ (r'/\*.*?\*/', Comment.Multiline)
1469
+ ],
1470
+ 'slashstartsregex': [
1471
+ include('commentsandwhitespace'),
1472
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
1473
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
1474
+ (r'(?=/)', Text, ('#pop', 'badregex')),
1475
+ default('#pop')
1476
+ ],
1477
+ 'badregex': [
1478
+ (r'\n', Text, '#pop')
1479
+ ],
1480
+ 'root': [
1481
+ (r'^(?=\s|/)', Text, 'slashstartsregex'),
1482
+ include('commentsandwhitespace'),
1483
+ (r':\d{2}:\d{2}:\d{2}(\.\d*)?:', String.Moment),
1484
+ (r':(now|beginning|end|forever|yesterday|today|tomorrow|(\d+(\.\d*)?|\.\d+)(ms|[smhdwMy])?):', String.Moment),
1485
+ (r':\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d*)?)?(Z|[+-]\d{2}:\d{2}|[+-]\d{4})?:', String.Moment),
1486
+ (r':((\d+(\.\d*)?|\.\d+)[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?'
1487
+ r'(([ ]+and[ ]+(\d+[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?)'
1488
+ r'|[ ]+(ago|from[ ]+now))*:', String.Moment),
1489
+ (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
1490
+ r'(==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
1491
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
1492
+ (r'[})\].]', Punctuation),
1493
+ (r'(import|return|continue|if|else)\b', Keyword, 'slashstartsregex'),
1494
+ (r'(var|const|function|reducer|sub|input)\b', Keyword.Declaration, 'slashstartsregex'),
1495
+ (r'(batch|emit|filter|head|join|keep|pace|pass|put|read|reduce|remove|'
1496
+ r'sequence|skip|sort|split|tail|unbatch|uniq|view|write)\b', Keyword.Reserved),
1497
+ (r'(true|false|null|Infinity)\b', Keyword.Constant),
1498
+ (r'(Array|Date|Juttle|Math|Number|Object|RegExp|String)\b', Name.Builtin),
1499
+ (JS_IDENT, Name.Other),
1500
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
1501
+ (r'[0-9]+', Number.Integer),
1502
+ (r'"(\\\\|\\"|[^"])*"', String.Double),
1503
+ (r"'(\\\\|\\'|[^'])*'", String.Single)
1504
+ ]
1505
+
1506
+ }