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,26 +4,23 @@
4
4
 
5
5
  Lexers for various shells.
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, do_insertions, bygroups, \
14
- include, default, this, using, words
15
- from pygments.token import Punctuation, \
14
+ include, default, this, using, words, line_re
15
+ from pygments.token import Punctuation, Whitespace, \
16
16
  Text, Comment, Operator, Keyword, Name, String, Number, Generic
17
17
  from pygments.util import shebang_matches
18
18
 
19
-
20
19
  __all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer',
21
20
  'SlurmBashLexer', 'MSDOSSessionLexer', 'PowerShellLexer',
22
21
  'PowerShellSessionLexer', 'TcshSessionLexer', 'FishShellLexer',
23
22
  'ExeclineLexer']
24
23
 
25
- line_re = re.compile('.*?\n')
26
-
27
24
 
28
25
  class BashLexer(RegexLexer):
29
26
  """
@@ -37,6 +34,7 @@ class BashLexer(RegexLexer):
37
34
  filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass',
38
35
  '*.exheres-0', '*.exlib', '*.zsh',
39
36
  '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc',
37
+ '.kshrc', 'kshrc',
40
38
  'PKGBUILD']
41
39
  mimetypes = ['application/x-sh', 'application/x-shellscript', 'text/x-shellscript']
42
40
 
@@ -57,9 +55,9 @@ class BashLexer(RegexLexer):
57
55
  ],
58
56
  'basic': [
59
57
  (r'\b(if|fi|else|while|in|do|done|for|then|return|function|case|'
60
- r'select|continue|until|esac|elif)(\s*)\b',
61
- bygroups(Keyword, Text)),
62
- (r'\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|'
58
+ r'select|break|continue|until|esac|elif)(\s*)\b',
59
+ bygroups(Keyword, Whitespace)),
60
+ (r'\b(alias|bg|bind|builtin|caller|cd|command|compgen|'
63
61
  r'complete|declare|dirs|disown|echo|enable|eval|exec|exit|'
64
62
  r'export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|'
65
63
  r'local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|'
@@ -69,7 +67,7 @@ class BashLexer(RegexLexer):
69
67
  (r'\A#!.+\n', Comment.Hashbang),
70
68
  (r'#.*\n', Comment.Single),
71
69
  (r'\\[\w\W]', String.Escape),
72
- (r'(\b\w+)(\s*)(\+?=)', bygroups(Name.Variable, Text, Operator)),
70
+ (r'(\b\w+)(\s*)(\+?=)', bygroups(Name.Variable, Whitespace, Operator)),
73
71
  (r'[\[\]{}()=]', Operator),
74
72
  (r'<<<', Operator), # here-string
75
73
  (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
@@ -83,7 +81,7 @@ class BashLexer(RegexLexer):
83
81
  (r';', Punctuation),
84
82
  (r'&', Punctuation),
85
83
  (r'\|', Punctuation),
86
- (r'\s+', Text),
84
+ (r'\s+', Whitespace),
87
85
  (r'\d+\b', Number),
88
86
  (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
89
87
  (r'<', Text),
@@ -107,10 +105,12 @@ class BashLexer(RegexLexer):
107
105
  ],
108
106
  'math': [
109
107
  (r'\)\)', Keyword, '#pop'),
110
- (r'[-+*/%^|&]|\*\*|\|\|', Operator),
111
- (r'\d+#\d+', Number),
108
+ (r'\*\*|\|\||<<|>>|[-+*/%^|&<>]', Operator),
109
+ (r'\d+#[\da-zA-Z]+', Number),
112
110
  (r'\d+#(?! )', Number),
111
+ (r'0[xX][\da-fA-F]+', Number),
113
112
  (r'\d+', Number),
113
+ (r'[a-zA-Z_]\w*', Name.Variable), # user variable
114
114
  include('root'),
115
115
  ],
116
116
  'backticks': [
@@ -156,6 +156,7 @@ class ShellSessionBaseLexer(Lexer):
156
156
  .. versionadded:: 2.1
157
157
  """
158
158
 
159
+ _bare_continuation = False
159
160
  _venv = re.compile(r'^(\([^)]*\))(\s*)')
160
161
 
161
162
  def get_tokens_unprocessed(self, text):
@@ -174,10 +175,10 @@ class ShellSessionBaseLexer(Lexer):
174
175
  venv = venv_match.group(1)
175
176
  venv_whitespace = venv_match.group(2)
176
177
  insertions.append((len(curcode),
177
- [(0, Generic.Prompt.VirtualEnv, venv)]))
178
+ [(0, Generic.Prompt.VirtualEnv, venv)]))
178
179
  if venv_whitespace:
179
180
  insertions.append((len(curcode),
180
- [(0, Text, venv_whitespace)]))
181
+ [(0, Text, venv_whitespace)]))
181
182
  line = line[venv_match.end():]
182
183
 
183
184
  m = self._ps1rgx.match(line)
@@ -195,11 +196,17 @@ class ShellSessionBaseLexer(Lexer):
195
196
  elif backslash_continuation:
196
197
  if line.startswith(self._ps2):
197
198
  insertions.append((len(curcode),
198
- [(0, Generic.Prompt, line[:len(self._ps2)])]))
199
+ [(0, Generic.Prompt,
200
+ line[:len(self._ps2)])]))
199
201
  curcode += line[len(self._ps2):]
200
202
  else:
201
203
  curcode += line
202
204
  backslash_continuation = curcode.endswith('\\\n')
205
+ elif self._bare_continuation and line.startswith(self._ps2):
206
+ insertions.append((len(curcode),
207
+ [(0, Generic.Prompt,
208
+ line[:len(self._ps2)])]))
209
+ curcode += line[len(self._ps2):]
203
210
  else:
204
211
  if insertions:
205
212
  toks = innerlexer.get_tokens_unprocessed(curcode)
@@ -584,9 +591,9 @@ class TcshLexer(RegexLexer):
584
591
  ],
585
592
  'basic': [
586
593
  (r'\b(if|endif|else|while|then|foreach|case|default|'
587
- r'continue|goto|breaksw|end|switch|endsw)\s*\b',
594
+ r'break|continue|goto|breaksw|end|switch|endsw)\s*\b',
588
595
  Keyword),
589
- (r'\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|'
596
+ (r'\b(alias|alloc|bg|bindkey|builtins|bye|caller|cd|chdir|'
590
597
  r'complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|'
591
598
  r'glob|getspath|hashstat|history|hup|inlib|jobs|kill|'
592
599
  r'limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|'
@@ -664,7 +671,7 @@ class PowerShellLexer(RegexLexer):
664
671
  keywords = (
665
672
  'while validateset validaterange validatepattern validatelength '
666
673
  'validatecount until trap switch return ref process param parameter in '
667
- 'if global: function foreach for finally filter end elseif else '
674
+ 'if global: local: function foreach for finally filter end elseif else '
668
675
  'dynamicparam do default continue cmdletbinding break begin alias \\? '
669
676
  '% #script #private #local #global mandatory parametersetname position '
670
677
  'valuefrompipeline valuefrompipelinebypropertyname '
@@ -776,8 +783,9 @@ class PowerShellSessionLexer(ShellSessionBaseLexer):
776
783
  mimetypes = []
777
784
 
778
785
  _innerLexerCls = PowerShellLexer
786
+ _bare_continuation = True
779
787
  _ps1rgx = re.compile(r'^((?:\[[^]]+\]: )?PS[^>]*> ?)(.*\n?)')
780
- _ps2 = '>> '
788
+ _ps2 = '> '
781
789
 
782
790
 
783
791
  class FishShellLexer(RegexLexer):
@@ -818,7 +826,7 @@ class FishShellLexer(RegexLexer):
818
826
  Name.Builtin),
819
827
  (r'#.*\n', Comment),
820
828
  (r'\\[\w\W]', String.Escape),
821
- (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
829
+ (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Whitespace, Operator)),
822
830
  (r'[\[\]()=]', Operator),
823
831
  (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
824
832
  ],
@@ -13,12 +13,13 @@
13
13
  https://tools.ietf.org/html/rfc5429
14
14
  https://tools.ietf.org/html/rfc8580
15
15
 
16
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
16
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
17
17
  :license: BSD, see LICENSE for details.
18
18
  """
19
19
 
20
20
  from pygments.lexer import RegexLexer, bygroups
21
- from pygments.token import Comment, Name, Literal, String, Text, Punctuation, Keyword
21
+ from pygments.token import Comment, Name, Literal, String, Text, Punctuation, \
22
+ Keyword
22
23
 
23
24
  __all__ = ["SieveLexer"]
24
25
 
@@ -26,6 +27,8 @@ __all__ = ["SieveLexer"]
26
27
  class SieveLexer(RegexLexer):
27
28
  """
28
29
  Lexer for sieve format.
30
+
31
+ .. versionadded:: 2.6
29
32
  """
30
33
  name = 'Sieve'
31
34
  filenames = ['*.siv', '*.sieve']
@@ -39,10 +42,17 @@ class SieveLexer(RegexLexer):
39
42
  (r'(?i)require',
40
43
  Keyword.Namespace),
41
44
  # tags:
42
- (r'(?i)(:)(addresses|all|contains|content|create|copy|comparator|count|days|detail|domain|fcc|flags|from|handle|importance|is|localpart|length|lowerfirst|lower|matches|message|mime|options|over|percent|quotewildcard|raw|regex|specialuse|subject|text|under|upperfirst|upper|value)',
45
+ (r'(?i)(:)(addresses|all|contains|content|create|copy|comparator|'
46
+ r'count|days|detail|domain|fcc|flags|from|handle|importance|is|'
47
+ r'localpart|length|lowerfirst|lower|matches|message|mime|options|'
48
+ r'over|percent|quotewildcard|raw|regex|specialuse|subject|text|'
49
+ r'under|upperfirst|upper|value)',
43
50
  bygroups(Name.Tag, Name.Tag)),
44
51
  # tokens:
45
- (r'(?i)(address|addflag|allof|anyof|body|discard|elsif|else|envelope|ereject|exists|false|fileinto|if|hasflag|header|keep|notify_method_capability|notify|not|redirect|reject|removeflag|setflag|size|spamtest|stop|string|true|vacation|virustest)',
52
+ (r'(?i)(address|addflag|allof|anyof|body|discard|elsif|else|envelope|'
53
+ r'ereject|exists|false|fileinto|if|hasflag|header|keep|'
54
+ r'notify_method_capability|notify|not|redirect|reject|removeflag|'
55
+ r'setflag|size|spamtest|stop|string|true|vacation|virustest)',
46
56
  Name.Builtin),
47
57
  (r'(?i)set',
48
58
  Keyword.Declaration),
@@ -5,7 +5,7 @@
5
5
  Lexer for the `Slash <https://github.com/arturadib/Slash-A>`_ programming
6
6
  language.
7
7
 
8
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for Smalltalk 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
 
@@ -17,13 +17,14 @@ __all__ = ['SmalltalkLexer', 'NewspeakLexer']
17
17
 
18
18
  class SmalltalkLexer(RegexLexer):
19
19
  """
20
- For `Smalltalk <http://www.smalltalk.org/>`_ syntax.
20
+ For Smalltalk syntax.
21
21
  Contributed by Stefan Matthias Aust.
22
22
  Rewritten by Nils Winter.
23
23
 
24
24
  .. versionadded:: 0.10
25
25
  """
26
26
  name = 'Smalltalk'
27
+ url = 'http://www.smalltalk.org/'
27
28
  filenames = ['*.st']
28
29
  aliases = ['smalltalk', 'squeak', 'st']
29
30
  mimetypes = ['text/x-smalltalk']
@@ -138,11 +139,12 @@ class SmalltalkLexer(RegexLexer):
138
139
 
139
140
  class NewspeakLexer(RegexLexer):
140
141
  """
141
- For `Newspeak <http://newspeaklanguage.org/>`_ syntax.
142
+ For Newspeak syntax.
142
143
 
143
144
  .. versionadded:: 1.1
144
145
  """
145
146
  name = 'Newspeak'
147
+ url = 'http://newspeaklanguage.org/'
146
148
  filenames = ['*.ns2']
147
149
  aliases = ['newspeak', ]
148
150
  mimetypes = ['text/x-newspeak']
@@ -4,12 +4,10 @@
4
4
 
5
5
  Lexers for the Smithy IDL.
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
- import re
12
-
13
11
  from pygments.lexer import RegexLexer, bygroups, words
14
12
  from pygments.token import Text, Comment, Keyword, Name, String, \
15
13
  Number, Whitespace, Punctuation
@@ -24,10 +22,10 @@ class SmithyLexer(RegexLexer):
24
22
  .. versionadded:: 2.10
25
23
  """
26
24
  name = 'Smithy'
25
+ url = 'https://awslabs.github.io/smithy/'
27
26
  filenames = ['*.smithy']
28
27
  aliases = ['smithy']
29
28
 
30
- flags = re.MULTILINE | re.UNICODE
31
29
  unquoted = r'[A-Za-z0-9_\.#$-]+'
32
30
  identifier = r"[A-Za-z0-9_\.#$-]+"
33
31
 
@@ -58,8 +56,9 @@ class SmithyLexer(RegexLexer):
58
56
  (words(aggregate_shapes,
59
57
  prefix=r'^', suffix=r'(\s+' + identifier + r')'),
60
58
  bygroups(Keyword.Declaration, Name.Class)),
61
- (r'^(metadata)(\s+.+)(\s*)(=)',
62
- bygroups(Keyword.Declaration, Name.Class, Whitespace, Name.Decorator)),
59
+ (r'^(metadata)(\s+)((?:\S+)|(?:\"[^"]+\"))(\s*)(=)',
60
+ bygroups(Keyword.Declaration, Whitespace, Name.Class,
61
+ Whitespace, Name.Decorator)),
63
62
  (r"(true|false|null)", Keyword.Constant),
64
63
  (r"(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)", Number),
65
64
  (identifier + ":", Name.Label),
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for the SMV 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
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for the SNOBOL language.
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
 
@@ -4,12 +4,10 @@
4
4
 
5
5
  Lexers for Solidity.
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
- import re
12
-
13
11
  from pygments.lexer import RegexLexer, bygroups, include, words
14
12
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
15
13
  Number, Punctuation, Whitespace
@@ -29,8 +27,6 @@ class SolidityLexer(RegexLexer):
29
27
  filenames = ['*.sol']
30
28
  mimetypes = []
31
29
 
32
- flags = re.MULTILINE | re.UNICODE
33
-
34
30
  datatype = (
35
31
  r'\b(address|bool|(?:(?:bytes|hash|int|string|uint)(?:8|16|24|32|40|48|56|64'
36
32
  r'|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208'
@@ -63,8 +59,8 @@ class SolidityLexer(RegexLexer):
63
59
  (datatype, Keyword.Type),
64
60
  include('constants'),
65
61
  (r'[a-zA-Z_]\w*', Text),
66
- (r'[!<=>+*/-]', Operator),
67
- (r'[.;:{}(),\[\]]', Punctuation)
62
+ (r'[~!%^&*+=|?:<>/-]', Operator),
63
+ (r'[.;{}(),\[\]]', Punctuation)
68
64
  ],
69
65
  'comments': [
70
66
  (r'//(\n|[\w\W]*?[^\\]\n)', Comment.Single),
@@ -0,0 +1,103 @@
1
+ """
2
+ pygments.lexers.sophia
3
+ ~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for Sophia.
6
+
7
+ Derived from pygments/lexers/reason.py.
8
+
9
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
10
+ :license: BSD, see LICENSE for details.
11
+ """
12
+
13
+ from pygments.lexer import RegexLexer, include, default, words
14
+ from pygments.token import Comment, Keyword, Name, Number, Operator, \
15
+ Punctuation, String, Text
16
+
17
+ __all__ = ['SophiaLexer']
18
+
19
+ class SophiaLexer(RegexLexer):
20
+ """
21
+ A Sophia lexer.
22
+
23
+ .. versionadded:: 2.11
24
+ """
25
+
26
+ name = 'Sophia'
27
+ aliases = ['sophia']
28
+ filenames = ['*.aes']
29
+ mimetypes = []
30
+
31
+ keywords = (
32
+ 'contract', 'include', 'let', 'switch', 'type', 'record', 'datatype',
33
+ 'if', 'elif', 'else', 'function', 'stateful', 'payable', 'public',
34
+ 'entrypoint', 'private', 'indexed', 'namespace', 'interface', 'main',
35
+ 'using', 'as', 'for', 'hiding',
36
+ )
37
+
38
+ builtins = ('state', 'put', 'abort', 'require')
39
+
40
+ word_operators = ('mod', 'band', 'bor', 'bxor', 'bnot')
41
+
42
+ primitive_types = ('int', 'address', 'bool', 'bits', 'bytes', 'string',
43
+ 'list', 'option', 'char', 'unit', 'map', 'event',
44
+ 'hash', 'signature', 'oracle', 'oracle_query')
45
+
46
+ tokens = {
47
+ 'escape-sequence': [
48
+ (r'\\[\\"\'ntbr]', String.Escape),
49
+ (r'\\[0-9]{3}', String.Escape),
50
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
51
+ ],
52
+ 'root': [
53
+ (r'\s+', Text.Whitespace),
54
+ (r'(true|false)\b', Keyword.Constant),
55
+ (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Class, 'dotted'),
56
+ (r'\b([A-Z][\w\']*)', Name.Function),
57
+ (r'//.*?\n', Comment.Single),
58
+ (r'\/\*(?!/)', Comment.Multiline, 'comment'),
59
+
60
+ (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
61
+ (r'#[\da-fA-F][\da-fA-F_]*', Name.Label),
62
+ (r'\d[\d_]*', Number.Integer),
63
+
64
+ (words(keywords, suffix=r'\b'), Keyword),
65
+ (words(builtins, suffix=r'\b'), Name.Builtin),
66
+ (words(word_operators, prefix=r'\b', suffix=r'\b'), Operator.Word),
67
+ (words(primitive_types, prefix=r'\b', suffix=r'\b'), Keyword.Type),
68
+
69
+ (r'[=!<>+\\*/:&|?~@^-]', Operator.Word),
70
+ (r'[.;:{}(),\[\]]', Punctuation),
71
+
72
+ (r"(ak_|ok_|oq_|ct_)[\w']*", Name.Label),
73
+ (r"[^\W\d][\w']*", Name),
74
+
75
+ (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
76
+ String.Char),
77
+ (r"'.'", String.Char),
78
+ (r"'[a-z][\w]*", Name.Variable),
79
+
80
+ (r'"', String.Double, 'string')
81
+ ],
82
+ 'comment': [
83
+ (r'[^/*]+', Comment.Multiline),
84
+ (r'\/\*', Comment.Multiline, '#push'),
85
+ (r'\*\/', Comment.Multiline, '#pop'),
86
+ (r'\*', Comment.Multiline),
87
+ ],
88
+ 'string': [
89
+ (r'[^\\"]+', String.Double),
90
+ include('escape-sequence'),
91
+ (r'\\\n', String.Double),
92
+ (r'"', String.Double, '#pop'),
93
+ ],
94
+ 'dotted': [
95
+ (r'\s+', Text),
96
+ (r'\.', Punctuation),
97
+ (r'[A-Z][\w\']*(?=\s*\.)', Name.Function),
98
+ (r'[A-Z][\w\']*', Name.Function, '#pop'),
99
+ (r'[a-z_][\w\']*', Name, '#pop'),
100
+ default('#pop'),
101
+ ],
102
+ }
103
+
@@ -4,14 +4,13 @@
4
4
 
5
5
  Special lexers.
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 ast
12
- import re
13
12
 
14
- from pygments.lexer import Lexer
13
+ from pygments.lexer import Lexer, line_re
15
14
  from pygments.token import Token, Error, Text, Generic
16
15
  from pygments.util import get_choice_opt
17
16
 
@@ -51,8 +50,6 @@ class OutputLexer(Lexer):
51
50
 
52
51
  _ttype_cache = {}
53
52
 
54
- line_re = re.compile('.*?\n')
55
-
56
53
 
57
54
  class RawTokenLexer(Lexer):
58
55
  """
@@ -0,0 +1,71 @@
1
+ """
2
+ pygments.lexers.spice
3
+ ~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexers for the Spice programming language.
6
+
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, bygroups, words
12
+ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
13
+ Number, Punctuation, Whitespace
14
+
15
+ __all__ = ['SpiceLexer']
16
+
17
+
18
+ class SpiceLexer(RegexLexer):
19
+ """
20
+ For Spice source.
21
+
22
+ .. versionadded:: 2.11
23
+ """
24
+ name = 'Spice'
25
+ url = 'https://www.spicelang.com'
26
+ filenames = ['*.spice']
27
+ aliases = ['spice', 'spicelang']
28
+ mimetypes = ['text/x-spice']
29
+
30
+ tokens = {
31
+ 'root': [
32
+ (r'\n', Whitespace),
33
+ (r'\s+', Whitespace),
34
+ (r'\\\n', Text),
35
+ # comments
36
+ (r'//(.*?)\n', Comment.Single),
37
+ (r'/(\\\n)?[*]{2}(.|\n)*?[*](\\\n)?/', String.Doc),
38
+ (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
39
+ # keywords
40
+ (r'(import|as)\b', Keyword.Namespace),
41
+ (r'(f|p|type|struct|interface|enum|alias|operator)\b', Keyword.Declaration),
42
+ (words(('if', 'else', 'for', 'foreach', 'do', 'while', 'break',
43
+ 'continue', 'return', 'assert', 'thread', 'unsafe', 'ext',
44
+ 'dll'), suffix=r'\b'), Keyword),
45
+ (words(('const', 'signed', 'unsigned', 'inline', 'public', 'heap'),
46
+ suffix=r'\b'), Keyword.Pseudo),
47
+ (words(('new', 'switch', 'case', 'yield', 'stash', 'pick', 'sync',
48
+ 'class'), suffix=r'\b'), Keyword.Reserved),
49
+ (r'(true|false|nil)\b', Keyword.Constant),
50
+ (words(('double', 'int', 'short', 'long', 'byte', 'char', 'string',
51
+ 'bool', 'dyn'), suffix=r'\b'), Keyword.Type),
52
+ (words(('printf', 'sizeof', 'len', 'tid', 'join'), suffix=r'\b(\()'),
53
+ bygroups(Name.Builtin, Punctuation)),
54
+ # numeric literals
55
+ (r'[0-9]*[.][0-9]+', Number.Double),
56
+ (r'0[bB][01]+[sl]?', Number.Bin),
57
+ (r'0[oO][0-7]+[sl]?', Number.Oct),
58
+ (r'0[xXhH][0-9a-fA-F]+[sl]?', Number.Hex),
59
+ (r'(0[dD])?[0-9]+[sl]?', Number.Integer),
60
+ # string literal
61
+ (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
62
+ # char literal
63
+ (r'\'(\\\\|\\[^\\]|[^\'\\])\'', String.Char),
64
+ # tokens
65
+ (r'<<=|>>=|<<|>>|<=|>=|\+=|-=|\*=|/=|\%=|\|=|&=|\^=|&&|\|\||&|\||'
66
+ r'\+\+|--|\%|\^|\~|==|!=|::|[.]{3}|[+\-*/&]', Operator),
67
+ (r'[|<>=!()\[\]{}.,;:\?]', Punctuation),
68
+ # identifiers
69
+ (r'[^\W\d]\w*', Name.Other),
70
+ ]
71
+ }