pygments.rb 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.rubocop.yml +7 -0
  4. data/CHANGELOG.adoc +4 -0
  5. data/README.adoc +1 -1
  6. data/bench.rb +1 -1
  7. data/lib/pygments/popen.rb +3 -7
  8. data/lib/pygments/version.rb +1 -1
  9. data/pygments.rb.gemspec +2 -2
  10. data/test/test_pygments.rb +0 -19
  11. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/AUTHORS +21 -1
  12. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/LICENSE +1 -1
  13. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/METADATA +19 -11
  14. data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +614 -0
  15. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/WHEEL +1 -1
  16. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/entry_points.txt +0 -1
  17. data/vendor/pygments-main/bin/pygmentize +1 -1
  18. data/vendor/pygments-main/pygments/__init__.py +20 -22
  19. data/vendor/pygments-main/pygments/__main__.py +1 -1
  20. data/vendor/pygments-main/pygments/cmdline.py +74 -8
  21. data/vendor/pygments-main/pygments/console.py +1 -1
  22. data/vendor/pygments-main/pygments/filter.py +1 -1
  23. data/vendor/pygments-main/pygments/filters/__init__.py +6 -3
  24. data/vendor/pygments-main/pygments/formatter.py +41 -11
  25. data/vendor/pygments-main/pygments/formatters/__init__.py +21 -16
  26. data/vendor/pygments-main/pygments/formatters/_mapping.py +5 -65
  27. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  28. data/vendor/pygments-main/pygments/formatters/groff.py +170 -0
  29. data/vendor/pygments-main/pygments/formatters/html.py +54 -32
  30. data/vendor/pygments-main/pygments/formatters/img.py +9 -5
  31. data/vendor/pygments-main/pygments/formatters/irc.py +6 -33
  32. data/vendor/pygments-main/pygments/formatters/latex.py +24 -14
  33. data/vendor/pygments-main/pygments/formatters/other.py +1 -1
  34. data/vendor/pygments-main/pygments/formatters/pangomarkup.py +1 -1
  35. data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
  36. data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
  37. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -3
  38. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -4
  39. data/vendor/pygments-main/pygments/lexer.py +101 -32
  40. data/vendor/pygments-main/pygments/lexers/__init__.py +50 -29
  41. data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +103 -0
  42. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
  43. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
  44. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
  45. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +21 -6
  46. data/vendor/pygments-main/pygments/lexers/_css_builtins.py +558 -0
  47. data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +10 -0
  48. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
  49. data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +4932 -0
  50. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +11 -18
  51. data/vendor/pygments-main/pygments/lexers/_mapping.py +71 -82
  52. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +58 -4
  54. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  55. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +408 -1835
  56. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +70 -8
  57. data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +666 -0
  58. data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1609 -0
  59. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3 -3
  60. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +9 -18
  61. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +185 -94
  62. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
  63. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  64. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
  65. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
  66. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  67. data/vendor/pygments-main/pygments/lexers/actionscript.py +15 -14
  68. data/vendor/pygments-main/pygments/lexers/ada.py +144 -0
  69. data/vendor/pygments-main/pygments/lexers/agile.py +1 -1
  70. data/vendor/pygments-main/pygments/lexers/algebra.py +72 -9
  71. data/vendor/pygments-main/pygments/lexers/ambient.py +8 -7
  72. data/vendor/pygments-main/pygments/lexers/amdgpu.py +4 -3
  73. data/vendor/pygments-main/pygments/lexers/ampl.py +10 -8
  74. data/vendor/pygments-main/pygments/lexers/apdlexer.py +164 -20
  75. data/vendor/pygments-main/pygments/lexers/apl.py +6 -5
  76. data/vendor/pygments-main/pygments/lexers/archetype.py +23 -21
  77. data/vendor/pygments-main/pygments/lexers/arrow.py +10 -9
  78. data/vendor/pygments-main/pygments/lexers/arturo.py +250 -0
  79. data/vendor/pygments-main/pygments/lexers/asc.py +9 -5
  80. data/vendor/pygments-main/pygments/lexers/asm.py +68 -63
  81. data/vendor/pygments-main/pygments/lexers/automation.py +7 -5
  82. data/vendor/pygments-main/pygments/lexers/bare.py +20 -21
  83. data/vendor/pygments-main/pygments/lexers/basic.py +45 -41
  84. data/vendor/pygments-main/pygments/lexers/bdd.py +58 -0
  85. data/vendor/pygments-main/pygments/lexers/berry.py +99 -0
  86. data/vendor/pygments-main/pygments/lexers/bibtex.py +6 -6
  87. data/vendor/pygments-main/pygments/lexers/boa.py +4 -8
  88. data/vendor/pygments-main/pygments/lexers/business.py +18 -18
  89. data/vendor/pygments-main/pygments/lexers/c_cpp.py +80 -40
  90. data/vendor/pygments-main/pygments/lexers/c_like.py +21 -19
  91. data/vendor/pygments-main/pygments/lexers/capnproto.py +6 -8
  92. data/vendor/pygments-main/pygments/lexers/carbon.py +96 -0
  93. data/vendor/pygments-main/pygments/lexers/cddl.py +16 -33
  94. data/vendor/pygments-main/pygments/lexers/chapel.py +14 -9
  95. data/vendor/pygments-main/pygments/lexers/clean.py +3 -2
  96. data/vendor/pygments-main/pygments/lexers/comal.py +80 -0
  97. data/vendor/pygments-main/pygments/lexers/compiled.py +3 -2
  98. data/vendor/pygments-main/pygments/lexers/configs.py +235 -120
  99. data/vendor/pygments-main/pygments/lexers/console.py +5 -4
  100. data/vendor/pygments-main/pygments/lexers/cplint.py +44 -0
  101. data/vendor/pygments-main/pygments/lexers/crystal.py +22 -23
  102. data/vendor/pygments-main/pygments/lexers/csound.py +19 -17
  103. data/vendor/pygments-main/pygments/lexers/css.py +67 -159
  104. data/vendor/pygments-main/pygments/lexers/d.py +15 -12
  105. data/vendor/pygments-main/pygments/lexers/dalvik.py +14 -11
  106. data/vendor/pygments-main/pygments/lexers/data.py +119 -49
  107. data/vendor/pygments-main/pygments/lexers/dax.py +136 -0
  108. data/vendor/pygments-main/pygments/lexers/devicetree.py +9 -8
  109. data/vendor/pygments-main/pygments/lexers/diff.py +23 -19
  110. data/vendor/pygments-main/pygments/lexers/dotnet.py +216 -81
  111. data/vendor/pygments-main/pygments/lexers/dsls.py +86 -64
  112. data/vendor/pygments-main/pygments/lexers/dylan.py +16 -15
  113. data/vendor/pygments-main/pygments/lexers/ecl.py +46 -38
  114. data/vendor/pygments-main/pygments/lexers/eiffel.py +15 -10
  115. data/vendor/pygments-main/pygments/lexers/elm.py +12 -8
  116. data/vendor/pygments-main/pygments/lexers/elpi.py +165 -0
  117. data/vendor/pygments-main/pygments/lexers/email.py +21 -39
  118. data/vendor/pygments-main/pygments/lexers/erlang.py +21 -22
  119. data/vendor/pygments-main/pygments/lexers/esoteric.py +28 -30
  120. data/vendor/pygments-main/pygments/lexers/ezhil.py +10 -9
  121. data/vendor/pygments-main/pygments/lexers/factor.py +104 -83
  122. data/vendor/pygments-main/pygments/lexers/fantom.py +31 -29
  123. data/vendor/pygments-main/pygments/lexers/felix.py +18 -14
  124. data/vendor/pygments-main/pygments/lexers/fift.py +67 -0
  125. data/vendor/pygments-main/pygments/lexers/floscript.py +7 -7
  126. data/vendor/pygments-main/pygments/lexers/forth.py +8 -6
  127. data/vendor/pygments-main/pygments/lexers/fortran.py +16 -11
  128. data/vendor/pygments-main/pygments/lexers/foxpro.py +2 -2
  129. data/vendor/pygments-main/pygments/lexers/freefem.py +7 -10
  130. data/vendor/pygments-main/pygments/lexers/func.py +108 -0
  131. data/vendor/pygments-main/pygments/lexers/functional.py +1 -1
  132. data/vendor/pygments-main/pygments/lexers/futhark.py +12 -17
  133. data/vendor/pygments-main/pygments/lexers/gcodelexer.py +1 -2
  134. data/vendor/pygments-main/pygments/lexers/gdscript.py +76 -233
  135. data/vendor/pygments-main/pygments/lexers/go.py +12 -14
  136. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +22 -26
  137. data/vendor/pygments-main/pygments/lexers/graph.py +36 -15
  138. data/vendor/pygments-main/pygments/lexers/graphics.py +37 -38
  139. data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -1
  140. data/vendor/pygments-main/pygments/lexers/gsql.py +39 -27
  141. data/vendor/pygments-main/pygments/lexers/haskell.py +73 -71
  142. data/vendor/pygments-main/pygments/lexers/haxe.py +13 -11
  143. data/vendor/pygments-main/pygments/lexers/hdl.py +31 -34
  144. data/vendor/pygments-main/pygments/lexers/hexdump.py +21 -21
  145. data/vendor/pygments-main/pygments/lexers/html.py +11 -19
  146. data/vendor/pygments-main/pygments/lexers/idl.py +10 -5
  147. data/vendor/pygments-main/pygments/lexers/igor.py +3 -2
  148. data/vendor/pygments-main/pygments/lexers/inferno.py +9 -8
  149. data/vendor/pygments-main/pygments/lexers/installers.py +39 -33
  150. data/vendor/pygments-main/pygments/lexers/int_fiction.py +35 -20
  151. data/vendor/pygments-main/pygments/lexers/iolang.py +9 -9
  152. data/vendor/pygments-main/pygments/lexers/j.py +20 -13
  153. data/vendor/pygments-main/pygments/lexers/javascript.py +183 -149
  154. data/vendor/pygments-main/pygments/lexers/jmespath.py +68 -0
  155. data/vendor/pygments-main/pygments/lexers/jslt.py +4 -3
  156. data/vendor/pygments-main/pygments/lexers/jsonnet.py +168 -0
  157. data/vendor/pygments-main/pygments/lexers/julia.py +44 -32
  158. data/vendor/pygments-main/pygments/lexers/jvm.py +161 -140
  159. data/vendor/pygments-main/pygments/lexers/kuin.py +93 -59
  160. data/vendor/pygments-main/pygments/lexers/lilypond.py +226 -0
  161. data/vendor/pygments-main/pygments/lexers/lisp.py +244 -107
  162. data/vendor/pygments-main/pygments/lexers/macaulay2.py +1739 -0
  163. data/vendor/pygments-main/pygments/lexers/make.py +21 -16
  164. data/vendor/pygments-main/pygments/lexers/markup.py +752 -11
  165. data/vendor/pygments-main/pygments/lexers/math.py +1 -1
  166. data/vendor/pygments-main/pygments/lexers/matlab.py +18 -3
  167. data/vendor/pygments-main/pygments/lexers/maxima.py +85 -0
  168. data/vendor/pygments-main/pygments/lexers/meson.py +10 -25
  169. data/vendor/pygments-main/pygments/lexers/mime.py +2 -2
  170. data/vendor/pygments-main/pygments/lexers/minecraft.py +394 -0
  171. data/vendor/pygments-main/pygments/lexers/mips.py +128 -0
  172. data/vendor/pygments-main/pygments/lexers/ml.py +9 -6
  173. data/vendor/pygments-main/pygments/lexers/modeling.py +12 -8
  174. data/vendor/pygments-main/pygments/lexers/modula2.py +3 -2
  175. data/vendor/pygments-main/pygments/lexers/monte.py +3 -2
  176. data/vendor/pygments-main/pygments/lexers/mosel.py +1 -1
  177. data/vendor/pygments-main/pygments/lexers/ncl.py +1 -1
  178. data/vendor/pygments-main/pygments/lexers/nimrod.py +62 -20
  179. data/vendor/pygments-main/pygments/lexers/nit.py +3 -2
  180. data/vendor/pygments-main/pygments/lexers/nix.py +5 -5
  181. data/vendor/pygments-main/pygments/lexers/oberon.py +2 -2
  182. data/vendor/pygments-main/pygments/lexers/objective.py +6 -4
  183. data/vendor/pygments-main/pygments/lexers/ooc.py +3 -2
  184. data/vendor/pygments-main/pygments/lexers/other.py +1 -1
  185. data/vendor/pygments-main/pygments/lexers/parasail.py +3 -2
  186. data/vendor/pygments-main/pygments/lexers/parsers.py +23 -21
  187. data/vendor/pygments-main/pygments/lexers/pascal.py +196 -198
  188. data/vendor/pygments-main/pygments/lexers/pawn.py +1 -1
  189. data/vendor/pygments-main/pygments/lexers/perl.py +17 -15
  190. data/vendor/pygments-main/pygments/lexers/phix.py +364 -0
  191. data/vendor/pygments-main/pygments/lexers/php.py +35 -20
  192. data/vendor/pygments-main/pygments/lexers/pointless.py +3 -2
  193. data/vendor/pygments-main/pygments/lexers/pony.py +1 -1
  194. data/vendor/pygments-main/pygments/lexers/praat.py +41 -38
  195. data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
  196. data/vendor/pygments-main/pygments/lexers/prolog.py +7 -8
  197. data/vendor/pygments-main/pygments/lexers/promql.py +5 -12
  198. data/vendor/pygments-main/pygments/lexers/python.py +145 -119
  199. data/vendor/pygments-main/pygments/lexers/q.py +188 -0
  200. data/vendor/pygments-main/pygments/lexers/qlik.py +117 -0
  201. data/vendor/pygments-main/pygments/lexers/qvt.py +1 -1
  202. data/vendor/pygments-main/pygments/lexers/r.py +4 -4
  203. data/vendor/pygments-main/pygments/lexers/rdf.py +3 -3
  204. data/vendor/pygments-main/pygments/lexers/rebol.py +1 -12
  205. data/vendor/pygments-main/pygments/lexers/resource.py +1 -1
  206. data/vendor/pygments-main/pygments/lexers/ride.py +3 -2
  207. data/vendor/pygments-main/pygments/lexers/rita.py +43 -0
  208. data/vendor/pygments-main/pygments/lexers/rnc.py +3 -2
  209. data/vendor/pygments-main/pygments/lexers/roboconf.py +3 -3
  210. data/vendor/pygments-main/pygments/lexers/robotframework.py +6 -5
  211. data/vendor/pygments-main/pygments/lexers/ruby.py +24 -24
  212. data/vendor/pygments-main/pygments/lexers/rust.py +3 -2
  213. data/vendor/pygments-main/pygments/lexers/sas.py +2 -2
  214. data/vendor/pygments-main/pygments/lexers/savi.py +170 -0
  215. data/vendor/pygments-main/pygments/lexers/scdoc.py +4 -7
  216. data/vendor/pygments-main/pygments/lexers/scripting.py +24 -21
  217. data/vendor/pygments-main/pygments/lexers/sgf.py +6 -6
  218. data/vendor/pygments-main/pygments/lexers/shell.py +29 -21
  219. data/vendor/pygments-main/pygments/lexers/sieve.py +14 -4
  220. data/vendor/pygments-main/pygments/lexers/slash.py +1 -1
  221. data/vendor/pygments-main/pygments/lexers/smalltalk.py +5 -3
  222. data/vendor/pygments-main/pygments/lexers/smithy.py +5 -6
  223. data/vendor/pygments-main/pygments/lexers/smv.py +1 -1
  224. data/vendor/pygments-main/pygments/lexers/snobol.py +1 -1
  225. data/vendor/pygments-main/pygments/lexers/solidity.py +3 -7
  226. data/vendor/pygments-main/pygments/lexers/sophia.py +103 -0
  227. data/vendor/pygments-main/pygments/lexers/special.py +2 -5
  228. data/vendor/pygments-main/pygments/lexers/spice.py +71 -0
  229. data/vendor/pygments-main/pygments/lexers/sql.py +212 -17
  230. data/vendor/pygments-main/pygments/lexers/srcinfo.py +62 -0
  231. data/vendor/pygments-main/pygments/lexers/stata.py +4 -3
  232. data/vendor/pygments-main/pygments/lexers/supercollider.py +4 -3
  233. data/vendor/pygments-main/pygments/lexers/tal.py +74 -0
  234. data/vendor/pygments-main/pygments/lexers/tcl.py +21 -16
  235. data/vendor/pygments-main/pygments/lexers/teal.py +9 -8
  236. data/vendor/pygments-main/pygments/lexers/templates.py +62 -29
  237. data/vendor/pygments-main/pygments/lexers/teraterm.py +12 -20
  238. data/vendor/pygments-main/pygments/lexers/testing.py +6 -2
  239. data/vendor/pygments-main/pygments/lexers/text.py +3 -2
  240. data/vendor/pygments-main/pygments/lexers/textedit.py +41 -7
  241. data/vendor/pygments-main/pygments/lexers/textfmts.py +7 -5
  242. data/vendor/pygments-main/pygments/lexers/theorem.py +42 -36
  243. data/vendor/pygments-main/pygments/lexers/thingsdb.py +2 -4
  244. data/vendor/pygments-main/pygments/lexers/tlb.py +57 -0
  245. data/vendor/pygments-main/pygments/lexers/tnt.py +3 -4
  246. data/vendor/pygments-main/pygments/lexers/trafficscript.py +2 -4
  247. data/vendor/pygments-main/pygments/lexers/typoscript.py +2 -3
  248. data/vendor/pygments-main/pygments/lexers/ul4.py +267 -0
  249. data/vendor/pygments-main/pygments/lexers/unicon.py +1 -1
  250. data/vendor/pygments-main/pygments/lexers/urbi.py +4 -4
  251. data/vendor/pygments-main/pygments/lexers/usd.py +2 -1
  252. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  253. data/vendor/pygments-main/pygments/lexers/verification.py +4 -3
  254. data/vendor/pygments-main/pygments/lexers/web.py +1 -1
  255. data/vendor/pygments-main/pygments/lexers/webassembly.py +5 -5
  256. data/vendor/pygments-main/pygments/lexers/webidl.py +2 -1
  257. data/vendor/pygments-main/pygments/lexers/webmisc.py +90 -71
  258. data/vendor/pygments-main/pygments/lexers/wgsl.py +407 -0
  259. data/vendor/pygments-main/pygments/lexers/whiley.py +2 -1
  260. data/vendor/pygments-main/pygments/lexers/wowtoc.py +120 -0
  261. data/vendor/pygments-main/pygments/lexers/wren.py +99 -0
  262. data/vendor/pygments-main/pygments/lexers/x10.py +5 -6
  263. data/vendor/pygments-main/pygments/lexers/xorg.py +3 -2
  264. data/vendor/pygments-main/pygments/lexers/yang.py +6 -5
  265. data/vendor/pygments-main/pygments/lexers/zig.py +3 -2
  266. data/vendor/pygments-main/pygments/modeline.py +1 -1
  267. data/vendor/pygments-main/pygments/plugin.py +28 -9
  268. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  269. data/vendor/pygments-main/pygments/scanner.py +2 -2
  270. data/vendor/pygments-main/pygments/sphinxext.py +63 -1
  271. data/vendor/pygments-main/pygments/style.py +7 -1
  272. data/vendor/pygments-main/pygments/styles/__init__.py +19 -5
  273. data/vendor/pygments-main/pygments/styles/abap.py +2 -2
  274. data/vendor/pygments-main/pygments/styles/algol.py +1 -2
  275. data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -2
  276. data/vendor/pygments-main/pygments/styles/arduino.py +2 -3
  277. data/vendor/pygments-main/pygments/styles/autumn.py +1 -3
  278. data/vendor/pygments-main/pygments/styles/borland.py +1 -3
  279. data/vendor/pygments-main/pygments/styles/bw.py +1 -2
  280. data/vendor/pygments-main/pygments/styles/colorful.py +1 -3
  281. data/vendor/pygments-main/pygments/styles/default.py +13 -14
  282. data/vendor/pygments-main/pygments/styles/dracula.py +102 -0
  283. data/vendor/pygments-main/pygments/styles/emacs.py +1 -2
  284. data/vendor/pygments-main/pygments/styles/friendly.py +1 -2
  285. data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +75 -0
  286. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  287. data/vendor/pygments-main/pygments/styles/gh_dark.py +107 -0
  288. data/vendor/pygments-main/pygments/styles/gruvbox.py +4 -2
  289. data/vendor/pygments-main/pygments/styles/igor.py +1 -2
  290. data/vendor/pygments-main/pygments/styles/inkpot.py +3 -2
  291. data/vendor/pygments-main/pygments/styles/lilypond.py +56 -0
  292. data/vendor/pygments-main/pygments/styles/lovelace.py +1 -3
  293. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  294. data/vendor/pygments-main/pygments/styles/material.py +1 -2
  295. data/vendor/pygments-main/pygments/styles/monokai.py +3 -3
  296. data/vendor/pygments-main/pygments/styles/murphy.py +1 -3
  297. data/vendor/pygments-main/pygments/styles/native.py +11 -11
  298. data/vendor/pygments-main/pygments/styles/nord.py +150 -0
  299. data/vendor/pygments-main/pygments/styles/onedark.py +59 -0
  300. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -6
  301. data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -6
  302. data/vendor/pygments-main/pygments/styles/pastie.py +1 -3
  303. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -2
  304. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +3 -3
  305. data/vendor/pygments-main/pygments/styles/rrt.py +3 -2
  306. data/vendor/pygments-main/pygments/styles/sas.py +2 -4
  307. data/vendor/pygments-main/pygments/styles/solarized.py +1 -1
  308. data/vendor/pygments-main/pygments/styles/staroffice.py +26 -0
  309. data/vendor/pygments-main/pygments/styles/stata_dark.py +4 -6
  310. data/vendor/pygments-main/pygments/styles/stata_light.py +1 -2
  311. data/vendor/pygments-main/pygments/styles/tango.py +2 -3
  312. data/vendor/pygments-main/pygments/styles/trac.py +1 -3
  313. data/vendor/pygments-main/pygments/styles/vim.py +1 -2
  314. data/vendor/pygments-main/pygments/styles/vs.py +1 -2
  315. data/vendor/pygments-main/pygments/styles/xcode.py +1 -3
  316. data/vendor/pygments-main/pygments/styles/zenburn.py +4 -6
  317. data/vendor/pygments-main/pygments/token.py +2 -1
  318. data/vendor/pygments-main/pygments/unistring.py +4 -6
  319. data/vendor/pygments-main/pygments/util.py +27 -5
  320. metadata +59 -14
  321. data/vendor/pygments-main/Pygments-2.10.0.dist-info/RECORD +0 -524
  322. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/INSTALLER +0 -0
  323. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/REQUESTED +0 -0
  324. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/top_level.txt +0 -0
@@ -4,16 +4,16 @@
4
4
 
5
5
  Lexers for Haskell and related languages.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
11
11
  import re
12
12
 
13
13
  from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \
14
- default, include, inherit
14
+ default, include, inherit, line_re
15
15
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
16
- Number, Punctuation, Generic
16
+ Number, Punctuation, Generic, Whitespace
17
17
  from pygments import unistring as uni
18
18
 
19
19
  __all__ = ['HaskellLexer', 'HspecLexer', 'IdrisLexer', 'AgdaLexer', 'CryptolLexer',
@@ -21,9 +21,6 @@ __all__ = ['HaskellLexer', 'HspecLexer', 'IdrisLexer', 'AgdaLexer', 'CryptolLexe
21
21
  'LiterateCryptolLexer', 'KokaLexer']
22
22
 
23
23
 
24
- line_re = re.compile('.*?\n')
25
-
26
-
27
24
  class HaskellLexer(RegexLexer):
28
25
  """
29
26
  A Haskell lexer based on the lexemes defined in the Haskell 98 Report.
@@ -31,12 +28,11 @@ class HaskellLexer(RegexLexer):
31
28
  .. versionadded:: 0.8
32
29
  """
33
30
  name = 'Haskell'
31
+ url = 'https://www.haskell.org/'
34
32
  aliases = ['haskell', 'hs']
35
33
  filenames = ['*.hs']
36
34
  mimetypes = ['text/x-haskell']
37
35
 
38
- flags = re.MULTILINE | re.UNICODE
39
-
40
36
  reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else',
41
37
  'family', 'if', 'in', 'infix[lr]?', 'instance',
42
38
  'let', 'newtype', 'of', 'then', 'type', 'where', '_')
@@ -48,7 +44,7 @@ class HaskellLexer(RegexLexer):
48
44
  tokens = {
49
45
  'root': [
50
46
  # Whitespace:
51
- (r'\s+', Text),
47
+ (r'\s+', Whitespace),
52
48
  # (r'--\s*|.*$', Comment.Doc),
53
49
  (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
54
50
  (r'\{-', Comment.Multiline, 'comment'),
@@ -91,31 +87,31 @@ class HaskellLexer(RegexLexer):
91
87
  ],
92
88
  'import': [
93
89
  # Import statements
94
- (r'\s+', Text),
90
+ (r'\s+', Whitespace),
95
91
  (r'"', String, 'string'),
96
92
  # after "funclist" state
97
93
  (r'\)', Punctuation, '#pop'),
98
94
  (r'qualified\b', Keyword),
99
95
  # import X as Y
100
96
  (r'([' + uni.Lu + r'][\w.]*)(\s+)(as)(\s+)([' + uni.Lu + r'][\w.]*)',
101
- bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'),
97
+ bygroups(Name.Namespace, Whitespace, Keyword, Whitespace, Name), '#pop'),
102
98
  # import X hiding (functions)
103
99
  (r'([' + uni.Lu + r'][\w.]*)(\s+)(hiding)(\s+)(\()',
104
- bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'),
100
+ bygroups(Name.Namespace, Whitespace, Keyword, Whitespace, Punctuation), 'funclist'),
105
101
  # import X (functions)
106
102
  (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()',
107
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
103
+ bygroups(Name.Namespace, Whitespace, Punctuation), 'funclist'),
108
104
  # import X
109
105
  (r'[\w.]+', Name.Namespace, '#pop'),
110
106
  ],
111
107
  'module': [
112
- (r'\s+', Text),
108
+ (r'\s+', Whitespace),
113
109
  (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()',
114
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
110
+ bygroups(Name.Namespace, Whitespace, Punctuation), 'funclist'),
115
111
  (r'[' + uni.Lu + r'][\w.]*', Name.Namespace, '#pop'),
116
112
  ],
117
113
  'funclist': [
118
- (r'\s+', Text),
114
+ (r'\s+', Whitespace),
119
115
  (r'[' + uni.Lu + r']\w*', Keyword.Type),
120
116
  (r'(_[\w\']+|[' + uni.Ll + r'][\w\']*)', Name.Function),
121
117
  (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
@@ -153,7 +149,7 @@ class HaskellLexer(RegexLexer):
153
149
  (r'o[0-7]+', String.Escape, '#pop'),
154
150
  (r'x[\da-fA-F]+', String.Escape, '#pop'),
155
151
  (r'\d+', String.Escape, '#pop'),
156
- (r'\s+\\', String.Escape, '#pop'),
152
+ (r'(\s+)(\\)', bygroups(Whitespace, String.Escape), '#pop'),
157
153
  ],
158
154
  }
159
155
 
@@ -167,14 +163,14 @@ class HspecLexer(HaskellLexer):
167
163
 
168
164
  name = 'Hspec'
169
165
  aliases = ['hspec']
170
- filenames = []
166
+ filenames = ['*Spec.hs']
171
167
  mimetypes = []
172
168
 
173
169
  tokens = {
174
170
  'root': [
175
- (r'(it\s*)("[^"]*")', bygroups(Text, String.Doc)),
176
- (r'(describe\s*)("[^"]*")', bygroups(Text, String.Doc)),
177
- (r'(context\s*)("[^"]*")', bygroups(Text, String.Doc)),
171
+ (r'(it)(\s*)("[^"]*")', bygroups(Text, Whitespace, String.Doc)),
172
+ (r'(describe)(\s*)("[^"]*")', bygroups(Text, Whitespace, String.Doc)),
173
+ (r'(context)(\s*)("[^"]*")', bygroups(Text, Whitespace, String.Doc)),
178
174
  inherit,
179
175
  ],
180
176
  }
@@ -189,6 +185,7 @@ class IdrisLexer(RegexLexer):
189
185
  .. versionadded:: 2.0
190
186
  """
191
187
  name = 'Idris'
188
+ url = 'https://www.idris-lang.org/'
192
189
  aliases = ['idris', 'idr']
193
190
  filenames = ['*.idr']
194
191
  mimetypes = ['text/x-idris']
@@ -215,16 +212,16 @@ class IdrisLexer(RegexLexer):
215
212
  'root': [
216
213
  # Comments
217
214
  (r'^(\s*)(%%(%s))' % '|'.join(directives),
218
- bygroups(Text, Keyword.Reserved)),
219
- (r'(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$', bygroups(Text, Comment.Single)),
220
- (r'(\s*)(\|{3}.*?)$', bygroups(Text, Comment.Single)),
221
- (r'(\s*)(\{-)', bygroups(Text, Comment.Multiline), 'comment'),
215
+ bygroups(Whitespace, Keyword.Reserved)),
216
+ (r'(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$', bygroups(Whitespace, Comment.Single)),
217
+ (r'(\s*)(\|{3}.*?)$', bygroups(Whitespace, Comment.Single)),
218
+ (r'(\s*)(\{-)', bygroups(Whitespace, Comment.Multiline), 'comment'),
222
219
  # Declaration
223
220
  (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)',
224
- bygroups(Text, Name.Function, Text, Operator.Word, Text)),
221
+ bygroups(Whitespace, Name.Function, Whitespace, Operator.Word, Whitespace)),
225
222
  # Identifiers
226
223
  (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
227
- (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'),
224
+ (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Whitespace), 'module'),
228
225
  (r"('')?[A-Z][\w\']*", Keyword.Type),
229
226
  (r'[a-z][\w\']*', Text),
230
227
  # Special Symbols
@@ -239,16 +236,16 @@ class IdrisLexer(RegexLexer):
239
236
  (r"'", String.Char, 'character'),
240
237
  (r'"', String, 'string'),
241
238
  (r'[^\s(){}]+', Text),
242
- (r'\s+?', Text), # Whitespace
239
+ (r'\s+?', Whitespace), # Whitespace
243
240
  ],
244
241
  'module': [
245
- (r'\s+', Text),
242
+ (r'\s+', Whitespace),
246
243
  (r'([A-Z][\w.]*)(\s+)(\()',
247
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
244
+ bygroups(Name.Namespace, Whitespace, Punctuation), 'funclist'),
248
245
  (r'[A-Z][\w.]*', Name.Namespace, '#pop'),
249
246
  ],
250
247
  'funclist': [
251
- (r'\s+', Text),
248
+ (r'\s+', Whitespace),
252
249
  (r'[A-Z]\w*', Keyword.Type),
253
250
  (r'(_[\w\']+|[a-z][\w\']*)', Name.Function),
254
251
  (r'--.*$', Comment.Single),
@@ -286,37 +283,41 @@ class IdrisLexer(RegexLexer):
286
283
  (r'o[0-7]+', String.Escape, '#pop'),
287
284
  (r'x[\da-fA-F]+', String.Escape, '#pop'),
288
285
  (r'\d+', String.Escape, '#pop'),
289
- (r'\s+\\', String.Escape, '#pop')
286
+ (r'(\s+)(\\)', bygroups(Whitespace, String.Escape), '#pop')
290
287
  ],
291
288
  }
292
289
 
293
290
 
294
291
  class AgdaLexer(RegexLexer):
295
292
  """
296
- For the `Agda <http://wiki.portal.chalmers.se/agda/pmwiki.php>`_
297
- dependently typed functional programming language and proof assistant.
293
+ For the Agda dependently typed functional programming language and
294
+ proof assistant.
298
295
 
299
296
  .. versionadded:: 2.0
300
297
  """
301
298
 
302
299
  name = 'Agda'
300
+ url = 'http://wiki.portal.chalmers.se/agda/pmwiki.php'
303
301
  aliases = ['agda']
304
302
  filenames = ['*.agda']
305
303
  mimetypes = ['text/x-agda']
306
304
 
307
- reserved = ['abstract', 'codata', 'coinductive', 'constructor', 'data',
308
- 'field', 'forall', 'hiding', 'in', 'inductive', 'infix',
309
- 'infixl', 'infixr', 'instance', 'let', 'mutual', 'open',
310
- 'pattern', 'postulate', 'primitive', 'private',
311
- 'quote', 'quoteGoal', 'quoteTerm',
312
- 'record', 'renaming', 'rewrite', 'syntax', 'tactic',
313
- 'unquote', 'unquoteDecl', 'using', 'where', 'with']
305
+ reserved = (
306
+ 'abstract', 'codata', 'coinductive', 'constructor', 'data', 'do',
307
+ 'eta-equality', 'field', 'forall', 'hiding', 'in', 'inductive', 'infix',
308
+ 'infixl', 'infixr', 'instance', 'interleaved', 'let', 'macro', 'mutual',
309
+ 'no-eta-equality', 'open', 'overlap', 'pattern', 'postulate', 'primitive',
310
+ 'private', 'quote', 'quoteTerm', 'record', 'renaming', 'rewrite',
311
+ 'syntax', 'tactic', 'unquote', 'unquoteDecl', 'unquoteDef', 'using',
312
+ 'variable', 'where', 'with',
313
+ )
314
314
 
315
315
  tokens = {
316
316
  'root': [
317
317
  # Declaration
318
318
  (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)',
319
- bygroups(Text, Name.Function, Text, Operator.Word, Text)),
319
+ bygroups(Whitespace, Name.Function, Whitespace,
320
+ Operator.Word, Whitespace)),
320
321
  # Comments
321
322
  (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
322
323
  (r'\{-', Comment.Multiline, 'comment'),
@@ -325,7 +326,8 @@ class AgdaLexer(RegexLexer):
325
326
  # Lexemes:
326
327
  # Identifiers
327
328
  (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
328
- (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'),
329
+ (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Whitespace),
330
+ 'module'),
329
331
  (r'\b(Set|Prop)[\u2080-\u2089]*\b', Keyword.Type),
330
332
  # Special Symbols
331
333
  (r'(\(|\)|\{|\})', Operator),
@@ -339,7 +341,7 @@ class AgdaLexer(RegexLexer):
339
341
  (r"'", String.Char, 'character'),
340
342
  (r'"', String, 'string'),
341
343
  (r'[^\s(){}]+', Text),
342
- (r'\s+?', Text), # Whitespace
344
+ (r'\s+?', Whitespace), # Whitespace
343
345
  ],
344
346
  'hole': [
345
347
  # Holes
@@ -350,7 +352,7 @@ class AgdaLexer(RegexLexer):
350
352
  ],
351
353
  'module': [
352
354
  (r'\{-', Comment.Multiline, 'comment'),
353
- (r'[a-zA-Z][\w.]*', Name, '#pop'),
355
+ (r'[a-zA-Z][\w.\']*', Name, '#pop'),
354
356
  (r'[\W0-9_]+', Text)
355
357
  ],
356
358
  'comment': HaskellLexer.tokens['comment'],
@@ -383,7 +385,7 @@ class CryptolLexer(RegexLexer):
383
385
  tokens = {
384
386
  'root': [
385
387
  # Whitespace:
386
- (r'\s+', Text),
388
+ (r'\s+', Whitespace),
387
389
  # (r'--\s*|.*$', Comment.Doc),
388
390
  (r'//.*$', Comment.Single),
389
391
  (r'/\*', Comment.Multiline, 'comment'),
@@ -417,31 +419,31 @@ class CryptolLexer(RegexLexer):
417
419
  ],
418
420
  'import': [
419
421
  # Import statements
420
- (r'\s+', Text),
422
+ (r'\s+', Whitespace),
421
423
  (r'"', String, 'string'),
422
424
  # after "funclist" state
423
425
  (r'\)', Punctuation, '#pop'),
424
426
  (r'qualified\b', Keyword),
425
427
  # import X as Y
426
428
  (r'([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][\w.]*)',
427
- bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'),
429
+ bygroups(Name.Namespace, Whitespace, Keyword, Whitespace, Name), '#pop'),
428
430
  # import X hiding (functions)
429
431
  (r'([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()',
430
- bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'),
432
+ bygroups(Name.Namespace, Whitespace, Keyword, Whitespace, Punctuation), 'funclist'),
431
433
  # import X (functions)
432
434
  (r'([A-Z][\w.]*)(\s+)(\()',
433
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
435
+ bygroups(Name.Namespace, Whitespace, Punctuation), 'funclist'),
434
436
  # import X
435
437
  (r'[\w.]+', Name.Namespace, '#pop'),
436
438
  ],
437
439
  'module': [
438
- (r'\s+', Text),
440
+ (r'\s+', Whitespace),
439
441
  (r'([A-Z][\w.]*)(\s+)(\()',
440
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
442
+ bygroups(Name.Namespace, Whitespace, Punctuation), 'funclist'),
441
443
  (r'[A-Z][\w.]*', Name.Namespace, '#pop'),
442
444
  ],
443
445
  'funclist': [
444
- (r'\s+', Text),
446
+ (r'\s+', Whitespace),
445
447
  (r'[A-Z]\w*', Keyword.Type),
446
448
  (r'(_[\w\']+|[a-z][\w\']*)', Name.Function),
447
449
  # TODO: these don't match the comments in docs, remove.
@@ -478,7 +480,7 @@ class CryptolLexer(RegexLexer):
478
480
  (r'o[0-7]+', String.Escape, '#pop'),
479
481
  (r'x[\da-fA-F]+', String.Escape, '#pop'),
480
482
  (r'\d+', String.Escape, '#pop'),
481
- (r'\s+\\', String.Escape, '#pop'),
483
+ (r'(\s+)(\\)', bygroups(Whitespace, String.Escape), '#pop'),
482
484
  ],
483
485
  }
484
486
 
@@ -655,13 +657,13 @@ class LiterateCryptolLexer(LiterateLexer):
655
657
 
656
658
  class KokaLexer(RegexLexer):
657
659
  """
658
- Lexer for the `Koka <http://koka.codeplex.com>`_
659
- language.
660
+ Lexer for the Koka language.
660
661
 
661
662
  .. versionadded:: 1.6
662
663
  """
663
664
 
664
665
  name = 'Koka'
666
+ url = 'https://koka-lang.github.io/koka/doc/index.html'
665
667
  aliases = ['koka']
666
668
  filenames = ['*.kk', '*.kki']
667
669
  mimetypes = ['text/x-koka']
@@ -720,30 +722,30 @@ class KokaLexer(RegexLexer):
720
722
 
721
723
  # go into type mode
722
724
  (r'::?' + sboundary, tokenType, 'type'),
723
- (r'(alias)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
725
+ (r'(alias)(\s+)([a-z]\w*)?', bygroups(Keyword, Whitespace, tokenTypeDef),
724
726
  'alias-type'),
725
- (r'(struct)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
727
+ (r'(struct)(\s+)([a-z]\w*)?', bygroups(Keyword, Whitespace, tokenTypeDef),
726
728
  'struct-type'),
727
729
  ((r'(%s)' % '|'.join(typeStartKeywords)) +
728
- r'(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
730
+ r'(\s+)([a-z]\w*)?', bygroups(Keyword, Whitespace, tokenTypeDef),
729
731
  'type'),
730
732
 
731
733
  # special sequences of tokens (we use ?: for non-capturing group as
732
734
  # required by 'bygroups')
733
- (r'(module)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)',
734
- bygroups(Keyword, Text, Keyword, Name.Namespace)),
735
+ (r'(module)(\s+)(interface(?=\s))?(\s+)?((?:[a-z]\w*/)*[a-z]\w*)',
736
+ bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Namespace)),
735
737
  (r'(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)'
736
- r'(?:(\s*)(=)(\s*)((?:qualified\s*)?)'
738
+ r'(?:(\s*)(=)(\s*)(qualified)?(\s*)'
737
739
  r'((?:[a-z]\w*/)*[a-z]\w*))?',
738
- bygroups(Keyword, Text, Name.Namespace, Text, Keyword, Text,
739
- Keyword, Name.Namespace)),
740
+ bygroups(Keyword, Whitespace, Name.Namespace, Whitespace, Keyword, Whitespace,
741
+ Keyword, Whitespace, Name.Namespace)),
740
742
 
741
- (r'(^(?:(?:public|private)\s*)?(?:function|fun|val))'
743
+ (r'^(public|private)?(\s+)?(function|fun|val)'
742
744
  r'(\s+)([a-z]\w*|\((?:' + symbols + r'|/)\))',
743
- bygroups(Keyword, Text, Name.Function)),
744
- (r'(^(?:(?:public|private)\s*)?external)(\s+)(inline\s+)?'
745
+ bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Function)),
746
+ (r'^(?:(public|private)(?=\s+external))?((?<!^)\s+)?(external)(\s+)(inline(?=\s))?(\s+)?'
745
747
  r'([a-z]\w*|\((?:' + symbols + r'|/)\))',
746
- bygroups(Keyword, Text, Keyword, Name.Function)),
748
+ bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword, Whitespace, Name.Function)),
747
749
 
748
750
  # keywords
749
751
  (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword.Type),
@@ -800,7 +802,7 @@ class KokaLexer(RegexLexer):
800
802
  (r'[(\[<]', tokenType, 'type-nested'),
801
803
  (r',', tokenType),
802
804
  (r'([a-z]\w*)(\s*)(:)(?!:)',
803
- bygroups(Name, Text, tokenType)), # parameter name
805
+ bygroups(Name, Whitespace, tokenType)), # parameter name
804
806
  include('type-content')
805
807
  ],
806
808
 
@@ -833,8 +835,8 @@ class KokaLexer(RegexLexer):
833
835
 
834
836
  # comments and literals
835
837
  'whitespace': [
836
- (r'\n\s*#.*$', Comment.Preproc),
837
- (r'\s+', Text),
838
+ (r'(\n\s*)(#.*)$', bygroups(Whitespace, Comment.Preproc)),
839
+ (r'\s+', Whitespace),
838
840
  (r'/\*', Comment.Multiline, 'comment'),
839
841
  (r'//.*$', Comment.Single)
840
842
  ],
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for Haxe and related stuff.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -20,12 +20,13 @@ __all__ = ['HaxeLexer', 'HxmlLexer']
20
20
 
21
21
  class HaxeLexer(ExtendedRegexLexer):
22
22
  """
23
- For Haxe source code (http://haxe.org/).
23
+ For Haxe source code.
24
24
 
25
25
  .. versionadded:: 1.3
26
26
  """
27
27
 
28
28
  name = 'Haxe'
29
+ url = 'http://haxe.org/'
29
30
  aliases = ['haxe', 'hxsl', 'hx']
30
31
  filenames = ['*.hx', '*.hxsl']
31
32
  mimetypes = ['text/haxe', 'text/x-haxe', 'text/x-hx']
@@ -103,7 +104,7 @@ class HaxeLexer(ExtendedRegexLexer):
103
104
 
104
105
  # space/tab/comment/preproc
105
106
  'spaces': [
106
- (r'\s+', Text),
107
+ (r'\s+', Whitespace),
107
108
  (r'//[^\n\r]*', Comment.Single),
108
109
  (r'/\*.*?\*/', Comment.Multiline),
109
110
  (r'(#)(if|elseif|else|end|error)\b', preproc_callback),
@@ -163,14 +164,14 @@ class HaxeLexer(ExtendedRegexLexer):
163
164
  ],
164
165
 
165
166
  'preproc-error': [
166
- (r'\s+', Comment.Preproc),
167
+ (r'\s+', Whitespace),
167
168
  (r"'", String.Single, ('#pop', 'string-single')),
168
169
  (r'"', String.Double, ('#pop', 'string-double')),
169
170
  default('#pop'),
170
171
  ],
171
172
 
172
173
  'preproc-expr': [
173
- (r'\s+', Comment.Preproc),
174
+ (r'\s+', Whitespace),
174
175
  (r'\!', Comment.Preproc),
175
176
  (r'\(', Comment.Preproc, ('#pop', 'preproc-parenthesis')),
176
177
 
@@ -193,20 +194,20 @@ class HaxeLexer(ExtendedRegexLexer):
193
194
  ],
194
195
 
195
196
  'preproc-parenthesis': [
196
- (r'\s+', Comment.Preproc),
197
+ (r'\s+', Whitespace),
197
198
  (r'\)', Comment.Preproc, '#pop'),
198
199
  default('preproc-expr-in-parenthesis'),
199
200
  ],
200
201
 
201
202
  'preproc-expr-chain': [
202
- (r'\s+', Comment.Preproc),
203
+ (r'\s+', Whitespace),
203
204
  (binop, Comment.Preproc, ('#pop', 'preproc-expr-in-parenthesis')),
204
205
  default('#pop'),
205
206
  ],
206
207
 
207
208
  # same as 'preproc-expr' but able to chain 'preproc-expr-chain'
208
209
  'preproc-expr-in-parenthesis': [
209
- (r'\s+', Comment.Preproc),
210
+ (r'\s+', Whitespace),
210
211
  (r'\!', Comment.Preproc),
211
212
  (r'\(', Comment.Preproc,
212
213
  ('#pop', 'preproc-expr-chain', 'preproc-parenthesis')),
@@ -896,17 +897,18 @@ class HaxeLexer(ExtendedRegexLexer):
896
897
 
897
898
  class HxmlLexer(RegexLexer):
898
899
  """
899
- Lexer for `haXe build <http://haxe.org/doc/compiler>`_ files.
900
+ Lexer for haXe build files.
900
901
 
901
902
  .. versionadded:: 1.6
902
903
  """
903
904
  name = 'Hxml'
905
+ url = 'https://haxe.org/manual/compiler-usage-hxml.html'
904
906
  aliases = ['haxeml', 'hxml']
905
907
  filenames = ['*.hxml']
906
908
 
907
909
  tokens = {
908
910
  'root': [
909
- # Seperator
911
+ # Separator
910
912
  (r'(--)(next)', bygroups(Punctuation, Generic.Heading)),
911
913
  # Compiler switches with one dash
912
914
  (r'(-)(prompt|debug|v)', bygroups(Punctuation, Keyword.Keyword)),
@@ -919,7 +921,7 @@ class HxmlLexer(RegexLexer):
919
921
  bygroups(Punctuation, Keyword, Whitespace, String)),
920
922
  # Options that take only numerical arguments
921
923
  (r'(-)(swf-version)( +)(\d+)',
922
- bygroups(Punctuation, Keyword, Number.Integer)),
924
+ bygroups(Punctuation, Keyword, Whitespace, Number.Integer)),
923
925
  # An Option that defines the size, the fps and the background
924
926
  # color of an flash movie
925
927
  (r'(-)(swf-header)( +)(\d+)(:)(\d+)(:)(\d+)(:)([A-Fa-f0-9]{6})',
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for hardware descriptor languages.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -12,7 +12,7 @@ import re
12
12
 
13
13
  from pygments.lexer import RegexLexer, bygroups, include, using, this, words
14
14
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
- Number, Punctuation
15
+ Number, Punctuation, Whitespace
16
16
 
17
17
  __all__ = ['VerilogLexer', 'SystemVerilogLexer', 'VhdlLexer']
18
18
 
@@ -34,9 +34,8 @@ class VerilogLexer(RegexLexer):
34
34
  tokens = {
35
35
  'root': [
36
36
  (r'^\s*`define', Comment.Preproc, 'macro'),
37
- (r'\n', Text),
38
- (r'\s+', Text),
39
- (r'\\\n', Text), # line continuation
37
+ (r'\s+', Whitespace),
38
+ (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), # line continuation
40
39
  (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
41
40
  (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
42
41
  (r'[{}#@]', Punctuation),
@@ -54,8 +53,8 @@ class VerilogLexer(RegexLexer):
54
53
  (r'[()\[\],.;\']', Punctuation),
55
54
  (r'`[a-zA-Z_]\w*', Name.Constant),
56
55
 
57
- (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
58
- (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text),
56
+ (r'^(\s*)(package)(\s+)', bygroups(Whitespace, Keyword.Namespace, Text)),
57
+ (r'^(\s*)(import)(\s+)', bygroups(Whitespace, Keyword.Namespace, Text),
59
58
  'import'),
60
59
 
61
60
  (words((
@@ -114,7 +113,7 @@ class VerilogLexer(RegexLexer):
114
113
  (r'"', String, '#pop'),
115
114
  (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
116
115
  (r'[^\\"\n]+', String), # all other characters
117
- (r'\\\n', String), # line continuation
116
+ (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), # line continuation
118
117
  (r'\\', String), # stray backslash
119
118
  ],
120
119
  'macro': [
@@ -123,7 +122,7 @@ class VerilogLexer(RegexLexer):
123
122
  (r'//.*?\n', Comment.Single, '#pop'),
124
123
  (r'/', Comment.Preproc),
125
124
  (r'(?<=\\)\n', Comment.Preproc),
126
- (r'\n', Comment.Preproc, '#pop'),
125
+ (r'\n', Whitespace, '#pop'),
127
126
  ],
128
127
  'import': [
129
128
  (r'[\w:]+\*?', Name.Namespace, '#pop')
@@ -161,13 +160,12 @@ class SystemVerilogLexer(RegexLexer):
161
160
 
162
161
  tokens = {
163
162
  'root': [
164
- (r'^\s*`define', Comment.Preproc, 'macro'),
165
- (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
166
- (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text), 'import'),
163
+ (r'^(\s*)(`define)', bygroups(Whitespace, Comment.Preproc), 'macro'),
164
+ (r'^(\s*)(package)(\s+)', bygroups(Whitespace, Keyword.Namespace, Whitespace)),
165
+ (r'^(\s*)(import)(\s+)', bygroups(Whitespace, Keyword.Namespace, Whitespace), 'import'),
167
166
 
168
- (r'\n', Text),
169
- (r'\s+', Text),
170
- (r'\\\n', Text), # line continuation
167
+ (r'\s+', Whitespace),
168
+ (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), # line continuation
171
169
  (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
172
170
  (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
173
171
  (r'[{}#@]', Punctuation),
@@ -240,11 +238,11 @@ class SystemVerilogLexer(RegexLexer):
240
238
  Keyword),
241
239
 
242
240
  (r'(class)(\s+)([a-zA-Z_]\w*)',
243
- bygroups(Keyword.Declaration, Text, Name.Class)),
241
+ bygroups(Keyword.Declaration, Whitespace, Name.Class)),
244
242
  (r'(extends)(\s+)([a-zA-Z_]\w*)',
245
- bygroups(Keyword.Declaration, Text, Name.Class)),
243
+ bygroups(Keyword.Declaration, Whitespace, Name.Class)),
246
244
  (r'(endclass\b)(?:(\s*)(:)(\s*)([a-zA-Z_]\w*))?',
247
- bygroups(Keyword.Declaration, Text, Punctuation, Text, Name.Class)),
245
+ bygroups(Keyword.Declaration, Whitespace, Punctuation, Whitespace, Name.Class)),
248
246
 
249
247
  (words((
250
248
  # Variable types
@@ -355,16 +353,16 @@ class SystemVerilogLexer(RegexLexer):
355
353
  (r'"', String, '#pop'),
356
354
  (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
357
355
  (r'[^\\"\n]+', String), # all other characters
358
- (r'\\\n', String), # line continuation
356
+ (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), # line continuation
359
357
  (r'\\', String), # stray backslash
360
358
  ],
361
359
  'macro': [
362
360
  (r'[^/\n]+', Comment.Preproc),
363
361
  (r'/[*](.|\n)*?[*]/', Comment.Multiline),
364
- (r'//.*?\n', Comment.Single, '#pop'),
362
+ (r'//.*?$', Comment.Single, '#pop'),
365
363
  (r'/', Comment.Preproc),
366
364
  (r'(?<=\\)\n', Comment.Preproc),
367
- (r'\n', Comment.Preproc, '#pop'),
365
+ (r'\n', Whitespace, '#pop'),
368
366
  ],
369
367
  'import': [
370
368
  (r'[\w:]+\*?', Name.Namespace, '#pop')
@@ -386,9 +384,8 @@ class VhdlLexer(RegexLexer):
386
384
 
387
385
  tokens = {
388
386
  'root': [
389
- (r'\n', Text),
390
- (r'\s+', Text),
391
- (r'\\\n', Text), # line continuation
387
+ (r'\s+', Whitespace),
388
+ (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), # line continuation
392
389
  (r'--.*?$', Comment.Single),
393
390
  (r"'(U|X|0|1|Z|W|L|H|-)'", String.Char),
394
391
  (r'[~!%^&*+=|?:<>/-]', Operator),
@@ -397,25 +394,25 @@ class VhdlLexer(RegexLexer):
397
394
  (r'"[^\n\\"]*"', String),
398
395
 
399
396
  (r'(library)(\s+)([a-z_]\w*)',
400
- bygroups(Keyword, Text, Name.Namespace)),
401
- (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)),
397
+ bygroups(Keyword, Whitespace, Name.Namespace)),
398
+ (r'(use)(\s+)(entity)', bygroups(Keyword, Whitespace, Keyword)),
402
399
  (r'(use)(\s+)([a-z_][\w.]*\.)(all)',
403
- bygroups(Keyword, Text, Name.Namespace, Keyword)),
400
+ bygroups(Keyword, Whitespace, Name.Namespace, Keyword)),
404
401
  (r'(use)(\s+)([a-z_][\w.]*)',
405
- bygroups(Keyword, Text, Name.Namespace)),
402
+ bygroups(Keyword, Whitespace, Name.Namespace)),
406
403
  (r'(std|ieee)(\.[a-z_]\w*)',
407
404
  bygroups(Name.Namespace, Name.Namespace)),
408
405
  (words(('std', 'ieee', 'work'), suffix=r'\b'),
409
406
  Name.Namespace),
410
407
  (r'(entity|component)(\s+)([a-z_]\w*)',
411
- bygroups(Keyword, Text, Name.Class)),
408
+ bygroups(Keyword, Whitespace, Name.Class)),
412
409
  (r'(architecture|configuration)(\s+)([a-z_]\w*)(\s+)'
413
410
  r'(of)(\s+)([a-z_]\w*)(\s+)(is)',
414
- bygroups(Keyword, Text, Name.Class, Text, Keyword, Text,
415
- Name.Class, Text, Keyword)),
411
+ bygroups(Keyword, Whitespace, Name.Class, Whitespace, Keyword, Whitespace,
412
+ Name.Class, Whitespace, Keyword)),
416
413
  (r'([a-z_]\w*)(:)(\s+)(process|for)',
417
- bygroups(Name.Class, Operator, Text, Keyword)),
418
- (r'(end)(\s+)', bygroups(using(this), Text), 'endblock'),
414
+ bygroups(Name.Class, Operator, Whitespace, Keyword)),
415
+ (r'(end)(\s+)', bygroups(using(this), Whitespace), 'endblock'),
419
416
 
420
417
  include('types'),
421
418
  include('keywords'),
@@ -426,7 +423,7 @@ class VhdlLexer(RegexLexer):
426
423
  'endblock': [
427
424
  include('keywords'),
428
425
  (r'[a-z_]\w*', Name.Class),
429
- (r'(\s+)', Text),
426
+ (r'\s+', Whitespace),
430
427
  (r';', Punctuation, '#pop'),
431
428
  ],
432
429
  'types': [