pygments.rb 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.rubocop.yml +7 -0
  4. data/CHANGELOG.adoc +4 -0
  5. data/README.adoc +1 -1
  6. data/bench.rb +1 -1
  7. data/lib/pygments/popen.rb +3 -7
  8. data/lib/pygments/version.rb +1 -1
  9. data/pygments.rb.gemspec +2 -2
  10. data/test/test_pygments.rb +0 -19
  11. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/AUTHORS +21 -1
  12. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/LICENSE +1 -1
  13. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/METADATA +19 -11
  14. data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +614 -0
  15. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/WHEEL +1 -1
  16. data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/entry_points.txt +0 -1
  17. data/vendor/pygments-main/bin/pygmentize +1 -1
  18. data/vendor/pygments-main/pygments/__init__.py +20 -22
  19. data/vendor/pygments-main/pygments/__main__.py +1 -1
  20. data/vendor/pygments-main/pygments/cmdline.py +74 -8
  21. data/vendor/pygments-main/pygments/console.py +1 -1
  22. data/vendor/pygments-main/pygments/filter.py +1 -1
  23. data/vendor/pygments-main/pygments/filters/__init__.py +6 -3
  24. data/vendor/pygments-main/pygments/formatter.py +41 -11
  25. data/vendor/pygments-main/pygments/formatters/__init__.py +21 -16
  26. data/vendor/pygments-main/pygments/formatters/_mapping.py +5 -65
  27. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  28. data/vendor/pygments-main/pygments/formatters/groff.py +170 -0
  29. data/vendor/pygments-main/pygments/formatters/html.py +54 -32
  30. data/vendor/pygments-main/pygments/formatters/img.py +9 -5
  31. data/vendor/pygments-main/pygments/formatters/irc.py +6 -33
  32. data/vendor/pygments-main/pygments/formatters/latex.py +24 -14
  33. data/vendor/pygments-main/pygments/formatters/other.py +1 -1
  34. data/vendor/pygments-main/pygments/formatters/pangomarkup.py +1 -1
  35. data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
  36. data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
  37. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -3
  38. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -4
  39. data/vendor/pygments-main/pygments/lexer.py +101 -32
  40. data/vendor/pygments-main/pygments/lexers/__init__.py +50 -29
  41. data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +103 -0
  42. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
  43. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
  44. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
  45. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +21 -6
  46. data/vendor/pygments-main/pygments/lexers/_css_builtins.py +558 -0
  47. data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +10 -0
  48. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
  49. data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +4932 -0
  50. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +11 -18
  51. data/vendor/pygments-main/pygments/lexers/_mapping.py +71 -82
  52. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +58 -4
  54. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  55. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +408 -1835
  56. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +70 -8
  57. data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +666 -0
  58. data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1609 -0
  59. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3 -3
  60. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +9 -18
  61. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +185 -94
  62. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
  63. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  64. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
  65. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
  66. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  67. data/vendor/pygments-main/pygments/lexers/actionscript.py +15 -14
  68. data/vendor/pygments-main/pygments/lexers/ada.py +144 -0
  69. data/vendor/pygments-main/pygments/lexers/agile.py +1 -1
  70. data/vendor/pygments-main/pygments/lexers/algebra.py +72 -9
  71. data/vendor/pygments-main/pygments/lexers/ambient.py +8 -7
  72. data/vendor/pygments-main/pygments/lexers/amdgpu.py +4 -3
  73. data/vendor/pygments-main/pygments/lexers/ampl.py +10 -8
  74. data/vendor/pygments-main/pygments/lexers/apdlexer.py +164 -20
  75. data/vendor/pygments-main/pygments/lexers/apl.py +6 -5
  76. data/vendor/pygments-main/pygments/lexers/archetype.py +23 -21
  77. data/vendor/pygments-main/pygments/lexers/arrow.py +10 -9
  78. data/vendor/pygments-main/pygments/lexers/arturo.py +250 -0
  79. data/vendor/pygments-main/pygments/lexers/asc.py +9 -5
  80. data/vendor/pygments-main/pygments/lexers/asm.py +68 -63
  81. data/vendor/pygments-main/pygments/lexers/automation.py +7 -5
  82. data/vendor/pygments-main/pygments/lexers/bare.py +20 -21
  83. data/vendor/pygments-main/pygments/lexers/basic.py +45 -41
  84. data/vendor/pygments-main/pygments/lexers/bdd.py +58 -0
  85. data/vendor/pygments-main/pygments/lexers/berry.py +99 -0
  86. data/vendor/pygments-main/pygments/lexers/bibtex.py +6 -6
  87. data/vendor/pygments-main/pygments/lexers/boa.py +4 -8
  88. data/vendor/pygments-main/pygments/lexers/business.py +18 -18
  89. data/vendor/pygments-main/pygments/lexers/c_cpp.py +80 -40
  90. data/vendor/pygments-main/pygments/lexers/c_like.py +21 -19
  91. data/vendor/pygments-main/pygments/lexers/capnproto.py +6 -8
  92. data/vendor/pygments-main/pygments/lexers/carbon.py +96 -0
  93. data/vendor/pygments-main/pygments/lexers/cddl.py +16 -33
  94. data/vendor/pygments-main/pygments/lexers/chapel.py +14 -9
  95. data/vendor/pygments-main/pygments/lexers/clean.py +3 -2
  96. data/vendor/pygments-main/pygments/lexers/comal.py +80 -0
  97. data/vendor/pygments-main/pygments/lexers/compiled.py +3 -2
  98. data/vendor/pygments-main/pygments/lexers/configs.py +235 -120
  99. data/vendor/pygments-main/pygments/lexers/console.py +5 -4
  100. data/vendor/pygments-main/pygments/lexers/cplint.py +44 -0
  101. data/vendor/pygments-main/pygments/lexers/crystal.py +22 -23
  102. data/vendor/pygments-main/pygments/lexers/csound.py +19 -17
  103. data/vendor/pygments-main/pygments/lexers/css.py +67 -159
  104. data/vendor/pygments-main/pygments/lexers/d.py +15 -12
  105. data/vendor/pygments-main/pygments/lexers/dalvik.py +14 -11
  106. data/vendor/pygments-main/pygments/lexers/data.py +119 -49
  107. data/vendor/pygments-main/pygments/lexers/dax.py +136 -0
  108. data/vendor/pygments-main/pygments/lexers/devicetree.py +9 -8
  109. data/vendor/pygments-main/pygments/lexers/diff.py +23 -19
  110. data/vendor/pygments-main/pygments/lexers/dotnet.py +216 -81
  111. data/vendor/pygments-main/pygments/lexers/dsls.py +86 -64
  112. data/vendor/pygments-main/pygments/lexers/dylan.py +16 -15
  113. data/vendor/pygments-main/pygments/lexers/ecl.py +46 -38
  114. data/vendor/pygments-main/pygments/lexers/eiffel.py +15 -10
  115. data/vendor/pygments-main/pygments/lexers/elm.py +12 -8
  116. data/vendor/pygments-main/pygments/lexers/elpi.py +165 -0
  117. data/vendor/pygments-main/pygments/lexers/email.py +21 -39
  118. data/vendor/pygments-main/pygments/lexers/erlang.py +21 -22
  119. data/vendor/pygments-main/pygments/lexers/esoteric.py +28 -30
  120. data/vendor/pygments-main/pygments/lexers/ezhil.py +10 -9
  121. data/vendor/pygments-main/pygments/lexers/factor.py +104 -83
  122. data/vendor/pygments-main/pygments/lexers/fantom.py +31 -29
  123. data/vendor/pygments-main/pygments/lexers/felix.py +18 -14
  124. data/vendor/pygments-main/pygments/lexers/fift.py +67 -0
  125. data/vendor/pygments-main/pygments/lexers/floscript.py +7 -7
  126. data/vendor/pygments-main/pygments/lexers/forth.py +8 -6
  127. data/vendor/pygments-main/pygments/lexers/fortran.py +16 -11
  128. data/vendor/pygments-main/pygments/lexers/foxpro.py +2 -2
  129. data/vendor/pygments-main/pygments/lexers/freefem.py +7 -10
  130. data/vendor/pygments-main/pygments/lexers/func.py +108 -0
  131. data/vendor/pygments-main/pygments/lexers/functional.py +1 -1
  132. data/vendor/pygments-main/pygments/lexers/futhark.py +12 -17
  133. data/vendor/pygments-main/pygments/lexers/gcodelexer.py +1 -2
  134. data/vendor/pygments-main/pygments/lexers/gdscript.py +76 -233
  135. data/vendor/pygments-main/pygments/lexers/go.py +12 -14
  136. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +22 -26
  137. data/vendor/pygments-main/pygments/lexers/graph.py +36 -15
  138. data/vendor/pygments-main/pygments/lexers/graphics.py +37 -38
  139. data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -1
  140. data/vendor/pygments-main/pygments/lexers/gsql.py +39 -27
  141. data/vendor/pygments-main/pygments/lexers/haskell.py +73 -71
  142. data/vendor/pygments-main/pygments/lexers/haxe.py +13 -11
  143. data/vendor/pygments-main/pygments/lexers/hdl.py +31 -34
  144. data/vendor/pygments-main/pygments/lexers/hexdump.py +21 -21
  145. data/vendor/pygments-main/pygments/lexers/html.py +11 -19
  146. data/vendor/pygments-main/pygments/lexers/idl.py +10 -5
  147. data/vendor/pygments-main/pygments/lexers/igor.py +3 -2
  148. data/vendor/pygments-main/pygments/lexers/inferno.py +9 -8
  149. data/vendor/pygments-main/pygments/lexers/installers.py +39 -33
  150. data/vendor/pygments-main/pygments/lexers/int_fiction.py +35 -20
  151. data/vendor/pygments-main/pygments/lexers/iolang.py +9 -9
  152. data/vendor/pygments-main/pygments/lexers/j.py +20 -13
  153. data/vendor/pygments-main/pygments/lexers/javascript.py +183 -149
  154. data/vendor/pygments-main/pygments/lexers/jmespath.py +68 -0
  155. data/vendor/pygments-main/pygments/lexers/jslt.py +4 -3
  156. data/vendor/pygments-main/pygments/lexers/jsonnet.py +168 -0
  157. data/vendor/pygments-main/pygments/lexers/julia.py +44 -32
  158. data/vendor/pygments-main/pygments/lexers/jvm.py +161 -140
  159. data/vendor/pygments-main/pygments/lexers/kuin.py +93 -59
  160. data/vendor/pygments-main/pygments/lexers/lilypond.py +226 -0
  161. data/vendor/pygments-main/pygments/lexers/lisp.py +244 -107
  162. data/vendor/pygments-main/pygments/lexers/macaulay2.py +1739 -0
  163. data/vendor/pygments-main/pygments/lexers/make.py +21 -16
  164. data/vendor/pygments-main/pygments/lexers/markup.py +752 -11
  165. data/vendor/pygments-main/pygments/lexers/math.py +1 -1
  166. data/vendor/pygments-main/pygments/lexers/matlab.py +18 -3
  167. data/vendor/pygments-main/pygments/lexers/maxima.py +85 -0
  168. data/vendor/pygments-main/pygments/lexers/meson.py +10 -25
  169. data/vendor/pygments-main/pygments/lexers/mime.py +2 -2
  170. data/vendor/pygments-main/pygments/lexers/minecraft.py +394 -0
  171. data/vendor/pygments-main/pygments/lexers/mips.py +128 -0
  172. data/vendor/pygments-main/pygments/lexers/ml.py +9 -6
  173. data/vendor/pygments-main/pygments/lexers/modeling.py +12 -8
  174. data/vendor/pygments-main/pygments/lexers/modula2.py +3 -2
  175. data/vendor/pygments-main/pygments/lexers/monte.py +3 -2
  176. data/vendor/pygments-main/pygments/lexers/mosel.py +1 -1
  177. data/vendor/pygments-main/pygments/lexers/ncl.py +1 -1
  178. data/vendor/pygments-main/pygments/lexers/nimrod.py +62 -20
  179. data/vendor/pygments-main/pygments/lexers/nit.py +3 -2
  180. data/vendor/pygments-main/pygments/lexers/nix.py +5 -5
  181. data/vendor/pygments-main/pygments/lexers/oberon.py +2 -2
  182. data/vendor/pygments-main/pygments/lexers/objective.py +6 -4
  183. data/vendor/pygments-main/pygments/lexers/ooc.py +3 -2
  184. data/vendor/pygments-main/pygments/lexers/other.py +1 -1
  185. data/vendor/pygments-main/pygments/lexers/parasail.py +3 -2
  186. data/vendor/pygments-main/pygments/lexers/parsers.py +23 -21
  187. data/vendor/pygments-main/pygments/lexers/pascal.py +196 -198
  188. data/vendor/pygments-main/pygments/lexers/pawn.py +1 -1
  189. data/vendor/pygments-main/pygments/lexers/perl.py +17 -15
  190. data/vendor/pygments-main/pygments/lexers/phix.py +364 -0
  191. data/vendor/pygments-main/pygments/lexers/php.py +35 -20
  192. data/vendor/pygments-main/pygments/lexers/pointless.py +3 -2
  193. data/vendor/pygments-main/pygments/lexers/pony.py +1 -1
  194. data/vendor/pygments-main/pygments/lexers/praat.py +41 -38
  195. data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
  196. data/vendor/pygments-main/pygments/lexers/prolog.py +7 -8
  197. data/vendor/pygments-main/pygments/lexers/promql.py +5 -12
  198. data/vendor/pygments-main/pygments/lexers/python.py +145 -119
  199. data/vendor/pygments-main/pygments/lexers/q.py +188 -0
  200. data/vendor/pygments-main/pygments/lexers/qlik.py +117 -0
  201. data/vendor/pygments-main/pygments/lexers/qvt.py +1 -1
  202. data/vendor/pygments-main/pygments/lexers/r.py +4 -4
  203. data/vendor/pygments-main/pygments/lexers/rdf.py +3 -3
  204. data/vendor/pygments-main/pygments/lexers/rebol.py +1 -12
  205. data/vendor/pygments-main/pygments/lexers/resource.py +1 -1
  206. data/vendor/pygments-main/pygments/lexers/ride.py +3 -2
  207. data/vendor/pygments-main/pygments/lexers/rita.py +43 -0
  208. data/vendor/pygments-main/pygments/lexers/rnc.py +3 -2
  209. data/vendor/pygments-main/pygments/lexers/roboconf.py +3 -3
  210. data/vendor/pygments-main/pygments/lexers/robotframework.py +6 -5
  211. data/vendor/pygments-main/pygments/lexers/ruby.py +24 -24
  212. data/vendor/pygments-main/pygments/lexers/rust.py +3 -2
  213. data/vendor/pygments-main/pygments/lexers/sas.py +2 -2
  214. data/vendor/pygments-main/pygments/lexers/savi.py +170 -0
  215. data/vendor/pygments-main/pygments/lexers/scdoc.py +4 -7
  216. data/vendor/pygments-main/pygments/lexers/scripting.py +24 -21
  217. data/vendor/pygments-main/pygments/lexers/sgf.py +6 -6
  218. data/vendor/pygments-main/pygments/lexers/shell.py +29 -21
  219. data/vendor/pygments-main/pygments/lexers/sieve.py +14 -4
  220. data/vendor/pygments-main/pygments/lexers/slash.py +1 -1
  221. data/vendor/pygments-main/pygments/lexers/smalltalk.py +5 -3
  222. data/vendor/pygments-main/pygments/lexers/smithy.py +5 -6
  223. data/vendor/pygments-main/pygments/lexers/smv.py +1 -1
  224. data/vendor/pygments-main/pygments/lexers/snobol.py +1 -1
  225. data/vendor/pygments-main/pygments/lexers/solidity.py +3 -7
  226. data/vendor/pygments-main/pygments/lexers/sophia.py +103 -0
  227. data/vendor/pygments-main/pygments/lexers/special.py +2 -5
  228. data/vendor/pygments-main/pygments/lexers/spice.py +71 -0
  229. data/vendor/pygments-main/pygments/lexers/sql.py +212 -17
  230. data/vendor/pygments-main/pygments/lexers/srcinfo.py +62 -0
  231. data/vendor/pygments-main/pygments/lexers/stata.py +4 -3
  232. data/vendor/pygments-main/pygments/lexers/supercollider.py +4 -3
  233. data/vendor/pygments-main/pygments/lexers/tal.py +74 -0
  234. data/vendor/pygments-main/pygments/lexers/tcl.py +21 -16
  235. data/vendor/pygments-main/pygments/lexers/teal.py +9 -8
  236. data/vendor/pygments-main/pygments/lexers/templates.py +62 -29
  237. data/vendor/pygments-main/pygments/lexers/teraterm.py +12 -20
  238. data/vendor/pygments-main/pygments/lexers/testing.py +6 -2
  239. data/vendor/pygments-main/pygments/lexers/text.py +3 -2
  240. data/vendor/pygments-main/pygments/lexers/textedit.py +41 -7
  241. data/vendor/pygments-main/pygments/lexers/textfmts.py +7 -5
  242. data/vendor/pygments-main/pygments/lexers/theorem.py +42 -36
  243. data/vendor/pygments-main/pygments/lexers/thingsdb.py +2 -4
  244. data/vendor/pygments-main/pygments/lexers/tlb.py +57 -0
  245. data/vendor/pygments-main/pygments/lexers/tnt.py +3 -4
  246. data/vendor/pygments-main/pygments/lexers/trafficscript.py +2 -4
  247. data/vendor/pygments-main/pygments/lexers/typoscript.py +2 -3
  248. data/vendor/pygments-main/pygments/lexers/ul4.py +267 -0
  249. data/vendor/pygments-main/pygments/lexers/unicon.py +1 -1
  250. data/vendor/pygments-main/pygments/lexers/urbi.py +4 -4
  251. data/vendor/pygments-main/pygments/lexers/usd.py +2 -1
  252. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  253. data/vendor/pygments-main/pygments/lexers/verification.py +4 -3
  254. data/vendor/pygments-main/pygments/lexers/web.py +1 -1
  255. data/vendor/pygments-main/pygments/lexers/webassembly.py +5 -5
  256. data/vendor/pygments-main/pygments/lexers/webidl.py +2 -1
  257. data/vendor/pygments-main/pygments/lexers/webmisc.py +90 -71
  258. data/vendor/pygments-main/pygments/lexers/wgsl.py +407 -0
  259. data/vendor/pygments-main/pygments/lexers/whiley.py +2 -1
  260. data/vendor/pygments-main/pygments/lexers/wowtoc.py +120 -0
  261. data/vendor/pygments-main/pygments/lexers/wren.py +99 -0
  262. data/vendor/pygments-main/pygments/lexers/x10.py +5 -6
  263. data/vendor/pygments-main/pygments/lexers/xorg.py +3 -2
  264. data/vendor/pygments-main/pygments/lexers/yang.py +6 -5
  265. data/vendor/pygments-main/pygments/lexers/zig.py +3 -2
  266. data/vendor/pygments-main/pygments/modeline.py +1 -1
  267. data/vendor/pygments-main/pygments/plugin.py +28 -9
  268. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  269. data/vendor/pygments-main/pygments/scanner.py +2 -2
  270. data/vendor/pygments-main/pygments/sphinxext.py +63 -1
  271. data/vendor/pygments-main/pygments/style.py +7 -1
  272. data/vendor/pygments-main/pygments/styles/__init__.py +19 -5
  273. data/vendor/pygments-main/pygments/styles/abap.py +2 -2
  274. data/vendor/pygments-main/pygments/styles/algol.py +1 -2
  275. data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -2
  276. data/vendor/pygments-main/pygments/styles/arduino.py +2 -3
  277. data/vendor/pygments-main/pygments/styles/autumn.py +1 -3
  278. data/vendor/pygments-main/pygments/styles/borland.py +1 -3
  279. data/vendor/pygments-main/pygments/styles/bw.py +1 -2
  280. data/vendor/pygments-main/pygments/styles/colorful.py +1 -3
  281. data/vendor/pygments-main/pygments/styles/default.py +13 -14
  282. data/vendor/pygments-main/pygments/styles/dracula.py +102 -0
  283. data/vendor/pygments-main/pygments/styles/emacs.py +1 -2
  284. data/vendor/pygments-main/pygments/styles/friendly.py +1 -2
  285. data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +75 -0
  286. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  287. data/vendor/pygments-main/pygments/styles/gh_dark.py +107 -0
  288. data/vendor/pygments-main/pygments/styles/gruvbox.py +4 -2
  289. data/vendor/pygments-main/pygments/styles/igor.py +1 -2
  290. data/vendor/pygments-main/pygments/styles/inkpot.py +3 -2
  291. data/vendor/pygments-main/pygments/styles/lilypond.py +56 -0
  292. data/vendor/pygments-main/pygments/styles/lovelace.py +1 -3
  293. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  294. data/vendor/pygments-main/pygments/styles/material.py +1 -2
  295. data/vendor/pygments-main/pygments/styles/monokai.py +3 -3
  296. data/vendor/pygments-main/pygments/styles/murphy.py +1 -3
  297. data/vendor/pygments-main/pygments/styles/native.py +11 -11
  298. data/vendor/pygments-main/pygments/styles/nord.py +150 -0
  299. data/vendor/pygments-main/pygments/styles/onedark.py +59 -0
  300. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -6
  301. data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -6
  302. data/vendor/pygments-main/pygments/styles/pastie.py +1 -3
  303. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -2
  304. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +3 -3
  305. data/vendor/pygments-main/pygments/styles/rrt.py +3 -2
  306. data/vendor/pygments-main/pygments/styles/sas.py +2 -4
  307. data/vendor/pygments-main/pygments/styles/solarized.py +1 -1
  308. data/vendor/pygments-main/pygments/styles/staroffice.py +26 -0
  309. data/vendor/pygments-main/pygments/styles/stata_dark.py +4 -6
  310. data/vendor/pygments-main/pygments/styles/stata_light.py +1 -2
  311. data/vendor/pygments-main/pygments/styles/tango.py +2 -3
  312. data/vendor/pygments-main/pygments/styles/trac.py +1 -3
  313. data/vendor/pygments-main/pygments/styles/vim.py +1 -2
  314. data/vendor/pygments-main/pygments/styles/vs.py +1 -2
  315. data/vendor/pygments-main/pygments/styles/xcode.py +1 -3
  316. data/vendor/pygments-main/pygments/styles/zenburn.py +4 -6
  317. data/vendor/pygments-main/pygments/token.py +2 -1
  318. data/vendor/pygments-main/pygments/unistring.py +4 -6
  319. data/vendor/pygments-main/pygments/util.py +27 -5
  320. metadata +59 -14
  321. data/vendor/pygments-main/Pygments-2.10.0.dist-info/RECORD +0 -524
  322. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/INSTALLER +0 -0
  323. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/REQUESTED +0 -0
  324. /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/top_level.txt +0 -0
@@ -4,16 +4,14 @@
4
4
 
5
5
  Lexers for data file format.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
11
- import re
12
-
13
- from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, LexerContext, \
14
- include, bygroups, inherit
15
- from pygments.token import Text, Comment, Keyword, Name, String, Number, \
16
- Punctuation, Literal, Error
11
+ from pygments.lexer import Lexer, ExtendedRegexLexer, LexerContext, \
12
+ include, bygroups
13
+ from pygments.token import Comment, Error, Keyword, Literal, Name, Number, \
14
+ Punctuation, String, Whitespace
17
15
 
18
16
  __all__ = ['YamlLexer', 'JsonLexer', 'JsonBareObjectLexer', 'JsonLdLexer']
19
17
 
@@ -31,13 +29,14 @@ class YamlLexerContext(LexerContext):
31
29
 
32
30
  class YamlLexer(ExtendedRegexLexer):
33
31
  """
34
- Lexer for `YAML <http://yaml.org/>`_, a human-friendly data serialization
32
+ Lexer for YAML, a human-friendly data serialization
35
33
  language.
36
34
 
37
35
  .. versionadded:: 0.11
38
36
  """
39
37
 
40
38
  name = 'YAML'
39
+ url = 'http://yaml.org/'
41
40
  aliases = ['yaml']
42
41
  filenames = ['*.yaml', '*.yml']
43
42
  mimetypes = ['text/x-yaml']
@@ -170,9 +169,9 @@ class YamlLexer(ExtendedRegexLexer):
170
169
  # the root rules
171
170
  'root': [
172
171
  # ignored whitespaces
173
- (r'[ ]+(?=#|$)', Text),
172
+ (r'[ ]+(?=#|$)', Whitespace),
174
173
  # line breaks
175
- (r'\n+', Text),
174
+ (r'\n+', Whitespace),
176
175
  # a comment
177
176
  (r'#[^\n]*', Comment.Single),
178
177
  # the '%YAML' directive
@@ -183,25 +182,25 @@ class YamlLexer(ExtendedRegexLexer):
183
182
  (r'^(?:---|\.\.\.)(?=[ ]|$)', reset_indent(Name.Namespace),
184
183
  'block-line'),
185
184
  # indentation spaces
186
- (r'[ ]*(?!\s|$)', save_indent(Text, start=True),
185
+ (r'[ ]*(?!\s|$)', save_indent(Whitespace, start=True),
187
186
  ('block-line', 'indentation')),
188
187
  ],
189
188
 
190
189
  # trailing whitespaces after directives or a block scalar indicator
191
190
  'ignored-line': [
192
191
  # ignored whitespaces
193
- (r'[ ]+(?=#|$)', Text),
192
+ (r'[ ]+(?=#|$)', Whitespace),
194
193
  # a comment
195
194
  (r'#[^\n]*', Comment.Single),
196
195
  # line break
197
- (r'\n', Text, '#pop:2'),
196
+ (r'\n', Whitespace, '#pop:2'),
198
197
  ],
199
198
 
200
199
  # the %YAML directive
201
200
  'yaml-directive': [
202
201
  # the version number
203
202
  (r'([ ]+)([0-9]+\.[0-9]+)',
204
- bygroups(Text, Number), 'ignored-line'),
203
+ bygroups(Whitespace, Number), 'ignored-line'),
205
204
  ],
206
205
 
207
206
  # the %TAG directive
@@ -209,30 +208,30 @@ class YamlLexer(ExtendedRegexLexer):
209
208
  # a tag handle and the corresponding prefix
210
209
  (r'([ ]+)(!|![\w-]*!)'
211
210
  r'([ ]+)(!|!?[\w;/?:@&=+$,.!~*\'()\[\]%-]+)',
212
- bygroups(Text, Keyword.Type, Text, Keyword.Type),
211
+ bygroups(Whitespace, Keyword.Type, Whitespace, Keyword.Type),
213
212
  'ignored-line'),
214
213
  ],
215
214
 
216
215
  # block scalar indicators and indentation spaces
217
216
  'indentation': [
218
217
  # trailing whitespaces are ignored
219
- (r'[ ]*$', something(Text), '#pop:2'),
218
+ (r'[ ]*$', something(Whitespace), '#pop:2'),
220
219
  # whitespaces preceding block collection indicators
221
- (r'[ ]+(?=[?:-](?:[ ]|$))', save_indent(Text)),
220
+ (r'[ ]+(?=[?:-](?:[ ]|$))', save_indent(Whitespace)),
222
221
  # block collection indicators
223
222
  (r'[?:-](?=[ ]|$)', set_indent(Punctuation.Indicator)),
224
223
  # the beginning a block line
225
- (r'[ ]*', save_indent(Text), '#pop'),
224
+ (r'[ ]*', save_indent(Whitespace), '#pop'),
226
225
  ],
227
226
 
228
227
  # an indented line in the block context
229
228
  'block-line': [
230
229
  # the line end
231
- (r'[ ]*(?=#|$)', something(Text), '#pop'),
230
+ (r'[ ]*(?=#|$)', something(Whitespace), '#pop'),
232
231
  # whitespaces separating tokens
233
- (r'[ ]+', Text),
232
+ (r'[ ]+', Whitespace),
234
233
  # key with colon
235
- (r'''([^#,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
234
+ (r'''([^#,?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
236
235
  bygroups(Name.Tag, set_indent(Punctuation, implicit=True))),
237
236
  # tags, anchors and aliases,
238
237
  include('descriptors'),
@@ -283,9 +282,9 @@ class YamlLexer(ExtendedRegexLexer):
283
282
  # the content of a flow collection
284
283
  'flow-collection': [
285
284
  # whitespaces
286
- (r'[ ]+', Text),
285
+ (r'[ ]+', Whitespace),
287
286
  # line breaks
288
- (r'\n+', Text),
287
+ (r'\n+', Whitespace),
289
288
  # a comment
290
289
  (r'#[^\n]*', Comment.Single),
291
290
  # simple indicators
@@ -322,12 +321,12 @@ class YamlLexer(ExtendedRegexLexer):
322
321
  # block scalar lines
323
322
  'block-scalar-content': [
324
323
  # line break
325
- (r'\n', Text),
324
+ (r'\n', Whitespace),
326
325
  # empty line
327
326
  (r'^[ ]+$',
328
- parse_block_scalar_empty_line(Text, Name.Constant)),
327
+ parse_block_scalar_empty_line(Whitespace, Name.Constant)),
329
328
  # indentation spaces (we may leave the state here)
330
- (r'^[ ]*', parse_block_scalar_indent(Text)),
329
+ (r'^[ ]*', parse_block_scalar_indent(Whitespace)),
331
330
  # line content
332
331
  (r'[\S\t ]+', Name.Constant),
333
332
  ],
@@ -347,10 +346,10 @@ class YamlLexer(ExtendedRegexLexer):
347
346
  # ignored and regular whitespaces in quoted scalars
348
347
  'quoted-scalar-whitespaces': [
349
348
  # leading and trailing whitespaces are ignored
350
- (r'^[ ]+', Text),
351
- (r'[ ]+$', Text),
349
+ (r'^[ ]+', Whitespace),
350
+ (r'[ ]+$', Whitespace),
352
351
  # line breaks are ignored
353
- (r'\n+', Text),
352
+ (r'\n+', Whitespace),
354
353
  # other whitespaces are a part of the value
355
354
  (r'[ ]+', Name.Variable),
356
355
  ],
@@ -385,25 +384,25 @@ class YamlLexer(ExtendedRegexLexer):
385
384
  # the beginning of a new line while scanning a plain scalar
386
385
  'plain-scalar-in-block-context-new-line': [
387
386
  # empty lines
388
- (r'^[ ]+$', Text),
387
+ (r'^[ ]+$', Whitespace),
389
388
  # line breaks
390
- (r'\n+', Text),
389
+ (r'\n+', Whitespace),
391
390
  # document start and document end indicators
392
391
  (r'^(?=---|\.\.\.)', something(Name.Namespace), '#pop:3'),
393
392
  # indentation spaces (we may leave the block line state here)
394
- (r'^[ ]*', parse_plain_scalar_indent(Text), '#pop'),
393
+ (r'^[ ]*', parse_plain_scalar_indent(Whitespace), '#pop'),
395
394
  ],
396
395
 
397
396
  # a plain scalar in the block context
398
397
  'plain-scalar-in-block-context': [
399
398
  # the scalar ends with the ':' indicator
400
- (r'[ ]*(?=:[ ]|:$)', something(Text), '#pop'),
399
+ (r'[ ]*(?=:[ ]|:$)', something(Whitespace), '#pop'),
401
400
  # the scalar ends with whitespaces followed by a comment
402
- (r'[ ]+(?=#)', Text, '#pop'),
401
+ (r'[ ]+(?=#)', Whitespace, '#pop'),
403
402
  # trailing whitespaces are ignored
404
- (r'[ ]+$', Text),
403
+ (r'[ ]+$', Whitespace),
405
404
  # line breaks are ignored
406
- (r'\n+', Text, 'plain-scalar-in-block-context-new-line'),
405
+ (r'\n+', Whitespace, 'plain-scalar-in-block-context-new-line'),
407
406
  # other whitespaces are a part of the value
408
407
  (r'[ ]+', Literal.Scalar.Plain),
409
408
  # regular non-whitespace characters
@@ -413,14 +412,14 @@ class YamlLexer(ExtendedRegexLexer):
413
412
  # a plain scalar is the flow context
414
413
  'plain-scalar-in-flow-context': [
415
414
  # the scalar ends with an indicator character
416
- (r'[ ]*(?=[,:?\[\]{}])', something(Text), '#pop'),
415
+ (r'[ ]*(?=[,:?\[\]{}])', something(Whitespace), '#pop'),
417
416
  # the scalar ends with a comment
418
- (r'[ ]+(?=#)', Text, '#pop'),
417
+ (r'[ ]+(?=#)', Whitespace, '#pop'),
419
418
  # leading and trailing whitespaces are ignored
420
- (r'^[ ]+', Text),
421
- (r'[ ]+$', Text),
419
+ (r'^[ ]+', Whitespace),
420
+ (r'[ ]+$', Whitespace),
422
421
  # line breaks are ignored
423
- (r'\n+', Text),
422
+ (r'\n+', Whitespace),
424
423
  # other whitespaces are a part of the value
425
424
  (r'[ ]+', Name.Variable),
426
425
  # regular non-whitespace characters
@@ -439,10 +438,17 @@ class JsonLexer(Lexer):
439
438
  """
440
439
  For JSON data structures.
441
440
 
441
+ Javascript-style comments are supported (like ``/* */`` and ``//``),
442
+ though comments are not part of the JSON specification.
443
+ This allows users to highlight JSON as it is used in the wild.
444
+
445
+ No validation is performed on the input JSON document.
446
+
442
447
  .. versionadded:: 1.5
443
448
  """
444
449
 
445
450
  name = 'JSON'
451
+ url = 'https://www.json.org'
446
452
  aliases = ['json', 'json-object']
447
453
  filenames = ['*.json', 'Pipfile.lock']
448
454
  mimetypes = ['application/json', 'application/json-object']
@@ -473,6 +479,10 @@ class JsonLexer(Lexer):
473
479
  in_number = False
474
480
  in_float = False
475
481
  in_punctuation = False
482
+ in_comment_single = False
483
+ in_comment_multiline = False
484
+ expecting_second_comment_opener = False # // or /*
485
+ expecting_second_comment_closer = False # */
476
486
 
477
487
  start = 0
478
488
 
@@ -529,9 +539,9 @@ class JsonLexer(Lexer):
529
539
  continue
530
540
 
531
541
  if queue:
532
- queue.append((start, Text, text[start:stop]))
542
+ queue.append((start, Whitespace, text[start:stop]))
533
543
  else:
534
- yield start, Text, text[start:stop]
544
+ yield start, Whitespace, text[start:stop]
535
545
  in_whitespace = False
536
546
  # Fall through so the new character can be evaluated.
537
547
 
@@ -566,6 +576,49 @@ class JsonLexer(Lexer):
566
576
  in_punctuation = False
567
577
  # Fall through so the new character can be evaluated.
568
578
 
579
+ elif in_comment_single:
580
+ if character != '\n':
581
+ continue
582
+
583
+ if queue:
584
+ queue.append((start, Comment.Single, text[start:stop]))
585
+ else:
586
+ yield start, Comment.Single, text[start:stop]
587
+
588
+ in_comment_single = False
589
+ # Fall through so the new character can be evaluated.
590
+
591
+ elif in_comment_multiline:
592
+ if character == '*':
593
+ expecting_second_comment_closer = True
594
+ elif expecting_second_comment_closer:
595
+ expecting_second_comment_closer = False
596
+ if character == '/':
597
+ if queue:
598
+ queue.append((start, Comment.Multiline, text[start:stop + 1]))
599
+ else:
600
+ yield start, Comment.Multiline, text[start:stop + 1]
601
+
602
+ in_comment_multiline = False
603
+
604
+ continue
605
+
606
+ elif expecting_second_comment_opener:
607
+ expecting_second_comment_opener = False
608
+ if character == '/':
609
+ in_comment_single = True
610
+ continue
611
+ elif character == '*':
612
+ in_comment_multiline = True
613
+ continue
614
+
615
+ # Exhaust the queue. Accept the existing token types.
616
+ yield from queue
617
+ queue.clear()
618
+
619
+ yield start, Error, text[start:stop]
620
+ # Fall through so the new character can be evaluated.
621
+
569
622
  start = stop
570
623
 
571
624
  if character == '"':
@@ -591,12 +644,18 @@ class JsonLexer(Lexer):
591
644
  elif character == ':':
592
645
  # Yield from the queue. Replace string token types.
593
646
  for _start, _token, _text in queue:
594
- if _token is Text:
595
- yield _start, _token, _text
596
- elif _token is String.Double:
647
+ # There can be only three types of tokens before a ':':
648
+ # Whitespace, Comment, or a quoted string.
649
+ #
650
+ # If it's a quoted string we emit Name.Tag.
651
+ # Otherwise, we yield the original token.
652
+ #
653
+ # In all other cases this would be invalid JSON,
654
+ # but this is not a validating JSON lexer, so it's OK.
655
+ if _token is String.Double:
597
656
  yield _start, Name.Tag, _text
598
657
  else:
599
- yield _start, Error, _text
658
+ yield _start, _token, _text
600
659
  queue.clear()
601
660
 
602
661
  in_punctuation = True
@@ -608,6 +667,10 @@ class JsonLexer(Lexer):
608
667
 
609
668
  in_punctuation = True
610
669
 
670
+ elif character == '/':
671
+ # This is the beginning of a comment.
672
+ expecting_second_comment_opener = True
673
+
611
674
  else:
612
675
  # Exhaust the queue. Accept the existing token types.
613
676
  yield from queue
@@ -626,9 +689,15 @@ class JsonLexer(Lexer):
626
689
  elif in_constant:
627
690
  yield start, Keyword.Constant, text[start:]
628
691
  elif in_whitespace:
629
- yield start, Text, text[start:]
692
+ yield start, Whitespace, text[start:]
630
693
  elif in_punctuation:
631
694
  yield start, Punctuation, text[start:]
695
+ elif in_comment_single:
696
+ yield start, Comment.Single, text[start:]
697
+ elif in_comment_multiline:
698
+ yield start, Error, text[start:]
699
+ elif expecting_second_comment_opener:
700
+ yield start, Error, text[start:]
632
701
 
633
702
 
634
703
  class JsonBareObjectLexer(JsonLexer):
@@ -650,12 +719,13 @@ class JsonBareObjectLexer(JsonLexer):
650
719
 
651
720
  class JsonLdLexer(JsonLexer):
652
721
  """
653
- For `JSON-LD <https://json-ld.org/>`_ linked data.
722
+ For JSON-LD linked data.
654
723
 
655
724
  .. versionadded:: 2.0
656
725
  """
657
726
 
658
727
  name = 'JSON-LD'
728
+ url = 'https://json-ld.org/'
659
729
  aliases = ['jsonld', 'json-ld']
660
730
  filenames = ['*.jsonld']
661
731
  mimetypes = ['application/ld+json']
@@ -0,0 +1,136 @@
1
+ """
2
+ pygments.lexers.dax
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for LilyPond.
6
+
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from pygments.lexer import RegexLexer, words
12
+ from pygments.token import Comment, Punctuation, Whitespace,\
13
+ Name, Operator, String, Number, Text
14
+
15
+ __all__ = ['DaxLexer']
16
+
17
+
18
+ class DaxLexer(RegexLexer):
19
+ """
20
+ Lexer for Power BI DAX
21
+ Referenced from: https://github.com/sql-bi/SyntaxHighlighterBrushDax
22
+
23
+ .. versionadded:: 2.15
24
+ """
25
+ name = 'Dax'
26
+ aliases = ['dax']
27
+ filenames = ['*.dax']
28
+ url = 'https://learn.microsoft.com/en-us/dax/dax-function-reference'
29
+ mimetypes = []
30
+
31
+ tokens = {
32
+ 'root': [
33
+ (r'\s+', Whitespace),
34
+ (r"--.*\n?", Comment.Single), # Comment: Double dash comment
35
+ (r"//.*\n?", Comment.Single), # Comment: Double backslash comment
36
+ (r'/\*', Comment.Multiline, 'multiline-comments'),
37
+ (words(('abs', 'accrint', 'accrintm', 'acos', 'acosh', 'acot', 'acoth',
38
+ 'addcolumns', 'addmissingitems', 'all', 'allcrossfiltered',
39
+ 'allexcept', 'allnoblankrow', 'allselected', 'amordegrc', 'amorlinc',
40
+ 'and','approximatedistinctcount', 'asin', 'asinh', 'atan', 'atanh',
41
+ 'average', 'averagea', 'averagex', 'beta.dist', 'beta.inv',
42
+ 'bitand', 'bitlshift', 'bitor', 'bitrshift', 'bitxor', 'blank',
43
+ 'calculate', 'calculatetable', 'calendar', 'calendarauto', 'ceiling',
44
+ 'chisq.dist', 'chisq.dist.rt', 'chisq.inv', 'chisq.inv.rt',
45
+ 'closingbalancemonth', 'closingbalancequarter', 'closingbalanceyear',
46
+ 'coalesce', 'columnstatistics', 'combin', 'combina', 'combinevalues',
47
+ 'concatenate', 'concatenatex', 'confidence.norm', 'confidence.t',
48
+ 'contains', 'containsrow', 'containsstring', 'containsstringexact',
49
+ 'convert', 'cos', 'cosh', 'cot', 'coth', 'count', 'counta', 'countax',
50
+ 'countblank', 'countrows', 'countx', 'coupdaybs', 'coupdays',
51
+ 'coupdaysnc', 'coupncd', 'coupnum', 'couppcd', 'crossfilter',
52
+ 'crossjoin', 'cumipmt', 'cumprinc', 'currency', 'currentgroup',
53
+ 'customdata', 'datatable', 'date', 'dateadd', 'datediff',
54
+ 'datesbetween', 'datesinperiod', 'datesmtd', 'datesqtd',
55
+ 'datesytd', 'datevalue', 'day', 'db', 'ddb', 'degrees', 'detailrows',
56
+ 'disc', 'distinct', 'distinctcount', 'distinctcountnoblank',
57
+ 'divide', 'dollarde', 'dollarfr', 'duration', 'earlier', 'earliest',
58
+ 'edate', 'effect', 'endofmonth', 'endofquarter', 'endofyear',
59
+ 'eomonth', 'error', 'evaluateandlog', 'even', 'exact', 'except',
60
+ 'exp', 'expon.dist', 'fact', 'false', 'filter', 'filters', 'find',
61
+ 'firstdate', 'firstnonblank', 'firstnonblankvalue', 'fixed', 'floor',
62
+ 'format', 'fv', 'gcd', 'generate', 'generateall', 'generateseries',
63
+ 'geomean', 'geomeanx', 'groupby', 'hash', 'hasonefilter',
64
+ 'hasonevalue', 'hour', 'if', 'if.eager', 'iferror', 'ignore', 'index',
65
+ 'int', 'intersect', 'intrate', 'ipmt', 'isafter', 'isblank',
66
+ 'iscrossfiltered', 'isempty', 'iserror', 'iseven', 'isfiltered',
67
+ 'isinscope', 'islogical', 'isnontext', 'isnumber', 'iso.ceiling',
68
+ 'isodd', 'isonorafter', 'ispmt', 'isselectedmeasure', 'issubtotal',
69
+ 'istext', 'keepfilters', 'keywordmatch', 'lastdate', 'lastnonblank',
70
+ 'lastnonblankvalue', 'lcm', 'left', 'len', 'linest', 'linestx', 'ln',
71
+ 'log', 'log10', 'lookupvalue', 'lower', 'max', 'maxa', 'maxx',
72
+ 'mduration', 'median', 'medianx', 'mid', 'min', 'mina', 'minute',
73
+ 'minx', 'mod', 'month', 'mround', 'nameof', 'naturalinnerjoin',
74
+ 'naturalleftouterjoin', 'networkdays', 'nextday', 'nextmonth',
75
+ 'nextquarter', 'nextyear', 'nominal', 'nonvisual', 'norm.dist',
76
+ 'norm.inv', 'norm.s.dist', 'norm.s.inv', 'not', 'now', 'nper', 'odd',
77
+ 'oddfprice', 'oddfyield', 'oddlprice', 'oddlyield', 'offset',
78
+ 'openingbalancemonth', 'openingbalancequarter', 'openingbalanceyear',
79
+ 'or', 'orderby', 'parallelperiod', 'partitionby', 'path',
80
+ 'pathcontains', 'pathitem', 'pathitemreverse', 'pathlength',
81
+ 'pduration', 'percentile.exc', 'percentile.inc', 'percentilex.exc',
82
+ 'percentilex.inc', 'permut', 'pi', 'pmt', 'poisson.dist', 'power',
83
+ 'ppmt', 'previousday', 'previousmonth', 'previousquarter',
84
+ 'previousyear', 'price', 'pricedisc', 'pricemat', 'product',
85
+ 'productx', 'pv', 'quarter', 'quotient', 'radians', 'rand',
86
+ 'randbetween', 'rank.eq', 'rankx', 'rate', 'received', 'related',
87
+ 'relatedtable', 'removefilters', 'replace', 'rept', 'right',
88
+ 'rollup', 'rollupaddissubtotal', 'rollupgroup', 'rollupissubtotal',
89
+ 'round', 'rounddown', 'roundup', 'row', 'rri', 'sameperiodlastyear',
90
+ 'sample', 'sampleaxiswithlocalminmax', 'search', 'second',
91
+ 'selectcolumns', 'selectedmeasure', 'selectedmeasureformatstring',
92
+ 'selectedmeasurename', 'selectedvalue', 'sign', 'sin', 'sinh', 'sln',
93
+ 'sqrt', 'sqrtpi', 'startofmonth', 'startofquarter', 'startofyear',
94
+ 'stdev.p', 'stdev.s', 'stdevx.p', 'stdevx.s', 'substitute',
95
+ 'substitutewithindex', 'sum', 'summarize', 'summarizecolumns', 'sumx',
96
+ 'switch', 'syd', 't.dist', 't.dist.2t', 't.dist.rt', 't.inv',
97
+ 't.inv.2t', 'tan', 'tanh', 'tbilleq', 'tbillprice', 'tbillyield',
98
+ 'time', 'timevalue', 'tocsv', 'today', 'tojson', 'topn',
99
+ 'topnperlevel', 'topnskip', 'totalmtd', 'totalqtd', 'totalytd',
100
+ 'treatas', 'trim', 'true', 'trunc', 'unichar', 'unicode', 'union',
101
+ 'upper', 'userculture', 'userelationship', 'username', 'userobjectid',
102
+ 'userprincipalname', 'utcnow', 'utctoday', 'value', 'values', 'var.p',
103
+ 'var.s', 'varx.p', 'varx.s', 'vdb', 'weekday', 'weeknum', 'window',
104
+ 'xirr', 'xnpv', 'year', 'yearfrac', 'yield', 'yielddisc', 'yieldmat'),
105
+ prefix=r'(?i)', suffix=r'\b'), Name.Function), #Functions
106
+
107
+ (words(('at','asc','boolean','both','by','create','currency',
108
+ 'datetime','day','define','desc','double',
109
+ 'evaluate','false','integer','measure',
110
+ 'month','none','order','return','single','start','string',
111
+ 'table','true','var','year'),
112
+ prefix=r'(?i)', suffix=r'\b'), Name.Builtin), # Keyword
113
+
114
+ (r':=|[-+*\/=^]', Operator),
115
+ (r'\b(IN|NOT)\b', Operator.Word),
116
+ (r'"', String, 'string'), #StringLiteral
117
+ (r"'(?:[^']|'')*'(?!')(?:\[[ \w]+\])?|\w+\[[ \w]+\]",
118
+ Name.Attribute), # Column reference
119
+ (r"\[[ \w]+\]", Name.Attribute), #Measure reference
120
+ (r'(?<!\w)(\d+\.?\d*|\.\d+\b)', Number),# Number
121
+ (r'[\[\](){}`,.]', Punctuation), #Parenthesis
122
+ (r'.*\n', Text),
123
+
124
+ ],
125
+ 'multiline-comments': [
126
+ (r'/\*', Comment.Multiline, 'multiline-comments'),
127
+ (r'\*/', Comment.Multiline, '#pop'),
128
+ (r'[^/*]+', Comment.Multiline),
129
+ (r'[/*]', Comment.Multiline)
130
+ ],
131
+ 'string': [
132
+ (r'""', String.Escape),
133
+ (r'"', String, '#pop'),
134
+ (r'[^"]+', String),
135
+ ]
136
+ }
@@ -4,25 +4,26 @@
4
4
 
5
5
  Lexers for Devicetree language.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
11
11
  from pygments.lexer import RegexLexer, bygroups, include, default, words
12
12
  from pygments.token import Comment, Keyword, Name, Number, Operator, \
13
- Punctuation, String, Text
13
+ Punctuation, String, Text, Whitespace
14
14
 
15
15
  __all__ = ['DevicetreeLexer']
16
16
 
17
17
 
18
18
  class DevicetreeLexer(RegexLexer):
19
19
  """
20
- Lexer for `Devicetree <https://www.devicetree.org/>`_ files.
20
+ Lexer for Devicetree files.
21
21
 
22
22
  .. versionadded:: 2.7
23
23
  """
24
24
 
25
25
  name = 'Devicetree'
26
+ url = 'https://www.devicetree.org/'
26
27
  aliases = ['devicetree', 'dts']
27
28
  filenames = ['*.dts', '*.dtsi']
28
29
  mimetypes = ['text/x-c']
@@ -46,12 +47,12 @@ class DevicetreeLexer(RegexLexer):
46
47
  bygroups(Comment.Preproc, Comment.Multiline, Comment.Preproc, Punctuation)),
47
48
  ],
48
49
  'whitespace': [
49
- (r'\n', Text),
50
- (r'\s+', Text),
50
+ (r'\n', Whitespace),
51
+ (r'\s+', Whitespace),
51
52
  (r'\\\n', Text), # line continuation
52
53
  (r'//(\n|[\w\W]*?[^\\]\n)', Comment.Single),
53
54
  (r'/(\\\n)?[*][\w\W]*?[*](\\\n)?/', Comment.Multiline),
54
- # Open until EOF, so no ending delimeter
55
+ # Open until EOF, so no ending delimiter
55
56
  (r'/(\\\n)?[*][\w\W]*', Comment.Multiline),
56
57
  ],
57
58
  'statements': [
@@ -73,7 +74,7 @@ class DevicetreeLexer(RegexLexer):
73
74
  include('macro'),
74
75
 
75
76
  # Nodes
76
- (r'([^/*@\s&]+|/)(@?)([0-9a-fA-F,]*)(' + _ws + r')(\{)',
77
+ (r'([^/*@\s&]+|/)(@?)((?:0x)?[0-9a-fA-F,]*)(' + _ws + r')(\{)',
77
78
  bygroups(Name.Function, Operator, Number.Integer,
78
79
  Comment.Multiline, Punctuation), 'node'),
79
80
 
@@ -88,7 +89,7 @@ class DevicetreeLexer(RegexLexer):
88
89
  include('whitespace'),
89
90
  include('macro'),
90
91
 
91
- (r'([^/*@\s&]+|/)(@?)([0-9a-fA-F,]*)(' + _ws + r')(\{)',
92
+ (r'([^/*@\s&]+|/)(@?)((?:0x)?[0-9a-fA-F,]*)(' + _ws + r')(\{)',
92
93
  bygroups(Name.Function, Operator, Number.Integer,
93
94
  Comment.Multiline, Punctuation), '#push'),
94
95
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lexers for diff/patch formats.
6
6
 
7
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -12,7 +12,7 @@ import re
12
12
 
13
13
  from pygments.lexer import RegexLexer, include, bygroups
14
14
  from pygments.token import Text, Comment, Operator, Keyword, Name, Generic, \
15
- Literal
15
+ Literal, Whitespace
16
16
 
17
17
  __all__ = ['DiffLexer', 'DarcsPatchLexer', 'WDiffLexer']
18
18
 
@@ -29,14 +29,17 @@ class DiffLexer(RegexLexer):
29
29
 
30
30
  tokens = {
31
31
  'root': [
32
- (r' .*\n', Text),
33
- (r'\+.*\n', Generic.Inserted),
34
- (r'-.*\n', Generic.Deleted),
35
- (r'!.*\n', Generic.Strong),
36
- (r'@.*\n', Generic.Subheading),
37
- (r'([Ii]ndex|diff).*\n', Generic.Heading),
38
- (r'=.*\n', Generic.Heading),
39
- (r'.*\n', Text),
32
+ (r'( )(.*)(\n)', bygroups(Whitespace, Text, Whitespace)),
33
+ (r'(!.*|---)(\n)', bygroups(Generic.Strong, Whitespace)),
34
+ (r'((?:< |-).*)(\n)', bygroups(Generic.Deleted, Whitespace)),
35
+ (r'((?:> |\+).*)(\n)', bygroups(Generic.Inserted, Whitespace)),
36
+ (
37
+ r'(@.*|\d(?:,\d+)?(?:a|c|d)\d+(?:,\d+)?)(\n)',
38
+ bygroups(Generic.Subheading, Whitespace),
39
+ ),
40
+ (r'((?:[Ii]ndex|diff).*)(\n)', bygroups(Generic.Heading, Whitespace)),
41
+ (r'(=.*)(\n)', bygroups(Generic.Heading, Whitespace)),
42
+ (r'(.*)(\n)', bygroups(Text, Whitespace)),
40
43
  ]
41
44
  }
42
45
 
@@ -72,26 +75,26 @@ class DarcsPatchLexer(RegexLexer):
72
75
  (r'\{', Operator),
73
76
  (r'\}', Operator),
74
77
  (r'(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)(\])',
75
- bygroups(Operator, Keyword, Name, Text, Name, Operator,
76
- Literal.Date, Text, Operator)),
78
+ bygroups(Operator, Keyword, Name, Whitespace, Name, Operator,
79
+ Literal.Date, Whitespace, Operator)),
77
80
  (r'(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)',
78
- bygroups(Operator, Keyword, Name, Text, Name, Operator,
79
- Literal.Date, Text), 'comment'),
81
+ bygroups(Operator, Keyword, Name, Whitespace, Name, Operator,
82
+ Literal.Date, Whitespace), 'comment'),
80
83
  (r'New patches:', Generic.Heading),
81
84
  (r'Context:', Generic.Heading),
82
85
  (r'Patch bundle hash:', Generic.Heading),
83
- (r'(\s*)(%s)(.*\n)' % '|'.join(DPATCH_KEYWORDS),
84
- bygroups(Text, Keyword, Text)),
86
+ (r'(\s*)(%s)(.*)(\n)' % '|'.join(DPATCH_KEYWORDS),
87
+ bygroups(Whitespace, Keyword, Text, Whitespace)),
85
88
  (r'\+', Generic.Inserted, "insert"),
86
89
  (r'-', Generic.Deleted, "delete"),
87
- (r'.*\n', Text),
90
+ (r'(.*)(\n)', bygroups(Text, Whitespace)),
88
91
  ],
89
92
  'comment': [
90
93
  (r'[^\]].*\n', Comment),
91
94
  (r'\]', Operator, "#pop"),
92
95
  ],
93
96
  'specialText': [ # darcs add [_CODE_] special operators for clarity
94
- (r'\n', Text, "#pop"), # line-based
97
+ (r'\n', Whitespace, "#pop"), # line-based
95
98
  (r'\[_[^_]*_]', Operator),
96
99
  ],
97
100
  'insert': [
@@ -109,7 +112,7 @@ class DarcsPatchLexer(RegexLexer):
109
112
 
110
113
  class WDiffLexer(RegexLexer):
111
114
  """
112
- A `wdiff <https://www.gnu.org/software/wdiff/>`_ lexer.
115
+ A wdiff lexer.
113
116
 
114
117
  Note that:
115
118
 
@@ -121,6 +124,7 @@ class WDiffLexer(RegexLexer):
121
124
  """
122
125
 
123
126
  name = 'WDiff'
127
+ url = 'https://www.gnu.org/software/wdiff/'
124
128
  aliases = ['wdiff']
125
129
  filenames = ['*.wdiff']
126
130
  mimetypes = []