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 interactive fiction 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
 
@@ -22,14 +22,13 @@ __all__ = ['Inform6Lexer', 'Inform6TemplateLexer', 'Inform7Lexer',
22
22
  class Inform6Lexer(RegexLexer):
23
23
  """
24
24
  For Inform 6 source code.
25
-
26
- .. versionadded:: 2.0
27
25
  """
28
26
 
29
27
  name = 'Inform 6'
30
28
  url = 'http://inform-fiction.org/'
31
29
  aliases = ['inform6', 'i6']
32
30
  filenames = ['*.inf']
31
+ version_added = '2.0'
33
32
 
34
33
  flags = re.MULTILINE | re.DOTALL
35
34
 
@@ -45,13 +44,13 @@ class Inform6Lexer(RegexLexer):
45
44
 
46
45
  tokens = {
47
46
  'root': [
48
- (r'\A(!%%[^%s]*[%s])+' % (_newline, _newline), Comment.Preproc,
47
+ (rf'\A(!%[^{_newline}]*[{_newline}])+', Comment.Preproc,
49
48
  'directive'),
50
49
  default('directive')
51
50
  ],
52
51
  '_whitespace': [
53
52
  (r'\s+', Text),
54
- (r'![^%s]*' % _newline, Comment.Single)
53
+ (rf'![^{_newline}]*', Comment.Single)
55
54
  ],
56
55
  'default': [
57
56
  include('_whitespace'),
@@ -65,20 +64,20 @@ class Inform6Lexer(RegexLexer):
65
64
  '_expression': [
66
65
  include('_whitespace'),
67
66
  (r'(?=sp\b)', Text, '#pop'),
68
- (r'(?=[%s%s$0-9#a-zA-Z_])' % (_dquote, _squote), Text,
67
+ (rf'(?=[{_dquote}{_squote}$0-9#a-zA-Z_])', Text,
69
68
  ('#pop', 'value')),
70
- (r'\+\+|[%s]{1,2}(?!>)|~~?' % _dash, Operator),
71
- (r'(?=[()\[%s,?@{:;])' % _dash, Text, '#pop')
69
+ (rf'\+\+|[{_dash}]{{1,2}}(?!>)|~~?', Operator),
70
+ (rf'(?=[()\[{_dash},?@{{:;])', Text, '#pop')
72
71
  ],
73
72
  'expression': [
74
73
  include('_whitespace'),
75
74
  (r'\(', Punctuation, ('expression', '_expression')),
76
75
  (r'\)', Punctuation, '#pop'),
77
76
  (r'\[', Punctuation, ('#pop', 'statements', 'locals')),
78
- (r'>(?=(\s+|(![^%s]*))*[>;])' % _newline, Punctuation),
79
- (r'\+\+|[%s]{2}(?!>)' % _dash, Operator),
77
+ (rf'>(?=(\s+|(![^{_newline}]*))*[>;])', Punctuation),
78
+ (rf'\+\+|[{_dash}]{{2}}(?!>)', Operator),
80
79
  (r',', Punctuation, '_expression'),
81
- (r'&&?|\|\|?|[=~><]?=|[%s]{1,2}>?|\.\.?[&#]?|::|[<>+*/%%]' % _dash,
80
+ (rf'&&?|\|\|?|[=~><]?=|[{_dash}]{{1,2}}>?|\.\.?[&#]?|::|[<>+*/%]',
82
81
  Operator, '_expression'),
83
82
  (r'(has|hasnt|in|notin|ofclass|or|provides)\b', Operator.Word,
84
83
  '_expression'),
@@ -90,7 +89,7 @@ class Inform6Lexer(RegexLexer):
90
89
  '_assembly-expression': [
91
90
  (r'\(', Punctuation, ('#push', '_expression')),
92
91
  (r'[\[\]]', Punctuation),
93
- (r'[%s]>' % _dash, Punctuation, '_expression'),
92
+ (rf'[{_dash}]>', Punctuation, '_expression'),
94
93
  (r'sp\b', Keyword.Pseudo),
95
94
  (r';', Punctuation, '#pop:3'),
96
95
  include('expression')
@@ -117,25 +116,25 @@ class Inform6Lexer(RegexLexer):
117
116
  'value': [
118
117
  include('_whitespace'),
119
118
  # Strings
120
- (r'[%s][^@][%s]' % (_squote, _squote), String.Char, '#pop'),
121
- (r'([%s])(@\{[0-9a-fA-F]*\})([%s])' % (_squote, _squote),
119
+ (rf'[{_squote}][^@][{_squote}]', String.Char, '#pop'),
120
+ (rf'([{_squote}])(@\{{[0-9a-fA-F]*\}})([{_squote}])',
122
121
  bygroups(String.Char, String.Escape, String.Char), '#pop'),
123
- (r'([%s])(@.{2})([%s])' % (_squote, _squote),
122
+ (rf'([{_squote}])(@.{{2}})([{_squote}])',
124
123
  bygroups(String.Char, String.Escape, String.Char), '#pop'),
125
- (r'[%s]' % _squote, String.Single, ('#pop', 'dictionary-word')),
126
- (r'[%s]' % _dquote, String.Double, ('#pop', 'string')),
124
+ (rf'[{_squote}]', String.Single, ('#pop', 'dictionary-word')),
125
+ (rf'[{_dquote}]', String.Double, ('#pop', 'string')),
127
126
  # Numbers
128
- (r'\$[<>]?[+%s][0-9]*\.?[0-9]*([eE][+%s]?[0-9]+)?' % (_dash, _dash),
127
+ (rf'\$[<>]?[+{_dash}][0-9]*\.?[0-9]*([eE][+{_dash}]?[0-9]+)?',
129
128
  Number.Float, '#pop'),
130
129
  (r'\$[0-9a-fA-F]+', Number.Hex, '#pop'),
131
130
  (r'\$\$[01]+', Number.Bin, '#pop'),
132
131
  (r'[0-9]+', Number.Integer, '#pop'),
133
132
  # Values prefixed by hashes
134
- (r'(##|#a\$)(%s)' % _name, bygroups(Operator, Name), '#pop'),
135
- (r'(#g\$)(%s)' % _name,
133
+ (rf'(##|#a\$)({_name})', bygroups(Operator, Name), '#pop'),
134
+ (rf'(#g\$)({_name})',
136
135
  bygroups(Operator, Name.Variable.Global), '#pop'),
137
136
  (r'#[nw]\$', Operator, ('#pop', 'obsolete-dictionary-word')),
138
- (r'(#r\$)(%s)' % _name, bygroups(Operator, Name.Function), '#pop'),
137
+ (rf'(#r\$)({_name})', bygroups(Operator, Name.Function), '#pop'),
139
138
  (r'#', Name.Builtin, ('#pop', 'system-constant')),
140
139
  # System functions
141
140
  (words((
@@ -182,32 +181,31 @@ class Inform6Lexer(RegexLexer):
182
181
  ],
183
182
  # Strings
184
183
  'dictionary-word': [
185
- (r'[~^]+', String.Escape),
186
- (r'[^~^\\@({%s]+' % _squote, String.Single),
187
- (r'[({]', String.Single),
184
+ (rf'[~^]+|//[^{_squote}]*', String.Escape),
185
+ (rf'[^~^/\\@({{{_squote}]+', String.Single),
186
+ (r'[/({]', String.Single),
188
187
  (r'@\{[0-9a-fA-F]*\}', String.Escape),
189
188
  (r'@.{2}', String.Escape),
190
- (r'[%s]' % _squote, String.Single, '#pop')
189
+ (rf'[{_squote}]', String.Single, '#pop')
191
190
  ],
192
191
  'string': [
193
192
  (r'[~^]+', String.Escape),
194
- (r'[^~^\\@({%s]+' % _dquote, String.Double),
193
+ (rf'[^~^\\@({{{_dquote}]+', String.Double),
195
194
  (r'[({]', String.Double),
196
195
  (r'\\', String.Escape),
197
- (r'@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*' %
198
- (_newline, _newline), String.Escape),
199
- (r'@(\\\s*[%s]\s*)*[({]((\\\s*[%s]\s*)*[0-9a-zA-Z_])*'
200
- r'(\\\s*[%s]\s*)*[)}]' % (_newline, _newline, _newline),
196
+ (rf'@(\\\s*[{_newline}]\s*)*@((\\\s*[{_newline}]\s*)*[0-9])*', String.Escape),
197
+ (rf'@(\\\s*[{_newline}]\s*)*[({{]((\\\s*[{_newline}]\s*)*[0-9a-zA-Z_])*'
198
+ rf'(\\\s*[{_newline}]\s*)*[)}}]',
201
199
  String.Escape),
202
- (r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline),
200
+ (rf'@(\\\s*[{_newline}]\s*)*.(\\\s*[{_newline}]\s*)*.',
203
201
  String.Escape),
204
- (r'[%s]' % _dquote, String.Double, '#pop')
202
+ (rf'[{_dquote}]', String.Double, '#pop')
205
203
  ],
206
204
  'plain-string': [
207
- (r'[^~^\\({\[\]%s]+' % _dquote, String.Double),
205
+ (rf'[^~^\\({{\[\]{_dquote}]+', String.Double),
208
206
  (r'[~^({\[\]]', String.Double),
209
207
  (r'\\', String.Escape),
210
- (r'[%s]' % _dquote, String.Double, '#pop')
208
+ (rf'[{_dquote}]', String.Double, '#pop')
211
209
  ],
212
210
  # Names
213
211
  '_constant': [
@@ -326,7 +324,7 @@ class Inform6Lexer(RegexLexer):
326
324
  default('#pop')
327
325
  ],
328
326
  '_object-head': [
329
- (r'[%s]>' % _dash, Punctuation),
327
+ (rf'[{_dash}]>', Punctuation),
330
328
  (r'(class|has|private|with)\b', Keyword.Declaration, '#pop'),
331
329
  include('_global')
332
330
  ],
@@ -356,7 +354,7 @@ class Inform6Lexer(RegexLexer):
356
354
  include('_whitespace'),
357
355
  (r';', Punctuation, '#pop'),
358
356
  (r'[/*]', Punctuation),
359
- (r'[%s]>' % _dash, Punctuation, 'value'),
357
+ (rf'[{_dash}]>', Punctuation, 'value'),
360
358
  (r'(noun|scope)\b', Keyword, '=routine'),
361
359
  default('_directive-keyword')
362
360
  ],
@@ -376,12 +374,12 @@ class Inform6Lexer(RegexLexer):
376
374
  # Include, Link, Message
377
375
  'diagnostic': [
378
376
  include('_whitespace'),
379
- (r'[%s]' % _dquote, String.Double, ('#pop', 'message-string')),
377
+ (rf'[{_dquote}]', String.Double, ('#pop', 'message-string')),
380
378
  default(('#pop', 'before-plain-string?', 'directive-keyword?'))
381
379
  ],
382
380
  'before-plain-string?': [
383
381
  include('_whitespace'),
384
- (r'[%s]' % _dquote, String.Double, ('#pop', 'plain-string')),
382
+ (rf'[{_dquote}]', String.Double, ('#pop', 'plain-string')),
385
383
  default('#pop')
386
384
  ],
387
385
  'message-string': [
@@ -400,7 +398,7 @@ class Inform6Lexer(RegexLexer):
400
398
  'terminating', 'time', 'topic', 'warning', 'with'), suffix=r'\b'),
401
399
  Keyword, '#pop'),
402
400
  (r'static\b', Keyword),
403
- (r'[%s]{1,2}>|[+=]' % _dash, Punctuation, '#pop')
401
+ (rf'[{_dash}]{{1,2}}>|[+=]', Punctuation, '#pop')
404
402
  ],
405
403
  '_directive-keyword': [
406
404
  include('_directive-keyword!'),
@@ -413,7 +411,7 @@ class Inform6Lexer(RegexLexer):
413
411
  'property-keyword*': [
414
412
  include('_whitespace'),
415
413
  (words(('additive', 'individual', 'long'),
416
- suffix=r'\b(?=(\s*|(![^%s]*[%s]))*[_a-zA-Z])' % (_newline, _newline)),
414
+ suffix=rf'\b(?=(\s*|(![^{_newline}]*[{_newline}]))*[_a-zA-Z])'),
417
415
  Keyword),
418
416
  default('#pop')
419
417
  ],
@@ -445,7 +443,7 @@ class Inform6Lexer(RegexLexer):
445
443
  (r'(jump|save|restore)\b', Keyword, ('default', 'label?')),
446
444
  (r'objectloop\b', Keyword,
447
445
  ('_keyword-expression', 'variable?', '(?')),
448
- (r'print(_ret)?\b|(?=[%s])' % _dquote, Keyword, 'print-list'),
446
+ (rf'print(_ret)?\b|(?=[{_dquote}])', Keyword, 'print-list'),
449
447
  (r'\.', Name.Label, 'label?'),
450
448
  (r'@', Keyword, 'opcode'),
451
449
  (r'#(?![agrnw]\$|#)', Punctuation, 'directive'),
@@ -459,9 +457,9 @@ class Inform6Lexer(RegexLexer):
459
457
  (r'(bold|fixed|from|near|off|on|reverse|roman|to|underline)\b',
460
458
  Keyword, '#pop'),
461
459
  (r'(a|A|an|address|char|name|number|object|property|string|the|'
462
- r'The)\b(?=(\s+|(![^%s]*))*\))' % _newline, Keyword.Pseudo,
460
+ rf'The)\b(?=(\s+|(![^{_newline}]*))*\))', Keyword.Pseudo,
463
461
  '#pop'),
464
- (r'%s(?=(\s+|(![^%s]*))*\))' % (_name, _newline), Name.Function,
462
+ (rf'{_name}(?=(\s+|(![^{_newline}]*))*\))', Name.Function,
465
463
  '#pop'),
466
464
  default('#pop')
467
465
  ],
@@ -490,7 +488,8 @@ class Inform6Lexer(RegexLexer):
490
488
  # Assembly
491
489
  'opcode': [
492
490
  include('_whitespace'),
493
- (r'[%s]' % _dquote, String.Double, ('operands', 'plain-string')),
491
+ (rf'[{_dquote}]', String.Double, ('operands', 'plain-string')),
492
+ (rf'[{_dash}]{{1,2}}>', Punctuation, 'operands'),
494
493
  (_name, Keyword, 'operands')
495
494
  ],
496
495
  'operands': [
@@ -543,21 +542,20 @@ class Inform6Lexer(RegexLexer):
543
542
  class Inform7Lexer(RegexLexer):
544
543
  """
545
544
  For Inform 7 source code.
546
-
547
- .. versionadded:: 2.0
548
545
  """
549
546
 
550
547
  name = 'Inform 7'
551
548
  url = 'http://inform7.com/'
552
549
  aliases = ['inform7', 'i7']
553
550
  filenames = ['*.ni', '*.i7x']
551
+ version_added = '2.0'
554
552
 
555
553
  flags = re.MULTILINE | re.DOTALL
556
554
 
557
555
  _dash = Inform6Lexer._dash
558
556
  _dquote = Inform6Lexer._dquote
559
557
  _newline = Inform6Lexer._newline
560
- _start = r'\A|(?<=[%s])' % _newline
558
+ _start = rf'\A|(?<=[{_newline}])'
561
559
 
562
560
  # There are three variants of Inform 7, differing in how to
563
561
  # interpret at signs and braces in I6T. In top-level inclusions, at
@@ -571,47 +569,46 @@ class Inform7Lexer(RegexLexer):
571
569
  tokens[level] = {
572
570
  '+i6-root': list(Inform6Lexer.tokens['root']),
573
571
  '+i6t-root': [ # For Inform6TemplateLexer
574
- (r'[^%s]*' % Inform6Lexer._newline, Comment.Preproc,
572
+ (rf'[^{Inform6Lexer._newline}]*', Comment.Preproc,
575
573
  ('directive', '+p'))
576
574
  ],
577
575
  'root': [
578
576
  (r'(\|?\s)+', Text),
579
577
  (r'\[', Comment.Multiline, '+comment'),
580
- (r'[%s]' % _dquote, Generic.Heading,
578
+ (rf'[{_dquote}]', Generic.Heading,
581
579
  ('+main', '+titling', '+titling-string')),
582
580
  default(('+main', '+heading?'))
583
581
  ],
584
582
  '+titling-string': [
585
- (r'[^%s]+' % _dquote, Generic.Heading),
586
- (r'[%s]' % _dquote, Generic.Heading, '#pop')
583
+ (rf'[^{_dquote}]+', Generic.Heading),
584
+ (rf'[{_dquote}]', Generic.Heading, '#pop')
587
585
  ],
588
586
  '+titling': [
589
587
  (r'\[', Comment.Multiline, '+comment'),
590
- (r'[^%s.;:|%s]+' % (_dquote, _newline), Generic.Heading),
591
- (r'[%s]' % _dquote, Generic.Heading, '+titling-string'),
592
- (r'[%s]{2}|(?<=[\s%s])\|[\s%s]' % (_newline, _dquote, _dquote),
588
+ (rf'[^{_dquote}.;:|{_newline}]+', Generic.Heading),
589
+ (rf'[{_dquote}]', Generic.Heading, '+titling-string'),
590
+ (rf'[{_newline}]{{2}}|(?<=[\s{_dquote}])\|[\s{_dquote}]',
593
591
  Text, ('#pop', '+heading?')),
594
- (r'[.;:]|(?<=[\s%s])\|' % _dquote, Text, '#pop'),
595
- (r'[|%s]' % _newline, Generic.Heading)
592
+ (rf'[.;:]|(?<=[\s{_dquote}])\|', Text, '#pop'),
593
+ (rf'[|{_newline}]', Generic.Heading)
596
594
  ],
597
595
  '+main': [
598
- (r'(?i)[^%s:a\[(|%s]+' % (_dquote, _newline), Text),
599
- (r'[%s]' % _dquote, String.Double, '+text'),
596
+ (rf'(?i)[^{_dquote}:a\[(|{_newline}]+', Text),
597
+ (rf'[{_dquote}]', String.Double, '+text'),
600
598
  (r':', Text, '+phrase-definition'),
601
599
  (r'(?i)\bas\b', Text, '+use-option'),
602
600
  (r'\[', Comment.Multiline, '+comment'),
603
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
601
+ (rf'(\([{_dash}])(.*?)([{_dash}]\))',
604
602
  bygroups(Punctuation,
605
603
  using(this, state=('+i6-root', 'directive'),
606
604
  i6t='+i6t-not-inline'), Punctuation)),
607
- (r'(%s|(?<=[\s;:.%s]))\|\s|[%s]{2,}' %
608
- (_start, _dquote, _newline), Text, '+heading?'),
609
- (r'(?i)[a(|%s]' % _newline, Text)
605
+ (rf'({_start}|(?<=[\s;:.{_dquote}]))\|\s|[{_newline}]{{2,}}', Text, '+heading?'),
606
+ (rf'(?i)[a(|{_newline}]', Text)
610
607
  ],
611
608
  '+phrase-definition': [
612
609
  (r'\s+', Text),
613
610
  (r'\[', Comment.Multiline, '+comment'),
614
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
611
+ (rf'(\([{_dash}])(.*?)([{_dash}]\))',
615
612
  bygroups(Punctuation,
616
613
  using(this, state=('+i6-root', 'directive',
617
614
  'default', 'statements'),
@@ -621,7 +618,7 @@ class Inform7Lexer(RegexLexer):
621
618
  '+use-option': [
622
619
  (r'\s+', Text),
623
620
  (r'\[', Comment.Multiline, '+comment'),
624
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
621
+ (rf'(\([{_dash}])(.*?)([{_dash}]\))',
625
622
  bygroups(Punctuation,
626
623
  using(this, state=('+i6-root', 'directive'),
627
624
  i6t='+i6t-use-option'), Punctuation), '#pop'),
@@ -633,16 +630,16 @@ class Inform7Lexer(RegexLexer):
633
630
  (r'\]', Comment.Multiline, '#pop')
634
631
  ],
635
632
  '+text': [
636
- (r'[^\[%s]+' % _dquote, String.Double),
633
+ (rf'[^\[{_dquote}]+', String.Double),
637
634
  (r'\[.*?\]', String.Interpol),
638
- (r'[%s]' % _dquote, String.Double, '#pop')
635
+ (rf'[{_dquote}]', String.Double, '#pop')
639
636
  ],
640
637
  '+heading?': [
641
638
  (r'(\|?\s)+', Text),
642
639
  (r'\[', Comment.Multiline, '+comment'),
643
- (r'[%s]{4}\s+' % _dash, Text, '+documentation-heading'),
644
- (r'[%s]{1,3}' % _dash, Text),
645
- (r'(?i)(volume|book|part|chapter|section)\b[^%s]*' % _newline,
640
+ (rf'[{_dash}]{{4}}\s+', Text, '+documentation-heading'),
641
+ (rf'[{_dash}]{{1,3}}', Text),
642
+ (rf'(?i)(volume|book|part|chapter|section)\b[^{_newline}]*',
646
643
  Generic.Heading, '#pop'),
647
644
  default('#pop')
648
645
  ],
@@ -655,25 +652,24 @@ class Inform7Lexer(RegexLexer):
655
652
  '+documentation-heading2': [
656
653
  (r'\s+', Text),
657
654
  (r'\[', Comment.Multiline, '+comment'),
658
- (r'[%s]{4}\s' % _dash, Text, '+documentation'),
655
+ (rf'[{_dash}]{{4}}\s', Text, '+documentation'),
659
656
  default('#pop:2')
660
657
  ],
661
658
  '+documentation': [
662
- (r'(?i)(%s)\s*(chapter|example)\s*:[^%s]*' %
663
- (_start, _newline), Generic.Heading),
664
- (r'(?i)(%s)\s*section\s*:[^%s]*' % (_start, _newline),
659
+ (rf'(?i)({_start})\s*(chapter|example)\s*:[^{_newline}]*', Generic.Heading),
660
+ (rf'(?i)({_start})\s*section\s*:[^{_newline}]*',
665
661
  Generic.Subheading),
666
- (r'((%s)\t.*?[%s])+' % (_start, _newline),
662
+ (rf'(({_start})\t.*?[{_newline}])+',
667
663
  using(this, state='+main')),
668
- (r'[^%s\[]+|[%s\[]' % (_newline, _newline), Text),
664
+ (rf'[^{_newline}\[]+|[{_newline}\[]', Text),
669
665
  (r'\[', Comment.Multiline, '+comment'),
670
666
  ],
671
667
  '+i6t-not-inline': [
672
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
668
+ (rf'({_start})@c( .*?)?([{_newline}]|\Z)',
673
669
  Comment.Preproc),
674
- (r'(%s)@([%s]+|Purpose:)[^%s]*' % (_start, _dash, _newline),
670
+ (rf'({_start})@([{_dash}]+|Purpose:)[^{_newline}]*',
675
671
  Comment.Preproc),
676
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
672
+ (rf'({_start})@p( .*?)?([{_newline}]|\Z)',
677
673
  Generic.Heading, '+p')
678
674
  ],
679
675
  '+i6t-use-option': [
@@ -686,12 +682,12 @@ class Inform7Lexer(RegexLexer):
686
682
  Punctuation))
687
683
  ],
688
684
  '+i6t': [
689
- (r'(\{[%s])(![^}]*)(\}?)' % _dash,
685
+ (rf'(\{{[{_dash}])(![^}}]*)(\}}?)',
690
686
  bygroups(Punctuation, Comment.Single, Punctuation)),
691
- (r'(\{[%s])(lines)(:)([^}]*)(\}?)' % _dash,
687
+ (rf'(\{{[{_dash}])(lines)(:)([^}}]*)(\}}?)',
692
688
  bygroups(Punctuation, Keyword, Punctuation, Text,
693
689
  Punctuation), '+lines'),
694
- (r'(\{[%s])([^:}]*)(:?)([^}]*)(\}?)' % _dash,
690
+ (rf'(\{{[{_dash}])([^:}}]*)(:?)([^}}]*)(\}}?)',
695
691
  bygroups(Punctuation, Keyword, Punctuation, Text,
696
692
  Punctuation)),
697
693
  (r'(\(\+)(.*?)(\+\)|\Z)',
@@ -700,25 +696,25 @@ class Inform7Lexer(RegexLexer):
700
696
  ],
701
697
  '+p': [
702
698
  (r'[^@]+', Comment.Preproc),
703
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
699
+ (rf'({_start})@c( .*?)?([{_newline}]|\Z)',
704
700
  Comment.Preproc, '#pop'),
705
- (r'(%s)@([%s]|Purpose:)' % (_start, _dash), Comment.Preproc),
706
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
701
+ (rf'({_start})@([{_dash}]|Purpose:)', Comment.Preproc),
702
+ (rf'({_start})@p( .*?)?([{_newline}]|\Z)',
707
703
  Generic.Heading),
708
704
  (r'@', Comment.Preproc)
709
705
  ],
710
706
  '+lines': [
711
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
707
+ (rf'({_start})@c( .*?)?([{_newline}]|\Z)',
712
708
  Comment.Preproc),
713
- (r'(%s)@([%s]|Purpose:)[^%s]*' % (_start, _dash, _newline),
709
+ (rf'({_start})@([{_dash}]|Purpose:)[^{_newline}]*',
714
710
  Comment.Preproc),
715
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
711
+ (rf'({_start})@p( .*?)?([{_newline}]|\Z)',
716
712
  Generic.Heading, '+p'),
717
- (r'(%s)@\w*[ %s]' % (_start, _newline), Keyword),
718
- (r'![^%s]*' % _newline, Comment.Single),
719
- (r'(\{)([%s]endlines)(\})' % _dash,
713
+ (rf'({_start})@\w*[ {_newline}]', Keyword),
714
+ (rf'![^{_newline}]*', Comment.Single),
715
+ (rf'(\{{)([{_dash}]endlines)(\}})',
720
716
  bygroups(Punctuation, Keyword, Punctuation), '#pop'),
721
- (r'[^@!{]+?([%s]|\Z)|.' % _newline, Text)
717
+ (rf'[^@!{{]+?([{_newline}]|\Z)|.', Text)
722
718
  ]
723
719
  }
724
720
  # Inform 7 can include snippets of Inform 6 template language,
@@ -747,13 +743,12 @@ class Inform7Lexer(RegexLexer):
747
743
  class Inform6TemplateLexer(Inform7Lexer):
748
744
  """
749
745
  For Inform 6 template code.
750
-
751
- .. versionadded:: 2.0
752
746
  """
753
747
 
754
748
  name = 'Inform 6 template'
755
749
  aliases = ['i6t']
756
750
  filenames = ['*.i6t']
751
+ version_added = '2.0'
757
752
 
758
753
  def get_tokens_unprocessed(self, text, stack=('+i6t-root',)):
759
754
  return Inform7Lexer.get_tokens_unprocessed(self, text, stack)
@@ -767,6 +762,8 @@ class Tads3Lexer(RegexLexer):
767
762
  name = 'TADS 3'
768
763
  aliases = ['tads3']
769
764
  filenames = ['*.t']
765
+ url = 'https://www.tads.org'
766
+ version_added = ''
770
767
 
771
768
  flags = re.DOTALL | re.MULTILINE
772
769
 
@@ -778,55 +775,50 @@ class Tads3Lexer(RegexLexer):
778
775
  _no_quote = r'(?=\s|\\?>)'
779
776
  _operator = (r'(?:&&|\|\||\+\+|--|\?\?|::|[.,@\[\]~]|'
780
777
  r'(?:[=+\-*/%!&|^]|<<?|>>?>?)=?)')
781
- _ws = r'(?:\\|\s|%s|%s)' % (_comment_single, _comment_multiline)
782
- _ws_pp = r'(?:\\\n|[^\S\n]|%s|%s)' % (_comment_single, _comment_multiline)
778
+ _ws = rf'(?:\\|\s|{_comment_single}|{_comment_multiline})'
779
+ _ws_pp = rf'(?:\\\n|[^\S\n]|{_comment_single}|{_comment_multiline})'
783
780
 
784
781
  def _make_string_state(triple, double, verbatim=None, _escape=_escape):
785
782
  if verbatim:
786
- verbatim = ''.join(['(?:%s|%s)' % (re.escape(c.lower()),
787
- re.escape(c.upper()))
783
+ verbatim = ''.join([f'(?:{re.escape(c.lower())}|{re.escape(c.upper())})'
788
784
  for c in verbatim])
789
785
  char = r'"' if double else r"'"
790
786
  token = String.Double if double else String.Single
791
- escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r''
792
- prefix = '%s%s' % ('t' if triple else '', 'd' if double else 's')
793
- tag_state_name = '%sqt' % prefix
787
+ escaped_quotes = rf'+|{char}(?!{char}{{2}})' if triple else r''
788
+ prefix = '{}{}'.format('t' if triple else '', 'd' if double else 's')
789
+ tag_state_name = f'{prefix}qt'
794
790
  state = []
795
791
  if triple:
796
792
  state += [
797
- (r'%s{3,}' % char, token, '#pop'),
798
- (r'\\%s+' % char, String.Escape),
793
+ (rf'{char}{{3,}}', token, '#pop'),
794
+ (rf'\\{char}+', String.Escape),
799
795
  (char, token)
800
796
  ]
801
797
  else:
802
798
  state.append((char, token, '#pop'))
803
799
  state += [
804
800
  include('s/verbatim'),
805
- (r'[^\\<&{}%s]+' % char, token)
801
+ (rf'[^\\<&{{}}{char}]+', token)
806
802
  ]
807
803
  if verbatim:
808
804
  # This regex can't use `(?i)` because escape sequences are
809
805
  # case-sensitive. `<\XMP>` works; `<\xmp>` doesn't.
810
- state.append((r'\\?<(/|\\\\|(?!%s)\\)%s(?=[\s=>])' %
811
- (_escape, verbatim),
812
- Name.Tag, ('#pop', '%sqs' % prefix, tag_state_name)))
806
+ state.append((rf'\\?<(/|\\\\|(?!{_escape})\\){verbatim}(?=[\s=>])',
807
+ Name.Tag, ('#pop', f'{prefix}qs', tag_state_name)))
813
808
  else:
814
809
  state += [
815
- (r'\\?<!([^><\\%s]|<(?!<)|\\%s%s|%s|\\.)*>?' %
816
- (char, char, escaped_quotes, _escape), Comment.Multiline),
810
+ (rf'\\?<!([^><\\{char}]|<(?!<)|\\{char}{escaped_quotes}|{_escape}|\\.)*>?', Comment.Multiline),
817
811
  (r'(?i)\\?<listing(?=[\s=>]|\\>)', Name.Tag,
818
- ('#pop', '%sqs/listing' % prefix, tag_state_name)),
812
+ ('#pop', f'{prefix}qs/listing', tag_state_name)),
819
813
  (r'(?i)\\?<xmp(?=[\s=>]|\\>)', Name.Tag,
820
- ('#pop', '%sqs/xmp' % prefix, tag_state_name)),
821
- (r'\\?<([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)*' %
822
- (char, char, escaped_quotes, _escape), Name.Tag,
814
+ ('#pop', f'{prefix}qs/xmp', tag_state_name)),
815
+ (rf'\\?<([^\s=><\\{char}]|<(?!<)|\\{char}{escaped_quotes}|{_escape}|\\.)*', Name.Tag,
823
816
  tag_state_name),
824
817
  include('s/entity')
825
818
  ]
826
819
  state += [
827
820
  include('s/escape'),
828
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
829
- (char, char, escaped_quotes, _escape), String.Interpol),
821
+ (rf'\{{([^}}<\\{char}]|<(?!<)|\\{char}{escaped_quotes}|{_escape}|\\.)*\}}', String.Interpol),
830
822
  (r'[\\&{}<]', token)
831
823
  ]
832
824
  return state
@@ -834,22 +826,20 @@ class Tads3Lexer(RegexLexer):
834
826
  def _make_tag_state(triple, double, _escape=_escape):
835
827
  char = r'"' if double else r"'"
836
828
  quantifier = r'{3,}' if triple else r''
837
- state_name = '%s%sqt' % ('t' if triple else '', 'd' if double else 's')
829
+ state_name = '{}{}qt'.format('t' if triple else '', 'd' if double else 's')
838
830
  token = String.Double if double else String.Single
839
- escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r''
831
+ escaped_quotes = rf'+|{char}(?!{char}{{2}})' if triple else r''
840
832
  return [
841
- (r'%s%s' % (char, quantifier), token, '#pop:2'),
833
+ (rf'{char}{quantifier}', token, '#pop:2'),
842
834
  (r'(\s|\\\n)+', Text),
843
835
  (r'(=)(\\?")', bygroups(Punctuation, String.Double),
844
- 'dqs/%s' % state_name),
836
+ f'dqs/{state_name}'),
845
837
  (r"(=)(\\?')", bygroups(Punctuation, String.Single),
846
- 'sqs/%s' % state_name),
847
- (r'=', Punctuation, 'uqs/%s' % state_name),
838
+ f'sqs/{state_name}'),
839
+ (r'=', Punctuation, f'uqs/{state_name}'),
848
840
  (r'\\?>', Name.Tag, '#pop'),
849
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
850
- (char, char, escaped_quotes, _escape), String.Interpol),
851
- (r'([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)+' %
852
- (char, char, escaped_quotes, _escape), Name.Attribute),
841
+ (rf'\{{([^}}<\\{char}]|<(?!<)|\\{char}{escaped_quotes}|{_escape}|\\.)*\}}', String.Interpol),
842
+ (rf'([^\s=><\\{char}]|<(?!<)|\\{char}{escaped_quotes}|{_escape}|\\.)+', Name.Attribute),
853
843
  include('s/escape'),
854
844
  include('s/verbatim'),
855
845
  include('s/entity'),
@@ -863,16 +853,15 @@ class Tads3Lexer(RegexLexer):
863
853
  host_char = r'"' if host_double else r"'"
864
854
  host_quantifier = r'{3,}' if host_triple else r''
865
855
  host_token = String.Double if host_double else String.Single
866
- escaped_quotes = (r'+|%s(?!%s{2})' % (host_char, host_char)
856
+ escaped_quotes = (rf'+|{host_char}(?!{host_char}{{2}})'
867
857
  if host_triple else r'')
868
858
  return [
869
- (r'%s%s' % (host_char, host_quantifier), host_token, '#pop:3'),
870
- (r'%s%s' % (r'' if token is String.Other else r'\\?', terminator),
859
+ (rf'{host_char}{host_quantifier}', host_token, '#pop:3'),
860
+ (r'{}{}'.format(r'' if token is String.Other else r'\\?', terminator),
871
861
  token, '#pop'),
872
862
  include('s/verbatim'),
873
863
  include('s/entity'),
874
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
875
- (host_char, host_char, escaped_quotes, _escape), String.Interpol),
864
+ (rf'\{{([^}}<\\{host_char}]|<(?!<)|\\{host_char}{escaped_quotes}|{_escape}|\\.)*\}}', String.Interpol),
876
865
  (r'([^\s"\'<%s{}\\&])+' % (r'>' if token is String.Other else r''),
877
866
  token),
878
867
  include('s/escape'),
@@ -888,7 +877,7 @@ class Tads3Lexer(RegexLexer):
888
877
  r'delegated|do|else|for|foreach|finally|goto|if|inherited|'
889
878
  r'invokee|local|nil|new|operator|replaced|return|self|switch|'
890
879
  r'targetobj|targetprop|throw|true|try|while)\b)', Text, 'block'),
891
- (r'(%s)(%s*)(\()' % (_name, _ws),
880
+ (rf'({_name})({_ws}*)(\()',
892
881
  bygroups(Name.Function, using(this, state='whitespace'),
893
882
  Punctuation),
894
883
  ('block?/root', 'more/parameters', 'main/parameters')),
@@ -911,24 +900,24 @@ class Tads3Lexer(RegexLexer):
911
900
  (r'\{', Punctuation, '#push'),
912
901
  (r'\}', Punctuation, '#pop'),
913
902
  (r':', Punctuation, ('classes', 'class')),
914
- (r'(%s?)(%s*)(\()' % (_name, _ws),
903
+ (rf'({_name}?)({_ws}*)(\()',
915
904
  bygroups(Name.Function, using(this, state='whitespace'),
916
905
  Punctuation),
917
906
  ('block?', 'more/parameters', 'main/parameters')),
918
- (r'(%s)(%s*)(\{)' % (_name, _ws),
907
+ (rf'({_name})({_ws}*)(\{{)',
919
908
  bygroups(Name.Function, using(this, state='whitespace'),
920
909
  Punctuation), 'block'),
921
- (r'(%s)(%s*)(:)' % (_name, _ws),
910
+ (rf'({_name})({_ws}*)(:)',
922
911
  bygroups(Name.Variable, using(this, state='whitespace'),
923
912
  Punctuation),
924
913
  ('object-body/no-braces', 'classes', 'class')),
925
914
  include('whitespace'),
926
- (r'->|%s' % _operator, Punctuation, 'main'),
915
+ (rf'->|{_operator}', Punctuation, 'main'),
927
916
  default('main/object-body')
928
917
  ],
929
918
  'main/object-body': [
930
919
  include('main/basic'),
931
- (r'(%s)(%s*)(=?)' % (_name, _ws),
920
+ (rf'({_name})({_ws}*)(=?)',
932
921
  bygroups(Name.Variable, using(this, state='whitespace'),
933
922
  Punctuation), ('#pop', 'more', 'main')),
934
923
  default('#pop:2')
@@ -951,7 +940,7 @@ class Tads3Lexer(RegexLexer):
951
940
  (r'\{', Punctuation, '#push'),
952
941
  (r'\}', Punctuation, '#pop'),
953
942
  (r'default\b', Keyword.Reserved),
954
- (r'(%s)(%s*)(:)' % (_name, _ws),
943
+ (rf'({_name})({_ws}*)(:)',
955
944
  bygroups(Name.Label, using(this, state='whitespace'),
956
945
  Punctuation)),
957
946
  include('whitespace')
@@ -986,23 +975,23 @@ class Tads3Lexer(RegexLexer):
986
975
  (r'R"', String.Regex, ('#pop', 'dqr')),
987
976
  (r"R'", String.Regex, ('#pop', 'sqr')),
988
977
  # Two-token keywords
989
- (r'(extern)(%s+)(object\b)' % _ws,
978
+ (rf'(extern)({_ws}+)(object\b)',
990
979
  bygroups(Keyword.Reserved, using(this, state='whitespace'),
991
980
  Keyword.Reserved)),
992
- (r'(function|method)(%s*)(\()' % _ws,
981
+ (rf'(function|method)({_ws}*)(\()',
993
982
  bygroups(Keyword.Reserved, using(this, state='whitespace'),
994
983
  Punctuation),
995
984
  ('#pop', 'block?', 'more/parameters', 'main/parameters')),
996
- (r'(modify)(%s+)(grammar\b)' % _ws,
985
+ (rf'(modify)({_ws}+)(grammar\b)',
997
986
  bygroups(Keyword.Reserved, using(this, state='whitespace'),
998
987
  Keyword.Reserved),
999
988
  ('#pop', 'object-body/no-braces', ':', 'grammar')),
1000
- (r'(new)(%s+(?=(?:function|method)\b))' % _ws,
989
+ (rf'(new)({_ws}+(?=(?:function|method)\b))',
1001
990
  bygroups(Keyword.Reserved, using(this, state='whitespace'))),
1002
- (r'(object)(%s+)(template\b)' % _ws,
991
+ (rf'(object)({_ws}+)(template\b)',
1003
992
  bygroups(Keyword.Reserved, using(this, state='whitespace'),
1004
993
  Keyword.Reserved), ('#pop', 'template')),
1005
- (r'(string)(%s+)(template\b)' % _ws,
994
+ (rf'(string)({_ws}+)(template\b)',
1006
995
  bygroups(Keyword, using(this, state='whitespace'),
1007
996
  Keyword.Reserved), ('#pop', 'function-name')),
1008
997
  # Keywords
@@ -1039,7 +1028,7 @@ class Tads3Lexer(RegexLexer):
1039
1028
  (r'self\b', Name.Builtin.Pseudo, '#pop'),
1040
1029
  (r'template\b', Keyword.Reserved, ('#pop', 'template')),
1041
1030
  # Operators
1042
- (r'(__objref|defined)(%s*)(\()' % _ws,
1031
+ (rf'(__objref|defined)({_ws}*)(\()',
1043
1032
  bygroups(Operator.Word, using(this, state='whitespace'),
1044
1033
  Operator), ('#pop', 'more/__objref', 'main')),
1045
1034
  (r'delegated\b', Operator.Word),
@@ -1065,7 +1054,7 @@ class Tads3Lexer(RegexLexer):
1065
1054
  include('whitespace'),
1066
1055
  (_operator, Operator, 'main'),
1067
1056
  (r'\?', Operator, ('main', 'more/conditional', 'main')),
1068
- (r'(is|not)(%s+)(in\b)' % _ws,
1057
+ (rf'(is|not)({_ws}+)(in\b)',
1069
1058
  bygroups(Operator.Word, using(this, state='whitespace'),
1070
1059
  Operator.Word)),
1071
1060
  (r'[^\s!"%-_a-z{-~]+', Error) # Averts an infinite loop
@@ -1112,9 +1101,9 @@ class Tads3Lexer(RegexLexer):
1112
1101
  ],
1113
1102
  # Parameter list
1114
1103
  'main/parameters': [
1115
- (r'(%s)(%s*)(?=:)' % (_name, _ws),
1104
+ (rf'({_name})({_ws}*)(?=:)',
1116
1105
  bygroups(Name.Variable, using(this, state='whitespace')), '#pop'),
1117
- (r'(%s)(%s+)(%s)' % (_name, _ws, _name),
1106
+ (rf'({_name})({_ws}+)({_name})',
1118
1107
  bygroups(Name.Class, using(this, state='whitespace'),
1119
1108
  Name.Variable), '#pop'),
1120
1109
  (r'\[+', Punctuation),
@@ -1123,7 +1112,7 @@ class Tads3Lexer(RegexLexer):
1123
1112
  default('#pop')
1124
1113
  ],
1125
1114
  'more/parameters': [
1126
- (r'(:)(%s*(?=[?=,:)]))' % _ws,
1115
+ (rf'(:)({_ws}*(?=[?=,:)]))',
1127
1116
  bygroups(Punctuation, using(this, state='whitespace'))),
1128
1117
  (r'[?\]]+', Punctuation),
1129
1118
  (r'[:)]', Punctuation, ('#pop', 'multimethod?')),
@@ -1181,10 +1170,10 @@ class Tads3Lexer(RegexLexer):
1181
1170
  'grammar-rules': [
1182
1171
  include('string'),
1183
1172
  include('whitespace'),
1184
- (r'(\[)(%s*)(badness)' % _ws,
1173
+ (rf'(\[)({_ws}*)(badness)',
1185
1174
  bygroups(Punctuation, using(this, state='whitespace'), Keyword),
1186
1175
  'main'),
1187
- (r'->|%s|[()]' % _operator, Punctuation),
1176
+ (rf'->|{_operator}|[()]', Punctuation),
1188
1177
  (_name, Name.Constant),
1189
1178
  default('#pop:2')
1190
1179
  ],
@@ -1193,7 +1182,7 @@ class Tads3Lexer(RegexLexer):
1193
1182
  ],
1194
1183
  'function-name': [
1195
1184
  (r'(<<([^>]|>>>|>(?!>))*>>)+', String.Interpol),
1196
- (r'(?=%s?%s*[({])' % (_name, _ws), Text, '#pop'),
1185
+ (rf'(?={_name}?{_ws}*[({{])', Text, '#pop'),
1197
1186
  (_name, Name.Function, '#pop'),
1198
1187
  include('whitespace')
1199
1188
  ],
@@ -1219,7 +1208,7 @@ class Tads3Lexer(RegexLexer):
1219
1208
  include('string'),
1220
1209
  (r'inherited\b', Keyword.Reserved),
1221
1210
  include('whitespace'),
1222
- (r'->|\?|%s' % _operator, Punctuation),
1211
+ (rf'->|\?|{_operator}', Punctuation),
1223
1212
  (_name, Name.Variable)
1224
1213
  ],
1225
1214
 
@@ -1259,11 +1248,11 @@ class Tads3Lexer(RegexLexer):
1259
1248
 
1260
1249
  # Whitespace and comments
1261
1250
  'whitespace': [
1262
- (r'^%s*#(%s|[^\n]|(?<=\\)\n)*\n?' % (_ws_pp, _comment_multiline),
1251
+ (rf'^{_ws_pp}*#({_comment_multiline}|[^\n]|(?<=\\)\n)*\n?',
1263
1252
  Comment.Preproc),
1264
1253
  (_comment_single, Comment.Single),
1265
1254
  (_comment_multiline, Comment.Multiline),
1266
- (r'\\+\n+%s*#?|\n+|([^\S\n]|\\)+' % _ws_pp, Text)
1255
+ (rf'\\+\n+{_ws_pp}*#?|\n+|([^\S\n]|\\)+', Text)
1267
1256
  ],
1268
1257
 
1269
1258
  # Strings
@@ -1274,15 +1263,15 @@ class Tads3Lexer(RegexLexer):
1274
1263
  (r"'", String.Single, 'sqs')
1275
1264
  ],
1276
1265
  's/escape': [
1277
- (r'\{\{|\}\}|%s' % _escape, String.Escape)
1266
+ (rf'\{{\{{|\}}\}}|{_escape}', String.Escape)
1278
1267
  ],
1279
1268
  's/verbatim': [
1280
1269
  (r'<<\s*(as\s+decreasingly\s+likely\s+outcomes|cycling|else|end|'
1281
1270
  r'first\s+time|one\s+of|only|or|otherwise|'
1282
1271
  r'(sticky|(then\s+)?(purely\s+)?at)\s+random|stopping|'
1283
1272
  r'(then\s+)?(half\s+)?shuffled|\|\|)\s*>>', String.Interpol),
1284
- (r'<<(%%(_(%s|\\?.)|[\-+ ,#]|\[\d*\]?)*\d*\.?\d*(%s|\\?.)|'
1285
- r'\s*((else|otherwise)\s+)?(if|unless)\b)?' % (_escape, _escape),
1273
+ (rf'<<(%(_({_escape}|\\?.)|[\-+ ,#]|\[\d*\]?)*\d*\.?\d*({_escape}|\\?.)|'
1274
+ r'\s*((else|otherwise)\s+)?(if|unless)\b)?',
1286
1275
  String.Interpol, ('block/embed', 'more/embed', 'main'))
1287
1276
  ],
1288
1277
  's/entity': [
@@ -1345,23 +1334,22 @@ class Tads3Lexer(RegexLexer):
1345
1334
  }
1346
1335
 
1347
1336
  def get_tokens_unprocessed(self, text, **kwargs):
1348
- pp = r'^%s*#%s*' % (self._ws_pp, self._ws_pp)
1337
+ pp = rf'^{self._ws_pp}*#{self._ws_pp}*'
1349
1338
  if_false_level = 0
1350
1339
  for index, token, value in (
1351
1340
  RegexLexer.get_tokens_unprocessed(self, text, **kwargs)):
1352
1341
  if if_false_level == 0: # Not in a false #if
1353
1342
  if (token is Comment.Preproc and
1354
- re.match(r'%sif%s+(0|nil)%s*$\n?' %
1355
- (pp, self._ws_pp, self._ws_pp), value)):
1343
+ re.match(rf'{pp}if{self._ws_pp}+(0|nil){self._ws_pp}*$\n?', value)):
1356
1344
  if_false_level = 1
1357
1345
  else: # In a false #if
1358
1346
  if token is Comment.Preproc:
1359
1347
  if (if_false_level == 1 and
1360
- re.match(r'%sel(if|se)\b' % pp, value)):
1348
+ re.match(rf'{pp}el(if|se)\b', value)):
1361
1349
  if_false_level = 0
1362
- elif re.match(r'%sif' % pp, value):
1350
+ elif re.match(rf'{pp}if', value):
1363
1351
  if_false_level += 1
1364
- elif re.match(r'%sendif\b' % pp, value):
1352
+ elif re.match(rf'{pp}endif\b', value):
1365
1353
  if_false_level -= 1
1366
1354
  else:
1367
1355
  token = Comment