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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +8 -8
- data/.github/workflows/release.yml +5 -5
- data/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.adoc +12 -0
- data/README.adoc +2 -2
- data/lib/pygments/popen.rb +2 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +3 -3
- data/vendor/pygments-main/bin/pygmentize +1 -1
- data/vendor/pygments-main/pygments/__init__.py +2 -2
- data/vendor/pygments-main/pygments/__main__.py +1 -1
- data/vendor/pygments-main/pygments/cmdline.py +12 -12
- data/vendor/pygments-main/pygments/console.py +5 -5
- data/vendor/pygments-main/pygments/filter.py +2 -3
- data/vendor/pygments-main/pygments/filters/__init__.py +4 -4
- data/vendor/pygments-main/pygments/formatter.py +6 -1
- data/vendor/pygments-main/pygments/formatters/__init__.py +7 -8
- data/vendor/pygments-main/pygments/formatters/_mapping.py +0 -0
- data/vendor/pygments-main/pygments/formatters/bbcode.py +2 -2
- data/vendor/pygments-main/pygments/formatters/groff.py +3 -3
- data/vendor/pygments-main/pygments/formatters/html.py +38 -40
- data/vendor/pygments-main/pygments/formatters/img.py +51 -11
- data/vendor/pygments-main/pygments/formatters/irc.py +1 -1
- data/vendor/pygments-main/pygments/formatters/latex.py +24 -27
- data/vendor/pygments-main/pygments/formatters/other.py +3 -4
- data/vendor/pygments-main/pygments/formatters/pangomarkup.py +2 -2
- data/vendor/pygments-main/pygments/formatters/rtf.py +228 -25
- data/vendor/pygments-main/pygments/formatters/svg.py +17 -20
- data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
- data/vendor/pygments-main/pygments/lexer.py +51 -33
- data/vendor/pygments-main/pygments/lexers/__init__.py +12 -12
- data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_css_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +5 -5
- data/vendor/pygments-main/pygments/lexers/_luau_builtins.py +62 -0
- data/vendor/pygments-main/pygments/lexers/_mapping.py +41 -11
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +3 -3
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_php_builtins.py +3 -3
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +5 -5
- data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +4 -4
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +3 -3
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/actionscript.py +6 -8
- data/vendor/pygments-main/pygments/lexers/ada.py +3 -3
- data/vendor/pygments-main/pygments/lexers/agile.py +3 -1
- data/vendor/pygments-main/pygments/lexers/algebra.py +9 -13
- data/vendor/pygments-main/pygments/lexers/ambient.py +2 -3
- data/vendor/pygments-main/pygments/lexers/amdgpu.py +3 -3
- data/vendor/pygments-main/pygments/lexers/ampl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/apdlexer.py +4 -3
- data/vendor/pygments-main/pygments/lexers/apl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/archetype.py +8 -12
- data/vendor/pygments-main/pygments/lexers/arrow.py +2 -3
- data/vendor/pygments-main/pygments/lexers/arturo.py +2 -3
- data/vendor/pygments-main/pygments/lexers/asc.py +4 -4
- data/vendor/pygments-main/pygments/lexers/asm.py +28 -15
- data/vendor/pygments-main/pygments/lexers/asn1.py +178 -0
- data/vendor/pygments-main/pygments/lexers/automation.py +6 -8
- data/vendor/pygments-main/pygments/lexers/bare.py +2 -3
- data/vendor/pygments-main/pygments/lexers/basic.py +48 -57
- data/vendor/pygments-main/pygments/lexers/bdd.py +3 -4
- data/vendor/pygments-main/pygments/lexers/berry.py +4 -4
- data/vendor/pygments-main/pygments/lexers/bibtex.py +5 -5
- data/vendor/pygments-main/pygments/lexers/blueprint.py +173 -0
- data/vendor/pygments-main/pygments/lexers/boa.py +4 -4
- data/vendor/pygments-main/pygments/lexers/bqn.py +109 -0
- data/vendor/pygments-main/pygments/lexers/business.py +21 -22
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +9 -4
- data/vendor/pygments-main/pygments/lexers/c_like.py +99 -27
- data/vendor/pygments-main/pygments/lexers/capnproto.py +2 -3
- data/vendor/pygments-main/pygments/lexers/carbon.py +10 -11
- data/vendor/pygments-main/pygments/lexers/cddl.py +8 -9
- data/vendor/pygments-main/pygments/lexers/chapel.py +2 -3
- data/vendor/pygments-main/pygments/lexers/clean.py +2 -1
- data/vendor/pygments-main/pygments/lexers/comal.py +2 -1
- data/vendor/pygments-main/pygments/lexers/compiled.py +2 -1
- data/vendor/pygments-main/pygments/lexers/configs.py +342 -108
- data/vendor/pygments-main/pygments/lexers/console.py +5 -5
- data/vendor/pygments-main/pygments/lexers/cplint.py +2 -3
- data/vendor/pygments-main/pygments/lexers/crystal.py +4 -5
- data/vendor/pygments-main/pygments/lexers/csound.py +6 -8
- data/vendor/pygments-main/pygments/lexers/css.py +5 -5
- data/vendor/pygments-main/pygments/lexers/d.py +4 -3
- data/vendor/pygments-main/pygments/lexers/dalvik.py +2 -3
- data/vendor/pygments-main/pygments/lexers/data.py +8 -12
- data/vendor/pygments-main/pygments/lexers/dax.py +2 -3
- data/vendor/pygments-main/pygments/lexers/devicetree.py +2 -3
- data/vendor/pygments-main/pygments/lexers/diff.py +7 -6
- data/vendor/pygments-main/pygments/lexers/dns.py +109 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +19 -14
- data/vendor/pygments-main/pygments/lexers/dsls.py +24 -35
- data/vendor/pygments-main/pygments/lexers/dylan.py +8 -16
- data/vendor/pygments-main/pygments/lexers/ecl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/eiffel.py +3 -4
- data/vendor/pygments-main/pygments/lexers/elm.py +3 -4
- data/vendor/pygments-main/pygments/lexers/elpi.py +28 -21
- data/vendor/pygments-main/pygments/lexers/email.py +3 -3
- data/vendor/pygments-main/pygments/lexers/erlang.py +22 -24
- data/vendor/pygments-main/pygments/lexers/esoteric.py +11 -12
- data/vendor/pygments-main/pygments/lexers/ezhil.py +2 -3
- data/vendor/pygments-main/pygments/lexers/factor.py +2 -3
- data/vendor/pygments-main/pygments/lexers/fantom.py +3 -3
- data/vendor/pygments-main/pygments/lexers/felix.py +9 -10
- data/vendor/pygments-main/pygments/lexers/fift.py +2 -1
- data/vendor/pygments-main/pygments/lexers/floscript.py +2 -3
- data/vendor/pygments-main/pygments/lexers/forth.py +2 -3
- data/vendor/pygments-main/pygments/lexers/fortran.py +6 -7
- data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
- data/vendor/pygments-main/pygments/lexers/freefem.py +2 -3
- data/vendor/pygments-main/pygments/lexers/func.py +3 -1
- data/vendor/pygments-main/pygments/lexers/functional.py +2 -1
- data/vendor/pygments-main/pygments/lexers/futhark.py +6 -7
- data/vendor/pygments-main/pygments/lexers/gcodelexer.py +3 -3
- data/vendor/pygments-main/pygments/lexers/gdscript.py +2 -1
- data/vendor/pygments-main/pygments/lexers/go.py +3 -4
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +6 -9
- data/vendor/pygments-main/pygments/lexers/graph.py +12 -9
- data/vendor/pygments-main/pygments/lexers/graphics.py +13 -17
- data/vendor/pygments-main/pygments/lexers/graphql.py +176 -0
- data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -3
- data/vendor/pygments-main/pygments/lexers/gsql.py +2 -3
- data/vendor/pygments-main/pygments/lexers/haskell.py +27 -32
- data/vendor/pygments-main/pygments/lexers/haxe.py +3 -5
- data/vendor/pygments-main/pygments/lexers/hdl.py +8 -7
- data/vendor/pygments-main/pygments/lexers/hexdump.py +3 -3
- data/vendor/pygments-main/pygments/lexers/html.py +34 -13
- data/vendor/pygments-main/pygments/lexers/idl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/igor.py +305 -290
- data/vendor/pygments-main/pygments/lexers/inferno.py +2 -3
- data/vendor/pygments-main/pygments/lexers/installers.py +7 -9
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +150 -162
- data/vendor/pygments-main/pygments/lexers/iolang.py +2 -3
- data/vendor/pygments-main/pygments/lexers/j.py +2 -3
- data/vendor/pygments-main/pygments/lexers/javascript.py +18 -19
- data/vendor/pygments-main/pygments/lexers/jmespath.py +2 -1
- data/vendor/pygments-main/pygments/lexers/jslt.py +2 -3
- data/vendor/pygments-main/pygments/lexers/jsonnet.py +4 -3
- data/vendor/pygments-main/pygments/lexers/jsx.py +75 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +4 -5
- data/vendor/pygments-main/pygments/lexers/jvm.py +98 -116
- data/vendor/pygments-main/pygments/lexers/kuin.py +2 -3
- data/vendor/pygments-main/pygments/lexers/kusto.py +93 -0
- data/vendor/pygments-main/pygments/lexers/ldap.py +155 -0
- data/vendor/pygments-main/pygments/lexers/lean.py +241 -0
- data/vendor/pygments-main/pygments/lexers/lilypond.py +2 -3
- data/vendor/pygments-main/pygments/lexers/lisp.py +373 -65
- data/vendor/pygments-main/pygments/lexers/macaulay2.py +53 -4
- data/vendor/pygments-main/pygments/lexers/make.py +7 -5
- data/vendor/pygments-main/pygments/lexers/markup.py +242 -91
- data/vendor/pygments-main/pygments/lexers/math.py +2 -1
- data/vendor/pygments-main/pygments/lexers/matlab.py +10 -12
- data/vendor/pygments-main/pygments/lexers/maxima.py +2 -3
- data/vendor/pygments-main/pygments/lexers/meson.py +2 -3
- data/vendor/pygments-main/pygments/lexers/mime.py +4 -4
- data/vendor/pygments-main/pygments/lexers/minecraft.py +24 -27
- data/vendor/pygments-main/pygments/lexers/mips.py +3 -1
- data/vendor/pygments-main/pygments/lexers/ml.py +59 -61
- data/vendor/pygments-main/pygments/lexers/modeling.py +19 -22
- data/vendor/pygments-main/pygments/lexers/modula2.py +2 -3
- data/vendor/pygments-main/pygments/lexers/mojo.py +704 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +2 -3
- data/vendor/pygments-main/pygments/lexers/mosel.py +3 -3
- data/vendor/pygments-main/pygments/lexers/ncl.py +4 -3
- data/vendor/pygments-main/pygments/lexers/nimrod.py +7 -8
- data/vendor/pygments-main/pygments/lexers/nit.py +2 -3
- data/vendor/pygments-main/pygments/lexers/nix.py +40 -31
- data/vendor/pygments-main/pygments/lexers/oberon.py +3 -3
- data/vendor/pygments-main/pygments/lexers/objective.py +14 -6
- data/vendor/pygments-main/pygments/lexers/ooc.py +2 -3
- data/vendor/pygments-main/pygments/lexers/openscad.py +96 -0
- data/vendor/pygments-main/pygments/lexers/other.py +2 -1
- data/vendor/pygments-main/pygments/lexers/parasail.py +2 -3
- data/vendor/pygments-main/pygments/lexers/parsers.py +41 -44
- data/vendor/pygments-main/pygments/lexers/pascal.py +6 -3
- data/vendor/pygments-main/pygments/lexers/pawn.py +5 -5
- data/vendor/pygments-main/pygments/lexers/perl.py +3 -3
- data/vendor/pygments-main/pygments/lexers/phix.py +2 -3
- data/vendor/pygments-main/pygments/lexers/php.py +4 -5
- data/vendor/pygments-main/pygments/lexers/pointless.py +2 -3
- data/vendor/pygments-main/pygments/lexers/pony.py +3 -3
- data/vendor/pygments-main/pygments/lexers/praat.py +2 -3
- data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
- data/vendor/pygments-main/pygments/lexers/prolog.py +23 -9
- data/vendor/pygments-main/pygments/lexers/promql.py +2 -1
- data/vendor/pygments-main/pygments/lexers/prql.py +251 -0
- data/vendor/pygments-main/pygments/lexers/ptx.py +119 -0
- data/vendor/pygments-main/pygments/lexers/python.py +24 -24
- data/vendor/pygments-main/pygments/lexers/q.py +5 -6
- data/vendor/pygments-main/pygments/lexers/qlik.py +3 -3
- data/vendor/pygments-main/pygments/lexers/qvt.py +5 -3
- data/vendor/pygments-main/pygments/lexers/r.py +8 -6
- data/vendor/pygments-main/pygments/lexers/rdf.py +19 -13
- data/vendor/pygments-main/pygments/lexers/rebol.py +7 -7
- data/vendor/pygments-main/pygments/lexers/resource.py +5 -6
- data/vendor/pygments-main/pygments/lexers/ride.py +4 -5
- data/vendor/pygments-main/pygments/lexers/rita.py +2 -3
- data/vendor/pygments-main/pygments/lexers/rnc.py +2 -3
- data/vendor/pygments-main/pygments/lexers/roboconf.py +5 -5
- data/vendor/pygments-main/pygments/lexers/robotframework.py +2 -3
- data/vendor/pygments-main/pygments/lexers/ruby.py +8 -13
- data/vendor/pygments-main/pygments/lexers/rust.py +9 -10
- data/vendor/pygments-main/pygments/lexers/sas.py +3 -3
- data/vendor/pygments-main/pygments/lexers/savi.py +131 -130
- data/vendor/pygments-main/pygments/lexers/scdoc.py +13 -7
- data/vendor/pygments-main/pygments/lexers/scripting.py +354 -42
- data/vendor/pygments-main/pygments/lexers/sgf.py +2 -3
- data/vendor/pygments-main/pygments/lexers/shell.py +107 -129
- data/vendor/pygments-main/pygments/lexers/sieve.py +3 -3
- data/vendor/pygments-main/pygments/lexers/slash.py +4 -5
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +3 -5
- data/vendor/pygments-main/pygments/lexers/smithy.py +2 -3
- data/vendor/pygments-main/pygments/lexers/smv.py +3 -3
- data/vendor/pygments-main/pygments/lexers/snobol.py +3 -3
- data/vendor/pygments-main/pygments/lexers/solidity.py +3 -3
- data/vendor/pygments-main/pygments/lexers/soong.py +78 -0
- data/vendor/pygments-main/pygments/lexers/sophia.py +3 -4
- data/vendor/pygments-main/pygments/lexers/special.py +8 -3
- data/vendor/pygments-main/pygments/lexers/spice.py +15 -16
- data/vendor/pygments-main/pygments/lexers/sql.py +24 -18
- data/vendor/pygments-main/pygments/lexers/srcinfo.py +3 -3
- data/vendor/pygments-main/pygments/lexers/stata.py +2 -3
- data/vendor/pygments-main/pygments/lexers/supercollider.py +2 -3
- data/vendor/pygments-main/pygments/lexers/tact.py +303 -0
- data/vendor/pygments-main/pygments/lexers/tal.py +13 -10
- data/vendor/pygments-main/pygments/lexers/tcl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/teal.py +2 -3
- data/vendor/pygments-main/pygments/lexers/templates.py +131 -72
- data/vendor/pygments-main/pygments/lexers/teraterm.py +2 -3
- data/vendor/pygments-main/pygments/lexers/testing.py +4 -5
- data/vendor/pygments-main/pygments/lexers/text.py +2 -1
- data/vendor/pygments-main/pygments/lexers/textedit.py +9 -6
- data/vendor/pygments-main/pygments/lexers/textfmts.py +20 -15
- data/vendor/pygments-main/pygments/lexers/theorem.py +41 -115
- data/vendor/pygments-main/pygments/lexers/thingsdb.py +50 -26
- data/vendor/pygments-main/pygments/lexers/tlb.py +3 -1
- data/vendor/pygments-main/pygments/lexers/tls.py +54 -0
- data/vendor/pygments-main/pygments/lexers/tnt.py +2 -3
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +3 -3
- data/vendor/pygments-main/pygments/lexers/typoscript.py +6 -7
- data/vendor/pygments-main/pygments/lexers/typst.py +104 -0
- data/vendor/pygments-main/pygments/lexers/ul4.py +47 -5
- data/vendor/pygments-main/pygments/lexers/unicon.py +9 -7
- data/vendor/pygments-main/pygments/lexers/urbi.py +3 -3
- data/vendor/pygments-main/pygments/lexers/usd.py +6 -11
- data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
- data/vendor/pygments-main/pygments/lexers/verification.py +4 -5
- data/vendor/pygments-main/pygments/lexers/verifpal.py +65 -0
- data/vendor/pygments-main/pygments/lexers/vip.py +150 -0
- data/vendor/pygments-main/pygments/lexers/vyper.py +140 -0
- data/vendor/pygments-main/pygments/lexers/web.py +2 -1
- data/vendor/pygments-main/pygments/lexers/webassembly.py +2 -3
- data/vendor/pygments-main/pygments/lexers/webidl.py +2 -3
- data/vendor/pygments-main/pygments/lexers/webmisc.py +11 -15
- data/vendor/pygments-main/pygments/lexers/wgsl.py +6 -7
- data/vendor/pygments-main/pygments/lexers/whiley.py +2 -3
- data/vendor/pygments-main/pygments/lexers/wowtoc.py +3 -3
- data/vendor/pygments-main/pygments/lexers/wren.py +3 -4
- data/vendor/pygments-main/pygments/lexers/x10.py +6 -7
- data/vendor/pygments-main/pygments/lexers/xorg.py +2 -1
- data/vendor/pygments-main/pygments/lexers/yang.py +2 -3
- data/vendor/pygments-main/pygments/lexers/yara.py +69 -0
- data/vendor/pygments-main/pygments/lexers/zig.py +2 -1
- data/vendor/pygments-main/pygments/modeline.py +4 -4
- data/vendor/pygments-main/pygments/plugin.py +3 -19
- data/vendor/pygments-main/pygments/regexopt.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/sphinxext.py +38 -8
- data/vendor/pygments-main/pygments/style.py +8 -2
- data/vendor/pygments-main/pygments/styles/__init__.py +17 -59
- data/vendor/pygments-main/pygments/styles/_mapping.py +54 -0
- data/vendor/pygments-main/pygments/styles/abap.py +5 -1
- data/vendor/pygments-main/pygments/styles/algol.py +5 -1
- data/vendor/pygments-main/pygments/styles/algol_nu.py +5 -1
- data/vendor/pygments-main/pygments/styles/arduino.py +76 -72
- data/vendor/pygments-main/pygments/styles/autumn.py +6 -1
- data/vendor/pygments-main/pygments/styles/borland.py +6 -1
- data/vendor/pygments-main/pygments/styles/bw.py +6 -1
- data/vendor/pygments-main/pygments/styles/coffee.py +80 -0
- data/vendor/pygments-main/pygments/styles/colorful.py +6 -1
- data/vendor/pygments-main/pygments/styles/default.py +6 -1
- data/vendor/pygments-main/pygments/styles/dracula.py +68 -80
- data/vendor/pygments-main/pygments/styles/emacs.py +6 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +6 -1
- data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +6 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +7 -1
- data/vendor/pygments-main/pygments/styles/gh_dark.py +7 -1
- data/vendor/pygments-main/pygments/styles/gruvbox.py +10 -1
- data/vendor/pygments-main/pygments/styles/igor.py +6 -1
- data/vendor/pygments-main/pygments/styles/inkpot.py +7 -2
- data/vendor/pygments-main/pygments/styles/lightbulb.py +110 -0
- data/vendor/pygments-main/pygments/styles/lilypond.py +8 -2
- data/vendor/pygments-main/pygments/styles/lovelace.py +16 -10
- data/vendor/pygments-main/pygments/styles/manni.py +7 -2
- data/vendor/pygments-main/pygments/styles/material.py +21 -14
- data/vendor/pygments-main/pygments/styles/monokai.py +16 -10
- data/vendor/pygments-main/pygments/styles/murphy.py +7 -2
- data/vendor/pygments-main/pygments/styles/native.py +10 -5
- data/vendor/pygments-main/pygments/styles/nord.py +9 -3
- data/vendor/pygments-main/pygments/styles/onedark.py +6 -2
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +7 -2
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +7 -2
- data/vendor/pygments-main/pygments/styles/pastie.py +7 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +7 -1
- data/vendor/pygments-main/pygments/styles/rainbow_dash.py +26 -19
- data/vendor/pygments-main/pygments/styles/rrt.py +8 -2
- data/vendor/pygments-main/pygments/styles/sas.py +6 -1
- data/vendor/pygments-main/pygments/styles/solarized.py +9 -1
- data/vendor/pygments-main/pygments/styles/staroffice.py +6 -1
- data/vendor/pygments-main/pygments/styles/stata_dark.py +6 -2
- data/vendor/pygments-main/pygments/styles/stata_light.py +6 -1
- data/vendor/pygments-main/pygments/styles/tango.py +7 -3
- data/vendor/pygments-main/pygments/styles/trac.py +7 -1
- data/vendor/pygments-main/pygments/styles/vim.py +7 -1
- data/vendor/pygments-main/pygments/styles/vs.py +7 -2
- data/vendor/pygments-main/pygments/styles/xcode.py +6 -1
- data/vendor/pygments-main/pygments/styles/zenburn.py +6 -1
- data/vendor/pygments-main/pygments/token.py +2 -1
- data/vendor/pygments-main/pygments/unistring.py +5 -5
- data/vendor/pygments-main/pygments/util.py +13 -19
- data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/METADATA +14 -13
- data/vendor/pygments-main/pygments-2.18.0.dist-info/RECORD +663 -0
- data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/WHEEL +1 -2
- data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/AUTHORS +13 -0
- metadata +41 -17
- data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +0 -614
- data/vendor/pygments-main/Pygments-2.15.1.dist-info/top_level.txt +0 -1
- /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/INSTALLER +0 -0
- /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/REQUESTED +0 -0
- /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/entry_points.txt +0 -0
- /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 various shells.
|
6
6
|
|
7
|
-
:copyright: Copyright 2006-
|
7
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
8
8
|
:license: BSD, see LICENSE for details.
|
9
9
|
"""
|
10
10
|
|
@@ -25,18 +25,18 @@ __all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer',
|
|
25
25
|
class BashLexer(RegexLexer):
|
26
26
|
"""
|
27
27
|
Lexer for (ba|k|z|)sh shell scripts.
|
28
|
-
|
29
|
-
.. versionadded:: 0.6
|
30
28
|
"""
|
31
29
|
|
32
30
|
name = 'Bash'
|
33
|
-
aliases = ['bash', 'sh', 'ksh', 'zsh', 'shell']
|
31
|
+
aliases = ['bash', 'sh', 'ksh', 'zsh', 'shell', 'openrc']
|
34
32
|
filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass',
|
35
33
|
'*.exheres-0', '*.exlib', '*.zsh',
|
36
34
|
'.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc',
|
37
35
|
'.kshrc', 'kshrc',
|
38
36
|
'PKGBUILD']
|
39
37
|
mimetypes = ['application/x-sh', 'application/x-shellscript', 'text/x-shellscript']
|
38
|
+
url = 'https://en.wikipedia.org/wiki/Unix_shell'
|
39
|
+
version_added = '0.6'
|
40
40
|
|
41
41
|
tokens = {
|
42
42
|
'root': [
|
@@ -129,14 +129,13 @@ class BashLexer(RegexLexer):
|
|
129
129
|
class SlurmBashLexer(BashLexer):
|
130
130
|
"""
|
131
131
|
Lexer for (ba|k|z|)sh Slurm scripts.
|
132
|
-
|
133
|
-
.. versionadded:: 2.4
|
134
132
|
"""
|
135
133
|
|
136
134
|
name = 'Slurm'
|
137
135
|
aliases = ['slurm', 'sbatch']
|
138
136
|
filenames = ['*.sl']
|
139
137
|
mimetypes = []
|
138
|
+
version_added = '2.4'
|
140
139
|
EXTRA_KEYWORDS = {'srun'}
|
141
140
|
|
142
141
|
def get_tokens_unprocessed(self, text):
|
@@ -225,14 +224,14 @@ class BashSessionLexer(ShellSessionBaseLexer):
|
|
225
224
|
"""
|
226
225
|
Lexer for Bash shell sessions, i.e. command lines, including a
|
227
226
|
prompt, interspersed with output.
|
228
|
-
|
229
|
-
.. versionadded:: 1.1
|
230
227
|
"""
|
231
228
|
|
232
229
|
name = 'Bash Session'
|
233
230
|
aliases = ['console', 'shell-session']
|
234
231
|
filenames = ['*.sh-session', '*.shell-session']
|
235
232
|
mimetypes = ['application/x-shell-session', 'application/x-sh-session']
|
233
|
+
url = 'https://en.wikipedia.org/wiki/Unix_shell'
|
234
|
+
version_added = '1.1'
|
236
235
|
|
237
236
|
_innerLexerCls = BashLexer
|
238
237
|
_ps1rgx = re.compile(
|
@@ -244,13 +243,13 @@ class BashSessionLexer(ShellSessionBaseLexer):
|
|
244
243
|
class BatchLexer(RegexLexer):
|
245
244
|
"""
|
246
245
|
Lexer for the DOS/Windows Batch file format.
|
247
|
-
|
248
|
-
.. versionadded:: 0.7
|
249
246
|
"""
|
250
247
|
name = 'Batchfile'
|
251
248
|
aliases = ['batch', 'bat', 'dosbatch', 'winbatch']
|
252
249
|
filenames = ['*.bat', '*.cmd']
|
253
250
|
mimetypes = ['application/x-dos-batch']
|
251
|
+
url = 'https://en.wikipedia.org/wiki/Batch_file'
|
252
|
+
version_added = '0.7'
|
254
253
|
|
255
254
|
flags = re.MULTILINE | re.IGNORECASE
|
256
255
|
|
@@ -258,28 +257,25 @@ class BatchLexer(RegexLexer):
|
|
258
257
|
_punct = r'&<>|'
|
259
258
|
_ws = r'\t\v\f\r ,;=\xa0'
|
260
259
|
_nlws = r'\s\x1a\xa0,;='
|
261
|
-
_space =
|
262
|
-
_keyword_terminator = (
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
_number = r'(?:-?(?:0[0-7]+|0x[\da-f]+|\d+)%s)' % _token_terminator
|
260
|
+
_space = rf'(?:(?:(?:\^[{_nl}])?[{_ws}])+)'
|
261
|
+
_keyword_terminator = (rf'(?=(?:\^[{_nl}]?)?[{_ws}+./:[\\\]]|[{_nl}{_punct}(])')
|
262
|
+
_token_terminator = rf'(?=\^?[{_ws}]|[{_punct}{_nl}])'
|
263
|
+
_start_label = rf'((?:(?<=^[^:])|^[^:]?)[{_ws}]*)(:)'
|
264
|
+
_label = rf'(?:(?:[^{_nlws}{_punct}+:^]|\^[{_nl}]?[\w\W])*)'
|
265
|
+
_label_compound = rf'(?:(?:[^{_nlws}{_punct}+:^)]|\^[{_nl}]?[^)])*)'
|
266
|
+
_number = rf'(?:-?(?:0[0-7]+|0x[\da-f]+|\d+){_token_terminator})'
|
269
267
|
_opword = r'(?:equ|geq|gtr|leq|lss|neq)'
|
270
|
-
_string =
|
271
|
-
_variable = (r'(?:(
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
_stoken = (r'(?:[%s]+|(?:%s|%s|%s)+)' %
|
282
|
-
(_punct, _string, _variable, _core_token))
|
268
|
+
_string = rf'(?:"[^{_nl}"]*(?:"|(?=[{_nl}])))'
|
269
|
+
_variable = (r'(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|'
|
270
|
+
rf'[^%:{_nl}]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%{_nl}^]|'
|
271
|
+
rf'\^[^%{_nl}])[^={_nl}]*=(?:[^%{_nl}^]|\^[^%{_nl}])*)?)?%))|'
|
272
|
+
rf'(?:\^?![^!:{_nl}]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:'
|
273
|
+
rf'[^!{_nl}^]|\^[^!{_nl}])[^={_nl}]*=(?:[^!{_nl}^]|\^[^!{_nl}])*)?)?\^?!))')
|
274
|
+
_core_token = rf'(?:(?:(?:\^[{_nl}]?)?[^"{_nlws}{_punct}])+)'
|
275
|
+
_core_token_compound = rf'(?:(?:(?:\^[{_nl}]?)?[^"{_nlws}{_punct})])+)'
|
276
|
+
_token = rf'(?:[{_punct}]+|{_core_token})'
|
277
|
+
_token_compound = rf'(?:[{_punct}]+|{_core_token_compound})'
|
278
|
+
_stoken = (rf'(?:[{_punct}]+|(?:{_string}|{_variable}|{_core_token})+)')
|
283
279
|
|
284
280
|
def _make_begin_state(compound, _core_token=_core_token,
|
285
281
|
_core_token_compound=_core_token_compound,
|
@@ -288,81 +284,71 @@ class BatchLexer(RegexLexer):
|
|
288
284
|
_space=_space, _start_label=_start_label,
|
289
285
|
_stoken=_stoken, _token_terminator=_token_terminator,
|
290
286
|
_variable=_variable, _ws=_ws):
|
291
|
-
rest = '(
|
287
|
+
rest = '(?:{}|{}|[^"%{}{}{}])*'.format(_string, _variable, _nl, _punct,
|
292
288
|
')' if compound else '')
|
293
|
-
rest_of_line =
|
294
|
-
rest_of_line_compound =
|
295
|
-
set_space =
|
289
|
+
rest_of_line = rf'(?:(?:[^{_nl}^]|\^[{_nl}]?[\w\W])*)'
|
290
|
+
rest_of_line_compound = rf'(?:(?:[^{_nl}^)]|\^[{_nl}]?[^)])*)'
|
291
|
+
set_space = rf'((?:(?:\^[{_nl}]?)?[^\S\n])*)'
|
296
292
|
suffix = ''
|
297
293
|
if compound:
|
298
|
-
_keyword_terminator =
|
299
|
-
_token_terminator =
|
294
|
+
_keyword_terminator = rf'(?:(?=\))|{_keyword_terminator})'
|
295
|
+
_token_terminator = rf'(?:(?=\))|{_token_terminator})'
|
300
296
|
suffix = '/compound'
|
301
297
|
return [
|
302
298
|
((r'\)', Punctuation, '#pop') if compound else
|
303
|
-
(
|
299
|
+
(rf'\)((?=\()|{_token_terminator}){rest_of_line}',
|
304
300
|
Comment.Single)),
|
305
|
-
(
|
301
|
+
(rf'(?={_start_label})', Text, f'follow{suffix}'),
|
306
302
|
(_space, using(this, state='text')),
|
307
|
-
include('redirect
|
308
|
-
(
|
303
|
+
include(f'redirect{suffix}'),
|
304
|
+
(rf'[{_nl}]+', Text),
|
309
305
|
(r'\(', Punctuation, 'root/compound'),
|
310
306
|
(r'@+', Punctuation),
|
311
|
-
(
|
312
|
-
|
313
|
-
(_nl, _token_terminator, _space,
|
314
|
-
_core_token_compound if compound else _core_token, _nl, _nl),
|
307
|
+
(rf'((?:for|if|rem)(?:(?=(?:\^[{_nl}]?)?/)|(?:(?!\^)|'
|
308
|
+
rf'(?<=m))(?:(?=\()|{_token_terminator})))({_space}?{_core_token_compound if compound else _core_token}?(?:\^[{_nl}]?)?/(?:\^[{_nl}]?)?\?)',
|
315
309
|
bygroups(Keyword, using(this, state='text')),
|
316
|
-
'follow
|
317
|
-
(
|
318
|
-
(_keyword_terminator, rest, _nl, _nl, rest),
|
310
|
+
f'follow{suffix}'),
|
311
|
+
(rf'(goto{_keyword_terminator})({rest}(?:\^[{_nl}]?)?/(?:\^[{_nl}]?)?\?{rest})',
|
319
312
|
bygroups(Keyword, using(this, state='text')),
|
320
|
-
'follow
|
313
|
+
f'follow{suffix}'),
|
321
314
|
(words(('assoc', 'break', 'cd', 'chdir', 'cls', 'color', 'copy',
|
322
315
|
'date', 'del', 'dir', 'dpath', 'echo', 'endlocal', 'erase',
|
323
316
|
'exit', 'ftype', 'keys', 'md', 'mkdir', 'mklink', 'move',
|
324
317
|
'path', 'pause', 'popd', 'prompt', 'pushd', 'rd', 'ren',
|
325
318
|
'rename', 'rmdir', 'setlocal', 'shift', 'start', 'time',
|
326
319
|
'title', 'type', 'ver', 'verify', 'vol'),
|
327
|
-
suffix=_keyword_terminator), Keyword, 'follow
|
328
|
-
(
|
320
|
+
suffix=_keyword_terminator), Keyword, f'follow{suffix}'),
|
321
|
+
(rf'(call)({_space}?)(:)',
|
329
322
|
bygroups(Keyword, using(this, state='text'), Punctuation),
|
330
|
-
'call
|
331
|
-
(
|
332
|
-
(
|
333
|
-
(_token_terminator, _space, _token_terminator),
|
323
|
+
f'call{suffix}'),
|
324
|
+
(rf'call{_keyword_terminator}', Keyword),
|
325
|
+
(rf'(for{_token_terminator}(?!\^))({_space})(/f{_token_terminator})',
|
334
326
|
bygroups(Keyword, using(this, state='text'), Keyword),
|
335
327
|
('for/f', 'for')),
|
336
|
-
(
|
337
|
-
(_token_terminator, _space, _token_terminator),
|
328
|
+
(rf'(for{_token_terminator}(?!\^))({_space})(/l{_token_terminator})',
|
338
329
|
bygroups(Keyword, using(this, state='text'), Keyword),
|
339
330
|
('for/l', 'for')),
|
340
|
-
(
|
341
|
-
(
|
331
|
+
(rf'for{_token_terminator}(?!\^)', Keyword, ('for2', 'for')),
|
332
|
+
(rf'(goto{_keyword_terminator})({_space}?)(:?)',
|
342
333
|
bygroups(Keyword, using(this, state='text'), Punctuation),
|
343
|
-
'label
|
344
|
-
(
|
345
|
-
(_token_terminator, _space, _token_terminator, _space,
|
346
|
-
_token_terminator, _space),
|
334
|
+
f'label{suffix}'),
|
335
|
+
(rf'(if(?:(?=\()|{_token_terminator})(?!\^))({_space}?)((?:/i{_token_terminator})?)({_space}?)((?:not{_token_terminator})?)({_space}?)',
|
347
336
|
bygroups(Keyword, using(this, state='text'), Keyword,
|
348
337
|
using(this, state='text'), Keyword,
|
349
338
|
using(this, state='text')), ('(?', 'if')),
|
350
|
-
(
|
351
|
-
|
352
|
-
|
353
|
-
Comment.Single, 'follow%s' % suffix),
|
354
|
-
(r'(set%s)%s(/a)' % (_keyword_terminator, set_space),
|
339
|
+
(rf'rem(((?=\()|{_token_terminator}){_space}?{_stoken}?.*|{_keyword_terminator}{rest_of_line_compound if compound else rest_of_line})',
|
340
|
+
Comment.Single, f'follow{suffix}'),
|
341
|
+
(rf'(set{_keyword_terminator}){set_space}(/a)',
|
355
342
|
bygroups(Keyword, using(this, state='text'), Keyword),
|
356
|
-
'arithmetic
|
357
|
-
(r'(set
|
358
|
-
r'\^[
|
359
|
-
(_keyword_terminator, set_space, set_space, _nl, _nl, _punct,
|
343
|
+
f'arithmetic{suffix}'),
|
344
|
+
(r'(set{}){}((?:/p)?){}((?:(?:(?:\^[{}]?)?[^"{}{}^={}]|'
|
345
|
+
r'\^[{}]?[^"=])+)?)((?:(?:\^[{}]?)?=)?)'.format(_keyword_terminator, set_space, set_space, _nl, _nl, _punct,
|
360
346
|
')' if compound else '', _nl, _nl),
|
361
347
|
bygroups(Keyword, using(this, state='text'), Keyword,
|
362
348
|
using(this, state='text'), using(this, state='variable'),
|
363
349
|
Punctuation),
|
364
|
-
'follow
|
365
|
-
default('follow
|
350
|
+
f'follow{suffix}'),
|
351
|
+
default(f'follow{suffix}')
|
366
352
|
]
|
367
353
|
|
368
354
|
def _make_follow_state(compound, _label=_label,
|
@@ -375,11 +361,10 @@ class BatchLexer(RegexLexer):
|
|
375
361
|
if compound:
|
376
362
|
state.append((r'(?=\))', Text, '#pop'))
|
377
363
|
state += [
|
378
|
-
(
|
379
|
-
(_start_label, _ws, _label_compound if compound else _label),
|
364
|
+
(rf'{_start_label}([{_ws}]*)({_label_compound if compound else _label})(.*)',
|
380
365
|
bygroups(Text, Punctuation, Text, Name.Label, Comment.Single)),
|
381
|
-
include('redirect
|
382
|
-
(
|
366
|
+
include(f'redirect{suffix}'),
|
367
|
+
(rf'(?=[{_nl}])', Text, '#pop'),
|
383
368
|
(r'\|\|?|&&?', Punctuation, '#pop'),
|
384
369
|
include('text')
|
385
370
|
]
|
@@ -397,9 +382,8 @@ class BatchLexer(RegexLexer):
|
|
397
382
|
(r'0x[\da-f]+', Number.Hex),
|
398
383
|
(r'\d+', Number.Integer),
|
399
384
|
(r'[(),]+', Punctuation),
|
400
|
-
(
|
401
|
-
(r'(
|
402
|
-
(_string, _variable, _nl, op, _nlws, _punct, _nlws,
|
385
|
+
(rf'([{op}]|%|\^\^)+', Operator),
|
386
|
+
(r'({}|{}|(\^[{}]?)?[^(){}%\^"{}{}]|\^[{}]?{})+'.format(_string, _variable, _nl, op, _nlws, _punct, _nlws,
|
403
387
|
r'[^)]' if compound else r'[\w\W]'),
|
404
388
|
using(this, state='variable')),
|
405
389
|
(r'(?=[\x00|&])', Text, '#pop'),
|
@@ -422,8 +406,7 @@ class BatchLexer(RegexLexer):
|
|
422
406
|
state = []
|
423
407
|
if compound:
|
424
408
|
state.append((r'(?=\))', Text, '#pop'))
|
425
|
-
state.append((r'(
|
426
|
-
(_label_compound if compound else _label, _string,
|
409
|
+
state.append((r'({}?)((?:{}|{}|\^[{}]?{}|[^"%^{}{}{}])*)'.format(_label_compound if compound else _label, _string,
|
427
410
|
_variable, _nl, r'[^)]' if compound else r'[\w\W]', _nl,
|
428
411
|
_punct, r')' if compound else ''),
|
429
412
|
bygroups(Name.Label, Comment.Single), '#pop'))
|
@@ -434,14 +417,11 @@ class BatchLexer(RegexLexer):
|
|
434
417
|
_nl=_nl, _punct=_punct, _stoken=_stoken,
|
435
418
|
_string=_string, _space=_space,
|
436
419
|
_variable=_variable, _nlws=_nlws):
|
437
|
-
stoken_compound = (
|
438
|
-
(_punct, _string, _variable, _core_token_compound))
|
420
|
+
stoken_compound = (rf'(?:[{_punct}]+|(?:{_string}|{_variable}|{_core_token_compound})+)')
|
439
421
|
return [
|
440
|
-
(
|
441
|
-
(_nlws, _nlws),
|
422
|
+
(rf'((?:(?<=[{_nlws}])\d)?)(>>?&|<&)([{_nlws}]*)(\d)',
|
442
423
|
bygroups(Number.Integer, Punctuation, Text, Number.Integer)),
|
443
|
-
(
|
444
|
-
(_nlws, _nl, _space, stoken_compound if compound else _stoken),
|
424
|
+
(rf'((?:(?<=[{_nlws}])(?<!\^[{_nl}])\d)?)(>>?|<)({_space}?{stoken_compound if compound else _stoken})',
|
445
425
|
bygroups(Number.Integer, Punctuation, using(this, state='text')))
|
446
426
|
]
|
447
427
|
|
@@ -460,13 +440,13 @@ class BatchLexer(RegexLexer):
|
|
460
440
|
'redirect/compound': _make_redirect_state(True),
|
461
441
|
'variable-or-escape': [
|
462
442
|
(_variable, Name.Variable),
|
463
|
-
(
|
443
|
+
(rf'%%|\^[{_nl}]?(\^!|[\w\W])', String.Escape)
|
464
444
|
],
|
465
445
|
'string': [
|
466
446
|
(r'"', String.Double, '#pop'),
|
467
447
|
(_variable, Name.Variable),
|
468
448
|
(r'\^!|%%', String.Escape),
|
469
|
-
(
|
449
|
+
(rf'[^"%^{_nl}]+|[%^]', String.Double),
|
470
450
|
default('#pop')
|
471
451
|
],
|
472
452
|
'sqstring': [
|
@@ -480,34 +460,34 @@ class BatchLexer(RegexLexer):
|
|
480
460
|
'text': [
|
481
461
|
(r'"', String.Double, 'string'),
|
482
462
|
include('variable-or-escape'),
|
483
|
-
(
|
463
|
+
(rf'[^"%^{_nlws}{_punct}\d)]+|.', Text)
|
484
464
|
],
|
485
465
|
'variable': [
|
486
466
|
(r'"', String.Double, 'string'),
|
487
467
|
include('variable-or-escape'),
|
488
|
-
(
|
468
|
+
(rf'[^"%^{_nl}]+|.', Name.Variable)
|
489
469
|
],
|
490
470
|
'for': [
|
491
|
-
(
|
471
|
+
(rf'({_space})(in)({_space})(\()',
|
492
472
|
bygroups(using(this, state='text'), Keyword,
|
493
473
|
using(this, state='text'), Punctuation), '#pop'),
|
494
474
|
include('follow')
|
495
475
|
],
|
496
476
|
'for2': [
|
497
477
|
(r'\)', Punctuation),
|
498
|
-
(
|
478
|
+
(rf'({_space})(do{_token_terminator})',
|
499
479
|
bygroups(using(this, state='text'), Keyword), '#pop'),
|
500
|
-
(
|
480
|
+
(rf'[{_nl}]+', Text),
|
501
481
|
include('follow')
|
502
482
|
],
|
503
483
|
'for/f': [
|
504
|
-
(
|
484
|
+
(rf'(")((?:{_variable}|[^"])*?")([{_nlws}]*)(\))',
|
505
485
|
bygroups(String.Double, using(this, state='string'), Text,
|
506
486
|
Punctuation)),
|
507
487
|
(r'"', String.Double, ('#pop', 'for2', 'string')),
|
508
|
-
(
|
488
|
+
(rf"('(?:%%|{_variable}|[\w\W])*?')([{_nlws}]*)(\))",
|
509
489
|
bygroups(using(this, state='sqstring'), Text, Punctuation)),
|
510
|
-
(
|
490
|
+
(rf'(`(?:%%|{_variable}|[\w\W])*?`)([{_nlws}]*)(\))',
|
511
491
|
bygroups(using(this, state='bqstring'), Text, Punctuation)),
|
512
492
|
include('for2')
|
513
493
|
],
|
@@ -516,25 +496,24 @@ class BatchLexer(RegexLexer):
|
|
516
496
|
include('for2')
|
517
497
|
],
|
518
498
|
'if': [
|
519
|
-
(
|
520
|
-
(_token_terminator, _space),
|
499
|
+
(rf'((?:cmdextversion|errorlevel){_token_terminator})({_space})(\d+)',
|
521
500
|
bygroups(Keyword, using(this, state='text'),
|
522
501
|
Number.Integer), '#pop'),
|
523
|
-
(
|
502
|
+
(rf'(defined{_token_terminator})({_space})({_stoken})',
|
524
503
|
bygroups(Keyword, using(this, state='text'),
|
525
504
|
using(this, state='variable')), '#pop'),
|
526
|
-
(
|
505
|
+
(rf'(exist{_token_terminator})({_space}{_stoken})',
|
527
506
|
bygroups(Keyword, using(this, state='text')), '#pop'),
|
528
|
-
(
|
507
|
+
(rf'({_number}{_space})({_opword})({_space}{_number})',
|
529
508
|
bygroups(using(this, state='arithmetic'), Operator.Word,
|
530
509
|
using(this, state='arithmetic')), '#pop'),
|
531
510
|
(_stoken, using(this, state='text'), ('#pop', 'if2')),
|
532
511
|
],
|
533
512
|
'if2': [
|
534
|
-
(
|
513
|
+
(rf'({_space}?)(==)({_space}?{_stoken})',
|
535
514
|
bygroups(using(this, state='text'), Operator,
|
536
515
|
using(this, state='text')), '#pop'),
|
537
|
-
(
|
516
|
+
(rf'({_space})({_opword})({_space}{_stoken})',
|
538
517
|
bygroups(using(this, state='text'), Operator.Word,
|
539
518
|
using(this, state='text')), '#pop')
|
540
519
|
],
|
@@ -545,7 +524,7 @@ class BatchLexer(RegexLexer):
|
|
545
524
|
],
|
546
525
|
'else?': [
|
547
526
|
(_space, using(this, state='text')),
|
548
|
-
(
|
527
|
+
(rf'else{_token_terminator}', Keyword, '#pop'),
|
549
528
|
default('#pop')
|
550
529
|
]
|
551
530
|
}
|
@@ -555,14 +534,14 @@ class MSDOSSessionLexer(ShellSessionBaseLexer):
|
|
555
534
|
"""
|
556
535
|
Lexer for MS DOS shell sessions, i.e. command lines, including a
|
557
536
|
prompt, interspersed with output.
|
558
|
-
|
559
|
-
.. versionadded:: 2.1
|
560
537
|
"""
|
561
538
|
|
562
539
|
name = 'MSDOS Session'
|
563
540
|
aliases = ['doscon']
|
564
541
|
filenames = []
|
565
542
|
mimetypes = []
|
543
|
+
url = 'https://en.wikipedia.org/wiki/MS-DOS'
|
544
|
+
version_added = '2.1'
|
566
545
|
|
567
546
|
_innerLexerCls = BatchLexer
|
568
547
|
_ps1rgx = re.compile(r'^([^>]*>)(.*\n?)')
|
@@ -572,14 +551,14 @@ class MSDOSSessionLexer(ShellSessionBaseLexer):
|
|
572
551
|
class TcshLexer(RegexLexer):
|
573
552
|
"""
|
574
553
|
Lexer for tcsh scripts.
|
575
|
-
|
576
|
-
.. versionadded:: 0.10
|
577
554
|
"""
|
578
555
|
|
579
556
|
name = 'Tcsh'
|
580
557
|
aliases = ['tcsh', 'csh']
|
581
558
|
filenames = ['*.tcsh', '*.csh']
|
582
559
|
mimetypes = ['application/x-csh']
|
560
|
+
url = 'https://www.tcsh.org'
|
561
|
+
version_added = '0.10'
|
583
562
|
|
584
563
|
tokens = {
|
585
564
|
'root': [
|
@@ -641,14 +620,14 @@ class TcshSessionLexer(ShellSessionBaseLexer):
|
|
641
620
|
"""
|
642
621
|
Lexer for Tcsh sessions, i.e. command lines, including a
|
643
622
|
prompt, interspersed with output.
|
644
|
-
|
645
|
-
.. versionadded:: 2.1
|
646
623
|
"""
|
647
624
|
|
648
625
|
name = 'Tcsh Session'
|
649
626
|
aliases = ['tcshcon']
|
650
627
|
filenames = []
|
651
628
|
mimetypes = []
|
629
|
+
url = 'https://www.tcsh.org'
|
630
|
+
version_added = '2.1'
|
652
631
|
|
653
632
|
_innerLexerCls = TcshLexer
|
654
633
|
_ps1rgx = re.compile(r'^([^>]+>)(.*\n?)')
|
@@ -658,13 +637,13 @@ class TcshSessionLexer(ShellSessionBaseLexer):
|
|
658
637
|
class PowerShellLexer(RegexLexer):
|
659
638
|
"""
|
660
639
|
For Windows PowerShell code.
|
661
|
-
|
662
|
-
.. versionadded:: 1.5
|
663
640
|
"""
|
664
641
|
name = 'PowerShell'
|
665
642
|
aliases = ['powershell', 'pwsh', 'posh', 'ps1', 'psm1']
|
666
643
|
filenames = ['*.ps1', '*.psm1']
|
667
644
|
mimetypes = ['text/x-powershell']
|
645
|
+
url = 'https://learn.microsoft.com/en-us/powershell'
|
646
|
+
version_added = '1.5'
|
668
647
|
|
669
648
|
flags = re.DOTALL | re.IGNORECASE | re.MULTILINE
|
670
649
|
|
@@ -721,7 +700,7 @@ class PowerShellLexer(RegexLexer):
|
|
721
700
|
# of '$(...)' blocks in strings
|
722
701
|
(r'\(', Punctuation, 'child'),
|
723
702
|
(r'\s+', Text),
|
724
|
-
(r'^(\s*#[#\s]*)(\.(
|
703
|
+
(r'^(\s*#[#\s]*)(\.(?:{}))([^\n]*$)'.format('|'.join(commenthelp)),
|
725
704
|
bygroups(Comment, String.Doc, Comment)),
|
726
705
|
(r'#[^\n]*?$', Comment),
|
727
706
|
(r'(<|<)#', Comment.Multiline, 'multline'),
|
@@ -733,10 +712,10 @@ class PowerShellLexer(RegexLexer):
|
|
733
712
|
(r"'([^']|'')*'", String.Single),
|
734
713
|
(r'(\$|@@|@)((global|script|private|env):)?\w+',
|
735
714
|
Name.Variable),
|
736
|
-
(r'(
|
737
|
-
(r'-(
|
738
|
-
(r'(
|
739
|
-
(r'(
|
715
|
+
(r'({})\b'.format('|'.join(keywords)), Keyword),
|
716
|
+
(r'-({})\b'.format('|'.join(operators)), Operator),
|
717
|
+
(r'({})-[a-z_]\w*\b'.format('|'.join(verbs)), Name.Builtin),
|
718
|
+
(r'({})\s'.format('|'.join(aliases_)), Name.Builtin),
|
740
719
|
(r'\[[a-z_\[][\w. `,\[\]]*\]', Name.Constant), # .net [type]s
|
741
720
|
(r'-[a-z_]\w*', Name),
|
742
721
|
(r'\w+', Name),
|
@@ -749,7 +728,7 @@ class PowerShellLexer(RegexLexer):
|
|
749
728
|
'multline': [
|
750
729
|
(r'[^#&.]+', Comment.Multiline),
|
751
730
|
(r'#(>|>)', Comment.Multiline, '#pop'),
|
752
|
-
(r'\.(
|
731
|
+
(r'\.({})'.format('|'.join(commenthelp)), String.Doc),
|
753
732
|
(r'[#&.]', Comment.Multiline),
|
754
733
|
],
|
755
734
|
'string': [
|
@@ -773,14 +752,14 @@ class PowerShellSessionLexer(ShellSessionBaseLexer):
|
|
773
752
|
"""
|
774
753
|
Lexer for PowerShell sessions, i.e. command lines, including a
|
775
754
|
prompt, interspersed with output.
|
776
|
-
|
777
|
-
.. versionadded:: 2.1
|
778
755
|
"""
|
779
756
|
|
780
757
|
name = 'PowerShell Session'
|
781
758
|
aliases = ['pwsh-session', 'ps1con']
|
782
759
|
filenames = []
|
783
760
|
mimetypes = []
|
761
|
+
url = 'https://learn.microsoft.com/en-us/powershell'
|
762
|
+
version_added = '2.1'
|
784
763
|
|
785
764
|
_innerLexerCls = PowerShellLexer
|
786
765
|
_bare_continuation = True
|
@@ -791,14 +770,14 @@ class PowerShellSessionLexer(ShellSessionBaseLexer):
|
|
791
770
|
class FishShellLexer(RegexLexer):
|
792
771
|
"""
|
793
772
|
Lexer for Fish shell scripts.
|
794
|
-
|
795
|
-
.. versionadded:: 2.1
|
796
773
|
"""
|
797
774
|
|
798
775
|
name = 'Fish'
|
799
776
|
aliases = ['fish', 'fishshell']
|
800
777
|
filenames = ['*.fish', '*.load']
|
801
778
|
mimetypes = ['application/x-fish']
|
779
|
+
url = 'https://fishshell.com'
|
780
|
+
version_added = '2.1'
|
802
781
|
|
803
782
|
tokens = {
|
804
783
|
'root': [
|
@@ -862,15 +841,14 @@ class FishShellLexer(RegexLexer):
|
|
862
841
|
|
863
842
|
class ExeclineLexer(RegexLexer):
|
864
843
|
"""
|
865
|
-
Lexer for Laurent Bercot's execline language
|
866
|
-
(https://skarnet.org/software/execline).
|
867
|
-
|
868
|
-
.. versionadded:: 2.7
|
844
|
+
Lexer for Laurent Bercot's execline language.
|
869
845
|
"""
|
870
846
|
|
871
847
|
name = 'execline'
|
872
848
|
aliases = ['execline']
|
873
849
|
filenames = ['*.exec']
|
850
|
+
url = 'https://skarnet.org/software/execline'
|
851
|
+
version_added = '2.7'
|
874
852
|
|
875
853
|
tokens = {
|
876
854
|
'root': [
|
@@ -13,7 +13,7 @@
|
|
13
13
|
https://tools.ietf.org/html/rfc5429
|
14
14
|
https://tools.ietf.org/html/rfc8580
|
15
15
|
|
16
|
-
:copyright: Copyright 2006-
|
16
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
17
17
|
:license: BSD, see LICENSE for details.
|
18
18
|
"""
|
19
19
|
|
@@ -27,12 +27,12 @@ __all__ = ["SieveLexer"]
|
|
27
27
|
class SieveLexer(RegexLexer):
|
28
28
|
"""
|
29
29
|
Lexer for sieve format.
|
30
|
-
|
31
|
-
.. versionadded:: 2.6
|
32
30
|
"""
|
33
31
|
name = 'Sieve'
|
34
32
|
filenames = ['*.siv', '*.sieve']
|
35
33
|
aliases = ['sieve']
|
34
|
+
url = 'https://en.wikipedia.org/wiki/Sieve_(mail_filtering_language)'
|
35
|
+
version_added = '2.6'
|
36
36
|
|
37
37
|
tokens = {
|
38
38
|
'root': [
|
@@ -2,10 +2,9 @@
|
|
2
2
|
pygments.lexers.slash
|
3
3
|
~~~~~~~~~~~~~~~~~~~~~
|
4
4
|
|
5
|
-
Lexer for the
|
6
|
-
language.
|
5
|
+
Lexer for the Slash programming language.
|
7
6
|
|
8
|
-
:copyright: Copyright 2006-
|
7
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
9
8
|
:license: BSD, see LICENSE for details.
|
10
9
|
"""
|
11
10
|
|
@@ -171,13 +170,13 @@ class SlashLanguageLexer(ExtendedRegexLexer):
|
|
171
170
|
class SlashLexer(DelegatingLexer):
|
172
171
|
"""
|
173
172
|
Lexer for the Slash programming language.
|
174
|
-
|
175
|
-
.. versionadded:: 2.4
|
176
173
|
"""
|
177
174
|
|
178
175
|
name = 'Slash'
|
179
176
|
aliases = ['slash']
|
180
177
|
filenames = ['*.sla']
|
178
|
+
url = 'https://github.com/arturadib/Slash-A'
|
179
|
+
version_added = '2.4'
|
181
180
|
|
182
181
|
def __init__(self, **options):
|
183
182
|
from pygments.lexers.web import HtmlLexer
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for Smalltalk and related languages.
|
6
6
|
|
7
|
-
:copyright: Copyright 2006-
|
7
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
8
8
|
:license: BSD, see LICENSE for details.
|
9
9
|
"""
|
10
10
|
|
@@ -20,14 +20,13 @@ class SmalltalkLexer(RegexLexer):
|
|
20
20
|
For Smalltalk syntax.
|
21
21
|
Contributed by Stefan Matthias Aust.
|
22
22
|
Rewritten by Nils Winter.
|
23
|
-
|
24
|
-
.. versionadded:: 0.10
|
25
23
|
"""
|
26
24
|
name = 'Smalltalk'
|
27
25
|
url = 'http://www.smalltalk.org/'
|
28
26
|
filenames = ['*.st']
|
29
27
|
aliases = ['smalltalk', 'squeak', 'st']
|
30
28
|
mimetypes = ['text/x-smalltalk']
|
29
|
+
version_added = '0.10'
|
31
30
|
|
32
31
|
tokens = {
|
33
32
|
'root': [
|
@@ -140,14 +139,13 @@ class SmalltalkLexer(RegexLexer):
|
|
140
139
|
class NewspeakLexer(RegexLexer):
|
141
140
|
"""
|
142
141
|
For Newspeak syntax.
|
143
|
-
|
144
|
-
.. versionadded:: 1.1
|
145
142
|
"""
|
146
143
|
name = 'Newspeak'
|
147
144
|
url = 'http://newspeaklanguage.org/'
|
148
145
|
filenames = ['*.ns2']
|
149
146
|
aliases = ['newspeak', ]
|
150
147
|
mimetypes = ['text/x-newspeak']
|
148
|
+
version_added = '1.1'
|
151
149
|
|
152
150
|
tokens = {
|
153
151
|
'root': [
|