pygments.rb 2.4.1 → 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 +9 -1
- data/README.adoc +2 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -2
- 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 +39 -15
- 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
|
Lexer for the Futhark 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
|
|
@@ -19,14 +19,13 @@ __all__ = ['FutharkLexer']
|
|
19
19
|
class FutharkLexer(RegexLexer):
|
20
20
|
"""
|
21
21
|
A Futhark lexer
|
22
|
-
|
23
|
-
.. versionadded:: 2.8
|
24
22
|
"""
|
25
23
|
name = 'Futhark'
|
26
24
|
url = 'https://futhark-lang.org/'
|
27
25
|
aliases = ['futhark']
|
28
26
|
filenames = ['*.fut']
|
29
27
|
mimetypes = ['text/x-futhark']
|
28
|
+
version_added = '2.8'
|
30
29
|
|
31
30
|
num_types = ('i8', 'i16', 'i32', 'i64', 'u8', 'u16', 'u32', 'u64', 'f32', 'f64')
|
32
31
|
|
@@ -42,7 +41,7 @@ class FutharkLexer(RegexLexer):
|
|
42
41
|
'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN',
|
43
42
|
'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL')
|
44
43
|
|
45
|
-
num_postfix = r'(
|
44
|
+
num_postfix = r'({})?'.format('|'.join(num_types))
|
46
45
|
|
47
46
|
identifier_re = '[a-zA-Z_][a-zA-Z_0-9\']*'
|
48
47
|
|
@@ -53,12 +52,12 @@ class FutharkLexer(RegexLexer):
|
|
53
52
|
(r'--(.*?)$', Comment.Single),
|
54
53
|
(r'\s+', Whitespace),
|
55
54
|
(r'\(\)', Punctuation),
|
56
|
-
(r'\b(
|
57
|
-
(r'\b(
|
55
|
+
(r'\b({})(?!\')\b'.format('|'.join(reserved)), Keyword.Reserved),
|
56
|
+
(r'\b({})(?!\')\b'.format('|'.join(num_types + other_types)), Keyword.Type),
|
58
57
|
|
59
58
|
# Identifiers
|
60
59
|
(r'#\[([a-zA-Z_\(\) ]*)\]', Comment.Preproc),
|
61
|
-
(
|
60
|
+
(rf'[#!]?({identifier_re}\.)*{identifier_re}', Name),
|
62
61
|
|
63
62
|
(r'\\', Operator),
|
64
63
|
(r'[-+/%=!><|&*^][-+/%=!><|&*^.]*', Operator),
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for the G Code 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,12 +17,12 @@ __all__ = ['GcodeLexer']
|
|
17
17
|
class GcodeLexer(RegexLexer):
|
18
18
|
"""
|
19
19
|
For gcode source code.
|
20
|
-
|
21
|
-
.. versionadded:: 2.9
|
22
20
|
"""
|
23
21
|
name = 'g-code'
|
24
22
|
aliases = ['gcode']
|
25
23
|
filenames = ['*.gcode']
|
24
|
+
url = 'https://en.wikipedia.org/wiki/G-code'
|
25
|
+
version_added = '2.9'
|
26
26
|
|
27
27
|
tokens = {
|
28
28
|
'root': [
|
@@ -7,7 +7,7 @@
|
|
7
7
|
Modified by Daniel J. Ramirez <djrmuv@gmail.com> based on the original
|
8
8
|
python.py.
|
9
9
|
|
10
|
-
:copyright: Copyright 2006-
|
10
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
11
11
|
:license: BSD, see LICENSE for details.
|
12
12
|
"""
|
13
13
|
|
@@ -31,6 +31,7 @@ class GDScriptLexer(RegexLexer):
|
|
31
31
|
aliases = ["gdscript", "gd"]
|
32
32
|
filenames = ["*.gd"]
|
33
33
|
mimetypes = ["text/x-gdscript", "application/x-gdscript"]
|
34
|
+
version_added = ''
|
34
35
|
|
35
36
|
def innerstring_rules(ttype):
|
36
37
|
return [
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for the Google Go 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
|
|
@@ -18,14 +18,13 @@ __all__ = ['GoLexer']
|
|
18
18
|
class GoLexer(RegexLexer):
|
19
19
|
"""
|
20
20
|
For Go source.
|
21
|
-
|
22
|
-
.. versionadded:: 1.2
|
23
21
|
"""
|
24
22
|
name = 'Go'
|
25
23
|
url = 'https://go.dev/'
|
26
24
|
filenames = ['*.go']
|
27
25
|
aliases = ['go', 'golang']
|
28
26
|
mimetypes = ['text/x-gosrc']
|
27
|
+
version_added = '1.2'
|
29
28
|
|
30
29
|
tokens = {
|
31
30
|
'root': [
|
@@ -53,7 +52,7 @@ class GoLexer(RegexLexer):
|
|
53
52
|
'string', 'bool', 'error', 'uintptr', 'any', 'comparable',
|
54
53
|
'print', 'println', 'panic', 'recover', 'close', 'complex',
|
55
54
|
'real', 'imag', 'len', 'cap', 'append', 'copy', 'delete',
|
56
|
-
'new', 'make'), suffix=r'\b(\()'),
|
55
|
+
'new', 'make', 'min', 'max', 'clear'), suffix=r'\b(\()'),
|
57
56
|
bygroups(Name.Builtin, Punctuation)),
|
58
57
|
(words((
|
59
58
|
'uint', 'uint8', 'uint16', 'uint32', 'uint64',
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for grammar notations like BNF.
|
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
|
|
@@ -39,14 +39,14 @@ class BnfLexer(RegexLexer):
|
|
39
39
|
|
40
40
|
Though these decision making might cause too minimal highlighting
|
41
41
|
and you might be disappointed, but it is reasonable for us.
|
42
|
-
|
43
|
-
.. versionadded:: 2.1
|
44
42
|
"""
|
45
43
|
|
46
44
|
name = 'BNF'
|
47
45
|
aliases = ['bnf']
|
48
46
|
filenames = ['*.bnf']
|
49
47
|
mimetypes = ['text/x-bnf']
|
48
|
+
url = 'https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form'
|
49
|
+
version_added = '2.1'
|
50
50
|
|
51
51
|
tokens = {
|
52
52
|
'root': [
|
@@ -68,8 +68,6 @@ class AbnfLexer(RegexLexer):
|
|
68
68
|
Lexer for IETF 7405 ABNF.
|
69
69
|
|
70
70
|
(Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_) grammars.
|
71
|
-
|
72
|
-
.. versionadded:: 2.1
|
73
71
|
"""
|
74
72
|
|
75
73
|
name = 'ABNF'
|
@@ -77,6 +75,7 @@ class AbnfLexer(RegexLexer):
|
|
77
75
|
aliases = ['abnf']
|
78
76
|
filenames = ['*.abnf']
|
79
77
|
mimetypes = ['text/x-abnf']
|
78
|
+
version_added = '2.1'
|
80
79
|
|
81
80
|
_core_rules = (
|
82
81
|
'ALPHA', 'BIT', 'CHAR', 'CR', 'CRLF', 'CTL', 'DIGIT',
|
@@ -133,14 +132,13 @@ class AbnfLexer(RegexLexer):
|
|
133
132
|
class JsgfLexer(RegexLexer):
|
134
133
|
"""
|
135
134
|
For JSpeech Grammar Format grammars.
|
136
|
-
|
137
|
-
.. versionadded:: 2.2
|
138
135
|
"""
|
139
136
|
name = 'JSGF'
|
140
137
|
url = 'https://www.w3.org/TR/jsgf/'
|
141
138
|
aliases = ['jsgf']
|
142
139
|
filenames = ['*.jsgf']
|
143
140
|
mimetypes = ['application/jsgf', 'application/x-jsgf', 'text/jsgf']
|
141
|
+
version_added = '2.2'
|
144
142
|
|
145
143
|
tokens = {
|
146
144
|
'root': [
|
@@ -224,8 +222,6 @@ class PegLexer(RegexLexer):
|
|
224
222
|
* A single `a-z` character immediately before a string, or
|
225
223
|
multiple `a-z` characters following a string, are part of the
|
226
224
|
string (e.g., `r"..."` or `"..."ilmsuxa`).
|
227
|
-
|
228
|
-
.. versionadded:: 2.6
|
229
225
|
"""
|
230
226
|
|
231
227
|
name = 'PEG'
|
@@ -233,6 +229,7 @@ class PegLexer(RegexLexer):
|
|
233
229
|
aliases = ['peg']
|
234
230
|
filenames = ['*.peg']
|
235
231
|
mimetypes = ['text/x-peg']
|
232
|
+
version_added = '2.6'
|
236
233
|
|
237
234
|
tokens = {
|
238
235
|
'root': [
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for graph query 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
|
|
@@ -23,28 +23,24 @@ class CypherLexer(RegexLexer):
|
|
23
23
|
For Cypher Query Language
|
24
24
|
|
25
25
|
For the Cypher version in Neo4j 3.3
|
26
|
-
|
27
|
-
.. versionadded:: 2.0
|
28
26
|
"""
|
29
27
|
name = 'Cypher'
|
30
28
|
url = 'https://neo4j.com/docs/developer-manual/3.3/cypher/'
|
31
29
|
aliases = ['cypher']
|
32
30
|
filenames = ['*.cyp', '*.cypher']
|
31
|
+
version_added = '2.0'
|
33
32
|
|
34
33
|
flags = re.MULTILINE | re.IGNORECASE
|
35
34
|
|
36
35
|
tokens = {
|
37
36
|
'root': [
|
38
|
-
include('comment'),
|
39
37
|
include('clauses'),
|
40
38
|
include('keywords'),
|
41
39
|
include('relations'),
|
42
40
|
include('strings'),
|
43
41
|
include('whitespace'),
|
44
42
|
include('barewords'),
|
45
|
-
|
46
|
-
'comment': [
|
47
|
-
(r'^.*//.*$', Comment.Single),
|
43
|
+
include('comment'),
|
48
44
|
],
|
49
45
|
'keywords': [
|
50
46
|
(r'(create|order|match|limit|set|skip|start|return|with|where|'
|
@@ -76,12 +72,16 @@ class CypherLexer(RegexLexer):
|
|
76
72
|
bygroups(Keyword, Whitespace, Keyword)),
|
77
73
|
(r'(using)(\s+)(periodic)(\s+)(commit)\b',
|
78
74
|
bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword)),
|
75
|
+
(r'(using)(\s+)(index)\b',
|
76
|
+
bygroups(Keyword, Whitespace, Keyword)),
|
77
|
+
(r'(using)(\s+)(range|text|point)(\s+)(index)\b',
|
78
|
+
bygroups(Keyword, Whitespace, Name, Whitespace, Keyword)),
|
79
79
|
(words((
|
80
80
|
'all', 'any', 'as', 'asc', 'ascending', 'assert', 'call', 'case', 'create',
|
81
81
|
'delete', 'desc', 'descending', 'distinct', 'end', 'fieldterminator',
|
82
82
|
'foreach', 'in', 'limit', 'match', 'merge', 'none', 'not', 'null',
|
83
83
|
'remove', 'return', 'set', 'skip', 'single', 'start', 'then', 'union',
|
84
|
-
'unwind', 'yield', 'where', 'when', 'with'), suffix=r'\b'), Keyword),
|
84
|
+
'unwind', 'yield', 'where', 'when', 'with', 'collect'), suffix=r'\b'), Keyword),
|
85
85
|
],
|
86
86
|
'relations': [
|
87
87
|
(r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)),
|
@@ -92,7 +92,7 @@ class CypherLexer(RegexLexer):
|
|
92
92
|
(r'[.*{}]', Punctuation),
|
93
93
|
],
|
94
94
|
'strings': [
|
95
|
-
(r'"(?:\\[tbnrf\'"\\]|[^\\
|
95
|
+
(r'([\'"])(?:\\[tbnrf\'"\\]|[^\\])*?\1', String),
|
96
96
|
(r'`(?:``|[^`])+`', Name.Variable),
|
97
97
|
],
|
98
98
|
'whitespace': [
|
@@ -102,4 +102,7 @@ class CypherLexer(RegexLexer):
|
|
102
102
|
(r'[a-z]\w*', Name),
|
103
103
|
(r'\d+', Number),
|
104
104
|
],
|
105
|
+
'comment': [
|
106
|
+
(r'//.*$', Comment.Single),
|
107
|
+
],
|
105
108
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for computer graphics and plotting 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,13 +20,13 @@ __all__ = ['GLShaderLexer', 'PostScriptLexer', 'AsymptoteLexer', 'GnuplotLexer',
|
|
20
20
|
class GLShaderLexer(RegexLexer):
|
21
21
|
"""
|
22
22
|
GLSL (OpenGL Shader) lexer.
|
23
|
-
|
24
|
-
.. versionadded:: 1.1
|
25
23
|
"""
|
26
24
|
name = 'GLSL'
|
27
25
|
aliases = ['glsl']
|
28
26
|
filenames = ['*.vert', '*.frag', '*.geo']
|
29
27
|
mimetypes = ['text/x-glslsrc']
|
28
|
+
url = 'https://www.khronos.org/api/opengl'
|
29
|
+
version_added = '1.1'
|
30
30
|
|
31
31
|
tokens = {
|
32
32
|
'root': [
|
@@ -151,13 +151,13 @@ class GLShaderLexer(RegexLexer):
|
|
151
151
|
class HLSLShaderLexer(RegexLexer):
|
152
152
|
"""
|
153
153
|
HLSL (Microsoft Direct3D Shader) lexer.
|
154
|
-
|
155
|
-
.. versionadded:: 2.3
|
156
154
|
"""
|
157
155
|
name = 'HLSL'
|
158
156
|
aliases = ['hlsl']
|
159
157
|
filenames = ['*.hlsl', '*.hlsli']
|
160
158
|
mimetypes = ['text/x-hlsl']
|
159
|
+
url = 'https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl'
|
160
|
+
version_added = '2.3'
|
161
161
|
|
162
162
|
tokens = {
|
163
163
|
'root': [
|
@@ -305,20 +305,19 @@ class HLSLShaderLexer(RegexLexer):
|
|
305
305
|
class PostScriptLexer(RegexLexer):
|
306
306
|
"""
|
307
307
|
Lexer for PostScript files.
|
308
|
-
|
309
|
-
.. versionadded:: 1.4
|
310
308
|
"""
|
311
309
|
name = 'PostScript'
|
312
310
|
url = 'https://en.wikipedia.org/wiki/PostScript'
|
313
311
|
aliases = ['postscript', 'postscr']
|
314
312
|
filenames = ['*.ps', '*.eps']
|
315
313
|
mimetypes = ['application/postscript']
|
314
|
+
version_added = '1.4'
|
316
315
|
|
317
316
|
delimiter = r'()<>\[\]{}/%\s'
|
318
|
-
delimiter_end =
|
317
|
+
delimiter_end = rf'(?=[{delimiter}])'
|
319
318
|
|
320
|
-
valid_name_chars =
|
321
|
-
valid_name =
|
319
|
+
valid_name_chars = rf'[^{delimiter}]'
|
320
|
+
valid_name = rf"{valid_name_chars}+{delimiter_end}"
|
322
321
|
|
323
322
|
tokens = {
|
324
323
|
'root': [
|
@@ -343,7 +342,7 @@ class PostScriptLexer(RegexLexer):
|
|
343
342
|
(r'(\-|\+)?[0-9]+' + delimiter_end, Number.Integer),
|
344
343
|
|
345
344
|
# References
|
346
|
-
(
|
345
|
+
(rf'\/{valid_name}', Name.Variable),
|
347
346
|
|
348
347
|
# Names
|
349
348
|
(valid_name, Name.Function), # Anything else is executed
|
@@ -400,14 +399,13 @@ class PostScriptLexer(RegexLexer):
|
|
400
399
|
class AsymptoteLexer(RegexLexer):
|
401
400
|
"""
|
402
401
|
For Asymptote source code.
|
403
|
-
|
404
|
-
.. versionadded:: 1.2
|
405
402
|
"""
|
406
403
|
name = 'Asymptote'
|
407
404
|
url = 'http://asymptote.sf.net/'
|
408
405
|
aliases = ['asymptote', 'asy']
|
409
406
|
filenames = ['*.asy']
|
410
407
|
mimetypes = ['text/x-asymptote']
|
408
|
+
version_added = '1.2'
|
411
409
|
|
412
410
|
#: optional Comment or Whitespace
|
413
411
|
_ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
|
@@ -528,8 +526,6 @@ def _shortened_many(*words):
|
|
528
526
|
class GnuplotLexer(RegexLexer):
|
529
527
|
"""
|
530
528
|
For Gnuplot plotting scripts.
|
531
|
-
|
532
|
-
.. versionadded:: 0.11
|
533
529
|
"""
|
534
530
|
|
535
531
|
name = 'Gnuplot'
|
@@ -537,6 +533,7 @@ class GnuplotLexer(RegexLexer):
|
|
537
533
|
aliases = ['gnuplot']
|
538
534
|
filenames = ['*.plot', '*.plt']
|
539
535
|
mimetypes = ['text/x-gnuplot']
|
536
|
+
version_added = '0.11'
|
540
537
|
|
541
538
|
tokens = {
|
542
539
|
'root': [
|
@@ -689,14 +686,13 @@ class GnuplotLexer(RegexLexer):
|
|
689
686
|
class PovrayLexer(RegexLexer):
|
690
687
|
"""
|
691
688
|
For Persistence of Vision Raytracer files.
|
692
|
-
|
693
|
-
.. versionadded:: 0.11
|
694
689
|
"""
|
695
690
|
name = 'POVRay'
|
696
691
|
url = 'http://www.povray.org/'
|
697
692
|
aliases = ['pov']
|
698
693
|
filenames = ['*.pov', '*.inc']
|
699
694
|
mimetypes = ['text/x-povray']
|
695
|
+
version_added = '0.11'
|
700
696
|
|
701
697
|
tokens = {
|
702
698
|
'root': [
|
@@ -0,0 +1,176 @@
|
|
1
|
+
"""
|
2
|
+
pygments.lexers.graphql
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~~
|
4
|
+
|
5
|
+
Lexer for GraphQL, an open-source data query and manipulation
|
6
|
+
language for APIs.
|
7
|
+
|
8
|
+
More information:
|
9
|
+
https://graphql.org/
|
10
|
+
|
11
|
+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
|
12
|
+
:license: BSD, see LICENSE for details.
|
13
|
+
"""
|
14
|
+
|
15
|
+
from pygments.lexer import RegexLexer, words, include, bygroups, default
|
16
|
+
from pygments.token import (Comment, Keyword, Name, Number, Punctuation, String,
|
17
|
+
Whitespace)
|
18
|
+
|
19
|
+
|
20
|
+
__all__ = ["GraphQLLexer"]
|
21
|
+
|
22
|
+
OPERATION_TYPES = ("query", "mutation", "subscription")
|
23
|
+
BUILTIN_TYPES = ("Int", "Float", "String", "Boolean", "ID")
|
24
|
+
BOOLEAN_VALUES = ("true", "false", "null")
|
25
|
+
KEYWORDS = (
|
26
|
+
"type",
|
27
|
+
"schema",
|
28
|
+
"extend",
|
29
|
+
"enum",
|
30
|
+
"scalar",
|
31
|
+
"implements",
|
32
|
+
"interface",
|
33
|
+
"union",
|
34
|
+
"input",
|
35
|
+
"directive",
|
36
|
+
"QUERY",
|
37
|
+
"MUTATION",
|
38
|
+
"SUBSCRIPTION",
|
39
|
+
"FIELD",
|
40
|
+
"FRAGMENT_DEFINITION",
|
41
|
+
"FRAGMENT_SPREAD",
|
42
|
+
"INLINE_FRAGMENT",
|
43
|
+
"SCHEMA",
|
44
|
+
"SCALAR",
|
45
|
+
"OBJECT",
|
46
|
+
"FIELD_DEFINITION",
|
47
|
+
"ARGUMENT_DEFINITION",
|
48
|
+
"INTERFACE",
|
49
|
+
"UNION",
|
50
|
+
"ENUM",
|
51
|
+
"ENUM_VALUE",
|
52
|
+
"INPUT_OBJECT",
|
53
|
+
"INPUT_FIELD_DEFINITION",
|
54
|
+
)
|
55
|
+
|
56
|
+
|
57
|
+
class GraphQLLexer(RegexLexer):
|
58
|
+
"""
|
59
|
+
Lexer for GraphQL syntax
|
60
|
+
"""
|
61
|
+
name = "GraphQL"
|
62
|
+
aliases = ["graphql"]
|
63
|
+
filenames = ["*.graphql"]
|
64
|
+
url = "https://graphql.org"
|
65
|
+
version_added = '2.16'
|
66
|
+
|
67
|
+
tokens = {
|
68
|
+
"ignored_tokens": [
|
69
|
+
(r"\s+", Whitespace), # Whitespaces
|
70
|
+
(r"#.*$", Comment),
|
71
|
+
(",", Punctuation), # Insignificant commas
|
72
|
+
],
|
73
|
+
"value": [
|
74
|
+
include("ignored_tokens"),
|
75
|
+
(r"-?\d+(?![.eE])", Number.Integer, "#pop"),
|
76
|
+
(
|
77
|
+
r"-?\d+(\.\d+)?([eE][+-]?\d+)?",
|
78
|
+
Number.Float,
|
79
|
+
"#pop",
|
80
|
+
),
|
81
|
+
(r'"', String, ("#pop", "string")),
|
82
|
+
(words(BOOLEAN_VALUES, suffix=r"\b"), Name.Builtin, "#pop"),
|
83
|
+
(r"\$[a-zA-Z_]\w*", Name.Variable, "#pop"),
|
84
|
+
(r"[a-zA-Z_]\w*", Name.Constant, "#pop"),
|
85
|
+
(r"\[", Punctuation, ("#pop", "list_value")),
|
86
|
+
(r"\{", Punctuation, ("#pop", "object_value")),
|
87
|
+
],
|
88
|
+
"list_value": [
|
89
|
+
include("ignored_tokens"),
|
90
|
+
("]", Punctuation, "#pop"),
|
91
|
+
default("value"),
|
92
|
+
],
|
93
|
+
"object_value": [
|
94
|
+
include("ignored_tokens"),
|
95
|
+
(r"[a-zA-Z_]\w*", Name),
|
96
|
+
(r":", Punctuation, "value"),
|
97
|
+
(r"\}", Punctuation, "#pop"),
|
98
|
+
],
|
99
|
+
"string": [
|
100
|
+
(r'\\(["\\/bfnrt]|u[a-fA-F0-9]{4})', String.Escape),
|
101
|
+
(r'[^\\"\n]+', String), # all other characters
|
102
|
+
(r'"', String, "#pop"),
|
103
|
+
],
|
104
|
+
"root": [
|
105
|
+
include("ignored_tokens"),
|
106
|
+
(words(OPERATION_TYPES, suffix=r"\b"), Keyword, "operation"),
|
107
|
+
(words(KEYWORDS, suffix=r"\b"), Keyword),
|
108
|
+
(r"\{", Punctuation, "selection_set"),
|
109
|
+
(r"fragment\b", Keyword, "fragment_definition"),
|
110
|
+
],
|
111
|
+
"operation": [
|
112
|
+
include("ignored_tokens"),
|
113
|
+
(r"[a-zA-Z_]\w*", Name.Function),
|
114
|
+
(r"\(", Punctuation, "variable_definition"),
|
115
|
+
(r"\{", Punctuation, ("#pop", "selection_set")),
|
116
|
+
],
|
117
|
+
"variable_definition": [
|
118
|
+
include("ignored_tokens"),
|
119
|
+
(r"\$[a-zA-Z_]\w*", Name.Variable),
|
120
|
+
(r"[\]!]", Punctuation),
|
121
|
+
(r":", Punctuation, "type"),
|
122
|
+
(r"=", Punctuation, "value"),
|
123
|
+
(r"\)", Punctuation, "#pop"),
|
124
|
+
],
|
125
|
+
"type": [
|
126
|
+
include("ignored_tokens"),
|
127
|
+
(r"\[", Punctuation),
|
128
|
+
(words(BUILTIN_TYPES, suffix=r"\b"), Name.Builtin, "#pop"),
|
129
|
+
(r"[a-zA-Z_]\w*", Name.Class, "#pop"),
|
130
|
+
],
|
131
|
+
"selection_set": [
|
132
|
+
include("ignored_tokens"),
|
133
|
+
(r"([a-zA-Z_]\w*)(\s*)(:)", bygroups(Name.Label, Whitespace, Punctuation)),
|
134
|
+
(r"[a-zA-Z_]\w*", Name), # Field
|
135
|
+
(
|
136
|
+
r"(\.\.\.)(\s+)(on)\b",
|
137
|
+
bygroups(Punctuation, Whitespace, Keyword),
|
138
|
+
"inline_fragment",
|
139
|
+
),
|
140
|
+
(r"\.\.\.", Punctuation, "fragment_spread"),
|
141
|
+
(r"\(", Punctuation, "arguments"),
|
142
|
+
(r"@[a-zA-Z_]\w*", Name.Decorator, "directive"),
|
143
|
+
(r"\{", Punctuation, "selection_set"),
|
144
|
+
(r"\}", Punctuation, "#pop"),
|
145
|
+
],
|
146
|
+
"directive": [
|
147
|
+
include("ignored_tokens"),
|
148
|
+
(r"\(", Punctuation, ("#pop", "arguments")),
|
149
|
+
],
|
150
|
+
"arguments": [
|
151
|
+
include("ignored_tokens"),
|
152
|
+
(r"[a-zA-Z_]\w*", Name),
|
153
|
+
(r":", Punctuation, "value"),
|
154
|
+
(r"\)", Punctuation, "#pop"),
|
155
|
+
],
|
156
|
+
# Fragments
|
157
|
+
"fragment_definition": [
|
158
|
+
include("ignored_tokens"),
|
159
|
+
(r"[\]!]", Punctuation), # For NamedType
|
160
|
+
(r"on\b", Keyword, "type"),
|
161
|
+
(r"[a-zA-Z_]\w*", Name.Function),
|
162
|
+
(r"@[a-zA-Z_]\w*", Name.Decorator, "directive"),
|
163
|
+
(r"\{", Punctuation, ("#pop", "selection_set")),
|
164
|
+
],
|
165
|
+
"fragment_spread": [
|
166
|
+
include("ignored_tokens"),
|
167
|
+
(r"@[a-zA-Z_]\w*", Name.Decorator, "directive"),
|
168
|
+
(r"[a-zA-Z_]\w*", Name, "#pop"), # Fragment name
|
169
|
+
],
|
170
|
+
"inline_fragment": [
|
171
|
+
include("ignored_tokens"),
|
172
|
+
(r"[a-zA-Z_]\w*", Name.Class), # Type condition
|
173
|
+
(r"@[a-zA-Z_]\w*", Name.Decorator, "directive"),
|
174
|
+
(r"\{", Punctuation, ("#pop", "selection_set")),
|
175
|
+
],
|
176
|
+
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexer for the DOT language (graphviz).
|
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
|
|
@@ -19,14 +19,13 @@ __all__ = ['GraphvizLexer']
|
|
19
19
|
class GraphvizLexer(RegexLexer):
|
20
20
|
"""
|
21
21
|
For graphviz DOT graph description language.
|
22
|
-
|
23
|
-
.. versionadded:: 2.8
|
24
22
|
"""
|
25
23
|
name = 'Graphviz'
|
26
24
|
url = 'https://www.graphviz.org/doc/info/lang.html'
|
27
25
|
aliases = ['graphviz', 'dot']
|
28
26
|
filenames = ['*.gv', '*.dot']
|
29
27
|
mimetypes = ['text/x-graphviz', 'text/vnd.graphviz']
|
28
|
+
version_added = '2.8'
|
30
29
|
tokens = {
|
31
30
|
'root': [
|
32
31
|
(r'\s+', Whitespace),
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for TigerGraph GSQL graph query 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
|
|
@@ -21,14 +21,13 @@ class GSQLLexer(RegexLexer):
|
|
21
21
|
|
22
22
|
"""
|
23
23
|
For GSQL queries (version 3.x).
|
24
|
-
|
25
|
-
.. versionadded:: 2.10
|
26
24
|
"""
|
27
25
|
|
28
26
|
name = 'GSQL'
|
29
27
|
url = 'https://docs.tigergraph.com/dev/gsql-ref'
|
30
28
|
aliases = ['gsql']
|
31
29
|
filenames = ['*.gsql']
|
30
|
+
version_added = '2.10'
|
32
31
|
|
33
32
|
flags = re.MULTILINE | re.IGNORECASE
|
34
33
|
|