pygments.rb 2.4.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (349) 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 +12 -0
  7. data/README.adoc +2 -2
  8. data/lib/pygments/popen.rb +2 -2
  9. data/lib/pygments/version.rb +1 -1
  10. data/pygments.rb.gemspec +3 -3
  11. data/vendor/pygments-main/bin/pygmentize +1 -1
  12. data/vendor/pygments-main/pygments/__init__.py +2 -2
  13. data/vendor/pygments-main/pygments/__main__.py +1 -1
  14. data/vendor/pygments-main/pygments/cmdline.py +12 -12
  15. data/vendor/pygments-main/pygments/console.py +5 -5
  16. data/vendor/pygments-main/pygments/filter.py +2 -3
  17. data/vendor/pygments-main/pygments/filters/__init__.py +4 -4
  18. data/vendor/pygments-main/pygments/formatter.py +6 -1
  19. data/vendor/pygments-main/pygments/formatters/__init__.py +7 -8
  20. data/vendor/pygments-main/pygments/formatters/_mapping.py +0 -0
  21. data/vendor/pygments-main/pygments/formatters/bbcode.py +2 -2
  22. data/vendor/pygments-main/pygments/formatters/groff.py +3 -3
  23. data/vendor/pygments-main/pygments/formatters/html.py +38 -40
  24. data/vendor/pygments-main/pygments/formatters/img.py +51 -11
  25. data/vendor/pygments-main/pygments/formatters/irc.py +1 -1
  26. data/vendor/pygments-main/pygments/formatters/latex.py +24 -27
  27. data/vendor/pygments-main/pygments/formatters/other.py +3 -4
  28. data/vendor/pygments-main/pygments/formatters/pangomarkup.py +2 -2
  29. data/vendor/pygments-main/pygments/formatters/rtf.py +228 -25
  30. data/vendor/pygments-main/pygments/formatters/svg.py +17 -20
  31. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
  32. data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
  33. data/vendor/pygments-main/pygments/lexer.py +51 -33
  34. data/vendor/pygments-main/pygments/lexers/__init__.py +12 -12
  35. data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +1 -1
  36. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
  37. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
  38. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
  39. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1 -1
  40. data/vendor/pygments-main/pygments/lexers/_css_builtins.py +1 -1
  41. data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +1 -1
  42. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
  43. data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +1 -1
  44. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +5 -5
  45. data/vendor/pygments-main/pygments/lexers/_luau_builtins.py +62 -0
  46. data/vendor/pygments-main/pygments/lexers/_mapping.py +41 -11
  47. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
  48. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +3 -3
  49. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  50. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +3 -3
  51. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +5 -5
  52. data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1 -1
  54. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +4 -4
  55. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +3 -3
  56. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +1 -1
  57. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
  58. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  59. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
  60. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
  61. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  62. data/vendor/pygments-main/pygments/lexers/actionscript.py +6 -8
  63. data/vendor/pygments-main/pygments/lexers/ada.py +3 -3
  64. data/vendor/pygments-main/pygments/lexers/agile.py +3 -1
  65. data/vendor/pygments-main/pygments/lexers/algebra.py +9 -13
  66. data/vendor/pygments-main/pygments/lexers/ambient.py +2 -3
  67. data/vendor/pygments-main/pygments/lexers/amdgpu.py +3 -3
  68. data/vendor/pygments-main/pygments/lexers/ampl.py +2 -3
  69. data/vendor/pygments-main/pygments/lexers/apdlexer.py +4 -3
  70. data/vendor/pygments-main/pygments/lexers/apl.py +2 -3
  71. data/vendor/pygments-main/pygments/lexers/archetype.py +8 -12
  72. data/vendor/pygments-main/pygments/lexers/arrow.py +2 -3
  73. data/vendor/pygments-main/pygments/lexers/arturo.py +2 -3
  74. data/vendor/pygments-main/pygments/lexers/asc.py +4 -4
  75. data/vendor/pygments-main/pygments/lexers/asm.py +28 -15
  76. data/vendor/pygments-main/pygments/lexers/asn1.py +178 -0
  77. data/vendor/pygments-main/pygments/lexers/automation.py +6 -8
  78. data/vendor/pygments-main/pygments/lexers/bare.py +2 -3
  79. data/vendor/pygments-main/pygments/lexers/basic.py +48 -57
  80. data/vendor/pygments-main/pygments/lexers/bdd.py +3 -4
  81. data/vendor/pygments-main/pygments/lexers/berry.py +4 -4
  82. data/vendor/pygments-main/pygments/lexers/bibtex.py +5 -5
  83. data/vendor/pygments-main/pygments/lexers/blueprint.py +173 -0
  84. data/vendor/pygments-main/pygments/lexers/boa.py +4 -4
  85. data/vendor/pygments-main/pygments/lexers/bqn.py +109 -0
  86. data/vendor/pygments-main/pygments/lexers/business.py +21 -22
  87. data/vendor/pygments-main/pygments/lexers/c_cpp.py +9 -4
  88. data/vendor/pygments-main/pygments/lexers/c_like.py +99 -27
  89. data/vendor/pygments-main/pygments/lexers/capnproto.py +2 -3
  90. data/vendor/pygments-main/pygments/lexers/carbon.py +10 -11
  91. data/vendor/pygments-main/pygments/lexers/cddl.py +8 -9
  92. data/vendor/pygments-main/pygments/lexers/chapel.py +2 -3
  93. data/vendor/pygments-main/pygments/lexers/clean.py +2 -1
  94. data/vendor/pygments-main/pygments/lexers/comal.py +2 -1
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +2 -1
  96. data/vendor/pygments-main/pygments/lexers/configs.py +342 -108
  97. data/vendor/pygments-main/pygments/lexers/console.py +5 -5
  98. data/vendor/pygments-main/pygments/lexers/cplint.py +2 -3
  99. data/vendor/pygments-main/pygments/lexers/crystal.py +4 -5
  100. data/vendor/pygments-main/pygments/lexers/csound.py +6 -8
  101. data/vendor/pygments-main/pygments/lexers/css.py +5 -5
  102. data/vendor/pygments-main/pygments/lexers/d.py +4 -3
  103. data/vendor/pygments-main/pygments/lexers/dalvik.py +2 -3
  104. data/vendor/pygments-main/pygments/lexers/data.py +8 -12
  105. data/vendor/pygments-main/pygments/lexers/dax.py +2 -3
  106. data/vendor/pygments-main/pygments/lexers/devicetree.py +2 -3
  107. data/vendor/pygments-main/pygments/lexers/diff.py +7 -6
  108. data/vendor/pygments-main/pygments/lexers/dns.py +109 -0
  109. data/vendor/pygments-main/pygments/lexers/dotnet.py +19 -14
  110. data/vendor/pygments-main/pygments/lexers/dsls.py +24 -35
  111. data/vendor/pygments-main/pygments/lexers/dylan.py +8 -16
  112. data/vendor/pygments-main/pygments/lexers/ecl.py +2 -3
  113. data/vendor/pygments-main/pygments/lexers/eiffel.py +3 -4
  114. data/vendor/pygments-main/pygments/lexers/elm.py +3 -4
  115. data/vendor/pygments-main/pygments/lexers/elpi.py +28 -21
  116. data/vendor/pygments-main/pygments/lexers/email.py +3 -3
  117. data/vendor/pygments-main/pygments/lexers/erlang.py +22 -24
  118. data/vendor/pygments-main/pygments/lexers/esoteric.py +11 -12
  119. data/vendor/pygments-main/pygments/lexers/ezhil.py +2 -3
  120. data/vendor/pygments-main/pygments/lexers/factor.py +2 -3
  121. data/vendor/pygments-main/pygments/lexers/fantom.py +3 -3
  122. data/vendor/pygments-main/pygments/lexers/felix.py +9 -10
  123. data/vendor/pygments-main/pygments/lexers/fift.py +2 -1
  124. data/vendor/pygments-main/pygments/lexers/floscript.py +2 -3
  125. data/vendor/pygments-main/pygments/lexers/forth.py +2 -3
  126. data/vendor/pygments-main/pygments/lexers/fortran.py +6 -7
  127. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  128. data/vendor/pygments-main/pygments/lexers/freefem.py +2 -3
  129. data/vendor/pygments-main/pygments/lexers/func.py +3 -1
  130. data/vendor/pygments-main/pygments/lexers/functional.py +2 -1
  131. data/vendor/pygments-main/pygments/lexers/futhark.py +6 -7
  132. data/vendor/pygments-main/pygments/lexers/gcodelexer.py +3 -3
  133. data/vendor/pygments-main/pygments/lexers/gdscript.py +2 -1
  134. data/vendor/pygments-main/pygments/lexers/go.py +3 -4
  135. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +6 -9
  136. data/vendor/pygments-main/pygments/lexers/graph.py +12 -9
  137. data/vendor/pygments-main/pygments/lexers/graphics.py +13 -17
  138. data/vendor/pygments-main/pygments/lexers/graphql.py +176 -0
  139. data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -3
  140. data/vendor/pygments-main/pygments/lexers/gsql.py +2 -3
  141. data/vendor/pygments-main/pygments/lexers/haskell.py +27 -32
  142. data/vendor/pygments-main/pygments/lexers/haxe.py +3 -5
  143. data/vendor/pygments-main/pygments/lexers/hdl.py +8 -7
  144. data/vendor/pygments-main/pygments/lexers/hexdump.py +3 -3
  145. data/vendor/pygments-main/pygments/lexers/html.py +34 -13
  146. data/vendor/pygments-main/pygments/lexers/idl.py +2 -3
  147. data/vendor/pygments-main/pygments/lexers/igor.py +305 -290
  148. data/vendor/pygments-main/pygments/lexers/inferno.py +2 -3
  149. data/vendor/pygments-main/pygments/lexers/installers.py +7 -9
  150. data/vendor/pygments-main/pygments/lexers/int_fiction.py +150 -162
  151. data/vendor/pygments-main/pygments/lexers/iolang.py +2 -3
  152. data/vendor/pygments-main/pygments/lexers/j.py +2 -3
  153. data/vendor/pygments-main/pygments/lexers/javascript.py +18 -19
  154. data/vendor/pygments-main/pygments/lexers/jmespath.py +2 -1
  155. data/vendor/pygments-main/pygments/lexers/jslt.py +2 -3
  156. data/vendor/pygments-main/pygments/lexers/jsonnet.py +4 -3
  157. data/vendor/pygments-main/pygments/lexers/jsx.py +75 -0
  158. data/vendor/pygments-main/pygments/lexers/julia.py +4 -5
  159. data/vendor/pygments-main/pygments/lexers/jvm.py +98 -116
  160. data/vendor/pygments-main/pygments/lexers/kuin.py +2 -3
  161. data/vendor/pygments-main/pygments/lexers/kusto.py +93 -0
  162. data/vendor/pygments-main/pygments/lexers/ldap.py +155 -0
  163. data/vendor/pygments-main/pygments/lexers/lean.py +241 -0
  164. data/vendor/pygments-main/pygments/lexers/lilypond.py +2 -3
  165. data/vendor/pygments-main/pygments/lexers/lisp.py +373 -65
  166. data/vendor/pygments-main/pygments/lexers/macaulay2.py +53 -4
  167. data/vendor/pygments-main/pygments/lexers/make.py +7 -5
  168. data/vendor/pygments-main/pygments/lexers/markup.py +242 -91
  169. data/vendor/pygments-main/pygments/lexers/math.py +2 -1
  170. data/vendor/pygments-main/pygments/lexers/matlab.py +10 -12
  171. data/vendor/pygments-main/pygments/lexers/maxima.py +2 -3
  172. data/vendor/pygments-main/pygments/lexers/meson.py +2 -3
  173. data/vendor/pygments-main/pygments/lexers/mime.py +4 -4
  174. data/vendor/pygments-main/pygments/lexers/minecraft.py +24 -27
  175. data/vendor/pygments-main/pygments/lexers/mips.py +3 -1
  176. data/vendor/pygments-main/pygments/lexers/ml.py +59 -61
  177. data/vendor/pygments-main/pygments/lexers/modeling.py +19 -22
  178. data/vendor/pygments-main/pygments/lexers/modula2.py +2 -3
  179. data/vendor/pygments-main/pygments/lexers/mojo.py +704 -0
  180. data/vendor/pygments-main/pygments/lexers/monte.py +2 -3
  181. data/vendor/pygments-main/pygments/lexers/mosel.py +3 -3
  182. data/vendor/pygments-main/pygments/lexers/ncl.py +4 -3
  183. data/vendor/pygments-main/pygments/lexers/nimrod.py +7 -8
  184. data/vendor/pygments-main/pygments/lexers/nit.py +2 -3
  185. data/vendor/pygments-main/pygments/lexers/nix.py +40 -31
  186. data/vendor/pygments-main/pygments/lexers/oberon.py +3 -3
  187. data/vendor/pygments-main/pygments/lexers/objective.py +14 -6
  188. data/vendor/pygments-main/pygments/lexers/ooc.py +2 -3
  189. data/vendor/pygments-main/pygments/lexers/openscad.py +96 -0
  190. data/vendor/pygments-main/pygments/lexers/other.py +2 -1
  191. data/vendor/pygments-main/pygments/lexers/parasail.py +2 -3
  192. data/vendor/pygments-main/pygments/lexers/parsers.py +41 -44
  193. data/vendor/pygments-main/pygments/lexers/pascal.py +6 -3
  194. data/vendor/pygments-main/pygments/lexers/pawn.py +5 -5
  195. data/vendor/pygments-main/pygments/lexers/perl.py +3 -3
  196. data/vendor/pygments-main/pygments/lexers/phix.py +2 -3
  197. data/vendor/pygments-main/pygments/lexers/php.py +4 -5
  198. data/vendor/pygments-main/pygments/lexers/pointless.py +2 -3
  199. data/vendor/pygments-main/pygments/lexers/pony.py +3 -3
  200. data/vendor/pygments-main/pygments/lexers/praat.py +2 -3
  201. data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
  202. data/vendor/pygments-main/pygments/lexers/prolog.py +23 -9
  203. data/vendor/pygments-main/pygments/lexers/promql.py +2 -1
  204. data/vendor/pygments-main/pygments/lexers/prql.py +251 -0
  205. data/vendor/pygments-main/pygments/lexers/ptx.py +119 -0
  206. data/vendor/pygments-main/pygments/lexers/python.py +24 -24
  207. data/vendor/pygments-main/pygments/lexers/q.py +5 -6
  208. data/vendor/pygments-main/pygments/lexers/qlik.py +3 -3
  209. data/vendor/pygments-main/pygments/lexers/qvt.py +5 -3
  210. data/vendor/pygments-main/pygments/lexers/r.py +8 -6
  211. data/vendor/pygments-main/pygments/lexers/rdf.py +19 -13
  212. data/vendor/pygments-main/pygments/lexers/rebol.py +7 -7
  213. data/vendor/pygments-main/pygments/lexers/resource.py +5 -6
  214. data/vendor/pygments-main/pygments/lexers/ride.py +4 -5
  215. data/vendor/pygments-main/pygments/lexers/rita.py +2 -3
  216. data/vendor/pygments-main/pygments/lexers/rnc.py +2 -3
  217. data/vendor/pygments-main/pygments/lexers/roboconf.py +5 -5
  218. data/vendor/pygments-main/pygments/lexers/robotframework.py +2 -3
  219. data/vendor/pygments-main/pygments/lexers/ruby.py +8 -13
  220. data/vendor/pygments-main/pygments/lexers/rust.py +9 -10
  221. data/vendor/pygments-main/pygments/lexers/sas.py +3 -3
  222. data/vendor/pygments-main/pygments/lexers/savi.py +131 -130
  223. data/vendor/pygments-main/pygments/lexers/scdoc.py +13 -7
  224. data/vendor/pygments-main/pygments/lexers/scripting.py +354 -42
  225. data/vendor/pygments-main/pygments/lexers/sgf.py +2 -3
  226. data/vendor/pygments-main/pygments/lexers/shell.py +107 -129
  227. data/vendor/pygments-main/pygments/lexers/sieve.py +3 -3
  228. data/vendor/pygments-main/pygments/lexers/slash.py +4 -5
  229. data/vendor/pygments-main/pygments/lexers/smalltalk.py +3 -5
  230. data/vendor/pygments-main/pygments/lexers/smithy.py +2 -3
  231. data/vendor/pygments-main/pygments/lexers/smv.py +3 -3
  232. data/vendor/pygments-main/pygments/lexers/snobol.py +3 -3
  233. data/vendor/pygments-main/pygments/lexers/solidity.py +3 -3
  234. data/vendor/pygments-main/pygments/lexers/soong.py +78 -0
  235. data/vendor/pygments-main/pygments/lexers/sophia.py +3 -4
  236. data/vendor/pygments-main/pygments/lexers/special.py +8 -3
  237. data/vendor/pygments-main/pygments/lexers/spice.py +15 -16
  238. data/vendor/pygments-main/pygments/lexers/sql.py +24 -18
  239. data/vendor/pygments-main/pygments/lexers/srcinfo.py +3 -3
  240. data/vendor/pygments-main/pygments/lexers/stata.py +2 -3
  241. data/vendor/pygments-main/pygments/lexers/supercollider.py +2 -3
  242. data/vendor/pygments-main/pygments/lexers/tact.py +303 -0
  243. data/vendor/pygments-main/pygments/lexers/tal.py +13 -10
  244. data/vendor/pygments-main/pygments/lexers/tcl.py +2 -3
  245. data/vendor/pygments-main/pygments/lexers/teal.py +2 -3
  246. data/vendor/pygments-main/pygments/lexers/templates.py +131 -72
  247. data/vendor/pygments-main/pygments/lexers/teraterm.py +2 -3
  248. data/vendor/pygments-main/pygments/lexers/testing.py +4 -5
  249. data/vendor/pygments-main/pygments/lexers/text.py +2 -1
  250. data/vendor/pygments-main/pygments/lexers/textedit.py +9 -6
  251. data/vendor/pygments-main/pygments/lexers/textfmts.py +20 -15
  252. data/vendor/pygments-main/pygments/lexers/theorem.py +41 -115
  253. data/vendor/pygments-main/pygments/lexers/thingsdb.py +50 -26
  254. data/vendor/pygments-main/pygments/lexers/tlb.py +3 -1
  255. data/vendor/pygments-main/pygments/lexers/tls.py +54 -0
  256. data/vendor/pygments-main/pygments/lexers/tnt.py +2 -3
  257. data/vendor/pygments-main/pygments/lexers/trafficscript.py +3 -3
  258. data/vendor/pygments-main/pygments/lexers/typoscript.py +6 -7
  259. data/vendor/pygments-main/pygments/lexers/typst.py +104 -0
  260. data/vendor/pygments-main/pygments/lexers/ul4.py +47 -5
  261. data/vendor/pygments-main/pygments/lexers/unicon.py +9 -7
  262. data/vendor/pygments-main/pygments/lexers/urbi.py +3 -3
  263. data/vendor/pygments-main/pygments/lexers/usd.py +6 -11
  264. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  265. data/vendor/pygments-main/pygments/lexers/verification.py +4 -5
  266. data/vendor/pygments-main/pygments/lexers/verifpal.py +65 -0
  267. data/vendor/pygments-main/pygments/lexers/vip.py +150 -0
  268. data/vendor/pygments-main/pygments/lexers/vyper.py +140 -0
  269. data/vendor/pygments-main/pygments/lexers/web.py +2 -1
  270. data/vendor/pygments-main/pygments/lexers/webassembly.py +2 -3
  271. data/vendor/pygments-main/pygments/lexers/webidl.py +2 -3
  272. data/vendor/pygments-main/pygments/lexers/webmisc.py +11 -15
  273. data/vendor/pygments-main/pygments/lexers/wgsl.py +6 -7
  274. data/vendor/pygments-main/pygments/lexers/whiley.py +2 -3
  275. data/vendor/pygments-main/pygments/lexers/wowtoc.py +3 -3
  276. data/vendor/pygments-main/pygments/lexers/wren.py +3 -4
  277. data/vendor/pygments-main/pygments/lexers/x10.py +6 -7
  278. data/vendor/pygments-main/pygments/lexers/xorg.py +2 -1
  279. data/vendor/pygments-main/pygments/lexers/yang.py +2 -3
  280. data/vendor/pygments-main/pygments/lexers/yara.py +69 -0
  281. data/vendor/pygments-main/pygments/lexers/zig.py +2 -1
  282. data/vendor/pygments-main/pygments/modeline.py +4 -4
  283. data/vendor/pygments-main/pygments/plugin.py +3 -19
  284. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  285. data/vendor/pygments-main/pygments/scanner.py +1 -1
  286. data/vendor/pygments-main/pygments/sphinxext.py +38 -8
  287. data/vendor/pygments-main/pygments/style.py +8 -2
  288. data/vendor/pygments-main/pygments/styles/__init__.py +17 -59
  289. data/vendor/pygments-main/pygments/styles/_mapping.py +54 -0
  290. data/vendor/pygments-main/pygments/styles/abap.py +5 -1
  291. data/vendor/pygments-main/pygments/styles/algol.py +5 -1
  292. data/vendor/pygments-main/pygments/styles/algol_nu.py +5 -1
  293. data/vendor/pygments-main/pygments/styles/arduino.py +76 -72
  294. data/vendor/pygments-main/pygments/styles/autumn.py +6 -1
  295. data/vendor/pygments-main/pygments/styles/borland.py +6 -1
  296. data/vendor/pygments-main/pygments/styles/bw.py +6 -1
  297. data/vendor/pygments-main/pygments/styles/coffee.py +80 -0
  298. data/vendor/pygments-main/pygments/styles/colorful.py +6 -1
  299. data/vendor/pygments-main/pygments/styles/default.py +6 -1
  300. data/vendor/pygments-main/pygments/styles/dracula.py +68 -80
  301. data/vendor/pygments-main/pygments/styles/emacs.py +6 -1
  302. data/vendor/pygments-main/pygments/styles/friendly.py +6 -1
  303. data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +6 -1
  304. data/vendor/pygments-main/pygments/styles/fruity.py +7 -1
  305. data/vendor/pygments-main/pygments/styles/gh_dark.py +7 -1
  306. data/vendor/pygments-main/pygments/styles/gruvbox.py +10 -1
  307. data/vendor/pygments-main/pygments/styles/igor.py +6 -1
  308. data/vendor/pygments-main/pygments/styles/inkpot.py +7 -2
  309. data/vendor/pygments-main/pygments/styles/lightbulb.py +110 -0
  310. data/vendor/pygments-main/pygments/styles/lilypond.py +8 -2
  311. data/vendor/pygments-main/pygments/styles/lovelace.py +16 -10
  312. data/vendor/pygments-main/pygments/styles/manni.py +7 -2
  313. data/vendor/pygments-main/pygments/styles/material.py +21 -14
  314. data/vendor/pygments-main/pygments/styles/monokai.py +16 -10
  315. data/vendor/pygments-main/pygments/styles/murphy.py +7 -2
  316. data/vendor/pygments-main/pygments/styles/native.py +10 -5
  317. data/vendor/pygments-main/pygments/styles/nord.py +9 -3
  318. data/vendor/pygments-main/pygments/styles/onedark.py +6 -2
  319. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +7 -2
  320. data/vendor/pygments-main/pygments/styles/paraiso_light.py +7 -2
  321. data/vendor/pygments-main/pygments/styles/pastie.py +7 -1
  322. data/vendor/pygments-main/pygments/styles/perldoc.py +7 -1
  323. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +26 -19
  324. data/vendor/pygments-main/pygments/styles/rrt.py +8 -2
  325. data/vendor/pygments-main/pygments/styles/sas.py +6 -1
  326. data/vendor/pygments-main/pygments/styles/solarized.py +9 -1
  327. data/vendor/pygments-main/pygments/styles/staroffice.py +6 -1
  328. data/vendor/pygments-main/pygments/styles/stata_dark.py +6 -2
  329. data/vendor/pygments-main/pygments/styles/stata_light.py +6 -1
  330. data/vendor/pygments-main/pygments/styles/tango.py +7 -3
  331. data/vendor/pygments-main/pygments/styles/trac.py +7 -1
  332. data/vendor/pygments-main/pygments/styles/vim.py +7 -1
  333. data/vendor/pygments-main/pygments/styles/vs.py +7 -2
  334. data/vendor/pygments-main/pygments/styles/xcode.py +6 -1
  335. data/vendor/pygments-main/pygments/styles/zenburn.py +6 -1
  336. data/vendor/pygments-main/pygments/token.py +2 -1
  337. data/vendor/pygments-main/pygments/unistring.py +5 -5
  338. data/vendor/pygments-main/pygments/util.py +13 -19
  339. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/METADATA +14 -13
  340. data/vendor/pygments-main/pygments-2.18.0.dist-info/RECORD +663 -0
  341. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/WHEEL +1 -2
  342. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/AUTHORS +13 -0
  343. metadata +41 -17
  344. data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +0 -614
  345. data/vendor/pygments-main/Pygments-2.15.1.dist-info/top_level.txt +0 -1
  346. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/INSTALLER +0 -0
  347. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/REQUESTED +0 -0
  348. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/entry_points.txt +0 -0
  349. /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 misc console output.
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
 
@@ -19,13 +19,13 @@ class VCTreeStatusLexer(RegexLexer):
19
19
  """
20
20
  For colorizing output of version control status commands, like "hg
21
21
  status" or "svn status".
22
-
23
- .. versionadded:: 2.0
24
22
  """
25
23
  name = 'VCTreeStatus'
26
24
  aliases = ['vctreestatus']
27
25
  filenames = []
28
26
  mimetypes = []
27
+ url = ""
28
+ version_added = '2.0'
29
29
 
30
30
  tokens = {
31
31
  'root': [
@@ -45,13 +45,13 @@ class VCTreeStatusLexer(RegexLexer):
45
45
  class PyPyLogLexer(RegexLexer):
46
46
  """
47
47
  Lexer for PyPy log files.
48
-
49
- .. versionadded:: 1.5
50
48
  """
51
49
  name = "PyPy Log"
52
50
  aliases = ["pypylog", "pypy"]
53
51
  filenames = ["*.pypylog"]
54
52
  mimetypes = ['application/x-pypylog']
53
+ url = 'pypy.org'
54
+ version_added = '1.5'
55
55
 
56
56
  tokens = {
57
57
  "root": [
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexer for the cplint language
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
 
@@ -19,14 +19,13 @@ class CplintLexer(PrologLexer):
19
19
  """
20
20
  Lexer for cplint files, including CP-logic, Logic Programs with Annotated
21
21
  Disjunctions, Distributional Clauses syntax, ProbLog, DTProbLog.
22
-
23
- .. versionadded:: 2.12
24
22
  """
25
23
  name = 'cplint'
26
24
  url = 'https://cplint.eu'
27
25
  aliases = ['cplint']
28
26
  filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl', '*.P', '*.lpad', '*.cpl']
29
27
  mimetypes = ['text/x-cplint']
28
+ version_added = '2.12'
30
29
 
31
30
  tokens = {
32
31
  'root': [
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexer for Crystal.
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
 
@@ -27,15 +27,14 @@ CRYSTAL_OPERATORS = [
27
27
  class CrystalLexer(ExtendedRegexLexer):
28
28
  """
29
29
  For Crystal source code.
30
-
31
- .. versionadded:: 2.2
32
30
  """
33
31
 
34
32
  name = 'Crystal'
35
- url = 'http://crystal-lang.org'
33
+ url = 'https://crystal-lang.org'
36
34
  aliases = ['cr', 'crystal']
37
35
  filenames = ['*.cr']
38
36
  mimetypes = ['text/x-crystal']
37
+ version_added = '2.2'
39
38
 
40
39
  flags = re.DOTALL | re.MULTILINE
41
40
 
@@ -107,7 +106,7 @@ class CrystalLexer(ExtendedRegexLexer):
107
106
  ('backtick', String.Backtick, '`'):
108
107
  states['simple-'+name] = [
109
108
  include('string-escaped' if name == 'sym' else 'string-intp-escaped'),
110
- (r'[^\\%s#]+' % end, ttype),
109
+ (rf'[^\\{end}#]+', ttype),
111
110
  (r'[\\#]', ttype),
112
111
  (end, ttype, '#pop'),
113
112
  ]
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for Csound 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
 
@@ -136,13 +136,12 @@ class CsoundLexer(RegexLexer):
136
136
  class CsoundScoreLexer(CsoundLexer):
137
137
  """
138
138
  For `Csound <https://csound.com>`_ scores.
139
-
140
- .. versionadded:: 2.1
141
139
  """
142
140
 
143
141
  name = 'Csound Score'
144
142
  aliases = ['csound-score', 'csound-sco']
145
143
  filenames = ['*.sco']
144
+ version_added = '2.1'
146
145
 
147
146
  tokens = {
148
147
  'root': [
@@ -202,13 +201,12 @@ class CsoundScoreLexer(CsoundLexer):
202
201
  class CsoundOrchestraLexer(CsoundLexer):
203
202
  """
204
203
  For `Csound <https://csound.com>`_ orchestras.
205
-
206
- .. versionadded:: 2.1
207
204
  """
208
205
 
209
206
  name = 'Csound Orchestra'
210
207
  aliases = ['csound', 'csound-orc']
211
208
  filenames = ['*.orc', '*.udo']
209
+ version_added = '2.1'
212
210
 
213
211
  user_defined_opcodes = set()
214
212
 
@@ -411,14 +409,14 @@ class CsoundOrchestraLexer(CsoundLexer):
411
409
 
412
410
  class CsoundDocumentLexer(RegexLexer):
413
411
  """
414
- For `Csound <https://csound.com>`_ documents.
415
-
416
- .. versionadded:: 2.1
412
+ For Csound documents.
417
413
  """
418
414
 
419
415
  name = 'Csound Document'
420
416
  aliases = ['csound-document', 'csound-csd']
421
417
  filenames = ['*.csd']
418
+ url = 'https://csound.com'
419
+ version_added = '2.1'
422
420
 
423
421
  # These tokens are based on those in XmlLexer in pygments/lexers/html.py. Making
424
422
  # CsoundDocumentLexer a subclass of XmlLexer rather than RegexLexer may seem like a
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for CSS and related stylesheet formats.
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
 
@@ -178,6 +178,7 @@ class CssLexer(RegexLexer):
178
178
  aliases = ['css']
179
179
  filenames = ['*.css']
180
180
  mimetypes = ['text/css']
181
+ version_added = ''
181
182
 
182
183
  tokens = {
183
184
  'root': [
@@ -445,8 +446,6 @@ def _starts_block(token, state):
445
446
  class SassLexer(ExtendedRegexLexer):
446
447
  """
447
448
  For Sass stylesheets.
448
-
449
- .. versionadded:: 1.3
450
449
  """
451
450
 
452
451
  name = 'Sass'
@@ -454,6 +453,7 @@ class SassLexer(ExtendedRegexLexer):
454
453
  aliases = ['sass']
455
454
  filenames = ['*.sass']
456
455
  mimetypes = ['text/x-sass']
456
+ version_added = '1.3'
457
457
 
458
458
  flags = re.IGNORECASE | re.MULTILINE
459
459
 
@@ -535,6 +535,7 @@ class ScssLexer(RegexLexer):
535
535
  aliases = ['scss']
536
536
  filenames = ['*.scss']
537
537
  mimetypes = ['text/x-scss']
538
+ version_added = ''
538
539
 
539
540
  flags = re.IGNORECASE | re.DOTALL
540
541
  tokens = {
@@ -579,8 +580,6 @@ class ScssLexer(RegexLexer):
579
580
  class LessCssLexer(CssLexer):
580
581
  """
581
582
  For LESS styleshets.
582
-
583
- .. versionadded:: 2.1
584
583
  """
585
584
 
586
585
  name = 'LessCss'
@@ -588,6 +587,7 @@ class LessCssLexer(CssLexer):
588
587
  aliases = ['less']
589
588
  filenames = ['*.less']
590
589
  mimetypes = ['text/x-less-css']
590
+ version_added = '2.1'
591
591
 
592
592
  tokens = {
593
593
  'root': [
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for D 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
 
@@ -18,14 +18,13 @@ __all__ = ['DLexer', 'CrocLexer', 'MiniDLexer']
18
18
  class DLexer(RegexLexer):
19
19
  """
20
20
  For D source.
21
-
22
- .. versionadded:: 1.2
23
21
  """
24
22
  name = 'D'
25
23
  url = 'https://dlang.org/'
26
24
  filenames = ['*.d', '*.di']
27
25
  aliases = ['d']
28
26
  mimetypes = ['text/x-dsrc']
27
+ version_added = '1.2'
29
28
 
30
29
  tokens = {
31
30
  'root': [
@@ -194,6 +193,7 @@ class CrocLexer(RegexLexer):
194
193
  filenames = ['*.croc']
195
194
  aliases = ['croc']
196
195
  mimetypes = ['text/x-crocsrc']
196
+ version_added = ''
197
197
 
198
198
  tokens = {
199
199
  'root': [
@@ -256,3 +256,4 @@ class MiniDLexer(CrocLexer):
256
256
  filenames = [] # don't lex .md as MiniD, reserve for Markdown
257
257
  aliases = ['minid']
258
258
  mimetypes = ['text/x-minidsrc']
259
+ version_added = ''
@@ -4,7 +4,7 @@
4
4
 
5
5
  Pygments lexers for Dalvik VM-related 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
 
@@ -21,14 +21,13 @@ class SmaliLexer(RegexLexer):
21
21
  """
22
22
  For Smali (Android/Dalvik) assembly
23
23
  code.
24
-
25
- .. versionadded:: 1.6
26
24
  """
27
25
  name = 'Smali'
28
26
  url = 'http://code.google.com/p/smali/'
29
27
  aliases = ['smali']
30
28
  filenames = ['*.smali']
31
29
  mimetypes = ['text/smali']
30
+ version_added = '1.6'
32
31
 
33
32
  tokens = {
34
33
  'root': [
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for data file format.
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
 
@@ -31,8 +31,6 @@ class YamlLexer(ExtendedRegexLexer):
31
31
  """
32
32
  Lexer for YAML, a human-friendly data serialization
33
33
  language.
34
-
35
- .. versionadded:: 0.11
36
34
  """
37
35
 
38
36
  name = 'YAML'
@@ -40,6 +38,7 @@ class YamlLexer(ExtendedRegexLexer):
40
38
  aliases = ['yaml']
41
39
  filenames = ['*.yaml', '*.yml']
42
40
  mimetypes = ['text/x-yaml']
41
+ version_added = '0.11'
43
42
 
44
43
  def something(token_class):
45
44
  """Do not produce empty tokens."""
@@ -443,15 +442,14 @@ class JsonLexer(Lexer):
443
442
  This allows users to highlight JSON as it is used in the wild.
444
443
 
445
444
  No validation is performed on the input JSON document.
446
-
447
- .. versionadded:: 1.5
448
445
  """
449
446
 
450
447
  name = 'JSON'
451
448
  url = 'https://www.json.org'
452
449
  aliases = ['json', 'json-object']
453
- filenames = ['*.json', 'Pipfile.lock']
454
- mimetypes = ['application/json', 'application/json-object']
450
+ filenames = ['*.json', '*.jsonl', '*.ndjson', 'Pipfile.lock']
451
+ mimetypes = ['application/json', 'application/json-object', 'application/x-ndjson', 'application/jsonl', 'application/json-seq']
452
+ version_added = '1.5'
455
453
 
456
454
  # No validation of integers, floats, or constants is done.
457
455
  # As long as the characters are members of the following
@@ -704,8 +702,6 @@ class JsonBareObjectLexer(JsonLexer):
704
702
  """
705
703
  For JSON data structures (with missing object curly braces).
706
704
 
707
- .. versionadded:: 2.2
708
-
709
705
  .. deprecated:: 2.8.0
710
706
 
711
707
  Behaves the same as `JsonLexer` now.
@@ -715,13 +711,12 @@ class JsonBareObjectLexer(JsonLexer):
715
711
  aliases = []
716
712
  filenames = []
717
713
  mimetypes = []
714
+ version_added = '2.2'
718
715
 
719
716
 
720
717
  class JsonLdLexer(JsonLexer):
721
718
  """
722
719
  For JSON-LD linked data.
723
-
724
- .. versionadded:: 2.0
725
720
  """
726
721
 
727
722
  name = 'JSON-LD'
@@ -729,9 +724,10 @@ class JsonLdLexer(JsonLexer):
729
724
  aliases = ['jsonld', 'json-ld']
730
725
  filenames = ['*.jsonld']
731
726
  mimetypes = ['application/ld+json']
727
+ version_added = '2.0'
732
728
 
733
729
  json_ld_keywords = {
734
- '"@%s"' % keyword
730
+ f'"@{keyword}"'
735
731
  for keyword in (
736
732
  'base',
737
733
  'container',
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexer for LilyPond.
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
 
@@ -19,14 +19,13 @@ class DaxLexer(RegexLexer):
19
19
  """
20
20
  Lexer for Power BI DAX
21
21
  Referenced from: https://github.com/sql-bi/SyntaxHighlighterBrushDax
22
-
23
- .. versionadded:: 2.15
24
22
  """
25
23
  name = 'Dax'
26
24
  aliases = ['dax']
27
25
  filenames = ['*.dax']
28
26
  url = 'https://learn.microsoft.com/en-us/dax/dax-function-reference'
29
27
  mimetypes = []
28
+ version_added = '2.15'
30
29
 
31
30
  tokens = {
32
31
  'root': [
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for Devicetree language.
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
 
@@ -18,8 +18,6 @@ __all__ = ['DevicetreeLexer']
18
18
  class DevicetreeLexer(RegexLexer):
19
19
  """
20
20
  Lexer for Devicetree files.
21
-
22
- .. versionadded:: 2.7
23
21
  """
24
22
 
25
23
  name = 'Devicetree'
@@ -27,6 +25,7 @@ class DevicetreeLexer(RegexLexer):
27
25
  aliases = ['devicetree', 'dts']
28
26
  filenames = ['*.dts', '*.dtsi']
29
27
  mimetypes = ['text/x-c']
28
+ version_added = '2.7'
30
29
 
31
30
  #: optional Whitespace or /*...*/ style comment
32
31
  _ws = r'\s*(?:/[*][^*/]*?[*]/\s*)*'
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for diff/patch formats.
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
 
@@ -26,6 +26,8 @@ class DiffLexer(RegexLexer):
26
26
  aliases = ['diff', 'udiff']
27
27
  filenames = ['*.diff', '*.patch']
28
28
  mimetypes = ['text/x-diff', 'text/x-patch']
29
+ url = 'https://en.wikipedia.org/wiki/Diff'
30
+ version_added = ''
29
31
 
30
32
  tokens = {
31
33
  'root': [
@@ -57,13 +59,13 @@ class DarcsPatchLexer(RegexLexer):
57
59
  DarcsPatchLexer is a lexer for the various versions of the darcs patch
58
60
  format. Examples of this format are derived by commands such as
59
61
  ``darcs annotate --patch`` and ``darcs send``.
60
-
61
- .. versionadded:: 0.10
62
62
  """
63
63
 
64
64
  name = 'Darcs Patch'
65
65
  aliases = ['dpatch']
66
66
  filenames = ['*.dpatch', '*.darcspatch']
67
+ url = 'https://darcs.net'
68
+ version_added = '0.10'
67
69
 
68
70
  DPATCH_KEYWORDS = ('hunk', 'addfile', 'adddir', 'rmfile', 'rmdir', 'move',
69
71
  'replace')
@@ -83,7 +85,7 @@ class DarcsPatchLexer(RegexLexer):
83
85
  (r'New patches:', Generic.Heading),
84
86
  (r'Context:', Generic.Heading),
85
87
  (r'Patch bundle hash:', Generic.Heading),
86
- (r'(\s*)(%s)(.*)(\n)' % '|'.join(DPATCH_KEYWORDS),
88
+ (r'(\s*)({})(.*)(\n)'.format('|'.join(DPATCH_KEYWORDS)),
87
89
  bygroups(Whitespace, Keyword, Text, Whitespace)),
88
90
  (r'\+', Generic.Inserted, "insert"),
89
91
  (r'-', Generic.Deleted, "delete"),
@@ -119,8 +121,6 @@ class WDiffLexer(RegexLexer):
119
121
  * It only works with normal output (without options like ``-l``).
120
122
  * If the target files contain "[-", "-]", "{+", or "+}",
121
123
  especially they are unbalanced, the lexer will get confused.
122
-
123
- .. versionadded:: 2.2
124
124
  """
125
125
 
126
126
  name = 'WDiff'
@@ -128,6 +128,7 @@ class WDiffLexer(RegexLexer):
128
128
  aliases = ['wdiff']
129
129
  filenames = ['*.wdiff']
130
130
  mimetypes = []
131
+ version_added = '2.2'
131
132
 
132
133
  flags = re.MULTILINE | re.DOTALL
133
134
 
@@ -0,0 +1,109 @@
1
+ """
2
+ pygments.lexers.dns
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Pygments lexers for DNS
6
+
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+
13
+ from pygments.token import Comment, Operator, Keyword, Name, String, \
14
+ Number, Punctuation, Whitespace, Literal
15
+ from pygments.lexer import RegexLexer, bygroups, include
16
+
17
+ __all__ = ['DnsZoneLexer']
18
+
19
+
20
+ CLASSES = [
21
+ "IN",
22
+ "CS",
23
+ "CH",
24
+ "HS",
25
+ ]
26
+
27
+ CLASSES_RE = "(" + "|".join(CLASSES) + ')'
28
+
29
+
30
+ class DnsZoneLexer(RegexLexer):
31
+
32
+ """
33
+ Lexer for DNS zone file
34
+ """
35
+
36
+ flags = re.MULTILINE
37
+
38
+ name = 'Zone'
39
+ aliases = ['zone']
40
+ filenames = [ "*.zone" ]
41
+ url = "https://datatracker.ietf.org/doc/html/rfc1035"
42
+ mimetypes = ['text/dns']
43
+ version_added = '2.16'
44
+
45
+ tokens = {
46
+ 'root': [
47
+ # Empty/comment line:
48
+ (r'([ \t]*)(;.*)(\n)', bygroups(Whitespace, Comment.Single, Whitespace)),
49
+ # Special directives:
50
+ (r'^\$ORIGIN\b', Keyword, 'values'),
51
+ (r'^\$TTL\b', Keyword, 'values'),
52
+ (r'^\$INCLUDE\b', Comment.Preproc, 'include'),
53
+ # TODO, $GENERATE https://bind9.readthedocs.io/en/v9.18.14/chapter3.html#soa-rr
54
+ (r'^\$[A-Z]+\b', Keyword, 'values'),
55
+ # Records:
56
+ # <domain-name> [<TTL>] [<class>] <type> <RDATA> [<comment>]
57
+ (r'^(@)([ \t]+)(?:([0-9]+[smhdw]?)([ \t]+))?(?:' + CLASSES_RE + "([ \t]+))?([A-Z]+)([ \t]+)",
58
+ bygroups(Operator, Whitespace, Number.Integer, Whitespace, Name.Class, Whitespace, Keyword.Type, Whitespace),
59
+ "values"),
60
+ (r'^([^ \t\n]*)([ \t]+)(?:([0-9]+[smhdw]?)([ \t]+))?(?:' + CLASSES_RE + "([ \t]+))?([A-Z]+)([ \t]+)",
61
+ bygroups(Name, Whitespace, Number.Integer, Whitespace, Name.Class, Whitespace, Keyword.Type, Whitespace),
62
+ "values"),
63
+ # <domain-name> [<class>] [<TTL>] <type> <RDATA> [<comment>]
64
+ (r'^(Operator)([ \t]+)(?:' + CLASSES_RE + "([ \t]+))?(?:([0-9]+[smhdw]?)([ \t]+))?([A-Z]+)([ \t]+)",
65
+ bygroups(Name, Whitespace, Number.Integer, Whitespace, Name.Class, Whitespace, Keyword.Type, Whitespace),
66
+ "values"),
67
+ (r'^([^ \t\n]*)([ \t]+)(?:' + CLASSES_RE + "([ \t]+))?(?:([0-9]+[smhdw]?)([ \t]+))?([A-Z]+)([ \t]+)",
68
+ bygroups(Name, Whitespace, Number.Integer, Whitespace, Name.Class, Whitespace, Keyword.Type, Whitespace),
69
+ "values"),
70
+ ],
71
+ # Parsing values:
72
+ 'values': [
73
+ (r'\n', Whitespace, "#pop"),
74
+ (r'\(', Punctuation, 'nested'),
75
+ include('simple-value'),
76
+ ],
77
+ # Parsing nested values (...):
78
+ 'nested': [
79
+ (r'\)', Punctuation, "#pop"),
80
+ include('multiple-simple-values'),
81
+ ],
82
+ # Parsing values:
83
+ 'simple-value': [
84
+ (r'(;.*)', bygroups(Comment.Single)),
85
+ (r'[ \t]+', Whitespace),
86
+ (r"@\b", Operator),
87
+ ('"', String, 'string'),
88
+ (r'[0-9]+[smhdw]?$', Number.Integer),
89
+ (r'([0-9]+[smhdw]?)([ \t]+)', bygroups(Number.Integer, Whitespace)),
90
+ (r'\S+', Literal),
91
+ ],
92
+ 'multiple-simple-values': [
93
+ include('simple-value'),
94
+ (r'[\n]+', Whitespace),
95
+ ],
96
+ 'include': [
97
+ (r'([ \t]+)([^ \t\n]+)([ \t]+)([-\._a-zA-Z]+)([ \t]+)(;.*)?$',
98
+ bygroups(Whitespace, Comment.PreprocFile, Whitespace, Name, Whitespace, Comment.Single), '#pop'),
99
+ (r'([ \t]+)([^ \t\n]+)([ \t\n]+)$', bygroups(Whitespace, Comment.PreprocFile, Whitespace), '#pop'),
100
+ ],
101
+ "string": [
102
+ (r'\\"', String),
103
+ (r'"', String, "#pop"),
104
+ (r'[^"]+', String),
105
+ ]
106
+ }
107
+
108
+ def analyse_text(text):
109
+ return text.startswith("$ORIGIN")