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 BASIC like languages (other than VB.net).
|
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
|
|
@@ -23,8 +23,6 @@ __all__ = ['BlitzBasicLexer', 'BlitzMaxLexer', 'MonkeyLexer', 'CbmBasicV2Lexer',
|
|
23
23
|
class BlitzMaxLexer(RegexLexer):
|
24
24
|
"""
|
25
25
|
For BlitzMax source code.
|
26
|
-
|
27
|
-
.. versionadded:: 1.4
|
28
26
|
"""
|
29
27
|
|
30
28
|
name = 'BlitzMax'
|
@@ -32,14 +30,14 @@ class BlitzMaxLexer(RegexLexer):
|
|
32
30
|
aliases = ['blitzmax', 'bmax']
|
33
31
|
filenames = ['*.bmx']
|
34
32
|
mimetypes = ['text/x-bmx']
|
33
|
+
version_added = '1.4'
|
35
34
|
|
36
35
|
bmax_vopwords = r'\b(Shl|Shr|Sar|Mod)\b'
|
37
36
|
bmax_sktypes = r'@{1,2}|[!#$%]'
|
38
37
|
bmax_lktypes = r'\b(Int|Byte|Short|Float|Double|Long)\b'
|
39
38
|
bmax_name = r'[a-z_]\w*'
|
40
|
-
bmax_var = (
|
41
|
-
|
42
|
-
(bmax_name, bmax_sktypes, bmax_lktypes, bmax_name)
|
39
|
+
bmax_var = (rf'({bmax_name})(?:(?:([ \t]*)({bmax_sktypes})|([ \t]*:[ \t]*\b(?:Shl|Shr|Sar|Mod)\b)'
|
40
|
+
rf'|([ \t]*)(:)([ \t]*)(?:{bmax_lktypes}|({bmax_name})))(?:([ \t]*)(Ptr))?)')
|
43
41
|
bmax_func = bmax_var + r'?((?:[ \t]|\.\.\n)*)([(])'
|
44
42
|
|
45
43
|
flags = re.MULTILINE | re.IGNORECASE
|
@@ -60,16 +58,14 @@ class BlitzMaxLexer(RegexLexer):
|
|
60
58
|
(r'\$[0-9a-f]+', Number.Hex),
|
61
59
|
(r'\%[10]+', Number.Bin),
|
62
60
|
# Other
|
63
|
-
(
|
64
|
-
(bmax_vopwords), Operator),
|
61
|
+
(rf'(?:(?:(:)?([ \t]*)(:?{bmax_vopwords}|([+\-*/&|~]))|Or|And|Not|[=<>^]))', Operator),
|
65
62
|
(r'[(),.:\[\]]', Punctuation),
|
66
63
|
(r'(?:#[\w \t]*)', Name.Label),
|
67
64
|
(r'(?:\?[\w \t]*)', Comment.Preproc),
|
68
65
|
# Identifiers
|
69
|
-
(
|
66
|
+
(rf'\b(New)\b([ \t]?)([(]?)({bmax_name})',
|
70
67
|
bygroups(Keyword.Reserved, Whitespace, Punctuation, Name.Class)),
|
71
|
-
(
|
72
|
-
(bmax_name, bmax_name),
|
68
|
+
(rf'\b(Import|Framework|Module)([ \t]+)({bmax_name}\.{bmax_name})',
|
73
69
|
bygroups(Keyword.Reserved, Whitespace, Keyword.Namespace)),
|
74
70
|
(bmax_func, bygroups(Name.Function, Whitespace, Keyword.Type,
|
75
71
|
Operator, Whitespace, Punctuation, Whitespace,
|
@@ -78,7 +74,7 @@ class BlitzMaxLexer(RegexLexer):
|
|
78
74
|
(bmax_var, bygroups(Name.Variable, Whitespace, Keyword.Type, Operator,
|
79
75
|
Whitespace, Punctuation, Whitespace, Keyword.Type,
|
80
76
|
Name.Class, Whitespace, Keyword.Type)),
|
81
|
-
(
|
77
|
+
(rf'\b(Type|Extends)([ \t]+)({bmax_name})',
|
82
78
|
bygroups(Keyword.Reserved, Whitespace, Name.Class)),
|
83
79
|
# Keywords
|
84
80
|
(r'\b(Ptr)\b', Keyword.Type),
|
@@ -102,7 +98,7 @@ class BlitzMaxLexer(RegexLexer):
|
|
102
98
|
'RestoreData'), prefix=r'\b', suffix=r'\b'),
|
103
99
|
Keyword.Reserved),
|
104
100
|
# Final resolve (for variable names and such)
|
105
|
-
(
|
101
|
+
(rf'({bmax_name})', Name.Variable),
|
106
102
|
],
|
107
103
|
'string': [
|
108
104
|
(r'""', String.Double),
|
@@ -115,8 +111,6 @@ class BlitzMaxLexer(RegexLexer):
|
|
115
111
|
class BlitzBasicLexer(RegexLexer):
|
116
112
|
"""
|
117
113
|
For BlitzBasic source code.
|
118
|
-
|
119
|
-
.. versionadded:: 2.0
|
120
114
|
"""
|
121
115
|
|
122
116
|
name = 'BlitzBasic'
|
@@ -124,11 +118,11 @@ class BlitzBasicLexer(RegexLexer):
|
|
124
118
|
aliases = ['blitzbasic', 'b3d', 'bplus']
|
125
119
|
filenames = ['*.bb', '*.decls']
|
126
120
|
mimetypes = ['text/x-bb']
|
121
|
+
version_added = '2.0'
|
127
122
|
|
128
123
|
bb_sktypes = r'@{1,2}|[#$%]'
|
129
124
|
bb_name = r'[a-z]\w*'
|
130
|
-
bb_var = (
|
131
|
-
(bb_name, bb_sktypes, bb_name)
|
125
|
+
bb_var = (rf'({bb_name})(?:([ \t]*)({bb_sktypes})|([ \t]*)([.])([ \t]*)(?:({bb_name})))?')
|
132
126
|
|
133
127
|
flags = re.MULTILINE | re.IGNORECASE
|
134
128
|
tokens = {
|
@@ -153,21 +147,21 @@ class BlitzBasicLexer(RegexLexer):
|
|
153
147
|
Operator),
|
154
148
|
(r'([+\-*/~=<>^])', Operator),
|
155
149
|
(r'[(),:\[\]\\]', Punctuation),
|
156
|
-
(
|
150
|
+
(rf'\.([ \t]*)({bb_name})', Name.Label),
|
157
151
|
# Identifiers
|
158
|
-
(
|
152
|
+
(rf'\b(New)\b([ \t]+)({bb_name})',
|
159
153
|
bygroups(Keyword.Reserved, Whitespace, Name.Class)),
|
160
|
-
(
|
154
|
+
(rf'\b(Gosub|Goto)\b([ \t]+)({bb_name})',
|
161
155
|
bygroups(Keyword.Reserved, Whitespace, Name.Label)),
|
162
|
-
(
|
156
|
+
(rf'\b(Object)\b([ \t]*)([.])([ \t]*)({bb_name})\b',
|
163
157
|
bygroups(Operator, Whitespace, Punctuation, Whitespace, Name.Class)),
|
164
|
-
(
|
158
|
+
(rf'\b{bb_var}\b([ \t]*)(\()',
|
165
159
|
bygroups(Name.Function, Whitespace, Keyword.Type, Whitespace, Punctuation,
|
166
160
|
Whitespace, Name.Class, Whitespace, Punctuation)),
|
167
|
-
(
|
161
|
+
(rf'\b(Function)\b([ \t]+){bb_var}',
|
168
162
|
bygroups(Keyword.Reserved, Whitespace, Name.Function, Whitespace, Keyword.Type,
|
169
163
|
Whitespace, Punctuation, Whitespace, Name.Class)),
|
170
|
-
(
|
164
|
+
(rf'\b(Type)([ \t]+)({bb_name})',
|
171
165
|
bygroups(Keyword.Reserved, Whitespace, Name.Class)),
|
172
166
|
# Keywords
|
173
167
|
(r'\b(Pi|True|False|Null)\b', Keyword.Constant),
|
@@ -194,17 +188,15 @@ class BlitzBasicLexer(RegexLexer):
|
|
194
188
|
|
195
189
|
class MonkeyLexer(RegexLexer):
|
196
190
|
"""
|
197
|
-
For
|
198
|
-
`Monkey <https://en.wikipedia.org/wiki/Monkey_(programming_language)>`_
|
199
|
-
source code.
|
200
|
-
|
201
|
-
.. versionadded:: 1.6
|
191
|
+
For Monkey source code.
|
202
192
|
"""
|
203
193
|
|
204
194
|
name = 'Monkey'
|
205
195
|
aliases = ['monkey']
|
206
196
|
filenames = ['*.monkey']
|
207
197
|
mimetypes = ['text/x-monkey']
|
198
|
+
url = 'https://blitzresearch.itch.io/monkeyx'
|
199
|
+
version_added = '1.6'
|
208
200
|
|
209
201
|
name_variable = r'[a-z_]\w*'
|
210
202
|
name_function = r'[A-Z]\w*'
|
@@ -238,7 +230,7 @@ class MonkeyLexer(RegexLexer):
|
|
238
230
|
(r'\$[0-9a-fA-Z]+', Number.Hex),
|
239
231
|
(r'\%[10]+', Number.Bin),
|
240
232
|
# Native data types
|
241
|
-
(
|
233
|
+
(rf'\b{keyword_type}\b', Keyword.Type),
|
242
234
|
# Exception handling
|
243
235
|
(r'(?i)\b(?:Try|Catch|Throw)\b', Keyword.Reserved),
|
244
236
|
(r'Throwable', Name.Exception),
|
@@ -274,21 +266,21 @@ class MonkeyLexer(RegexLexer):
|
|
274
266
|
(r'(?i)(?:Not|Mod|Shl|Shr|And|Or)', Operator.Word),
|
275
267
|
(r'[(){}!#,.:]', Punctuation),
|
276
268
|
# catch the rest
|
277
|
-
(
|
278
|
-
(
|
279
|
-
(
|
269
|
+
(rf'{name_constant}\b', Name.Constant),
|
270
|
+
(rf'{name_function}\b', Name.Function),
|
271
|
+
(rf'{name_variable}\b', Name.Variable),
|
280
272
|
],
|
281
273
|
'funcname': [
|
282
|
-
(
|
274
|
+
(rf'(?i){name_function}\b', Name.Function),
|
283
275
|
(r':', Punctuation, 'classname'),
|
284
276
|
(r'\s+', Whitespace),
|
285
277
|
(r'\(', Punctuation, 'variables'),
|
286
278
|
(r'\)', Punctuation, '#pop')
|
287
279
|
],
|
288
280
|
'classname': [
|
289
|
-
(
|
290
|
-
(
|
291
|
-
(
|
281
|
+
(rf'{name_module}\.', Name.Namespace),
|
282
|
+
(rf'{keyword_type}\b', Keyword.Type),
|
283
|
+
(rf'{name_class}\b', Name.Class),
|
292
284
|
# array (of given size)
|
293
285
|
(r'(\[)(\s*)(\d*)(\s*)(\])',
|
294
286
|
bygroups(Punctuation, Whitespace, Number.Integer, Whitespace, Punctuation)),
|
@@ -300,9 +292,9 @@ class MonkeyLexer(RegexLexer):
|
|
300
292
|
default('#pop')
|
301
293
|
],
|
302
294
|
'variables': [
|
303
|
-
(
|
304
|
-
(
|
305
|
-
(
|
295
|
+
(rf'{name_constant}\b', Name.Constant),
|
296
|
+
(rf'{name_variable}\b', Name.Variable),
|
297
|
+
(rf'{keyword_type_special}', Keyword.Type),
|
306
298
|
(r'\s+', Whitespace),
|
307
299
|
(r':', Punctuation, 'classname'),
|
308
300
|
(r',', Punctuation, '#push'),
|
@@ -325,12 +317,12 @@ class MonkeyLexer(RegexLexer):
|
|
325
317
|
class CbmBasicV2Lexer(RegexLexer):
|
326
318
|
"""
|
327
319
|
For CBM BASIC V2 sources.
|
328
|
-
|
329
|
-
.. versionadded:: 1.6
|
330
320
|
"""
|
331
321
|
name = 'CBM BASIC V2'
|
332
322
|
aliases = ['cbmbas']
|
333
323
|
filenames = ['*.bas']
|
324
|
+
url = 'https://en.wikipedia.org/wiki/Commodore_BASIC'
|
325
|
+
version_added = '1.6'
|
334
326
|
|
335
327
|
flags = re.IGNORECASE
|
336
328
|
|
@@ -362,17 +354,15 @@ class CbmBasicV2Lexer(RegexLexer):
|
|
362
354
|
|
363
355
|
class QBasicLexer(RegexLexer):
|
364
356
|
"""
|
365
|
-
For
|
366
|
-
`QBasic <http://en.wikipedia.org/wiki/QBasic>`_
|
367
|
-
source code.
|
368
|
-
|
369
|
-
.. versionadded:: 2.0
|
357
|
+
For QBasic source code.
|
370
358
|
"""
|
371
359
|
|
372
360
|
name = 'QBasic'
|
373
361
|
aliases = ['qbasic', 'basic']
|
374
362
|
filenames = ['*.BAS', '*.bas']
|
375
363
|
mimetypes = ['text/basic']
|
364
|
+
url = 'https://en.wikipedia.org/wiki/QBasic'
|
365
|
+
version_added = '2.0'
|
376
366
|
|
377
367
|
declarations = ('DATA', 'LET')
|
378
368
|
|
@@ -475,26 +465,26 @@ class QBasicLexer(RegexLexer):
|
|
475
465
|
# can't use regular \b because of X$()
|
476
466
|
# XXX: use words() here
|
477
467
|
'declarations': [
|
478
|
-
(r'\b(
|
468
|
+
(r'\b({})(?=\(|\b)'.format('|'.join(map(re.escape, declarations))),
|
479
469
|
Keyword.Declaration),
|
480
470
|
],
|
481
471
|
'functions': [
|
482
|
-
(r'\b(
|
472
|
+
(r'\b({})(?=\(|\b)'.format('|'.join(map(re.escape, functions))),
|
483
473
|
Keyword.Reserved),
|
484
474
|
],
|
485
475
|
'metacommands': [
|
486
|
-
(r'\b(
|
476
|
+
(r'\b({})(?=\(|\b)'.format('|'.join(map(re.escape, metacommands))),
|
487
477
|
Keyword.Constant),
|
488
478
|
],
|
489
479
|
'operators': [
|
490
|
-
(r'\b(
|
480
|
+
(r'\b({})(?=\(|\b)'.format('|'.join(map(re.escape, operators))), Operator.Word),
|
491
481
|
],
|
492
482
|
'statements': [
|
493
|
-
(r'\b(
|
483
|
+
(r'\b({})\b'.format('|'.join(map(re.escape, statements))),
|
494
484
|
Keyword.Reserved),
|
495
485
|
],
|
496
486
|
'keywords': [
|
497
|
-
(r'\b(
|
487
|
+
(r'\b({})\b'.format('|'.join(keywords)), Keyword),
|
498
488
|
],
|
499
489
|
}
|
500
490
|
|
@@ -506,12 +496,13 @@ class QBasicLexer(RegexLexer):
|
|
506
496
|
class VBScriptLexer(RegexLexer):
|
507
497
|
"""
|
508
498
|
VBScript is scripting language that is modeled on Visual Basic.
|
509
|
-
|
510
|
-
.. versionadded:: 2.4
|
511
499
|
"""
|
512
500
|
name = 'VBScript'
|
513
501
|
aliases = ['vbscript']
|
514
502
|
filenames = ['*.vbs', '*.VBS']
|
503
|
+
url = 'https://learn.microsoft.com/en-us/previous-versions/t0aew7h6(v=vs.85)'
|
504
|
+
version_added = '2.4'
|
505
|
+
|
515
506
|
flags = re.IGNORECASE
|
516
507
|
|
517
508
|
tokens = {
|
@@ -573,8 +564,6 @@ class BBCBasicLexer(RegexLexer):
|
|
573
564
|
"""
|
574
565
|
BBC Basic was supplied on the BBC Micro, and later Acorn RISC OS.
|
575
566
|
It is also used by BBC Basic For Windows.
|
576
|
-
|
577
|
-
.. versionadded:: 2.4
|
578
567
|
"""
|
579
568
|
base_keywords = ['OTHERWISE', 'AND', 'DIV', 'EOR', 'MOD', 'OR', 'ERROR',
|
580
569
|
'LINE', 'OFF', 'STEP', 'SPC', 'TAB', 'ELSE', 'THEN',
|
@@ -607,6 +596,8 @@ class BBCBasicLexer(RegexLexer):
|
|
607
596
|
name = 'BBC Basic'
|
608
597
|
aliases = ['bbcbasic']
|
609
598
|
filenames = ['*.bbc']
|
599
|
+
url = 'https://www.bbcbasic.co.uk/bbcbasic.html'
|
600
|
+
version_added = '2.4'
|
610
601
|
|
611
602
|
tokens = {
|
612
603
|
'root': [
|
@@ -3,9 +3,8 @@
|
|
3
3
|
~~~~~~~~~~~~~~~~~~~
|
4
4
|
|
5
5
|
Lexer for BDD(Behavior-driven development).
|
6
|
-
More information: https://en.wikipedia.org/wiki/Behavior-driven_development
|
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
|
|
@@ -19,14 +18,14 @@ class BddLexer(RegexLexer):
|
|
19
18
|
"""
|
20
19
|
Lexer for BDD(Behavior-driven development), which highlights not only
|
21
20
|
keywords, but also comments, punctuations, strings, numbers, and variables.
|
22
|
-
|
23
|
-
.. versionadded:: 2.11
|
24
21
|
"""
|
25
22
|
|
26
23
|
name = 'Bdd'
|
27
24
|
aliases = ['bdd']
|
28
25
|
filenames = ['*.feature']
|
29
26
|
mimetypes = ['text/x-bdd']
|
27
|
+
url = 'https://en.wikipedia.org/wiki/Behavior-driven_development'
|
28
|
+
version_added = '2.11'
|
30
29
|
|
31
30
|
step_keywords = (r'Given|When|Then|Add|And|Feature|Scenario Outline|'
|
32
31
|
r'Scenario|Background|Examples|But')
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexer for Berry.
|
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
|
|
@@ -17,14 +17,14 @@ __all__ = ['BerryLexer']
|
|
17
17
|
|
18
18
|
class BerryLexer(RegexLexer):
|
19
19
|
"""
|
20
|
-
For
|
21
|
-
|
22
|
-
.. versionadded:: 2.12.0
|
20
|
+
For Berry source code.
|
23
21
|
"""
|
24
22
|
name = 'Berry'
|
25
23
|
aliases = ['berry', 'be']
|
26
24
|
filenames = ['*.be']
|
27
25
|
mimetypes = ['text/x-berry', 'application/x-berry']
|
26
|
+
url = 'https://berry-lang.github.io'
|
27
|
+
version_added = '2.12'
|
28
28
|
|
29
29
|
_name = r'\b[^\W\d]\w*'
|
30
30
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for BibTeX bibliography data and styles
|
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
|
|
@@ -21,15 +21,15 @@ __all__ = ['BibTeXLexer', 'BSTLexer']
|
|
21
21
|
class BibTeXLexer(ExtendedRegexLexer):
|
22
22
|
"""
|
23
23
|
A lexer for BibTeX bibliography data format.
|
24
|
-
|
25
|
-
.. versionadded:: 2.2
|
26
24
|
"""
|
27
25
|
|
28
26
|
name = 'BibTeX'
|
29
27
|
aliases = ['bibtex', 'bib']
|
30
28
|
filenames = ['*.bib']
|
31
29
|
mimetypes = ["text/x-bibtex"]
|
30
|
+
version_added = '2.2'
|
32
31
|
flags = re.IGNORECASE
|
32
|
+
url = 'https://texfaq.org/FAQ-BibTeXing'
|
33
33
|
|
34
34
|
ALLOWED_CHARS = r'@!$&*+\-./:;<>?\[\\\]^`|~'
|
35
35
|
IDENTIFIER = '[{}][{}]*'.format('a-z_' + ALLOWED_CHARS, r'\w' + ALLOWED_CHARS)
|
@@ -116,14 +116,14 @@ class BibTeXLexer(ExtendedRegexLexer):
|
|
116
116
|
class BSTLexer(RegexLexer):
|
117
117
|
"""
|
118
118
|
A lexer for BibTeX bibliography styles.
|
119
|
-
|
120
|
-
.. versionadded:: 2.2
|
121
119
|
"""
|
122
120
|
|
123
121
|
name = 'BST'
|
124
122
|
aliases = ['bst', 'bst-pybtex']
|
125
123
|
filenames = ['*.bst']
|
124
|
+
version_added = '2.2'
|
126
125
|
flags = re.IGNORECASE | re.MULTILINE
|
126
|
+
url = 'https://texfaq.org/FAQ-BibTeXing'
|
127
127
|
|
128
128
|
tokens = {
|
129
129
|
'root': [
|
@@ -0,0 +1,173 @@
|
|
1
|
+
"""
|
2
|
+
pygments.lexers.blueprint
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
4
|
+
|
5
|
+
Lexer for the Blueprint UI markup language.
|
6
|
+
|
7
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
8
|
+
:license: BSD, see LICENSE for details.
|
9
|
+
"""
|
10
|
+
|
11
|
+
import re
|
12
|
+
|
13
|
+
from pygments.lexer import RegexLexer, include, bygroups, words
|
14
|
+
from pygments.token import (
|
15
|
+
Comment,
|
16
|
+
Operator,
|
17
|
+
Keyword,
|
18
|
+
Name,
|
19
|
+
String,
|
20
|
+
Number,
|
21
|
+
Punctuation,
|
22
|
+
Whitespace,
|
23
|
+
)
|
24
|
+
|
25
|
+
__all__ = ["BlueprintLexer"]
|
26
|
+
|
27
|
+
|
28
|
+
class BlueprintLexer(RegexLexer):
|
29
|
+
"""
|
30
|
+
For Blueprint UI markup.
|
31
|
+
"""
|
32
|
+
|
33
|
+
name = "Blueprint"
|
34
|
+
aliases = ["blueprint"]
|
35
|
+
filenames = ["*.blp"]
|
36
|
+
mimetypes = ["text/x-blueprint"]
|
37
|
+
url = "https://gitlab.gnome.org/jwestman/blueprint-compiler"
|
38
|
+
version_added = '2.16'
|
39
|
+
|
40
|
+
flags = re.IGNORECASE
|
41
|
+
tokens = {
|
42
|
+
"root": [
|
43
|
+
include("block-content"),
|
44
|
+
],
|
45
|
+
"type": [
|
46
|
+
(r"\$\s*[a-z_][a-z0-9_\-]*", Name.Class),
|
47
|
+
(r"(?:([a-z_][a-z0-9_\-]*)(\s*)(\.)(\s*))?([a-z_][a-z0-9_\-]*)",
|
48
|
+
bygroups(Name.Namespace, Whitespace, Punctuation, Whitespace, Name.Class)),
|
49
|
+
],
|
50
|
+
"whitespace": [
|
51
|
+
(r"\s+", Whitespace),
|
52
|
+
(r"//.*?\n", Comment.Single),
|
53
|
+
(r"/\*", Comment.Multiline, "comment-multiline"),
|
54
|
+
],
|
55
|
+
"comment-multiline": [
|
56
|
+
(r"\*/", Comment.Multiline, "#pop"),
|
57
|
+
(r"[^*]+", Comment.Multiline),
|
58
|
+
(r"\*", Comment.Multiline),
|
59
|
+
],
|
60
|
+
"value": [
|
61
|
+
(r"(typeof)(\s*)(<)", bygroups(Keyword, Whitespace, Punctuation), "typeof"),
|
62
|
+
(words(("true", "false", "null")), Keyword.Constant),
|
63
|
+
(r"[a-z_][a-z0-9_\-]*", Name.Variable),
|
64
|
+
(r"\|", Operator),
|
65
|
+
(r'".*?"', String.Double),
|
66
|
+
(r"\'.*?\'", String.Single),
|
67
|
+
(r"0x[\d_]*", Number.Hex),
|
68
|
+
(r"[0-9_]+", Number.Integer),
|
69
|
+
(r"\d[\d\.a-z_]*", Number),
|
70
|
+
],
|
71
|
+
"typeof": [
|
72
|
+
include("whitespace"),
|
73
|
+
include("type"),
|
74
|
+
(r">", Punctuation, "#pop"),
|
75
|
+
],
|
76
|
+
"content": [
|
77
|
+
include("whitespace"),
|
78
|
+
# Keywords
|
79
|
+
(words(("after", "bidirectional", "bind-property", "bind", "default",
|
80
|
+
"destructive", "disabled", "inverted", "no-sync-create",
|
81
|
+
"suggested", "swapped", "sync-create", "template")),
|
82
|
+
Keyword),
|
83
|
+
# Translated strings
|
84
|
+
(r"(C?_)(\s*)(\()",
|
85
|
+
bygroups(Name.Function.Builtin, Whitespace, Punctuation),
|
86
|
+
"paren-content"),
|
87
|
+
# Cast expressions
|
88
|
+
(r"(as)(\s*)(<)", bygroups(Keyword, Whitespace, Punctuation), "typeof"),
|
89
|
+
# Closures
|
90
|
+
(r"(\$?[a-z_][a-z0-9_\-]*)(\s*)(\()",
|
91
|
+
bygroups(Name.Function, Whitespace, Punctuation),
|
92
|
+
"paren-content"),
|
93
|
+
# Objects
|
94
|
+
(r"(?:(\$\s*[a-z_][a-z0-9_\-]+)|(?:([a-z_][a-z0-9_\-]*)(\s*)(\.)(\s*))?([a-z_][a-z0-9_\-]*))(?:(\s+)([a-z_][a-z0-9_\-]*))?(\s*)(\{)",
|
95
|
+
bygroups(Name.Class, Name.Namespace, Whitespace, Punctuation, Whitespace,
|
96
|
+
Name.Class, Whitespace, Name.Variable, Whitespace, Punctuation),
|
97
|
+
"brace-block"),
|
98
|
+
# Misc
|
99
|
+
include("value"),
|
100
|
+
(r",|\.", Punctuation),
|
101
|
+
],
|
102
|
+
"block-content": [
|
103
|
+
# Import statements
|
104
|
+
(r"(using)(\s+)([a-z_][a-z0-9_\-]*)(\s+)(\d[\d\.]*)(;)",
|
105
|
+
bygroups(Keyword, Whitespace, Name.Namespace, Whitespace,
|
106
|
+
Name.Namespace, Punctuation)),
|
107
|
+
# Menus
|
108
|
+
(r"(menu|section|submenu)(?:(\s+)([a-z_][a-z0-9_\-]*))?(\s*)(\{)",
|
109
|
+
bygroups(Keyword, Whitespace, Name.Variable, Whitespace, Punctuation),
|
110
|
+
"brace-block"),
|
111
|
+
(r"(item)(\s*)(\{)",
|
112
|
+
bygroups(Keyword, Whitespace, Punctuation),
|
113
|
+
"brace-block"),
|
114
|
+
(r"(item)(\s*)(\()",
|
115
|
+
bygroups(Keyword, Whitespace, Punctuation),
|
116
|
+
"paren-block"),
|
117
|
+
# Templates
|
118
|
+
(r"template", Keyword.Declaration, "template"),
|
119
|
+
# Nested blocks. When extensions are added, this is where they go.
|
120
|
+
(r"(responses|items|mime-types|patterns|suffixes|marks|widgets|strings|styles)(\s*)(\[)",
|
121
|
+
bygroups(Keyword, Whitespace, Punctuation),
|
122
|
+
"bracket-block"),
|
123
|
+
(r"(accessibility|setters|layout|item)(\s*)(\{)",
|
124
|
+
bygroups(Keyword, Whitespace, Punctuation),
|
125
|
+
"brace-block"),
|
126
|
+
(r"(condition|mark|item)(\s*)(\()",
|
127
|
+
bygroups(Keyword, Whitespace, Punctuation),
|
128
|
+
"paren-content"),
|
129
|
+
(r"\[", Punctuation, "child-type"),
|
130
|
+
# Properties and signals
|
131
|
+
(r"([a-z_][a-z0-9_\-]*(?:::[a-z0-9_]+)?)(\s*)(:|=>)",
|
132
|
+
bygroups(Name.Property, Whitespace, Punctuation),
|
133
|
+
"statement"),
|
134
|
+
include("content"),
|
135
|
+
],
|
136
|
+
"paren-block": [
|
137
|
+
include("block-content"),
|
138
|
+
(r"\)", Punctuation, "#pop"),
|
139
|
+
],
|
140
|
+
"paren-content": [
|
141
|
+
include("content"),
|
142
|
+
(r"\)", Punctuation, "#pop"),
|
143
|
+
],
|
144
|
+
"bracket-block": [
|
145
|
+
include("block-content"),
|
146
|
+
(r"\]", Punctuation, "#pop"),
|
147
|
+
],
|
148
|
+
"brace-block": [
|
149
|
+
include("block-content"),
|
150
|
+
(r"\}", Punctuation, "#pop"),
|
151
|
+
],
|
152
|
+
"statement": [
|
153
|
+
include("content"),
|
154
|
+
(r";", Punctuation, "#pop"),
|
155
|
+
],
|
156
|
+
"child-type": [
|
157
|
+
include("whitespace"),
|
158
|
+
(r"(action)(\s+)(response)(\s*)(=)(\s*)",
|
159
|
+
bygroups(Keyword, Whitespace, Name.Attribute, Whitespace,
|
160
|
+
Punctuation, Whitespace)),
|
161
|
+
(words(("default", "internal-child", "response")), Keyword),
|
162
|
+
(r"[a-z_][a-z0-9_\-]*", Name.Decorator),
|
163
|
+
include("value"),
|
164
|
+
(r"=", Punctuation),
|
165
|
+
(r"\]", Punctuation, "#pop"),
|
166
|
+
],
|
167
|
+
"template": [
|
168
|
+
include("whitespace"),
|
169
|
+
include("type"),
|
170
|
+
(r":", Punctuation),
|
171
|
+
(r"\{", Punctuation, ("#pop", "brace-block")),
|
172
|
+
],
|
173
|
+
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for the Boa language.
|
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
|
|
@@ -17,13 +17,13 @@ __all__ = ['BoaLexer']
|
|
17
17
|
|
18
18
|
class BoaLexer(RegexLexer):
|
19
19
|
"""
|
20
|
-
Lexer for the
|
21
|
-
|
22
|
-
.. versionadded:: 2.4
|
20
|
+
Lexer for the Boa language.
|
23
21
|
"""
|
24
22
|
name = 'Boa'
|
25
23
|
aliases = ['boa']
|
26
24
|
filenames = ['*.boa']
|
25
|
+
url = 'https://boa.cs.iastate.edu/docs'
|
26
|
+
version_added = '2.4'
|
27
27
|
|
28
28
|
reserved = words(
|
29
29
|
('input', 'output', 'of', 'weight', 'before', 'after', 'stop',
|