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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2006-2014 by the respective authors (see AUTHORS file).
1
+ Copyright (c) 2006-2015 by the respective authors (see AUTHORS file).
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Combines scripts for common tasks.
6
6
  #
7
- # :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
7
+ # :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
8
8
  # :license: BSD, see LICENSE for details.
9
9
  #
10
10
 
@@ -19,9 +19,9 @@ all: clean-pyc check test
19
19
 
20
20
  check:
21
21
  @$(PYTHON) scripts/detect_missing_analyse_text.py || true
22
+ @pyflakes pygments | grep -v 'but unused' || true
22
23
  @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
23
- -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
24
- -i pygments/lexers/_vimbuiltins.py
24
+ -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py
25
25
 
26
26
  clean: clean-pyc
27
27
  -rm -rf build
@@ -40,8 +40,8 @@ docs:
40
40
  make -C doc html
41
41
 
42
42
  mapfiles:
43
- (cd pygments/lexers; $(PYTHON) _mapping.py)
44
43
  (cd pygments/formatters; $(PYTHON) _mapping.py)
44
+ (cd pygments/lexers; $(PYTHON) _mapping.py)
45
45
 
46
46
  pylint:
47
47
  @pylint --rcfile scripts/pylintrc pygments
@@ -50,7 +50,16 @@ reindent:
50
50
  @$(PYTHON) scripts/reindent.py -r -B .
51
51
 
52
52
  test:
53
- @$(PYTHON) tests/run.py $(TEST)
53
+ @$(PYTHON) tests/run.py -d $(TEST)
54
54
 
55
55
  test-coverage:
56
- @$(PYTHON) tests/run.py -C $(TEST)
56
+ @$(PYTHON) tests/run.py -d --with-coverage --cover-package=pygments --cover-erase $(TEST)
57
+
58
+ test-examplefiles:
59
+ nosetests tests/test_examplefiles.py
60
+
61
+ tox-test:
62
+ @tox -- $(TEST)
63
+
64
+ tox-test-coverage:
65
+ @tox -- --with-coverage --cover-package=pygments --cover-erase $(TEST)
@@ -0,0 +1,39 @@
1
+ README for Pygments
2
+ ===================
3
+
4
+ This is the source of Pygments. It is a generic syntax highlighter that
5
+ supports over 300 languages and text formats, for use in code hosting, forums,
6
+ wikis or other applications that need to prettify source code.
7
+
8
+ Installing
9
+ ----------
10
+
11
+ ... works as usual, use ``python setup.py install``.
12
+
13
+ Documentation
14
+ -------------
15
+
16
+ ... can be found online at http://pygments.org/ or created by ::
17
+
18
+ cd doc
19
+ make html
20
+
21
+ Development
22
+ -----------
23
+
24
+ ... takes place on `Bitbucket
25
+ <https://bitbucket.org/birkenfeld/pygments-main>`_, where the Mercurial
26
+ repository, tickets and pull requests can be viewed.
27
+
28
+ Continuous testing runs on drone.io:
29
+
30
+ .. image:: https://drone.io/bitbucket.org/birkenfeld/pygments-main/status.png
31
+ :target: https://drone.io/bitbucket.org/birkenfeld/pygments-main
32
+
33
+ The authors
34
+ -----------
35
+
36
+ Pygments is maintained by **Georg Brandl**, e-mail address *georg*\ *@*\ *python.org*.
37
+
38
+ Many lexers and fixes have been contributed by **Armin Ronacher**, the rest of
39
+ the `Pocoo <http://dev.pocoo.org/>`_ team and **Tim Hatch**.
@@ -1 +1 @@
1
- bec55c895c04
1
+ a042025b350c
@@ -1,9 +1,6 @@
1
1
  Todo
2
2
  ====
3
3
 
4
- - suggested new lexers
5
- * IPython sessions
6
-
7
4
  - lexers that need work:
8
5
  * review perl lexer (numerous bugs, but so far no one had complaints ;)
9
6
  * readd property support for C# lexer? that is, find a regex that doesn't
@@ -82,7 +82,7 @@
82
82
 
83
83
  {% block footer %}
84
84
  <div class="footer" role="contentinfo">
85
- &copy; Copyright 2014, Georg Brandl and Pygments contributors.
85
+ &copy; Copyright 2006-2015, Georg Brandl and Pygments contributors.
86
86
  Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{
87
87
  sphinx_version }}. <br/>
88
88
  Pygments logo created by <a href="http://joelunger.com">Joel Unger</a>.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Sphinx stylesheet -- pygments14 theme. Heavily copied from sphinx13.
6
6
  *
7
- * :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
7
+ * :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
8
8
  * :license: BSD, see LICENSE for details.
9
9
  *
10
10
  */
@@ -1,15 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Pygments documentation build configuration file, created by
4
- # sphinx-quickstart on Sat Jan 18 17:07:37 2014.
3
+ # Pygments documentation build configuration file
5
4
  #
6
- # This file is execfile()d with the current directory set to its containing dir.
7
- #
8
- # Note that not all possible configuration values are present in this
9
- # autogenerated file.
10
- #
11
- # All configuration values have a default; values that are commented out
12
- # serve to show the default.
13
5
 
14
6
  import sys, os
15
7
 
@@ -43,7 +35,7 @@ master_doc = 'index'
43
35
 
44
36
  # General information about the project.
45
37
  project = u'Pygments'
46
- copyright = u'2014, Georg Brandl'
38
+ copyright = u'2015, Georg Brandl'
47
39
 
48
40
  # The version info for the project you're documenting, acts as replacement for
49
41
  # |version| and |release|, also used in various other places throughout the
@@ -117,7 +109,7 @@ html_theme_path = ['_themes']
117
109
  # The name of an image file (within the static path) to use as favicon of the
118
110
  # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
119
111
  # pixels large.
120
- html_favicon = 'favicon.ico'
112
+ html_favicon = '_static/favicon.ico'
121
113
 
122
114
  # Add any paths that contain custom static files (such as style sheets) here,
123
115
  # relative to this directory. They are copied after the builtin static files,
@@ -89,6 +89,21 @@ Functions from :mod:`pygments.lexers`:
89
89
 
90
90
  .. versionadded:: 0.6
91
91
 
92
+ .. function:: find_lexer_class_by_name(alias)
93
+
94
+ Return the `Lexer` subclass that has `alias` in its aliases list, without
95
+ instantiating it.
96
+
97
+ Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
98
+ found.
99
+
100
+ .. versionadded:: 2.2
101
+
102
+ .. function:: find_lexer_class(name)
103
+
104
+ Return the `Lexer` subclass that with the *name* attribute as given by
105
+ the *name* argument.
106
+
92
107
 
93
108
  .. module:: pygments.formatters
94
109
 
@@ -136,9 +136,13 @@ Pygments tries to be smart regarding encodings in the formatting process:
136
136
  * If you give an ``outencoding`` option, it will override ``encoding``
137
137
  as the output encoding.
138
138
 
139
+ * If you give an ``inencoding`` option, it will override ``encoding``
140
+ as the input encoding.
141
+
139
142
  * If you don't give an encoding and have given an output file, the default
140
- encoding for lexer and formatter is ``latin1`` (which will pass through
141
- all non-ASCII characters).
143
+ encoding for lexer and formatter is the terminal encoding or the default
144
+ locale encoding of the system. As a last resort, ``latin1`` is used (which
145
+ will pass through all non-ASCII characters).
142
146
 
143
147
  * If you don't give an encoding and haven't given an output file (that means
144
148
  output is written to the console), the default encoding for lexer and
@@ -8,7 +8,7 @@ Write your own filter
8
8
 
9
9
  Writing own filters is very easy. All you have to do is to subclass
10
10
  the `Filter` class and override the `filter` method. Additionally a
11
- filter is instanciated with some keyword arguments you can use to
11
+ filter is instantiated with some keyword arguments you can use to
12
12
  adjust the behavior of your filter.
13
13
 
14
14
 
@@ -58,7 +58,7 @@ You can also use the `simplefilter` decorator from the `pygments.filter` module:
58
58
 
59
59
 
60
60
  @simplefilter
61
- def uncolor(lexer, stream, options):
61
+ def uncolor(self, lexer, stream, options):
62
62
  class_too = get_bool_opt(options, 'classtoo')
63
63
  for ttype, value in stream:
64
64
  if ttype is Name.Function or (class_too and
@@ -67,4 +67,5 @@ You can also use the `simplefilter` decorator from the `pygments.filter` module:
67
67
  yield ttype, value
68
68
 
69
69
  The decorator automatically subclasses an internal filter class and uses the
70
- decorated function for filtering.
70
+ decorated function as a method for filtering. (That's why there is a `self`
71
+ argument that you probably won't end up using in the method.)
@@ -4,21 +4,6 @@
4
4
  Using Pygments in various scenarios
5
5
  ===================================
6
6
 
7
- PyGtk
8
- -----
9
-
10
- Armin has written a piece of sample code that shows how to create a Gtk
11
- `TextBuffer` object containing Pygments-highlighted text.
12
-
13
- See the article here: http://lucumr.pocoo.org/cogitations/2007/05/30/pygments-gtk-rendering/
14
-
15
- Wordpress
16
- ---------
17
-
18
- He also has a snippet that shows how to use Pygments in WordPress:
19
-
20
- http://lucumr.pocoo.org/cogitations/2007/05/30/pygments-in-wordpress/
21
-
22
7
  Markdown
23
8
  --------
24
9
 
@@ -42,3 +27,14 @@ Bash completion
42
27
 
43
28
  The source distribution contains a file ``external/pygments.bashcomp`` that
44
29
  sets up completion for the ``pygmentize`` command in bash.
30
+
31
+ Wrappers for other languages
32
+ ----------------------------
33
+
34
+ These libraries provide Pygments highlighting for users of other languages
35
+ than Python:
36
+
37
+ * `pygments.rb <https://github.com/tmm1/pygments.rb>`_, a pygments wrapper for Ruby
38
+ * `Clygments <https://github.com/bfontaine/clygments>`_, a pygments wrapper for
39
+ Clojure
40
+ * `PHPygments <https://github.com/capynet/PHPygments>`_, a pygments wrapper for PHP
@@ -2,18 +2,18 @@
2
2
  Use Pygments in Java
3
3
  =====================
4
4
 
5
- Thanks to `Jython <http://www.jython.org>`__ it is possible to use Pygments in
5
+ Thanks to `Jython <http://www.jython.org>`_ it is possible to use Pygments in
6
6
  Java.
7
7
 
8
- This page is a simple tutorial to get an idea of how this is working. You can
9
- then look at the `Jython documentation <http://www.jython.org/docs/>`__ for more
10
- advanced use.
8
+ This page is a simple tutorial to get an idea of how this works. You can
9
+ then look at the `Jython documentation <http://www.jython.org/docs/>`_ for more
10
+ advanced uses.
11
11
 
12
12
  Since version 1.5, Pygments is deployed on `Maven Central
13
- <http://repo1.maven.org/maven2/org/pygments/pygments/>`__ as a JAR so is Jython
14
- which makes it a lot easier to create the Java project.
13
+ <http://repo1.maven.org/maven2/org/pygments/pygments/>`_ as a JAR, as is Jython
14
+ which makes it a lot easier to create a Java project.
15
15
 
16
- Here is an example of a `Maven <http://www.maven.org>`__ ``pom.xml`` file for a
16
+ Here is an example of a `Maven <http://www.maven.org>`_ ``pom.xml`` file for a
17
17
  project running Pygments:
18
18
 
19
19
  .. sourcecode:: xml
@@ -1,55 +1,56 @@
1
1
  .. -*- mode: rst -*-
2
2
 
3
+ .. highlight:: python
4
+
3
5
  ====================
4
6
  Write your own lexer
5
7
  ====================
6
8
 
7
- If a lexer for your favorite language is missing in the Pygments package, you can
8
- easily write your own and extend Pygments.
9
+ If a lexer for your favorite language is missing in the Pygments package, you
10
+ can easily write your own and extend Pygments.
9
11
 
10
- All you need can be found inside the :mod:`pygments.lexer` module. As you can
12
+ All you need can be found inside the :mod:`pygments.lexer` module. As you can
11
13
  read in the :doc:`API documentation <api>`, a lexer is a class that is
12
14
  initialized with some keyword arguments (the lexer options) and that provides a
13
15
  :meth:`.get_tokens_unprocessed()` method which is given a string or unicode
14
- object with the data to parse.
16
+ object with the data to lex.
15
17
 
16
18
  The :meth:`.get_tokens_unprocessed()` method must return an iterator or iterable
17
- containing tuples in the form ``(index, token, value)``. Normally you don't need
18
- to do this since there are numerous base lexers you can subclass.
19
+ containing tuples in the form ``(index, token, value)``. Normally you don't
20
+ need to do this since there are base lexers that do most of the work and that
21
+ you can subclass.
19
22
 
20
23
 
21
24
  RegexLexer
22
25
  ==========
23
26
 
24
- A very powerful (but quite easy to use) lexer is the :class:`RegexLexer`. This
25
- lexer base class allows you to define lexing rules in terms of *regular
26
- expressions* for different *states*.
27
+ The lexer base class used by almost all of Pygments' lexers is the
28
+ :class:`RegexLexer`. This class allows you to define lexing rules in terms of
29
+ *regular expressions* for different *states*.
27
30
 
28
31
  States are groups of regular expressions that are matched against the input
29
- string at the *current position*. If one of these expressions matches, a
30
- corresponding action is performed (normally yielding a token with a specific
31
- type), the current position is set to where the last match ended and the
32
- matching process continues with the first regex of the current state.
32
+ string at the *current position*. If one of these expressions matches, a
33
+ corresponding action is performed (such as yielding a token with a specific
34
+ type, or changing state), the current position is set to where the last match
35
+ ended and the matching process continues with the first regex of the current
36
+ state.
33
37
 
34
- Lexer states are kept in a state stack: each time a new state is entered, the
35
- new state is pushed onto the stack. The most basic lexers (like the
36
- `DiffLexer`) just need one state.
38
+ Lexer states are kept on a stack: each time a new state is entered, the new
39
+ state is pushed onto the stack. The most basic lexers (like the `DiffLexer`)
40
+ just need one state.
37
41
 
38
42
  Each state is defined as a list of tuples in the form (`regex`, `action`,
39
43
  `new_state`) where the last item is optional. In the most basic form, `action`
40
44
  is a token type (like `Name.Builtin`). That means: When `regex` matches, emit a
41
45
  token with the match text and type `tokentype` and push `new_state` on the state
42
46
  stack. If the new state is ``'#pop'``, the topmost state is popped from the
43
- stack instead. (To pop more than one state, use ``'#pop:2'`` and so on.)
44
- ``'#push'`` is a synonym for pushing the current state on the
45
- stack.
47
+ stack instead. To pop more than one state, use ``'#pop:2'`` and so on.
48
+ ``'#push'`` is a synonym for pushing the current state on the stack.
46
49
 
47
- The following example shows the `DiffLexer` from the builtin lexers. Note that
50
+ The following example shows the `DiffLexer` from the builtin lexers. Note that
48
51
  it contains some additional attributes `name`, `aliases` and `filenames` which
49
- aren't required for a lexer. They are used by the builtin lexer lookup
50
- functions.
51
-
52
- .. sourcecode:: python
52
+ aren't required for a lexer. They are used by the builtin lexer lookup
53
+ functions. ::
53
54
 
54
55
  from pygments.lexer import RegexLexer
55
56
  from pygments.token import *
@@ -72,56 +73,65 @@ functions.
72
73
  }
73
74
 
74
75
  As you can see this lexer only uses one state. When the lexer starts scanning
75
- the text, it first checks if the current character is a space. If this is true
76
- it scans everything until newline and returns the parsed data as `Text` token.
76
+ the text, it first checks if the current character is a space. If this is true
77
+ it scans everything until newline and returns the data as a `Text` token (which
78
+ is the "no special highlighting" token).
77
79
 
78
80
  If this rule doesn't match, it checks if the current char is a plus sign. And
79
81
  so on.
80
82
 
81
83
  If no rule matches at the current position, the current char is emitted as an
82
- `Error` token that indicates a parsing error, and the position is increased by
83
- 1.
84
+ `Error` token that indicates a lexing error, and the position is increased by
85
+ one.
84
86
 
85
87
 
86
88
  Adding and testing a new lexer
87
89
  ==============================
88
90
 
89
- To make pygments aware of your new lexer, you have to perform the following
90
- steps:
91
+ Using a lexer that is not part of Pygments can be done via the Python API. You
92
+ can import and instantiate the lexer, and pass it to :func:`pygments.highlight`.
91
93
 
92
- First, change to the current directory containing the pygments source code:
94
+ To prepare your new lexer for inclusion in the Pygments distribution, so that it
95
+ will be found when passing filenames or lexer aliases from the command line, you
96
+ have to perform the following steps.
93
97
 
94
- .. sourcecode:: console
98
+ First, change to the current directory containing the Pygments source code. You
99
+ will need to have either an unpacked source tarball, or (preferably) a copy
100
+ cloned from BitBucket.
101
+
102
+ .. code-block:: console
95
103
 
96
104
  $ cd .../pygments-main
97
105
 
98
- Next, make sure the lexer is known from outside of the module. All modules in
99
- the ``pygments.lexers`` specify ``__all__``. For example, ``other.py`` sets:
106
+ Select a matching module under ``pygments/lexers``, or create a new module for
107
+ your lexer class.
100
108
 
101
- .. sourcecode:: python
109
+ Next, make sure the lexer is known from outside of the module. All modules in
110
+ the ``pygments.lexers`` package specify ``__all__``. For example,
111
+ ``esoteric.py`` sets::
102
112
 
103
113
  __all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
104
114
 
105
- Simply add the name of your lexer class to this list.
115
+ Add the name of your lexer class to this list (or create the list if your lexer
116
+ is the only class in the module).
106
117
 
107
- Finally the lexer can be made publically known by rebuilding the lexer
108
- mapping:
118
+ Finally the lexer can be made publicly known by rebuilding the lexer mapping:
109
119
 
110
- .. sourcecode:: console
120
+ .. code-block:: console
111
121
 
112
122
  $ make mapfiles
113
123
 
114
124
  To test the new lexer, store an example file with the proper extension in
115
- ``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
125
+ ``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
116
126
  ``tests/examplefiles/example.diff`` containing a sample diff output.
117
127
 
118
128
  Now you can use pygmentize to render your example to HTML:
119
129
 
120
- .. sourcecode:: console
130
+ .. code-block:: console
121
131
 
122
132
  $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
123
133
 
124
- Note that this explicitely calls the ``pygmentize`` in the current directory
134
+ Note that this explicitly calls the ``pygmentize`` in the current directory
125
135
  by preceding it with ``./``. This ensures your modifications are used.
126
136
  Otherwise a possibly already installed, unmodified version without your new
127
137
  lexer would have been called from the system search path (``$PATH``).
@@ -130,29 +140,35 @@ To view the result, open ``/tmp/example.html`` in your browser.
130
140
 
131
141
  Once the example renders as expected, you should run the complete test suite:
132
142
 
133
- .. sourcecode:: console
143
+ .. code-block:: console
134
144
 
135
145
  $ make test
136
146
 
147
+ It also tests that your lexer fulfills the lexer API and certain invariants,
148
+ such as that the concatenation of all token text is the same as the input text.
149
+
137
150
 
138
151
  Regex Flags
139
152
  ===========
140
153
 
141
- You can either define regex flags in the regex (``r'(?x)foo bar'``) or by adding
142
- a `flags` attribute to your lexer class. If no attribute is defined, it defaults
143
- to `re.MULTILINE`. For more informations about regular expression flags see the
144
- `regular expressions`_ help page in the python documentation.
154
+ You can either define regex flags locally in the regex (``r'(?x)foo bar'``) or
155
+ globally by adding a `flags` attribute to your lexer class. If no attribute is
156
+ defined, it defaults to `re.MULTILINE`. For more information about regular
157
+ expression flags see the page about `regular expressions`_ in the Python
158
+ documentation.
145
159
 
146
- .. _regular expressions: http://docs.python.org/lib/re-syntax.html
160
+ .. _regular expressions: http://docs.python.org/library/re.html#regular-expression-syntax
147
161
 
148
162
 
149
163
  Scanning multiple tokens at once
150
164
  ================================
151
165
 
152
- Here is a more complex lexer that highlights INI files. INI files consist of
153
- sections, comments and key = value pairs:
166
+ So far, the `action` element in the rule tuple of regex, action and state has
167
+ been a single token type. Now we look at the first of several other possible
168
+ values.
154
169
 
155
- .. sourcecode:: python
170
+ Here is a more complex lexer that highlights INI files. INI files consist of
171
+ sections, comments and ``key = value`` pairs::
156
172
 
157
173
  from pygments.lexer import RegexLexer, bygroups
158
174
  from pygments.token import *
@@ -172,43 +188,41 @@ sections, comments and key = value pairs:
172
188
  ]
173
189
  }
174
190
 
175
- The lexer first looks for whitespace, comments and section names. And later it
191
+ The lexer first looks for whitespace, comments and section names. Later it
176
192
  looks for a line that looks like a key, value pair, separated by an ``'='``
177
193
  sign, and optional whitespace.
178
194
 
179
- The `bygroups` helper makes sure that each group is yielded with a different
180
- token type. First the `Name.Attribute` token, then a `Text` token for the
195
+ The `bygroups` helper yields each capturing group in the regex with a different
196
+ token type. First the `Name.Attribute` token, then a `Text` token for the
181
197
  optional whitespace, after that a `Operator` token for the equals sign. Then a
182
- `Text` token for the whitespace again. The rest of the line is returned as
198
+ `Text` token for the whitespace again. The rest of the line is returned as
183
199
  `String`.
184
200
 
185
201
  Note that for this to work, every part of the match must be inside a capturing
186
202
  group (a ``(...)``), and there must not be any nested capturing groups. If you
187
203
  nevertheless need a group, use a non-capturing group defined using this syntax:
188
- ``r'(?:some|words|here)'`` (note the ``?:`` after the beginning parenthesis).
204
+ ``(?:some|words|here)`` (note the ``?:`` after the beginning parenthesis).
189
205
 
190
- If you find yourself needing a capturing group inside the regex which
191
- shouldn't be part of the output but is used in the regular expressions for
192
- backreferencing (eg: ``r'(<(foo|bar)>)(.*?)(</\2>)'``), you can pass `None`
193
- to the bygroups function and it will skip that group will be skipped in the
194
- output.
206
+ If you find yourself needing a capturing group inside the regex which shouldn't
207
+ be part of the output but is used in the regular expressions for backreferencing
208
+ (eg: ``r'(<(foo|bar)>)(.*?)(</\2>)'``), you can pass `None` to the bygroups
209
+ function and that group will be skipped in the output.
195
210
 
196
211
 
197
212
  Changing states
198
213
  ===============
199
214
 
200
- Many lexers need multiple states to work as expected. For example, some
201
- languages allow multiline comments to be nested. Since this is a recursive
215
+ Many lexers need multiple states to work as expected. For example, some
216
+ languages allow multiline comments to be nested. Since this is a recursive
202
217
  pattern it's impossible to lex just using regular expressions.
203
218
 
204
- Here is the solution:
205
-
206
- .. sourcecode:: python
219
+ Here is a lexer that recognizes C++ style comments (multi-line with ``/* */``
220
+ and single-line with ``//`` until end of line)::
207
221
 
208
222
  from pygments.lexer import RegexLexer
209
223
  from pygments.token import *
210
224
 
211
- class ExampleLexer(RegexLexer):
225
+ class CppCommentLexer(RegexLexer):
212
226
  name = 'Example Lexer with states'
213
227
 
214
228
  tokens = {
@@ -227,28 +241,29 @@ Here is the solution:
227
241
  }
228
242
 
229
243
  This lexer starts lexing in the ``'root'`` state. It tries to match as much as
230
- possible until it finds a slash (``'/'``). If the next character after the slash
231
- is a star (``'*'``) the `RegexLexer` sends those two characters to the output
232
- stream marked as `Comment.Multiline` and continues parsing with the rules
244
+ possible until it finds a slash (``'/'``). If the next character after the slash
245
+ is an asterisk (``'*'``) the `RegexLexer` sends those two characters to the
246
+ output stream marked as `Comment.Multiline` and continues lexing with the rules
233
247
  defined in the ``'comment'`` state.
234
248
 
235
- If there wasn't a star after the slash, the `RegexLexer` checks if it's a
236
- singleline comment (eg: followed by a second slash). If this also wasn't the
237
- case it must be a single slash (the separate regex for a single slash must also
238
- be given, else the slash would be marked as an error token).
249
+ If there wasn't an asterisk after the slash, the `RegexLexer` checks if it's a
250
+ Singleline comment (i.e. followed by a second slash). If this also wasn't the
251
+ case it must be a single slash, which is not a comment starter (the separate
252
+ regex for a single slash must also be given, else the slash would be marked as
253
+ an error token).
239
254
 
240
- Inside the ``'comment'`` state, we do the same thing again. Scan until the lexer
241
- finds a star or slash. If it's the opening of a multiline comment, push the
242
- ``'comment'`` state on the stack and continue scanning, again in the
243
- ``'comment'`` state. Else, check if it's the end of the multiline comment. If
255
+ Inside the ``'comment'`` state, we do the same thing again. Scan until the
256
+ lexer finds a star or slash. If it's the opening of a multiline comment, push
257
+ the ``'comment'`` state on the stack and continue scanning, again in the
258
+ ``'comment'`` state. Else, check if it's the end of the multiline comment. If
244
259
  yes, pop one state from the stack.
245
260
 
246
- Note: If you pop from an empty stack you'll get an `IndexError`. (There is an
261
+ Note: If you pop from an empty stack you'll get an `IndexError`. (There is an
247
262
  easy way to prevent this from happening: don't ``'#pop'`` in the root state).
248
263
 
249
264
  If the `RegexLexer` encounters a newline that is flagged as an error token, the
250
- stack is emptied and the lexer continues scanning in the ``'root'`` state. This
251
- helps producing error-tolerant highlighting for erroneous input, e.g. when a
265
+ stack is emptied and the lexer continues scanning in the ``'root'`` state. This
266
+ can help producing error-tolerant highlighting for erroneous input, e.g. when a
252
267
  single-line string is not closed.
253
268
 
254
269
 
@@ -258,14 +273,14 @@ Advanced state tricks
258
273
  There are a few more things you can do with states:
259
274
 
260
275
  - You can push multiple states onto the stack if you give a tuple instead of a
261
- simple string as the third item in a rule tuple. For example, if you want to
262
- match a comment containing a directive, something like::
276
+ simple string as the third item in a rule tuple. For example, if you want to
277
+ match a comment containing a directive, something like:
263
278
 
264
- /* <processing directive> rest of comment */
279
+ .. code-block:: text
265
280
 
266
- you can use this rule:
281
+ /* <processing directive> rest of comment */
267
282
 
268
- .. sourcecode:: python
283
+ you can use this rule::
269
284
 
270
285
  tokens = {
271
286
  'root': [
@@ -286,7 +301,7 @@ There are a few more things you can do with states:
286
301
  When this encounters the above sample, first ``'comment'`` and ``'directive'``
287
302
  are pushed onto the stack, then the lexer continues in the directive state
288
303
  until it finds the closing ``>``, then it continues in the comment state until
289
- the closing ``*/``. Then, both states are popped from the stack again and
304
+ the closing ``*/``. Then, both states are popped from the stack again and
290
305
  lexing continues in the root state.
291
306
 
292
307
  .. versionadded:: 0.9
@@ -295,9 +310,7 @@ There are a few more things you can do with states:
295
310
 
296
311
 
297
312
  - You can include the rules of a state in the definition of another. This is
298
- done by using `include` from `pygments.lexer`:
299
-
300
- .. sourcecode:: python
313
+ done by using `include` from `pygments.lexer`::
301
314
 
302
315
  from pygments.lexer import RegexLexer, bygroups, include
303
316
  from pygments.token import *
@@ -318,20 +331,19 @@ There are a few more things you can do with states:
318
331
  (r'[^}/]+', Text),
319
332
  include('comments'),
320
333
  (r'/', Text),
321
- (r'}', Keyword, '#pop'),
334
+ (r'\}', Keyword, '#pop'),
322
335
  ]
323
336
  }
324
337
 
325
338
  This is a hypothetical lexer for a language that consist of functions and
326
- comments. Because comments can occur at toplevel and in functions, we need
327
- rules for comments in both states. As you can see, the `include` helper saves
339
+ comments. Because comments can occur at toplevel and in functions, we need
340
+ rules for comments in both states. As you can see, the `include` helper saves
328
341
  repeating rules that occur more than once (in this example, the state
329
342
  ``'comment'`` will never be entered by the lexer, as it's only there to be
330
343
  included in ``'root'`` and ``'function'``).
331
344
 
332
-
333
345
  - Sometimes, you may want to "combine" a state from existing ones. This is
334
- possible with the `combine` helper from `pygments.lexer`.
346
+ possible with the `combined` helper from `pygments.lexer`.
335
347
 
336
348
  If you, instead of a new state, write ``combined('state1', 'state2')`` as the
337
349
  third item of a rule tuple, a new anonymous state will be formed from state1
@@ -340,45 +352,101 @@ There are a few more things you can do with states:
340
352
  This is not used very often, but can be helpful in some cases, such as the
341
353
  `PythonLexer`'s string literal processing.
342
354
 
343
- - If you want your lexer to start lexing in a different state you can modify
344
- the stack by overloading the `get_tokens_unprocessed()` method:
345
-
346
- .. sourcecode:: python
355
+ - If you want your lexer to start lexing in a different state you can modify the
356
+ stack by overriding the `get_tokens_unprocessed()` method::
347
357
 
348
358
  from pygments.lexer import RegexLexer
349
359
 
350
- class MyLexer(RegexLexer):
360
+ class ExampleLexer(RegexLexer):
351
361
  tokens = {...}
352
362
 
353
- def get_tokens_unprocessed(self, text):
354
- stack = ['root', 'otherstate']
363
+ def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')):
355
364
  for item in RegexLexer.get_tokens_unprocessed(text, stack):
356
365
  yield item
357
366
 
358
367
  Some lexers like the `PhpLexer` use this to make the leading ``<?php``
359
- preprocessor comments optional. Note that you can crash the lexer easily
360
- by putting values into the stack that don't exist in the token map. Also
368
+ preprocessor comments optional. Note that you can crash the lexer easily by
369
+ putting values into the stack that don't exist in the token map. Also
361
370
  removing ``'root'`` from the stack can result in strange errors!
362
371
 
363
- - An empty regex at the end of a state list, combined with ``'#pop'``, can
364
- act as a return point from a state that doesn't have a clear end marker.
372
+ - In some lexers, a state should be popped if anything is encountered that isn't
373
+ matched by a rule in the state. You could use an empty regex at the end of
374
+ the state list, but Pygments provides a more obvious way of spelling that:
375
+ ``default('#pop')`` is equivalent to ``('', Text, '#pop')``.
376
+
377
+ .. versionadded:: 2.0
378
+
379
+
380
+ Subclassing lexers derived from RegexLexer
381
+ ==========================================
382
+
383
+ .. versionadded:: 1.6
384
+
385
+ Sometimes multiple languages are very similar, but should still be lexed by
386
+ different lexer classes.
387
+
388
+ When subclassing a lexer derived from RegexLexer, the ``tokens`` dictionaries
389
+ defined in the parent and child class are merged. For example::
390
+
391
+ from pygments.lexer import RegexLexer, inherit
392
+ from pygments.token import *
393
+
394
+ class BaseLexer(RegexLexer):
395
+ tokens = {
396
+ 'root': [
397
+ ('[a-z]+', Name),
398
+ (r'/\*', Comment, 'comment'),
399
+ ('"', String, 'string'),
400
+ ('\s+', Text),
401
+ ],
402
+ 'string': [
403
+ ('[^"]+', String),
404
+ ('"', String, '#pop'),
405
+ ],
406
+ 'comment': [
407
+ ...
408
+ ],
409
+ }
410
+
411
+ class DerivedLexer(BaseLexer):
412
+ tokens = {
413
+ 'root': [
414
+ ('[0-9]+', Number),
415
+ inherit,
416
+ ],
417
+ 'string': [
418
+ (r'[^"\\]+', String),
419
+ (r'\\.', String.Escape),
420
+ ('"', String, '#pop'),
421
+ ],
422
+ }
423
+
424
+ The `BaseLexer` defines two states, lexing names and strings. The
425
+ `DerivedLexer` defines its own tokens dictionary, which extends the definitions
426
+ of the base lexer:
427
+
428
+ * The "root" state has an additional rule and then the special object `inherit`,
429
+ which tells Pygments to insert the token definitions of the parent class at
430
+ that point.
431
+
432
+ * The "string" state is replaced entirely, since there is not `inherit` rule.
433
+
434
+ * The "comment" state is inherited entirely.
365
435
 
366
436
 
367
437
  Using multiple lexers
368
438
  =====================
369
439
 
370
- Using multiple lexers for the same input can be tricky. One of the easiest
371
- combination techniques is shown here: You can replace the token type entry in a
372
- rule tuple (the second item) with a lexer class. The matched text will then be
373
- lexed with that lexer, and the resulting tokens will be yielded.
440
+ Using multiple lexers for the same input can be tricky. One of the easiest
441
+ combination techniques is shown here: You can replace the action entry in a rule
442
+ tuple with a lexer class. The matched text will then be lexed with that lexer,
443
+ and the resulting tokens will be yielded.
374
444
 
375
- For example, look at this stripped-down HTML lexer:
376
-
377
- .. sourcecode:: python
445
+ For example, look at this stripped-down HTML lexer::
378
446
 
379
447
  from pygments.lexer import RegexLexer, bygroups, using
380
448
  from pygments.token import *
381
- from pygments.lexers.web import JavascriptLexer
449
+ from pygments.lexers.javascript import JavascriptLexer
382
450
 
383
451
  class HtmlLexer(RegexLexer):
384
452
  name = 'HTML'
@@ -402,26 +470,29 @@ For example, look at this stripped-down HTML lexer:
402
470
  }
403
471
 
404
472
  Here the content of a ``<script>`` tag is passed to a newly created instance of
405
- a `JavascriptLexer` and not processed by the `HtmlLexer`. This is done using the
406
- `using` helper that takes the other lexer class as its parameter.
407
-
408
- Note the combination of `bygroups` and `using`. This makes sure that the content
409
- up to the ``</script>`` end tag is processed by the `JavascriptLexer`, while the
410
- end tag is yielded as a normal token with the `Name.Tag` type.
473
+ a `JavascriptLexer` and not processed by the `HtmlLexer`. This is done using
474
+ the `using` helper that takes the other lexer class as its parameter.
411
475
 
412
- As an additional goodie, if the lexer class is replaced by `this` (imported from
413
- `pygments.lexer`), the "other" lexer will be the current one (because you cannot
414
- refer to the current class within the code that runs at class definition time).
476
+ Note the combination of `bygroups` and `using`. This makes sure that the
477
+ content up to the ``</script>`` end tag is processed by the `JavascriptLexer`,
478
+ while the end tag is yielded as a normal token with the `Name.Tag` type.
415
479
 
416
480
  Also note the ``(r'<\s*script\s*', Name.Tag, ('script-content', 'tag'))`` rule.
417
481
  Here, two states are pushed onto the state stack, ``'script-content'`` and
418
- ``'tag'``. That means that first ``'tag'`` is processed, which will parse
482
+ ``'tag'``. That means that first ``'tag'`` is processed, which will lex
419
483
  attributes and the closing ``>``, then the ``'tag'`` state is popped and the
420
484
  next state on top of the stack will be ``'script-content'``.
421
485
 
486
+ Since you cannot refer to the class currently being defined, use `this`
487
+ (imported from `pygments.lexer`) to refer to the current lexer class, i.e.
488
+ ``using(this)``. This construct may seem unnecessary, but this is often the
489
+ most obvious way of lexing arbitrary syntax between fixed delimiters without
490
+ introducing deeply nested states.
491
+
422
492
  The `using()` helper has a special keyword argument, `state`, which works as
423
493
  follows: if given, the lexer to use initially is not in the ``"root"`` state,
424
- but in the state given by this argument. This *only* works with a `RegexLexer`.
494
+ but in the state given by this argument. This does not work with advanced
495
+ `RegexLexer` subclasses such as `ExtendedRegexLexer` (see below).
425
496
 
426
497
  Any other keywords arguments passed to `using()` are added to the keyword
427
498
  arguments used to create the lexer.
@@ -430,17 +501,15 @@ arguments used to create the lexer.
430
501
  Delegating Lexer
431
502
  ================
432
503
 
433
- Another approach for nested lexers is the `DelegatingLexer` which is for
434
- example used for the template engine lexers. It takes two lexers as
435
- arguments on initialisation: a `root_lexer` and a `language_lexer`.
504
+ Another approach for nested lexers is the `DelegatingLexer` which is for example
505
+ used for the template engine lexers. It takes two lexers as arguments on
506
+ initialisation: a `root_lexer` and a `language_lexer`.
436
507
 
437
508
  The input is processed as follows: First, the whole text is lexed with the
438
- `language_lexer`. All tokens yielded with a type of ``Other`` are then
439
- concatenated and given to the `root_lexer`. The language tokens of the
440
- `language_lexer` are then inserted into the `root_lexer`'s token stream
441
- at the appropriate positions.
442
-
443
- .. sourcecode:: python
509
+ `language_lexer`. All tokens yielded with the special type of ``Other`` are
510
+ then concatenated and given to the `root_lexer`. The language tokens of the
511
+ `language_lexer` are then inserted into the `root_lexer`'s token stream at the
512
+ appropriate positions. ::
444
513
 
445
514
  from pygments.lexer import DelegatingLexer
446
515
  from pygments.lexers.web import HtmlLexer, PhpLexer
@@ -452,10 +521,8 @@ at the appropriate positions.
452
521
  This procedure ensures that e.g. HTML with template tags in it is highlighted
453
522
  correctly even if the template tags are put into HTML tags or attributes.
454
523
 
455
- If you want to change the needle token ``Other`` to something else, you can
456
- give the lexer another token type as the third parameter:
457
-
458
- .. sourcecode:: python
524
+ If you want to change the needle token ``Other`` to something else, you can give
525
+ the lexer another token type as the third parameter::
459
526
 
460
527
  DelegatingLexer.__init__(MyLexer, OtherLexer, Text, **options)
461
528
 
@@ -464,24 +531,22 @@ Callbacks
464
531
  =========
465
532
 
466
533
  Sometimes the grammar of a language is so complex that a lexer would be unable
467
- to parse it just by using regular expressions and stacks.
534
+ to process it just by using regular expressions and stacks.
468
535
 
469
536
  For this, the `RegexLexer` allows callbacks to be given in rule tuples, instead
470
537
  of token types (`bygroups` and `using` are nothing else but preimplemented
471
- callbacks). The callback must be a function taking two arguments:
538
+ callbacks). The callback must be a function taking two arguments:
472
539
 
473
540
  * the lexer itself
474
541
  * the match object for the last matched rule
475
542
 
476
543
  The callback must then return an iterable of (or simply yield) ``(index,
477
544
  tokentype, value)`` tuples, which are then just passed through by
478
- `get_tokens_unprocessed()`. The ``index`` here is the position of the token in
545
+ `get_tokens_unprocessed()`. The ``index`` here is the position of the token in
479
546
  the input string, ``tokentype`` is the normal token type (like `Name.Builtin`),
480
547
  and ``value`` the associated part of the input string.
481
548
 
482
- You can see an example here:
483
-
484
- .. sourcecode:: python
549
+ You can see an example here::
485
550
 
486
551
  from pygments.lexer import RegexLexer
487
552
  from pygments.token import Generic
@@ -499,26 +564,25 @@ You can see an example here:
499
564
  ]
500
565
  }
501
566
 
502
- If the regex for the `headline_callback` matches, the function is called with the
503
- match object. Note that after the callback is done, processing continues
504
- normally, that is, after the end of the previous match. The callback has no
567
+ If the regex for the `headline_callback` matches, the function is called with
568
+ the match object. Note that after the callback is done, processing continues
569
+ normally, that is, after the end of the previous match. The callback has no
505
570
  possibility to influence the position.
506
571
 
507
572
  There are not really any simple examples for lexer callbacks, but you can see
508
- them in action e.g. in the `compiled.py`_ source code in the `CLexer` and
509
- `JavaLexer` classes.
573
+ them in action e.g. in the `SMLLexer` class in `ml.py`_.
510
574
 
511
- .. _compiled.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/compiled.py
575
+ .. _ml.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ml.py
512
576
 
513
577
 
514
578
  The ExtendedRegexLexer class
515
579
  ============================
516
580
 
517
581
  The `RegexLexer`, even with callbacks, unfortunately isn't powerful enough for
518
- the funky syntax rules of some languages that will go unnamed, such as Ruby.
582
+ the funky syntax rules of languages such as Ruby.
519
583
 
520
584
  But fear not; even then you don't have to abandon the regular expression
521
- approach. For Pygments has a subclass of `RegexLexer`, the `ExtendedRegexLexer`.
585
+ approach: Pygments has a subclass of `RegexLexer`, the `ExtendedRegexLexer`.
522
586
  All features known from RegexLexers are available here too, and the tokens are
523
587
  specified in exactly the same way, *except* for one detail:
524
588
 
@@ -542,9 +606,7 @@ creating a new one for the string argument.
542
606
  Note that because you can set the current position to anything in the callback,
543
607
  it won't be automatically be set by the caller after the callback is finished.
544
608
  For example, this is how the hypothetical lexer above would be written with the
545
- `ExtendedRegexLexer`:
546
-
547
- .. sourcecode:: python
609
+ `ExtendedRegexLexer`::
548
610
 
549
611
  from pygments.lexer import ExtendedRegexLexer
550
612
  from pygments.token import Generic
@@ -564,31 +626,58 @@ For example, this is how the hypothetical lexer above would be written with the
564
626
  }
565
627
 
566
628
  This might sound confusing (and it can really be). But it is needed, and for an
567
- example look at the Ruby lexer in `agile.py`_.
629
+ example look at the Ruby lexer in `ruby.py`_.
568
630
 
569
- .. _agile.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/agile.py
631
+ .. _ruby.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ruby.py
570
632
 
571
633
 
572
- Filtering Token Streams
634
+ Handling Lists of Keywords
635
+ ==========================
636
+
637
+ For a relatively short list (hundreds) you can construct an optimized regular
638
+ expression directly using ``words()`` (longer lists, see next section). This
639
+ function handles a few things for you automatically, including escaping
640
+ metacharacters and Python's first-match rather than longest-match in
641
+ alternations. Feel free to put the lists themselves in
642
+ ``pygments/lexers/_$lang_builtins.py`` (see examples there), and generated by
643
+ code if possible.
644
+
645
+ An example of using ``words()`` is something like::
646
+
647
+ from pygments.lexer import RegexLexer, words, Name
648
+
649
+ class MyLexer(RegexLexer):
650
+
651
+ tokens = {
652
+ 'root': [
653
+ (words(('else', 'elseif'), suffix=r'\b'), Name.Builtin),
654
+ (r'\w+', Name),
655
+ ],
656
+ }
657
+
658
+ As you can see, you can add ``prefix`` and ``suffix`` parts to the constructed
659
+ regex.
660
+
661
+
662
+ Modifying Token Streams
573
663
  =======================
574
664
 
575
- Some languages ship a lot of builtin functions (for example PHP). The total
665
+ Some languages ship a lot of builtin functions (for example PHP). The total
576
666
  amount of those functions differs from system to system because not everybody
577
- has every extension installed. In the case of PHP there are over 3000 builtin
578
- functions. That's an incredible huge amount of functions, much more than you
579
- can put into a regular expression.
580
-
581
- But because only `Name` tokens can be function names it's solvable by overriding
582
- the ``get_tokens_unprocessed()`` method. The following lexer subclasses the
583
- `PythonLexer` so that it highlights some additional names as pseudo keywords:
667
+ has every extension installed. In the case of PHP there are over 3000 builtin
668
+ functions. That's an incredibly huge amount of functions, much more than you
669
+ want to put into a regular expression.
584
670
 
585
- .. sourcecode:: python
671
+ But because only `Name` tokens can be function names this is solvable by
672
+ overriding the ``get_tokens_unprocessed()`` method. The following lexer
673
+ subclasses the `PythonLexer` so that it highlights some additional names as
674
+ pseudo keywords::
586
675
 
587
- from pygments.lexers.agile import PythonLexer
676
+ from pygments.lexers.python import PythonLexer
588
677
  from pygments.token import Name, Keyword
589
678
 
590
679
  class MyPythonLexer(PythonLexer):
591
- EXTRA_KEYWORDS = ['foo', 'bar', 'foobar', 'barfoo', 'spam', 'eggs']
680
+ EXTRA_KEYWORDS = set(('foo', 'bar', 'foobar', 'barfoo', 'spam', 'eggs'))
592
681
 
593
682
  def get_tokens_unprocessed(self, text):
594
683
  for index, token, value in PythonLexer.get_tokens_unprocessed(self, text):
@@ -598,5 +687,3 @@ the ``get_tokens_unprocessed()`` method. The following lexer subclasses the
598
687
  yield index, token, value
599
688
 
600
689
  The `PhpLexer` and `LuaLexer` use this method to resolve builtin functions.
601
-
602
- .. note:: Do not confuse this with the :doc:`filter <filters>` system.