pygments.rb 2.4.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +8 -8
  3. data/.github/workflows/release.yml +5 -5
  4. data/.gitignore +2 -0
  5. data/.rubocop.yml +1 -1
  6. data/CHANGELOG.adoc +9 -1
  7. data/README.adoc +2 -2
  8. data/lib/pygments/version.rb +1 -1
  9. data/pygments.rb.gemspec +2 -2
  10. data/vendor/pygments-main/bin/pygmentize +1 -1
  11. data/vendor/pygments-main/pygments/__init__.py +2 -2
  12. data/vendor/pygments-main/pygments/__main__.py +1 -1
  13. data/vendor/pygments-main/pygments/cmdline.py +12 -12
  14. data/vendor/pygments-main/pygments/console.py +5 -5
  15. data/vendor/pygments-main/pygments/filter.py +2 -3
  16. data/vendor/pygments-main/pygments/filters/__init__.py +4 -4
  17. data/vendor/pygments-main/pygments/formatter.py +6 -1
  18. data/vendor/pygments-main/pygments/formatters/__init__.py +7 -8
  19. data/vendor/pygments-main/pygments/formatters/_mapping.py +0 -0
  20. data/vendor/pygments-main/pygments/formatters/bbcode.py +2 -2
  21. data/vendor/pygments-main/pygments/formatters/groff.py +3 -3
  22. data/vendor/pygments-main/pygments/formatters/html.py +38 -40
  23. data/vendor/pygments-main/pygments/formatters/img.py +51 -11
  24. data/vendor/pygments-main/pygments/formatters/irc.py +1 -1
  25. data/vendor/pygments-main/pygments/formatters/latex.py +24 -27
  26. data/vendor/pygments-main/pygments/formatters/other.py +3 -4
  27. data/vendor/pygments-main/pygments/formatters/pangomarkup.py +2 -2
  28. data/vendor/pygments-main/pygments/formatters/rtf.py +228 -25
  29. data/vendor/pygments-main/pygments/formatters/svg.py +17 -20
  30. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
  31. data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
  32. data/vendor/pygments-main/pygments/lexer.py +51 -33
  33. data/vendor/pygments-main/pygments/lexers/__init__.py +12 -12
  34. data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +1 -1
  35. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
  36. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
  37. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
  38. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1 -1
  39. data/vendor/pygments-main/pygments/lexers/_css_builtins.py +1 -1
  40. data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +1 -1
  41. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
  42. data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +1 -1
  43. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +5 -5
  44. data/vendor/pygments-main/pygments/lexers/_luau_builtins.py +62 -0
  45. data/vendor/pygments-main/pygments/lexers/_mapping.py +41 -11
  46. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
  47. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +3 -3
  48. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  49. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +3 -3
  50. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +5 -5
  51. data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +1 -1
  52. data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +4 -4
  54. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +3 -3
  55. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +1 -1
  56. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
  57. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  58. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
  59. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
  60. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  61. data/vendor/pygments-main/pygments/lexers/actionscript.py +6 -8
  62. data/vendor/pygments-main/pygments/lexers/ada.py +3 -3
  63. data/vendor/pygments-main/pygments/lexers/agile.py +3 -1
  64. data/vendor/pygments-main/pygments/lexers/algebra.py +9 -13
  65. data/vendor/pygments-main/pygments/lexers/ambient.py +2 -3
  66. data/vendor/pygments-main/pygments/lexers/amdgpu.py +3 -3
  67. data/vendor/pygments-main/pygments/lexers/ampl.py +2 -3
  68. data/vendor/pygments-main/pygments/lexers/apdlexer.py +4 -3
  69. data/vendor/pygments-main/pygments/lexers/apl.py +2 -3
  70. data/vendor/pygments-main/pygments/lexers/archetype.py +8 -12
  71. data/vendor/pygments-main/pygments/lexers/arrow.py +2 -3
  72. data/vendor/pygments-main/pygments/lexers/arturo.py +2 -3
  73. data/vendor/pygments-main/pygments/lexers/asc.py +4 -4
  74. data/vendor/pygments-main/pygments/lexers/asm.py +28 -15
  75. data/vendor/pygments-main/pygments/lexers/asn1.py +178 -0
  76. data/vendor/pygments-main/pygments/lexers/automation.py +6 -8
  77. data/vendor/pygments-main/pygments/lexers/bare.py +2 -3
  78. data/vendor/pygments-main/pygments/lexers/basic.py +48 -57
  79. data/vendor/pygments-main/pygments/lexers/bdd.py +3 -4
  80. data/vendor/pygments-main/pygments/lexers/berry.py +4 -4
  81. data/vendor/pygments-main/pygments/lexers/bibtex.py +5 -5
  82. data/vendor/pygments-main/pygments/lexers/blueprint.py +173 -0
  83. data/vendor/pygments-main/pygments/lexers/boa.py +4 -4
  84. data/vendor/pygments-main/pygments/lexers/bqn.py +109 -0
  85. data/vendor/pygments-main/pygments/lexers/business.py +21 -22
  86. data/vendor/pygments-main/pygments/lexers/c_cpp.py +9 -4
  87. data/vendor/pygments-main/pygments/lexers/c_like.py +99 -27
  88. data/vendor/pygments-main/pygments/lexers/capnproto.py +2 -3
  89. data/vendor/pygments-main/pygments/lexers/carbon.py +10 -11
  90. data/vendor/pygments-main/pygments/lexers/cddl.py +8 -9
  91. data/vendor/pygments-main/pygments/lexers/chapel.py +2 -3
  92. data/vendor/pygments-main/pygments/lexers/clean.py +2 -1
  93. data/vendor/pygments-main/pygments/lexers/comal.py +2 -1
  94. data/vendor/pygments-main/pygments/lexers/compiled.py +2 -1
  95. data/vendor/pygments-main/pygments/lexers/configs.py +342 -108
  96. data/vendor/pygments-main/pygments/lexers/console.py +5 -5
  97. data/vendor/pygments-main/pygments/lexers/cplint.py +2 -3
  98. data/vendor/pygments-main/pygments/lexers/crystal.py +4 -5
  99. data/vendor/pygments-main/pygments/lexers/csound.py +6 -8
  100. data/vendor/pygments-main/pygments/lexers/css.py +5 -5
  101. data/vendor/pygments-main/pygments/lexers/d.py +4 -3
  102. data/vendor/pygments-main/pygments/lexers/dalvik.py +2 -3
  103. data/vendor/pygments-main/pygments/lexers/data.py +8 -12
  104. data/vendor/pygments-main/pygments/lexers/dax.py +2 -3
  105. data/vendor/pygments-main/pygments/lexers/devicetree.py +2 -3
  106. data/vendor/pygments-main/pygments/lexers/diff.py +7 -6
  107. data/vendor/pygments-main/pygments/lexers/dns.py +109 -0
  108. data/vendor/pygments-main/pygments/lexers/dotnet.py +19 -14
  109. data/vendor/pygments-main/pygments/lexers/dsls.py +24 -35
  110. data/vendor/pygments-main/pygments/lexers/dylan.py +8 -16
  111. data/vendor/pygments-main/pygments/lexers/ecl.py +2 -3
  112. data/vendor/pygments-main/pygments/lexers/eiffel.py +3 -4
  113. data/vendor/pygments-main/pygments/lexers/elm.py +3 -4
  114. data/vendor/pygments-main/pygments/lexers/elpi.py +28 -21
  115. data/vendor/pygments-main/pygments/lexers/email.py +3 -3
  116. data/vendor/pygments-main/pygments/lexers/erlang.py +22 -24
  117. data/vendor/pygments-main/pygments/lexers/esoteric.py +11 -12
  118. data/vendor/pygments-main/pygments/lexers/ezhil.py +2 -3
  119. data/vendor/pygments-main/pygments/lexers/factor.py +2 -3
  120. data/vendor/pygments-main/pygments/lexers/fantom.py +3 -3
  121. data/vendor/pygments-main/pygments/lexers/felix.py +9 -10
  122. data/vendor/pygments-main/pygments/lexers/fift.py +2 -1
  123. data/vendor/pygments-main/pygments/lexers/floscript.py +2 -3
  124. data/vendor/pygments-main/pygments/lexers/forth.py +2 -3
  125. data/vendor/pygments-main/pygments/lexers/fortran.py +6 -7
  126. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  127. data/vendor/pygments-main/pygments/lexers/freefem.py +2 -3
  128. data/vendor/pygments-main/pygments/lexers/func.py +3 -1
  129. data/vendor/pygments-main/pygments/lexers/functional.py +2 -1
  130. data/vendor/pygments-main/pygments/lexers/futhark.py +6 -7
  131. data/vendor/pygments-main/pygments/lexers/gcodelexer.py +3 -3
  132. data/vendor/pygments-main/pygments/lexers/gdscript.py +2 -1
  133. data/vendor/pygments-main/pygments/lexers/go.py +3 -4
  134. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +6 -9
  135. data/vendor/pygments-main/pygments/lexers/graph.py +12 -9
  136. data/vendor/pygments-main/pygments/lexers/graphics.py +13 -17
  137. data/vendor/pygments-main/pygments/lexers/graphql.py +176 -0
  138. data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -3
  139. data/vendor/pygments-main/pygments/lexers/gsql.py +2 -3
  140. data/vendor/pygments-main/pygments/lexers/haskell.py +27 -32
  141. data/vendor/pygments-main/pygments/lexers/haxe.py +3 -5
  142. data/vendor/pygments-main/pygments/lexers/hdl.py +8 -7
  143. data/vendor/pygments-main/pygments/lexers/hexdump.py +3 -3
  144. data/vendor/pygments-main/pygments/lexers/html.py +34 -13
  145. data/vendor/pygments-main/pygments/lexers/idl.py +2 -3
  146. data/vendor/pygments-main/pygments/lexers/igor.py +305 -290
  147. data/vendor/pygments-main/pygments/lexers/inferno.py +2 -3
  148. data/vendor/pygments-main/pygments/lexers/installers.py +7 -9
  149. data/vendor/pygments-main/pygments/lexers/int_fiction.py +150 -162
  150. data/vendor/pygments-main/pygments/lexers/iolang.py +2 -3
  151. data/vendor/pygments-main/pygments/lexers/j.py +2 -3
  152. data/vendor/pygments-main/pygments/lexers/javascript.py +18 -19
  153. data/vendor/pygments-main/pygments/lexers/jmespath.py +2 -1
  154. data/vendor/pygments-main/pygments/lexers/jslt.py +2 -3
  155. data/vendor/pygments-main/pygments/lexers/jsonnet.py +4 -3
  156. data/vendor/pygments-main/pygments/lexers/jsx.py +75 -0
  157. data/vendor/pygments-main/pygments/lexers/julia.py +4 -5
  158. data/vendor/pygments-main/pygments/lexers/jvm.py +98 -116
  159. data/vendor/pygments-main/pygments/lexers/kuin.py +2 -3
  160. data/vendor/pygments-main/pygments/lexers/kusto.py +93 -0
  161. data/vendor/pygments-main/pygments/lexers/ldap.py +155 -0
  162. data/vendor/pygments-main/pygments/lexers/lean.py +241 -0
  163. data/vendor/pygments-main/pygments/lexers/lilypond.py +2 -3
  164. data/vendor/pygments-main/pygments/lexers/lisp.py +373 -65
  165. data/vendor/pygments-main/pygments/lexers/macaulay2.py +53 -4
  166. data/vendor/pygments-main/pygments/lexers/make.py +7 -5
  167. data/vendor/pygments-main/pygments/lexers/markup.py +242 -91
  168. data/vendor/pygments-main/pygments/lexers/math.py +2 -1
  169. data/vendor/pygments-main/pygments/lexers/matlab.py +10 -12
  170. data/vendor/pygments-main/pygments/lexers/maxima.py +2 -3
  171. data/vendor/pygments-main/pygments/lexers/meson.py +2 -3
  172. data/vendor/pygments-main/pygments/lexers/mime.py +4 -4
  173. data/vendor/pygments-main/pygments/lexers/minecraft.py +24 -27
  174. data/vendor/pygments-main/pygments/lexers/mips.py +3 -1
  175. data/vendor/pygments-main/pygments/lexers/ml.py +59 -61
  176. data/vendor/pygments-main/pygments/lexers/modeling.py +19 -22
  177. data/vendor/pygments-main/pygments/lexers/modula2.py +2 -3
  178. data/vendor/pygments-main/pygments/lexers/mojo.py +704 -0
  179. data/vendor/pygments-main/pygments/lexers/monte.py +2 -3
  180. data/vendor/pygments-main/pygments/lexers/mosel.py +3 -3
  181. data/vendor/pygments-main/pygments/lexers/ncl.py +4 -3
  182. data/vendor/pygments-main/pygments/lexers/nimrod.py +7 -8
  183. data/vendor/pygments-main/pygments/lexers/nit.py +2 -3
  184. data/vendor/pygments-main/pygments/lexers/nix.py +40 -31
  185. data/vendor/pygments-main/pygments/lexers/oberon.py +3 -3
  186. data/vendor/pygments-main/pygments/lexers/objective.py +14 -6
  187. data/vendor/pygments-main/pygments/lexers/ooc.py +2 -3
  188. data/vendor/pygments-main/pygments/lexers/openscad.py +96 -0
  189. data/vendor/pygments-main/pygments/lexers/other.py +2 -1
  190. data/vendor/pygments-main/pygments/lexers/parasail.py +2 -3
  191. data/vendor/pygments-main/pygments/lexers/parsers.py +41 -44
  192. data/vendor/pygments-main/pygments/lexers/pascal.py +6 -3
  193. data/vendor/pygments-main/pygments/lexers/pawn.py +5 -5
  194. data/vendor/pygments-main/pygments/lexers/perl.py +3 -3
  195. data/vendor/pygments-main/pygments/lexers/phix.py +2 -3
  196. data/vendor/pygments-main/pygments/lexers/php.py +4 -5
  197. data/vendor/pygments-main/pygments/lexers/pointless.py +2 -3
  198. data/vendor/pygments-main/pygments/lexers/pony.py +3 -3
  199. data/vendor/pygments-main/pygments/lexers/praat.py +2 -3
  200. data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
  201. data/vendor/pygments-main/pygments/lexers/prolog.py +23 -9
  202. data/vendor/pygments-main/pygments/lexers/promql.py +2 -1
  203. data/vendor/pygments-main/pygments/lexers/prql.py +251 -0
  204. data/vendor/pygments-main/pygments/lexers/ptx.py +119 -0
  205. data/vendor/pygments-main/pygments/lexers/python.py +24 -24
  206. data/vendor/pygments-main/pygments/lexers/q.py +5 -6
  207. data/vendor/pygments-main/pygments/lexers/qlik.py +3 -3
  208. data/vendor/pygments-main/pygments/lexers/qvt.py +5 -3
  209. data/vendor/pygments-main/pygments/lexers/r.py +8 -6
  210. data/vendor/pygments-main/pygments/lexers/rdf.py +19 -13
  211. data/vendor/pygments-main/pygments/lexers/rebol.py +7 -7
  212. data/vendor/pygments-main/pygments/lexers/resource.py +5 -6
  213. data/vendor/pygments-main/pygments/lexers/ride.py +4 -5
  214. data/vendor/pygments-main/pygments/lexers/rita.py +2 -3
  215. data/vendor/pygments-main/pygments/lexers/rnc.py +2 -3
  216. data/vendor/pygments-main/pygments/lexers/roboconf.py +5 -5
  217. data/vendor/pygments-main/pygments/lexers/robotframework.py +2 -3
  218. data/vendor/pygments-main/pygments/lexers/ruby.py +8 -13
  219. data/vendor/pygments-main/pygments/lexers/rust.py +9 -10
  220. data/vendor/pygments-main/pygments/lexers/sas.py +3 -3
  221. data/vendor/pygments-main/pygments/lexers/savi.py +131 -130
  222. data/vendor/pygments-main/pygments/lexers/scdoc.py +13 -7
  223. data/vendor/pygments-main/pygments/lexers/scripting.py +354 -42
  224. data/vendor/pygments-main/pygments/lexers/sgf.py +2 -3
  225. data/vendor/pygments-main/pygments/lexers/shell.py +107 -129
  226. data/vendor/pygments-main/pygments/lexers/sieve.py +3 -3
  227. data/vendor/pygments-main/pygments/lexers/slash.py +4 -5
  228. data/vendor/pygments-main/pygments/lexers/smalltalk.py +3 -5
  229. data/vendor/pygments-main/pygments/lexers/smithy.py +2 -3
  230. data/vendor/pygments-main/pygments/lexers/smv.py +3 -3
  231. data/vendor/pygments-main/pygments/lexers/snobol.py +3 -3
  232. data/vendor/pygments-main/pygments/lexers/solidity.py +3 -3
  233. data/vendor/pygments-main/pygments/lexers/soong.py +78 -0
  234. data/vendor/pygments-main/pygments/lexers/sophia.py +3 -4
  235. data/vendor/pygments-main/pygments/lexers/special.py +8 -3
  236. data/vendor/pygments-main/pygments/lexers/spice.py +15 -16
  237. data/vendor/pygments-main/pygments/lexers/sql.py +24 -18
  238. data/vendor/pygments-main/pygments/lexers/srcinfo.py +3 -3
  239. data/vendor/pygments-main/pygments/lexers/stata.py +2 -3
  240. data/vendor/pygments-main/pygments/lexers/supercollider.py +2 -3
  241. data/vendor/pygments-main/pygments/lexers/tact.py +303 -0
  242. data/vendor/pygments-main/pygments/lexers/tal.py +13 -10
  243. data/vendor/pygments-main/pygments/lexers/tcl.py +2 -3
  244. data/vendor/pygments-main/pygments/lexers/teal.py +2 -3
  245. data/vendor/pygments-main/pygments/lexers/templates.py +131 -72
  246. data/vendor/pygments-main/pygments/lexers/teraterm.py +2 -3
  247. data/vendor/pygments-main/pygments/lexers/testing.py +4 -5
  248. data/vendor/pygments-main/pygments/lexers/text.py +2 -1
  249. data/vendor/pygments-main/pygments/lexers/textedit.py +9 -6
  250. data/vendor/pygments-main/pygments/lexers/textfmts.py +20 -15
  251. data/vendor/pygments-main/pygments/lexers/theorem.py +41 -115
  252. data/vendor/pygments-main/pygments/lexers/thingsdb.py +50 -26
  253. data/vendor/pygments-main/pygments/lexers/tlb.py +3 -1
  254. data/vendor/pygments-main/pygments/lexers/tls.py +54 -0
  255. data/vendor/pygments-main/pygments/lexers/tnt.py +2 -3
  256. data/vendor/pygments-main/pygments/lexers/trafficscript.py +3 -3
  257. data/vendor/pygments-main/pygments/lexers/typoscript.py +6 -7
  258. data/vendor/pygments-main/pygments/lexers/typst.py +104 -0
  259. data/vendor/pygments-main/pygments/lexers/ul4.py +47 -5
  260. data/vendor/pygments-main/pygments/lexers/unicon.py +9 -7
  261. data/vendor/pygments-main/pygments/lexers/urbi.py +3 -3
  262. data/vendor/pygments-main/pygments/lexers/usd.py +6 -11
  263. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  264. data/vendor/pygments-main/pygments/lexers/verification.py +4 -5
  265. data/vendor/pygments-main/pygments/lexers/verifpal.py +65 -0
  266. data/vendor/pygments-main/pygments/lexers/vip.py +150 -0
  267. data/vendor/pygments-main/pygments/lexers/vyper.py +140 -0
  268. data/vendor/pygments-main/pygments/lexers/web.py +2 -1
  269. data/vendor/pygments-main/pygments/lexers/webassembly.py +2 -3
  270. data/vendor/pygments-main/pygments/lexers/webidl.py +2 -3
  271. data/vendor/pygments-main/pygments/lexers/webmisc.py +11 -15
  272. data/vendor/pygments-main/pygments/lexers/wgsl.py +6 -7
  273. data/vendor/pygments-main/pygments/lexers/whiley.py +2 -3
  274. data/vendor/pygments-main/pygments/lexers/wowtoc.py +3 -3
  275. data/vendor/pygments-main/pygments/lexers/wren.py +3 -4
  276. data/vendor/pygments-main/pygments/lexers/x10.py +6 -7
  277. data/vendor/pygments-main/pygments/lexers/xorg.py +2 -1
  278. data/vendor/pygments-main/pygments/lexers/yang.py +2 -3
  279. data/vendor/pygments-main/pygments/lexers/yara.py +69 -0
  280. data/vendor/pygments-main/pygments/lexers/zig.py +2 -1
  281. data/vendor/pygments-main/pygments/modeline.py +4 -4
  282. data/vendor/pygments-main/pygments/plugin.py +3 -19
  283. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  284. data/vendor/pygments-main/pygments/scanner.py +1 -1
  285. data/vendor/pygments-main/pygments/sphinxext.py +38 -8
  286. data/vendor/pygments-main/pygments/style.py +8 -2
  287. data/vendor/pygments-main/pygments/styles/__init__.py +17 -59
  288. data/vendor/pygments-main/pygments/styles/_mapping.py +54 -0
  289. data/vendor/pygments-main/pygments/styles/abap.py +5 -1
  290. data/vendor/pygments-main/pygments/styles/algol.py +5 -1
  291. data/vendor/pygments-main/pygments/styles/algol_nu.py +5 -1
  292. data/vendor/pygments-main/pygments/styles/arduino.py +76 -72
  293. data/vendor/pygments-main/pygments/styles/autumn.py +6 -1
  294. data/vendor/pygments-main/pygments/styles/borland.py +6 -1
  295. data/vendor/pygments-main/pygments/styles/bw.py +6 -1
  296. data/vendor/pygments-main/pygments/styles/coffee.py +80 -0
  297. data/vendor/pygments-main/pygments/styles/colorful.py +6 -1
  298. data/vendor/pygments-main/pygments/styles/default.py +6 -1
  299. data/vendor/pygments-main/pygments/styles/dracula.py +68 -80
  300. data/vendor/pygments-main/pygments/styles/emacs.py +6 -1
  301. data/vendor/pygments-main/pygments/styles/friendly.py +6 -1
  302. data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +6 -1
  303. data/vendor/pygments-main/pygments/styles/fruity.py +7 -1
  304. data/vendor/pygments-main/pygments/styles/gh_dark.py +7 -1
  305. data/vendor/pygments-main/pygments/styles/gruvbox.py +10 -1
  306. data/vendor/pygments-main/pygments/styles/igor.py +6 -1
  307. data/vendor/pygments-main/pygments/styles/inkpot.py +7 -2
  308. data/vendor/pygments-main/pygments/styles/lightbulb.py +110 -0
  309. data/vendor/pygments-main/pygments/styles/lilypond.py +8 -2
  310. data/vendor/pygments-main/pygments/styles/lovelace.py +16 -10
  311. data/vendor/pygments-main/pygments/styles/manni.py +7 -2
  312. data/vendor/pygments-main/pygments/styles/material.py +21 -14
  313. data/vendor/pygments-main/pygments/styles/monokai.py +16 -10
  314. data/vendor/pygments-main/pygments/styles/murphy.py +7 -2
  315. data/vendor/pygments-main/pygments/styles/native.py +10 -5
  316. data/vendor/pygments-main/pygments/styles/nord.py +9 -3
  317. data/vendor/pygments-main/pygments/styles/onedark.py +6 -2
  318. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +7 -2
  319. data/vendor/pygments-main/pygments/styles/paraiso_light.py +7 -2
  320. data/vendor/pygments-main/pygments/styles/pastie.py +7 -1
  321. data/vendor/pygments-main/pygments/styles/perldoc.py +7 -1
  322. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +26 -19
  323. data/vendor/pygments-main/pygments/styles/rrt.py +8 -2
  324. data/vendor/pygments-main/pygments/styles/sas.py +6 -1
  325. data/vendor/pygments-main/pygments/styles/solarized.py +9 -1
  326. data/vendor/pygments-main/pygments/styles/staroffice.py +6 -1
  327. data/vendor/pygments-main/pygments/styles/stata_dark.py +6 -2
  328. data/vendor/pygments-main/pygments/styles/stata_light.py +6 -1
  329. data/vendor/pygments-main/pygments/styles/tango.py +7 -3
  330. data/vendor/pygments-main/pygments/styles/trac.py +7 -1
  331. data/vendor/pygments-main/pygments/styles/vim.py +7 -1
  332. data/vendor/pygments-main/pygments/styles/vs.py +7 -2
  333. data/vendor/pygments-main/pygments/styles/xcode.py +6 -1
  334. data/vendor/pygments-main/pygments/styles/zenburn.py +6 -1
  335. data/vendor/pygments-main/pygments/token.py +2 -1
  336. data/vendor/pygments-main/pygments/unistring.py +5 -5
  337. data/vendor/pygments-main/pygments/util.py +13 -19
  338. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/METADATA +14 -13
  339. data/vendor/pygments-main/pygments-2.18.0.dist-info/RECORD +663 -0
  340. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/WHEEL +1 -2
  341. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/AUTHORS +13 -0
  342. metadata +39 -15
  343. data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +0 -614
  344. data/vendor/pygments-main/Pygments-2.15.1.dist-info/top_level.txt +0 -1
  345. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/INSTALLER +0 -0
  346. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/REQUESTED +0 -0
  347. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/entry_points.txt +0 -0
  348. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/LICENSE +0 -0
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for Lispy languages.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -20,7 +20,7 @@ from pygments.lexers._scheme_builtins import scheme_keywords, scheme_builtins
20
20
 
21
21
  __all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer',
22
22
  'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer',
23
- 'XtlangLexer', 'FennelLexer']
23
+ 'XtlangLexer', 'FennelLexer', 'JanetLexer']
24
24
 
25
25
 
26
26
  class SchemeLexer(RegexLexer):
@@ -31,14 +31,13 @@ class SchemeLexer(RegexLexer):
31
31
  at http://paste.lisp.org/ to cover as much syntax as possible.
32
32
 
33
33
  It supports the full Scheme syntax as defined in R5RS.
34
-
35
- .. versionadded:: 0.6
36
34
  """
37
35
  name = 'Scheme'
38
36
  url = 'http://www.scheme-reports.org/'
39
37
  aliases = ['scheme', 'scm']
40
38
  filenames = ['*.scm', '*.ss']
41
39
  mimetypes = ['text/x-scheme', 'application/x-scheme']
40
+ version_added = '0.6'
42
41
 
43
42
  flags = re.DOTALL | re.MULTILINE
44
43
 
@@ -296,14 +295,13 @@ class SchemeLexer(RegexLexer):
296
295
  class CommonLispLexer(RegexLexer):
297
296
  """
298
297
  A Common Lisp lexer.
299
-
300
- .. versionadded:: 0.9
301
298
  """
302
299
  name = 'Common Lisp'
303
300
  url = 'https://lisp-lang.org/'
304
301
  aliases = ['common-lisp', 'cl', 'lisp']
305
302
  filenames = ['*.cl', '*.lisp']
306
303
  mimetypes = ['text/x-common-lisp']
304
+ version_added = '0.9'
307
305
 
308
306
  flags = re.IGNORECASE | re.MULTILINE
309
307
 
@@ -316,7 +314,7 @@ class CommonLispLexer(RegexLexer):
316
314
 
317
315
  # symbol token, reverse-engineered from hyperspec
318
316
  # Take a deep breath...
319
- symbol = r'(\|[^|]+\||(?:%s)(?:%s)*)' % (nonmacro, constituent)
317
+ symbol = rf'(\|[^|]+\||(?:{nonmacro})(?:{constituent})*)'
320
318
 
321
319
  def __init__(self, **options):
322
320
  from pygments.lexers._cl_builtins import BUILTIN_FUNCTIONS, \
@@ -471,18 +469,27 @@ class CommonLispLexer(RegexLexer):
471
469
  ],
472
470
  }
473
471
 
472
+ def analyse_text(text):
473
+ """Competes with Visual Prolog on *.cl"""
474
+ # This is a *really* good indicator (and not conflicting with Visual Prolog)
475
+ # '(defun ' first on a line
476
+ # section keyword alone on line e.g. 'clauses'
477
+ if re.search(r'^\s*\(defun\s', text):
478
+ return 0.8
479
+ else:
480
+ return 0
481
+
474
482
 
475
483
  class HyLexer(RegexLexer):
476
484
  """
477
485
  Lexer for Hy source code.
478
-
479
- .. versionadded:: 2.0
480
486
  """
481
487
  name = 'Hy'
482
488
  url = 'http://hylang.org/'
483
- aliases = ['hylang']
489
+ aliases = ['hylang', 'hy']
484
490
  filenames = ['*.hy']
485
491
  mimetypes = ['text/x-hy', 'application/x-hy']
492
+ version_added = '2.0'
486
493
 
487
494
  special_forms = (
488
495
  'cond', 'for', '->', '->>', 'car',
@@ -512,7 +519,7 @@ class HyLexer(RegexLexer):
512
519
  # valid names for identifiers
513
520
  # well, names can only not consist fully of numbers
514
521
  # but this should be good enough for now
515
- valid_name = r'(?!#)[\w!$%*+<=>?/.#:-]+'
522
+ valid_name = r"[^ \t\n\r\f\v()[\]{};\"'`~]+"
516
523
 
517
524
  def _multi_escape(entries):
518
525
  return words(entries, suffix=' ')
@@ -524,8 +531,7 @@ class HyLexer(RegexLexer):
524
531
  (r';.*$', Comment.Single),
525
532
 
526
533
  # whitespaces - usually not relevant
527
- (r',+', Text),
528
- (r'\s+', Whitespace),
534
+ (r'[ \t\n\r\f\v]+', Whitespace),
529
535
 
530
536
  # numbers
531
537
  (r'-?\d+\.\d+', Number.Float),
@@ -591,8 +597,6 @@ class RacketLexer(RegexLexer):
591
597
  """
592
598
  Lexer for Racket source code (formerly
593
599
  known as PLT Scheme).
594
-
595
- .. versionadded:: 1.6
596
600
  """
597
601
 
598
602
  name = 'Racket'
@@ -600,6 +604,7 @@ class RacketLexer(RegexLexer):
600
604
  aliases = ['racket', 'rkt']
601
605
  filenames = ['*.rkt', '*.rktd', '*.rktl']
602
606
  mimetypes = ['text/x-racket', 'application/x-racket']
607
+ version_added = '1.6'
603
608
 
604
609
  # Generated by example.rkt
605
610
  _keywords = (
@@ -1381,19 +1386,17 @@ class RacketLexer(RegexLexer):
1381
1386
  _opening_parenthesis = r'[([{]'
1382
1387
  _closing_parenthesis = r'[)\]}]'
1383
1388
  _delimiters = r'()[\]{}",\'`;\s'
1384
- _symbol = r'(?:\|[^|]*\||\\[\w\W]|[^|\\%s]+)+' % _delimiters
1389
+ _symbol = rf'(?:\|[^|]*\||\\[\w\W]|[^|\\{_delimiters}]+)+'
1385
1390
  _exact_decimal_prefix = r'(?:#e)?(?:#d)?(?:#e)?'
1386
1391
  _exponent = r'(?:[defls][-+]?\d+)'
1387
1392
  _inexact_simple_no_hashes = r'(?:\d+(?:/\d+|\.\d*)?|\.\d+)'
1388
- _inexact_simple = (r'(?:%s|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|'
1389
- r'\d+(?:\.\d*#+|/\d+#+)))' % _inexact_simple_no_hashes)
1390
- _inexact_normal_no_hashes = r'(?:%s%s?)' % (_inexact_simple_no_hashes,
1391
- _exponent)
1392
- _inexact_normal = r'(?:%s%s?)' % (_inexact_simple, _exponent)
1393
+ _inexact_simple = (rf'(?:{_inexact_simple_no_hashes}|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|'
1394
+ r'\d+(?:\.\d*#+|/\d+#+)))')
1395
+ _inexact_normal_no_hashes = rf'(?:{_inexact_simple_no_hashes}{_exponent}?)'
1396
+ _inexact_normal = rf'(?:{_inexact_simple}{_exponent}?)'
1393
1397
  _inexact_special = r'(?:(?:inf|nan)\.[0f])'
1394
- _inexact_real = r'(?:[-+]?%s|[-+]%s)' % (_inexact_normal,
1395
- _inexact_special)
1396
- _inexact_unsigned = r'(?:%s|%s)' % (_inexact_normal, _inexact_special)
1398
+ _inexact_real = rf'(?:[-+]?{_inexact_normal}|[-+]{_inexact_special})'
1399
+ _inexact_unsigned = rf'(?:{_inexact_normal}|{_inexact_special})'
1397
1400
 
1398
1401
  tokens = {
1399
1402
  'root': [
@@ -1413,36 +1416,29 @@ class RacketLexer(RegexLexer):
1413
1416
  # onto Pygments token types; some judgment calls here.
1414
1417
 
1415
1418
  # #d or no prefix
1416
- (r'(?i)%s[-+]?\d+(?=[%s])' % (_exact_decimal_prefix, _delimiters),
1419
+ (rf'(?i){_exact_decimal_prefix}[-+]?\d+(?=[{_delimiters}])',
1417
1420
  Number.Integer, '#pop'),
1418
- (r'(?i)%s[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[%s])' %
1419
- (_exact_decimal_prefix, _delimiters), Number.Float, '#pop'),
1420
- (r'(?i)%s[-+]?(%s([-+]%s?i)?|[-+]%s?i)(?=[%s])' %
1421
- (_exact_decimal_prefix, _inexact_normal_no_hashes,
1422
- _inexact_normal_no_hashes, _inexact_normal_no_hashes,
1423
- _delimiters), Number, '#pop'),
1421
+ (rf'(?i){_exact_decimal_prefix}[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[{_delimiters}])', Number.Float, '#pop'),
1422
+ (rf'(?i){_exact_decimal_prefix}[-+]?({_inexact_normal_no_hashes}([-+]{_inexact_normal_no_hashes}?i)?|[-+]{_inexact_normal_no_hashes}?i)(?=[{_delimiters}])', Number, '#pop'),
1424
1423
 
1425
1424
  # Inexact without explicit #i
1426
- (r'(?i)(#d)?(%s([-+]%s?i)?|[-+]%s?i|%s@%s)(?=[%s])' %
1427
- (_inexact_real, _inexact_unsigned, _inexact_unsigned,
1428
- _inexact_real, _inexact_real, _delimiters), Number.Float,
1425
+ (rf'(?i)(#d)?({_inexact_real}([-+]{_inexact_unsigned}?i)?|[-+]{_inexact_unsigned}?i|{_inexact_real}@{_inexact_real})(?=[{_delimiters}])', Number.Float,
1429
1426
  '#pop'),
1430
1427
 
1431
1428
  # The remaining extflonums
1432
- (r'(?i)(([-+]?%st[-+]?\d+)|[-+](inf|nan)\.t)(?=[%s])' %
1433
- (_inexact_simple, _delimiters), Number.Float, '#pop'),
1429
+ (rf'(?i)(([-+]?{_inexact_simple}t[-+]?\d+)|[-+](inf|nan)\.t)(?=[{_delimiters}])', Number.Float, '#pop'),
1434
1430
 
1435
1431
  # #b
1436
- (r'(?iu)(#[ei])?#b%s' % _symbol, Number.Bin, '#pop'),
1432
+ (rf'(?iu)(#[ei])?#b{_symbol}', Number.Bin, '#pop'),
1437
1433
 
1438
1434
  # #o
1439
- (r'(?iu)(#[ei])?#o%s' % _symbol, Number.Oct, '#pop'),
1435
+ (rf'(?iu)(#[ei])?#o{_symbol}', Number.Oct, '#pop'),
1440
1436
 
1441
1437
  # #x
1442
- (r'(?iu)(#[ei])?#x%s' % _symbol, Number.Hex, '#pop'),
1438
+ (rf'(?iu)(#[ei])?#x{_symbol}', Number.Hex, '#pop'),
1443
1439
 
1444
1440
  # #i is always inexact, i.e. float
1445
- (r'(?iu)(#d)?#i%s' % _symbol, Number.Float, '#pop'),
1441
+ (rf'(?iu)(#d)?#i{_symbol}', Number.Float, '#pop'),
1446
1442
 
1447
1443
  # Strings and characters
1448
1444
  (r'#?"', String.Double, ('#pop', 'string')),
@@ -1455,7 +1451,7 @@ class RacketLexer(RegexLexer):
1455
1451
  (r'#(true|false|[tTfF])', Name.Constant, '#pop'),
1456
1452
 
1457
1453
  # Keyword argument names (e.g. #:keyword)
1458
- (r'#:%s' % _symbol, Keyword.Declaration, '#pop'),
1454
+ (rf'#:{_symbol}', Keyword.Declaration, '#pop'),
1459
1455
 
1460
1456
  # Reader extensions
1461
1457
  (r'(#lang |#!)(\S+)',
@@ -1463,8 +1459,8 @@ class RacketLexer(RegexLexer):
1463
1459
  (r'#reader', Keyword.Namespace, 'quoted-datum'),
1464
1460
 
1465
1461
  # Other syntax
1466
- (r"(?i)\.(?=[%s])|#c[is]|#['`]|#,@?" % _delimiters, Operator),
1467
- (r"'|#[s&]|#hash(eqv?)?|#\d*(?=%s)" % _opening_parenthesis,
1462
+ (rf"(?i)\.(?=[{_delimiters}])|#c[is]|#['`]|#,@?", Operator),
1463
+ (rf"'|#[s&]|#hash(eqv?)?|#\d*(?={_opening_parenthesis})",
1468
1464
  Operator, ('#pop', 'quoted-datum'))
1469
1465
  ],
1470
1466
  'datum*': [
@@ -1478,15 +1474,15 @@ class RacketLexer(RegexLexer):
1478
1474
  ],
1479
1475
  'unquoted-datum': [
1480
1476
  include('datum'),
1481
- (r'quote(?=[%s])' % _delimiters, Keyword,
1477
+ (rf'quote(?=[{_delimiters}])', Keyword,
1482
1478
  ('#pop', 'quoted-datum')),
1483
1479
  (r'`', Operator, ('#pop', 'quasiquoted-datum')),
1484
- (r'quasiquote(?=[%s])' % _delimiters, Keyword,
1480
+ (rf'quasiquote(?=[{_delimiters}])', Keyword,
1485
1481
  ('#pop', 'quasiquoted-datum')),
1486
1482
  (_opening_parenthesis, Punctuation, ('#pop', 'unquoted-list')),
1487
- (words(_keywords, suffix='(?=[%s])' % _delimiters),
1483
+ (words(_keywords, suffix=f'(?=[{_delimiters}])'),
1488
1484
  Keyword, '#pop'),
1489
- (words(_builtins, suffix='(?=[%s])' % _delimiters),
1485
+ (words(_builtins, suffix=f'(?=[{_delimiters}])'),
1490
1486
  Name.Builtin, '#pop'),
1491
1487
  (_symbol, Name, '#pop'),
1492
1488
  include('datum*')
@@ -1498,7 +1494,7 @@ class RacketLexer(RegexLexer):
1498
1494
  'quasiquoted-datum': [
1499
1495
  include('datum'),
1500
1496
  (r',@?', Operator, ('#pop', 'unquoted-datum')),
1501
- (r'unquote(-splicing)?(?=[%s])' % _delimiters, Keyword,
1497
+ (rf'unquote(-splicing)?(?=[{_delimiters}])', Keyword,
1502
1498
  ('#pop', 'unquoted-datum')),
1503
1499
  (_opening_parenthesis, Punctuation, ('#pop', 'quasiquoted-list')),
1504
1500
  include('datum*')
@@ -1533,8 +1529,6 @@ class RacketLexer(RegexLexer):
1533
1529
  class NewLispLexer(RegexLexer):
1534
1530
  """
1535
1531
  For newLISP source code (version 10.3.0).
1536
-
1537
- .. versionadded:: 1.5
1538
1532
  """
1539
1533
 
1540
1534
  name = 'NewLisp'
@@ -1542,6 +1536,7 @@ class NewLispLexer(RegexLexer):
1542
1536
  aliases = ['newlisp']
1543
1537
  filenames = ['*.lsp', '*.nl', '*.kif']
1544
1538
  mimetypes = ['text/x-newlisp', 'application/x-newlisp']
1539
+ version_added = '1.5'
1545
1540
 
1546
1541
  flags = re.IGNORECASE | re.MULTILINE
1547
1542
 
@@ -1666,13 +1661,13 @@ class EmacsLispLexer(RegexLexer):
1666
1661
  """
1667
1662
  An ELisp lexer, parsing a stream and outputting the tokens
1668
1663
  needed to highlight elisp code.
1669
-
1670
- .. versionadded:: 2.1
1671
1664
  """
1672
1665
  name = 'EmacsLisp'
1673
1666
  aliases = ['emacs-lisp', 'elisp', 'emacs']
1674
1667
  filenames = ['*.el']
1675
1668
  mimetypes = ['text/x-elisp', 'application/x-elisp']
1669
+ url = 'https://www.gnu.org/software/emacs'
1670
+ version_added = '2.1'
1676
1671
 
1677
1672
  flags = re.MULTILINE
1678
1673
 
@@ -1685,7 +1680,7 @@ class EmacsLispLexer(RegexLexer):
1685
1680
 
1686
1681
  # symbol token, reverse-engineered from hyperspec
1687
1682
  # Take a deep breath...
1688
- symbol = r'((?:%s)(?:%s)*)' % (nonmacro, constituent)
1683
+ symbol = rf'((?:{nonmacro})(?:{constituent})*)'
1689
1684
 
1690
1685
  macros = {
1691
1686
  'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2',
@@ -2298,7 +2293,7 @@ class EmacsLispLexer(RegexLexer):
2298
2293
  ],
2299
2294
  'string': [
2300
2295
  (r'[^"\\`]+', String),
2301
- (r'`%s\'' % symbol, String.Symbol),
2296
+ (rf'`{symbol}\'', String.Symbol),
2302
2297
  (r'`', String),
2303
2298
  (r'\\.', String),
2304
2299
  (r'\\\n', String),
@@ -2310,14 +2305,13 @@ class EmacsLispLexer(RegexLexer):
2310
2305
  class ShenLexer(RegexLexer):
2311
2306
  """
2312
2307
  Lexer for Shen source code.
2313
-
2314
- .. versionadded:: 2.1
2315
2308
  """
2316
2309
  name = 'Shen'
2317
2310
  url = 'http://shenlanguage.org/'
2318
2311
  aliases = ['shen']
2319
2312
  filenames = ['*.shen']
2320
2313
  mimetypes = ['text/x-shen', 'application/x-shen']
2314
+ version_added = '2.1'
2321
2315
 
2322
2316
  DECLARATIONS = (
2323
2317
  'datatype', 'define', 'defmacro', 'defprolog', 'defcc',
@@ -2365,9 +2359,9 @@ class ShenLexer(RegexLexer):
2365
2359
  MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS)
2366
2360
 
2367
2361
  valid_symbol_chars = r'[\w!$%*+,<=>?/.\'@&#:-]'
2368
- valid_name = '%s+' % valid_symbol_chars
2369
- symbol_name = r'[a-z!$%%*+,<=>?/.\'@&#_-]%s*' % valid_symbol_chars
2370
- variable = r'[A-Z]%s*' % valid_symbol_chars
2362
+ valid_name = f'{valid_symbol_chars}+'
2363
+ symbol_name = rf'[a-z!$%*+,<=>?/.\'@&#_-]{valid_symbol_chars}*'
2364
+ variable = rf'[A-Z]{valid_symbol_chars}*'
2371
2365
 
2372
2366
  tokens = {
2373
2367
  'string': [
@@ -2475,13 +2469,13 @@ class ShenLexer(RegexLexer):
2475
2469
  class CPSALexer(RegexLexer):
2476
2470
  """
2477
2471
  A CPSA lexer based on the CPSA language as of version 2.2.12
2478
-
2479
- .. versionadded:: 2.1
2480
2472
  """
2481
2473
  name = 'CPSA'
2482
2474
  aliases = ['cpsa']
2483
2475
  filenames = ['*.cpsa']
2484
2476
  mimetypes = []
2477
+ url = 'https://web.cs.wpi.edu/~guttman/cs564/cpsauser.html'
2478
+ version_added = '2.1'
2485
2479
 
2486
2480
  # list of known keywords and builtins taken form vim 6.4 scheme.vim
2487
2481
  # syntax file.
@@ -2556,14 +2550,13 @@ class XtlangLexer(RegexLexer):
2556
2550
  This is a mixture of Scheme and xtlang, really. Keyword lists are
2557
2551
  taken from the Extempore Emacs mode
2558
2552
  (https://github.com/extemporelang/extempore-emacs-mode)
2559
-
2560
- .. versionadded:: 2.2
2561
2553
  """
2562
2554
  name = 'xtlang'
2563
2555
  url = 'http://extempore.moso.com.au'
2564
2556
  aliases = ['extempore']
2565
2557
  filenames = ['*.xtm']
2566
2558
  mimetypes = []
2559
+ version_added = '2.2'
2567
2560
 
2568
2561
  common_keywords = (
2569
2562
  'lambda', 'define', 'if', 'else', 'cond', 'and',
@@ -2759,13 +2752,12 @@ class FennelLexer(RegexLexer):
2759
2752
 
2760
2753
  Fennel compiles to Lua, so all the Lua builtins are recognized as well
2761
2754
  as the special forms that are particular to the Fennel compiler.
2762
-
2763
- .. versionadded:: 2.3
2764
2755
  """
2765
2756
  name = 'Fennel'
2766
2757
  url = 'https://fennel-lang.org'
2767
2758
  aliases = ['fennel', 'fnl']
2768
2759
  filenames = ['*.fnl']
2760
+ version_added = '2.3'
2769
2761
 
2770
2762
  # this list is current as of Fennel version 0.10.0.
2771
2763
  special_forms = (
@@ -2836,3 +2828,319 @@ class FennelLexer(RegexLexer):
2836
2828
  (r'#', Punctuation),
2837
2829
  ]
2838
2830
  }
2831
+
2832
+
2833
+ class JanetLexer(RegexLexer):
2834
+ """A lexer for the Janet programming language.
2835
+ """
2836
+ name = 'Janet'
2837
+ url = 'https://janet-lang.org/'
2838
+ aliases = ['janet']
2839
+ filenames = ['*.janet', '*.jdn']
2840
+ mimetypes = ['text/x-janet', 'application/x-janet']
2841
+ version_added = '2.18'
2842
+
2843
+ # XXX: gets too slow
2844
+ #flags = re.MULTILINE | re.VERBOSE
2845
+
2846
+ special_forms = (
2847
+ 'break', 'def', 'do', 'fn', 'if', 'quote', 'quasiquote', 'splice',
2848
+ 'set', 'unquote', 'upscope', 'var', 'while'
2849
+ )
2850
+
2851
+ builtin_macros = (
2852
+ '%=', '*=', '++', '+=', '--', '-=', '->', '->>', '-?>',
2853
+ '-?>>', '/=', 'and', 'as->', 'as-macro', 'as?->',
2854
+ 'assert', 'case', 'catseq', 'chr', 'comment', 'compif',
2855
+ 'comptime', 'compwhen', 'cond', 'coro', 'def-',
2856
+ 'default', 'defdyn', 'defer', 'defmacro', 'defmacro-',
2857
+ 'defn', 'defn-', 'delay', 'doc', 'each', 'eachk',
2858
+ 'eachp', 'edefer', 'ev/do-thread', 'ev/gather',
2859
+ 'ev/spawn', 'ev/spawn-thread', 'ev/with-deadline',
2860
+ 'ffi/defbind', 'fiber-fn', 'for', 'forever', 'forv',
2861
+ 'generate', 'if-let', 'if-not', 'if-with', 'import',
2862
+ 'juxt', 'label', 'let', 'loop', 'match', 'or', 'prompt',
2863
+ 'protect', 'repeat', 'seq', 'short-fn', 'tabseq',
2864
+ 'toggle', 'tracev', 'try', 'unless', 'use', 'var-',
2865
+ 'varfn', 'when', 'when-let', 'when-with', 'with',
2866
+ 'with-dyns', 'with-syms', 'with-vars',
2867
+ # obsolete builtin macros
2868
+ 'eachy'
2869
+ )
2870
+
2871
+ builtin_functions = (
2872
+ '%', '*', '+', '-', '/', '<', '<=', '=', '>', '>=',
2873
+ 'abstract?', 'accumulate', 'accumulate2', 'all',
2874
+ 'all-bindings', 'all-dynamics', 'any?', 'apply',
2875
+ 'array', 'array/clear', 'array/concat', 'array/ensure',
2876
+ 'array/fill', 'array/insert', 'array/new',
2877
+ 'array/new-filled', 'array/peek', 'array/pop',
2878
+ 'array/push', 'array/remove', 'array/slice',
2879
+ 'array/trim', 'array/weak', 'array?', 'asm',
2880
+ 'bad-compile', 'bad-parse', 'band', 'blshift', 'bnot',
2881
+ 'boolean?', 'bor', 'brshift', 'brushift', 'buffer',
2882
+ 'buffer/bit', 'buffer/bit-clear', 'buffer/bit-set',
2883
+ 'buffer/bit-toggle', 'buffer/blit', 'buffer/clear',
2884
+ 'buffer/fill', 'buffer/format', 'buffer/from-bytes',
2885
+ 'buffer/new', 'buffer/new-filled', 'buffer/popn',
2886
+ 'buffer/push', 'buffer/push-at', 'buffer/push-byte',
2887
+ 'buffer/push-string', 'buffer/push-word',
2888
+ 'buffer/slice', 'buffer/trim', 'buffer?', 'bxor',
2889
+ 'bytes?', 'cancel', 'cfunction?', 'cli-main', 'cmp',
2890
+ 'comp', 'compare', 'compare<', 'compare<=', 'compare=',
2891
+ 'compare>', 'compare>=', 'compile', 'complement',
2892
+ 'count', 'curenv', 'debug', 'debug/arg-stack',
2893
+ 'debug/break', 'debug/fbreak', 'debug/lineage',
2894
+ 'debug/stack', 'debug/stacktrace', 'debug/step',
2895
+ 'debug/unbreak', 'debug/unfbreak', 'debugger',
2896
+ 'debugger-on-status', 'dec', 'deep-not=', 'deep=',
2897
+ 'defglobal', 'describe', 'dictionary?', 'disasm',
2898
+ 'distinct', 'div', 'doc*', 'doc-format', 'doc-of',
2899
+ 'dofile', 'drop', 'drop-until', 'drop-while', 'dyn',
2900
+ 'eflush', 'empty?', 'env-lookup', 'eprin', 'eprinf',
2901
+ 'eprint', 'eprintf', 'error', 'errorf',
2902
+ 'ev/acquire-lock', 'ev/acquire-rlock',
2903
+ 'ev/acquire-wlock', 'ev/all-tasks', 'ev/call',
2904
+ 'ev/cancel', 'ev/capacity', 'ev/chan', 'ev/chan-close',
2905
+ 'ev/chunk', 'ev/close', 'ev/count', 'ev/deadline',
2906
+ 'ev/full', 'ev/give', 'ev/give-supervisor', 'ev/go',
2907
+ 'ev/lock', 'ev/read', 'ev/release-lock',
2908
+ 'ev/release-rlock', 'ev/release-wlock', 'ev/rselect',
2909
+ 'ev/rwlock', 'ev/select', 'ev/sleep', 'ev/take',
2910
+ 'ev/thread', 'ev/thread-chan', 'ev/write', 'eval',
2911
+ 'eval-string', 'even?', 'every?', 'extreme', 'false?',
2912
+ 'ffi/align', 'ffi/call', 'ffi/calling-conventions',
2913
+ 'ffi/close', 'ffi/context', 'ffi/free', 'ffi/jitfn',
2914
+ 'ffi/lookup', 'ffi/malloc', 'ffi/native',
2915
+ 'ffi/pointer-buffer', 'ffi/pointer-cfunction',
2916
+ 'ffi/read', 'ffi/signature', 'ffi/size', 'ffi/struct',
2917
+ 'ffi/trampoline', 'ffi/write', 'fiber/can-resume?',
2918
+ 'fiber/current', 'fiber/getenv', 'fiber/last-value',
2919
+ 'fiber/maxstack', 'fiber/new', 'fiber/root',
2920
+ 'fiber/setenv', 'fiber/setmaxstack', 'fiber/status',
2921
+ 'fiber?', 'file/close', 'file/flush', 'file/lines',
2922
+ 'file/open', 'file/read', 'file/seek', 'file/tell',
2923
+ 'file/temp', 'file/write', 'filter', 'find',
2924
+ 'find-index', 'first', 'flatten', 'flatten-into',
2925
+ 'flush', 'flycheck', 'freeze', 'frequencies',
2926
+ 'from-pairs', 'function?', 'gccollect', 'gcinterval',
2927
+ 'gcsetinterval', 'gensym', 'get', 'get-in', 'getline',
2928
+ 'getproto', 'group-by', 'has-key?', 'has-value?',
2929
+ 'hash', 'idempotent?', 'identity', 'import*', 'in',
2930
+ 'inc', 'index-of', 'indexed?', 'int/s64',
2931
+ 'int/to-bytes', 'int/to-number', 'int/u64', 'int?',
2932
+ 'interleave', 'interpose', 'invert', 'juxt*', 'keep',
2933
+ 'keep-syntax', 'keep-syntax!', 'keys', 'keyword',
2934
+ 'keyword/slice', 'keyword?', 'kvs', 'last', 'length',
2935
+ 'lengthable?', 'load-image', 'macex', 'macex1',
2936
+ 'maclintf', 'make-env', 'make-image', 'map', 'mapcat',
2937
+ 'marshal', 'math/abs', 'math/acos', 'math/acosh',
2938
+ 'math/asin', 'math/asinh', 'math/atan', 'math/atan2',
2939
+ 'math/atanh', 'math/cbrt', 'math/ceil', 'math/cos',
2940
+ 'math/cosh', 'math/erf', 'math/erfc', 'math/exp',
2941
+ 'math/exp2', 'math/expm1', 'math/floor', 'math/gamma',
2942
+ 'math/gcd', 'math/hypot', 'math/lcm', 'math/log',
2943
+ 'math/log-gamma', 'math/log10', 'math/log1p',
2944
+ 'math/log2', 'math/next', 'math/pow', 'math/random',
2945
+ 'math/rng', 'math/rng-buffer', 'math/rng-int',
2946
+ 'math/rng-uniform', 'math/round', 'math/seedrandom',
2947
+ 'math/sin', 'math/sinh', 'math/sqrt', 'math/tan',
2948
+ 'math/tanh', 'math/trunc', 'max', 'max-of', 'mean',
2949
+ 'memcmp', 'merge', 'merge-into', 'merge-module', 'min',
2950
+ 'min-of', 'mod', 'module/add-paths',
2951
+ 'module/expand-path', 'module/find', 'module/value',
2952
+ 'nan?', 'nat?', 'native', 'neg?', 'net/accept',
2953
+ 'net/accept-loop', 'net/address', 'net/address-unpack',
2954
+ 'net/chunk', 'net/close', 'net/connect', 'net/flush',
2955
+ 'net/listen', 'net/localname', 'net/peername',
2956
+ 'net/read', 'net/recv-from', 'net/send-to',
2957
+ 'net/server', 'net/setsockopt', 'net/shutdown',
2958
+ 'net/write', 'next', 'nil?', 'not', 'not=', 'number?',
2959
+ 'odd?', 'one?', 'os/arch', 'os/cd', 'os/chmod',
2960
+ 'os/clock', 'os/compiler', 'os/cpu-count',
2961
+ 'os/cryptorand', 'os/cwd', 'os/date', 'os/dir',
2962
+ 'os/environ', 'os/execute', 'os/exit', 'os/getenv',
2963
+ 'os/isatty', 'os/link', 'os/lstat', 'os/mkdir',
2964
+ 'os/mktime', 'os/open', 'os/perm-int', 'os/perm-string',
2965
+ 'os/pipe', 'os/posix-exec', 'os/posix-fork',
2966
+ 'os/proc-close', 'os/proc-kill', 'os/proc-wait',
2967
+ 'os/readlink', 'os/realpath', 'os/rename', 'os/rm',
2968
+ 'os/rmdir', 'os/setenv', 'os/shell', 'os/sigaction',
2969
+ 'os/sleep', 'os/spawn', 'os/stat', 'os/strftime',
2970
+ 'os/symlink', 'os/time', 'os/touch', 'os/umask',
2971
+ 'os/which', 'pairs', 'parse', 'parse-all',
2972
+ 'parser/byte', 'parser/clone', 'parser/consume',
2973
+ 'parser/eof', 'parser/error', 'parser/flush',
2974
+ 'parser/has-more', 'parser/insert', 'parser/new',
2975
+ 'parser/produce', 'parser/state', 'parser/status',
2976
+ 'parser/where', 'partial', 'partition', 'partition-by',
2977
+ 'peg/compile', 'peg/find', 'peg/find-all', 'peg/match',
2978
+ 'peg/replace', 'peg/replace-all', 'pos?', 'postwalk',
2979
+ 'pp', 'prewalk', 'prin', 'prinf', 'print', 'printf',
2980
+ 'product', 'propagate', 'put', 'put-in', 'quit',
2981
+ 'range', 'reduce', 'reduce2', 'repl', 'require',
2982
+ 'resume', 'return', 'reverse', 'reverse!',
2983
+ 'run-context', 'sandbox', 'scan-number', 'setdyn',
2984
+ 'signal', 'slice', 'slurp', 'some', 'sort', 'sort-by',
2985
+ 'sorted', 'sorted-by', 'spit', 'string',
2986
+ 'string/ascii-lower', 'string/ascii-upper',
2987
+ 'string/bytes', 'string/check-set', 'string/find',
2988
+ 'string/find-all', 'string/format', 'string/from-bytes',
2989
+ 'string/has-prefix?', 'string/has-suffix?',
2990
+ 'string/join', 'string/repeat', 'string/replace',
2991
+ 'string/replace-all', 'string/reverse', 'string/slice',
2992
+ 'string/split', 'string/trim', 'string/triml',
2993
+ 'string/trimr', 'string?', 'struct', 'struct/getproto',
2994
+ 'struct/proto-flatten', 'struct/to-table',
2995
+ 'struct/with-proto', 'struct?', 'sum', 'symbol',
2996
+ 'symbol/slice', 'symbol?', 'table', 'table/clear',
2997
+ 'table/clone', 'table/getproto', 'table/new',
2998
+ 'table/proto-flatten', 'table/rawget', 'table/setproto',
2999
+ 'table/to-struct', 'table/weak', 'table/weak-keys',
3000
+ 'table/weak-values', 'table?', 'take', 'take-until',
3001
+ 'take-while', 'thaw', 'trace', 'true?', 'truthy?',
3002
+ 'tuple', 'tuple/brackets', 'tuple/setmap',
3003
+ 'tuple/slice', 'tuple/sourcemap', 'tuple/type',
3004
+ 'tuple?', 'type', 'unmarshal', 'untrace', 'update',
3005
+ 'update-in', 'values', 'varglobal', 'walk',
3006
+ 'warn-compile', 'xprin', 'xprinf', 'xprint', 'xprintf',
3007
+ 'yield', 'zero?', 'zipcoll',
3008
+ # obsolete builtin functions
3009
+ 'tarray/buffer', 'tarray/copy-bytes', 'tarray/length',
3010
+ 'tarray/new', 'tarray/properties', 'tarray/slice',
3011
+ 'tarray/swap-bytes', 'thread/close', 'thread/current',
3012
+ 'thread/exit', 'thread/new', 'thread/receive',
3013
+ 'thread/send'
3014
+ )
3015
+
3016
+ builtin_variables = (
3017
+ 'debugger-env', 'default-peg-grammar', 'janet/build',
3018
+ 'janet/config-bits', 'janet/version', 'load-image-dict',
3019
+ 'make-image-dict', 'math/-inf', 'math/e', 'math/inf',
3020
+ 'math/int-max', 'math/int-min', 'math/int32-max',
3021
+ 'math/int32-min', 'math/nan', 'math/pi', 'module/cache',
3022
+ 'module/loaders', 'module/loading', 'module/paths',
3023
+ 'root-env', 'stderr', 'stdin', 'stdout'
3024
+ )
3025
+
3026
+ constants = (
3027
+ 'false', 'nil', 'true'
3028
+ )
3029
+
3030
+ # XXX: this form not usable to pass to `suffix=`
3031
+ #_token_end = r'''
3032
+ # (?= # followed by one of:
3033
+ # \s # whitespace
3034
+ # | \# # comment
3035
+ # | [)\]] # end delimiters
3036
+ # | $ # end of file
3037
+ # )
3038
+ #'''
3039
+
3040
+ # ...so, express it like this
3041
+ _token_end = r'(?=\s|#|[)\]]|$)'
3042
+
3043
+ _first_char = r'[a-zA-Z!$%&*+\-./<=>?@^_]'
3044
+ _rest_char = rf'([0-9:]|{_first_char})'
3045
+
3046
+ valid_name = rf'{_first_char}({_rest_char})*'
3047
+
3048
+ _radix_unit = r'[0-9a-zA-Z][0-9a-zA-Z_]*'
3049
+
3050
+ # exponent marker, optional sign, one or more alphanumeric
3051
+ _radix_exp = r'&[+-]?[0-9a-zA-Z]+'
3052
+
3053
+ # 2af3__bee_
3054
+ _hex_unit = r'[0-9a-fA-F][0-9a-fA-F_]*'
3055
+
3056
+ # 12_000__
3057
+ _dec_unit = r'[0-9][0-9_]*'
3058
+
3059
+ # E-23
3060
+ # lower or uppercase e, optional sign, one or more digits
3061
+ _dec_exp = r'[eE][+-]?[0-9]+'
3062
+
3063
+ tokens = {
3064
+ 'root': [
3065
+ (r'#.*$', Comment.Single),
3066
+
3067
+ (r'\s+', Whitespace),
3068
+
3069
+ # radix number
3070
+ (rf'''(?x)
3071
+ [+-]? [0-9]{{1,2}} r {_radix_unit} \. ({_radix_unit})?
3072
+ ({_radix_exp})?
3073
+ ''',
3074
+ Number),
3075
+
3076
+ (rf'''(?x)
3077
+ [+-]? [0-9]{{1,2}} r (\.)? {_radix_unit}
3078
+ ({_radix_exp})?
3079
+ ''',
3080
+ Number),
3081
+
3082
+ # hex number
3083
+ (rf'(?x) [+-]? 0x {_hex_unit} \. ({_hex_unit})?',
3084
+ Number.Hex),
3085
+
3086
+ (rf'(?x) [+-]? 0x (\.)? {_hex_unit}',
3087
+ Number.Hex),
3088
+
3089
+ # decimal number
3090
+ (rf'(?x) [+-]? {_dec_unit} \. ({_dec_unit})? ({_dec_exp})?',
3091
+ Number.Float),
3092
+
3093
+ (rf'(?x) [+-]? (\.)? {_dec_unit} ({_dec_exp})?',
3094
+ Number.Float),
3095
+
3096
+ # strings and buffers
3097
+ (r'@?"', String, 'string'),
3098
+
3099
+ # long-strings and long-buffers
3100
+ #
3101
+ # non-empty content enclosed by a pair of n-backticks
3102
+ # with optional leading @
3103
+ (r'@?(`+)(.|\n)+?\1', String),
3104
+
3105
+ # things that hang out on front
3106
+ #
3107
+ # ' ~ , ; |
3108
+ (r"['~,;|]", Operator),
3109
+
3110
+ # collection delimiters
3111
+ #
3112
+ # @( ( )
3113
+ # @[ [ ]
3114
+ # @{ { }
3115
+ (r'@?[(\[{]|[)\]}]', Punctuation),
3116
+
3117
+ # constants
3118
+ (words(constants, suffix=_token_end), Keyword.Constants),
3119
+
3120
+ # keywords
3121
+ (rf'(:({_rest_char})+|:)', Name.Constant),
3122
+
3123
+ # symbols
3124
+ (words(builtin_variables, suffix=_token_end),
3125
+ Name.Variable.Global),
3126
+
3127
+ (words(special_forms, prefix=r'(?<=\()', suffix=_token_end),
3128
+ Keyword.Reserved),
3129
+
3130
+ (words(builtin_macros, prefix=r'(?<=\()', suffix=_token_end),
3131
+ Name.Builtin),
3132
+
3133
+ (words(builtin_functions, prefix=r'(?<=\()', suffix=_token_end),
3134
+ Name.Function),
3135
+
3136
+ # other symbols
3137
+ (valid_name, Name.Variable),
3138
+ ],
3139
+ 'string': [
3140
+ (r'\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})', String.Escape),
3141
+ (r'\\x[0-9a-fA-F]{2}', String.Escape),
3142
+ (r'\\.', String.Escape),
3143
+ (r'"', String, '#pop'),
3144
+ (r'[^\\"]+', String),
3145
+ ]
3146
+ }