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 ML family 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,14 @@ __all__ = ['SMLLexer', 'OcamlLexer', 'OpaLexer', 'ReasonLexer', 'FStarLexer']
|
|
20
20
|
class SMLLexer(RegexLexer):
|
21
21
|
"""
|
22
22
|
For the Standard ML language.
|
23
|
-
|
24
|
-
.. versionadded:: 1.5
|
25
23
|
"""
|
26
24
|
|
27
25
|
name = 'Standard ML'
|
28
26
|
aliases = ['sml']
|
29
27
|
filenames = ['*.sml', '*.sig', '*.fun']
|
30
28
|
mimetypes = ['text/x-standardml', 'application/x-standardml']
|
29
|
+
url = 'https://en.wikipedia.org/wiki/Standard_ML'
|
30
|
+
version_added = '1.5'
|
31
31
|
|
32
32
|
alphanumid_reserved = {
|
33
33
|
# Core
|
@@ -121,7 +121,7 @@ class SMLLexer(RegexLexer):
|
|
121
121
|
|
122
122
|
'core': [
|
123
123
|
# Punctuation that doesn't overlap symbolic identifiers
|
124
|
-
(r'(
|
124
|
+
(r'({})'.format('|'.join(re.escape(z) for z in nonid_reserved)),
|
125
125
|
Punctuation),
|
126
126
|
|
127
127
|
# Special constants: strings, floats, numbers in decimal and hex
|
@@ -137,8 +137,8 @@ class SMLLexer(RegexLexer):
|
|
137
137
|
|
138
138
|
# Labels
|
139
139
|
(r'#\s*[1-9][0-9]*', Name.Label),
|
140
|
-
(
|
141
|
-
(
|
140
|
+
(rf'#\s*({alphanumid_re})', Name.Label),
|
141
|
+
(rf'#\s+({symbolicid_re})', Name.Label),
|
142
142
|
# Some reserved words trigger a special, local lexer state change
|
143
143
|
(r'\b(datatype|abstype)\b(?!\')', Keyword.Reserved, 'dname'),
|
144
144
|
(r'\b(exception)\b(?!\')', Keyword.Reserved, 'ename'),
|
@@ -148,14 +148,14 @@ class SMLLexer(RegexLexer):
|
|
148
148
|
|
149
149
|
# Regular identifiers, long and otherwise
|
150
150
|
(r'\'[\w\']*', Name.Decorator),
|
151
|
-
(
|
152
|
-
(
|
153
|
-
(
|
151
|
+
(rf'({alphanumid_re})(\.)', long_id_callback, "dotted"),
|
152
|
+
(rf'({alphanumid_re})', id_callback),
|
153
|
+
(rf'({symbolicid_re})', id_callback),
|
154
154
|
],
|
155
155
|
'dotted': [
|
156
|
-
(
|
157
|
-
(
|
158
|
-
(
|
156
|
+
(rf'({alphanumid_re})(\.)', long_id_callback),
|
157
|
+
(rf'({alphanumid_re})', end_id_callback, "#pop"),
|
158
|
+
(rf'({symbolicid_re})', end_id_callback, "#pop"),
|
159
159
|
(r'\s+', Error),
|
160
160
|
(r'\S+', Error),
|
161
161
|
],
|
@@ -208,7 +208,7 @@ class SMLLexer(RegexLexer):
|
|
208
208
|
'string': stringy(String.Double),
|
209
209
|
|
210
210
|
'breakout': [
|
211
|
-
(r'(?=\b(
|
211
|
+
(r'(?=\b({})\b(?!\'))'.format('|'.join(alphanumid_reserved)), Text, '#pop'),
|
212
212
|
],
|
213
213
|
|
214
214
|
# Dealing with what comes after module system keywords
|
@@ -216,7 +216,7 @@ class SMLLexer(RegexLexer):
|
|
216
216
|
include('whitespace'),
|
217
217
|
include('breakout'),
|
218
218
|
|
219
|
-
(
|
219
|
+
(rf'({alphanumid_re})', Name.Namespace),
|
220
220
|
default('#pop'),
|
221
221
|
],
|
222
222
|
|
@@ -226,8 +226,8 @@ class SMLLexer(RegexLexer):
|
|
226
226
|
(r'\'[\w\']*', Name.Decorator),
|
227
227
|
(r'\(', Punctuation, 'tyvarseq'),
|
228
228
|
|
229
|
-
(
|
230
|
-
(
|
229
|
+
(rf'({alphanumid_re})', Name.Function, '#pop'),
|
230
|
+
(rf'({symbolicid_re})', Name.Function, '#pop'),
|
231
231
|
|
232
232
|
# Ignore interesting function declarations like "fun (x + y) = ..."
|
233
233
|
default('#pop'),
|
@@ -239,12 +239,12 @@ class SMLLexer(RegexLexer):
|
|
239
239
|
(r'\'[\w\']*', Name.Decorator),
|
240
240
|
(r'\(', Punctuation, 'tyvarseq'),
|
241
241
|
|
242
|
-
(
|
242
|
+
(rf'({alphanumid_re})(\s*)(=(?!{symbolicid_re}))',
|
243
243
|
bygroups(Name.Variable, Text, Punctuation), '#pop'),
|
244
|
-
(
|
244
|
+
(rf'({symbolicid_re})(\s*)(=(?!{symbolicid_re}))',
|
245
245
|
bygroups(Name.Variable, Text, Punctuation), '#pop'),
|
246
|
-
(
|
247
|
-
(
|
246
|
+
(rf'({alphanumid_re})', Name.Variable, '#pop'),
|
247
|
+
(rf'({symbolicid_re})', Name.Variable, '#pop'),
|
248
248
|
|
249
249
|
# Ignore interesting patterns like 'val (x, y)'
|
250
250
|
default('#pop'),
|
@@ -257,10 +257,10 @@ class SMLLexer(RegexLexer):
|
|
257
257
|
|
258
258
|
(r'\'[\w\']*', Name.Decorator),
|
259
259
|
(r'\(', Punctuation, 'tyvarseq'),
|
260
|
-
(
|
260
|
+
(rf'=(?!{symbolicid_re})', Punctuation, ('#pop', 'typbind')),
|
261
261
|
|
262
|
-
(
|
263
|
-
(
|
262
|
+
(rf'({alphanumid_re})', Keyword.Type),
|
263
|
+
(rf'({symbolicid_re})', Keyword.Type),
|
264
264
|
(r'\S+', Error, '#pop'),
|
265
265
|
],
|
266
266
|
|
@@ -284,11 +284,11 @@ class SMLLexer(RegexLexer):
|
|
284
284
|
(r'\(', Punctuation, 'tyvarseq'),
|
285
285
|
(r'(=)(\s*)(datatype)',
|
286
286
|
bygroups(Punctuation, Text, Keyword.Reserved), '#pop'),
|
287
|
-
(
|
287
|
+
(rf'=(?!{symbolicid_re})', Punctuation,
|
288
288
|
('#pop', 'datbind', 'datcon')),
|
289
289
|
|
290
|
-
(
|
291
|
-
(
|
290
|
+
(rf'({alphanumid_re})', Keyword.Type),
|
291
|
+
(rf'({symbolicid_re})', Keyword.Type),
|
292
292
|
(r'\S+', Error, '#pop'),
|
293
293
|
],
|
294
294
|
|
@@ -300,9 +300,9 @@ class SMLLexer(RegexLexer):
|
|
300
300
|
(r'\b(withtype)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')),
|
301
301
|
(r'\b(of)\b(?!\')', Keyword.Reserved),
|
302
302
|
|
303
|
-
(
|
303
|
+
(rf'(\|)(\s*)({alphanumid_re})',
|
304
304
|
bygroups(Punctuation, Text, Name.Class)),
|
305
|
-
(
|
305
|
+
(rf'(\|)(\s+)({symbolicid_re})',
|
306
306
|
bygroups(Punctuation, Text, Name.Class)),
|
307
307
|
|
308
308
|
include('breakout'),
|
@@ -314,20 +314,20 @@ class SMLLexer(RegexLexer):
|
|
314
314
|
'ename': [
|
315
315
|
include('whitespace'),
|
316
316
|
|
317
|
-
(
|
317
|
+
(rf'(and\b)(\s+)({alphanumid_re})',
|
318
318
|
bygroups(Keyword.Reserved, Text, Name.Class)),
|
319
|
-
(
|
319
|
+
(rf'(and\b)(\s*)({symbolicid_re})',
|
320
320
|
bygroups(Keyword.Reserved, Text, Name.Class)),
|
321
321
|
(r'\b(of)\b(?!\')', Keyword.Reserved),
|
322
|
-
(
|
322
|
+
(rf'({alphanumid_re})|({symbolicid_re})', Name.Class),
|
323
323
|
|
324
324
|
default('#pop'),
|
325
325
|
],
|
326
326
|
|
327
327
|
'datcon': [
|
328
328
|
include('whitespace'),
|
329
|
-
(
|
330
|
-
(
|
329
|
+
(rf'({alphanumid_re})', Name.Class, '#pop'),
|
330
|
+
(rf'({symbolicid_re})', Name.Class, '#pop'),
|
331
331
|
(r'\S+', Error, '#pop'),
|
332
332
|
],
|
333
333
|
|
@@ -355,8 +355,6 @@ class SMLLexer(RegexLexer):
|
|
355
355
|
class OcamlLexer(RegexLexer):
|
356
356
|
"""
|
357
357
|
For the OCaml language.
|
358
|
-
|
359
|
-
.. versionadded:: 0.7
|
360
358
|
"""
|
361
359
|
|
362
360
|
name = 'OCaml'
|
@@ -364,15 +362,16 @@ class OcamlLexer(RegexLexer):
|
|
364
362
|
aliases = ['ocaml']
|
365
363
|
filenames = ['*.ml', '*.mli', '*.mll', '*.mly']
|
366
364
|
mimetypes = ['text/x-ocaml']
|
365
|
+
version_added = '0.7'
|
367
366
|
|
368
367
|
keywords = (
|
369
|
-
'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done',
|
368
|
+
'and', 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done',
|
370
369
|
'downto', 'else', 'end', 'exception', 'external', 'false',
|
371
370
|
'for', 'fun', 'function', 'functor', 'if', 'in', 'include',
|
372
371
|
'inherit', 'initializer', 'lazy', 'let', 'match', 'method',
|
373
372
|
'module', 'mutable', 'new', 'object', 'of', 'open', 'private',
|
374
373
|
'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try',
|
375
|
-
'type', '
|
374
|
+
'type', 'val', 'virtual', 'when', 'while', 'with',
|
376
375
|
)
|
377
376
|
keyopts = (
|
378
377
|
'!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-',
|
@@ -382,7 +381,7 @@ class OcamlLexer(RegexLexer):
|
|
382
381
|
)
|
383
382
|
|
384
383
|
operators = r'[!$%&*+\./:<=>?@^|~-]'
|
385
|
-
word_operators = ('
|
384
|
+
word_operators = ('asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'or')
|
386
385
|
prefix_syms = r'[!?~]'
|
387
386
|
infix_syms = r'[=<>@^|&+\*/$%-]'
|
388
387
|
primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array')
|
@@ -399,11 +398,11 @@ class OcamlLexer(RegexLexer):
|
|
399
398
|
(r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'),
|
400
399
|
(r'\b([A-Z][\w\']*)', Name.Class),
|
401
400
|
(r'\(\*(?![)])', Comment, 'comment'),
|
402
|
-
(r'\b(
|
403
|
-
(r'(
|
404
|
-
(
|
405
|
-
(r'\b(
|
406
|
-
(r'\b(
|
401
|
+
(r'\b({})\b'.format('|'.join(keywords)), Keyword),
|
402
|
+
(r'({})'.format('|'.join(keyopts[::-1])), Operator),
|
403
|
+
(rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
|
404
|
+
(r'\b({})\b'.format('|'.join(word_operators)), Operator.Word),
|
405
|
+
(r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
|
407
406
|
|
408
407
|
(r"[^\W\d][\w']*", Name),
|
409
408
|
|
@@ -448,14 +447,14 @@ class OcamlLexer(RegexLexer):
|
|
448
447
|
class OpaLexer(RegexLexer):
|
449
448
|
"""
|
450
449
|
Lexer for the Opa language.
|
451
|
-
|
452
|
-
.. versionadded:: 1.5
|
453
450
|
"""
|
454
451
|
|
455
452
|
name = 'Opa'
|
456
453
|
aliases = ['opa']
|
457
454
|
filenames = ['*.opa']
|
458
455
|
mimetypes = ['text/x-opa']
|
456
|
+
url = 'http://opalang.org'
|
457
|
+
version_added = '1.5'
|
459
458
|
|
460
459
|
# most of these aren't strictly keywords
|
461
460
|
# but if you color only real keywords, you might just
|
@@ -557,8 +556,8 @@ class OpaLexer(RegexLexer):
|
|
557
556
|
# way to syntactic distinguish binding constructions
|
558
557
|
# unfortunately, this colors the equal in {x=2} too
|
559
558
|
(r'=(?!'+op_re+r')', Keyword),
|
560
|
-
(
|
561
|
-
(
|
559
|
+
(rf'({op_re})+', Operator),
|
560
|
+
(rf'({punc_re})+', Operator),
|
562
561
|
|
563
562
|
# coercions
|
564
563
|
(r':', Operator, 'type'),
|
@@ -771,8 +770,6 @@ class OpaLexer(RegexLexer):
|
|
771
770
|
class ReasonLexer(RegexLexer):
|
772
771
|
"""
|
773
772
|
For the ReasonML language.
|
774
|
-
|
775
|
-
.. versionadded:: 2.6
|
776
773
|
"""
|
777
774
|
|
778
775
|
name = 'ReasonML'
|
@@ -780,6 +777,7 @@ class ReasonLexer(RegexLexer):
|
|
780
777
|
aliases = ['reasonml', 'reason']
|
781
778
|
filenames = ['*.re', '*.rei']
|
782
779
|
mimetypes = ['text/x-reasonml']
|
780
|
+
version_added = '2.6'
|
783
781
|
|
784
782
|
keywords = (
|
785
783
|
'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', 'downto',
|
@@ -815,11 +813,11 @@ class ReasonLexer(RegexLexer):
|
|
815
813
|
(r'\b([A-Z][\w\']*)', Name.Class),
|
816
814
|
(r'//.*?\n', Comment.Single),
|
817
815
|
(r'\/\*(?!/)', Comment.Multiline, 'comment'),
|
818
|
-
(r'\b(
|
819
|
-
(r'(
|
820
|
-
(
|
821
|
-
(r'\b(
|
822
|
-
(r'\b(
|
816
|
+
(r'\b({})\b'.format('|'.join(keywords)), Keyword),
|
817
|
+
(r'({})'.format('|'.join(keyopts[::-1])), Operator.Word),
|
818
|
+
(rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
|
819
|
+
(r'\b({})\b'.format('|'.join(word_operators)), Operator.Word),
|
820
|
+
(r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
|
823
821
|
|
824
822
|
(r"[^\W\d][\w']*", Name),
|
825
823
|
|
@@ -864,7 +862,6 @@ class ReasonLexer(RegexLexer):
|
|
864
862
|
class FStarLexer(RegexLexer):
|
865
863
|
"""
|
866
864
|
For the F* language.
|
867
|
-
.. versionadded:: 2.7
|
868
865
|
"""
|
869
866
|
|
870
867
|
name = 'FStar'
|
@@ -872,6 +869,7 @@ class FStarLexer(RegexLexer):
|
|
872
869
|
aliases = ['fstar']
|
873
870
|
filenames = ['*.fst', '*.fsti']
|
874
871
|
mimetypes = ['text/x-fstar']
|
872
|
+
version_added = '2.7'
|
875
873
|
|
876
874
|
keywords = (
|
877
875
|
'abstract', 'attributes', 'noeq', 'unopteq', 'and'
|
@@ -912,12 +910,12 @@ class FStarLexer(RegexLexer):
|
|
912
910
|
(r'\b([A-Z][\w\']*)', Name.Class),
|
913
911
|
(r'\(\*(?![)])', Comment, 'comment'),
|
914
912
|
(r'\/\/.+$', Comment),
|
915
|
-
(r'\b(
|
916
|
-
(r'\b(
|
917
|
-
(r'\b(
|
918
|
-
(r'(
|
919
|
-
(
|
920
|
-
(r'\b(
|
913
|
+
(r'\b({})\b'.format('|'.join(keywords)), Keyword),
|
914
|
+
(r'\b({})\b'.format('|'.join(assume_keywords)), Name.Exception),
|
915
|
+
(r'\b({})\b'.format('|'.join(decl_keywords)), Keyword.Declaration),
|
916
|
+
(r'({})'.format('|'.join(keyopts[::-1])), Operator),
|
917
|
+
(rf'({infix_syms}|{prefix_syms})?{operators}', Operator),
|
918
|
+
(r'\b({})\b'.format('|'.join(primitives)), Keyword.Type),
|
921
919
|
|
922
920
|
(r"[^\W\d][\w']*", Name),
|
923
921
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for modeling 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,14 +23,13 @@ __all__ = ['ModelicaLexer', 'BugsLexer', 'JagsLexer', 'StanLexer']
|
|
23
23
|
class ModelicaLexer(RegexLexer):
|
24
24
|
"""
|
25
25
|
For Modelica source code.
|
26
|
-
|
27
|
-
.. versionadded:: 1.1
|
28
26
|
"""
|
29
27
|
name = 'Modelica'
|
30
28
|
url = 'http://www.modelica.org/'
|
31
29
|
aliases = ['modelica']
|
32
30
|
filenames = ['*.mo']
|
33
31
|
mimetypes = ['text/x-modelica']
|
32
|
+
version_added = '1.1'
|
34
33
|
|
35
34
|
flags = re.DOTALL | re.MULTILINE
|
36
35
|
|
@@ -100,13 +99,13 @@ class BugsLexer(RegexLexer):
|
|
100
99
|
"""
|
101
100
|
Pygments Lexer for OpenBugs and WinBugs
|
102
101
|
models.
|
103
|
-
|
104
|
-
.. versionadded:: 1.6
|
105
102
|
"""
|
106
103
|
|
107
104
|
name = 'BUGS'
|
108
105
|
aliases = ['bugs', 'winbugs', 'openbugs']
|
109
106
|
filenames = ['*.bug']
|
107
|
+
url = 'https://www.mrc-bsu.cam.ac.uk/software/bugs/openbugs'
|
108
|
+
version_added = '1.6'
|
110
109
|
|
111
110
|
_FUNCTIONS = (
|
112
111
|
# Scalar functions
|
@@ -166,8 +165,7 @@ class BugsLexer(RegexLexer):
|
|
166
165
|
# Reserved Words
|
167
166
|
(r'(for|in)(?![\w.])', Keyword.Reserved),
|
168
167
|
# Built-in Functions
|
169
|
-
(r'(
|
170
|
-
% r'|'.join(_FUNCTIONS + _DISTRIBUTIONS),
|
168
|
+
(r'({})(?=\s*\()'.format(r'|'.join(_FUNCTIONS + _DISTRIBUTIONS)),
|
171
169
|
Name.Builtin),
|
172
170
|
# Regular variable names
|
173
171
|
(r'[A-Za-z][\w.]*', Name),
|
@@ -195,13 +193,13 @@ class BugsLexer(RegexLexer):
|
|
195
193
|
class JagsLexer(RegexLexer):
|
196
194
|
"""
|
197
195
|
Pygments Lexer for JAGS.
|
198
|
-
|
199
|
-
.. versionadded:: 1.6
|
200
196
|
"""
|
201
197
|
|
202
198
|
name = 'JAGS'
|
203
199
|
aliases = ['jags']
|
204
200
|
filenames = ['*.jag', '*.bug']
|
201
|
+
url = 'https://mcmc-jags.sourceforge.io'
|
202
|
+
version_added = '1.6'
|
205
203
|
|
206
204
|
# JAGS
|
207
205
|
_FUNCTIONS = (
|
@@ -215,7 +213,7 @@ class JagsLexer(RegexLexer):
|
|
215
213
|
# Truncation/Censoring (should I include)
|
216
214
|
'T', 'I')
|
217
215
|
# Distributions with density, probability and quartile functions
|
218
|
-
_DISTRIBUTIONS = tuple('[dpq]
|
216
|
+
_DISTRIBUTIONS = tuple(f'[dpq]{x}' for x in
|
219
217
|
('bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp',
|
220
218
|
'df', 'gamma', 'gen.gamma', 'logis', 'lnorm',
|
221
219
|
'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib'))
|
@@ -251,9 +249,9 @@ class JagsLexer(RegexLexer):
|
|
251
249
|
(r'(for|in)(?![\w.])', Keyword.Reserved),
|
252
250
|
# Builtins
|
253
251
|
# Need to use lookahead because . is a valid char
|
254
|
-
(r'(
|
252
|
+
(r'({})(?=\s*\()'.format(r'|'.join(_FUNCTIONS
|
255
253
|
+ _DISTRIBUTIONS
|
256
|
-
+ _OTHER_DISTRIBUTIONS),
|
254
|
+
+ _OTHER_DISTRIBUTIONS)),
|
257
255
|
Name.Builtin),
|
258
256
|
# Names
|
259
257
|
include('names'),
|
@@ -286,13 +284,13 @@ class StanLexer(RegexLexer):
|
|
286
284
|
The Stan modeling language is specified in the *Stan Modeling Language
|
287
285
|
User's Guide and Reference Manual, v2.17.0*,
|
288
286
|
`pdf <https://github.com/stan-dev/stan/releases/download/v2.17.0/stan-reference-2.17.0.pdf>`__.
|
289
|
-
|
290
|
-
.. versionadded:: 1.6
|
291
287
|
"""
|
292
288
|
|
293
289
|
name = 'Stan'
|
294
290
|
aliases = ['stan']
|
295
291
|
filenames = ['*.stan']
|
292
|
+
url = 'https://mc-stan.org'
|
293
|
+
version_added = '1.6'
|
296
294
|
|
297
295
|
tokens = {
|
298
296
|
'whitespace': [
|
@@ -310,19 +308,18 @@ class StanLexer(RegexLexer):
|
|
310
308
|
# block start
|
311
309
|
include('whitespace'),
|
312
310
|
# Block start
|
313
|
-
(r'(
|
314
|
-
r'|'.join(('functions', 'data', r'transformed\s+?data',
|
311
|
+
(r'({})(\s*)(\{{)'.format(r'|'.join(('functions', 'data', r'transformed\s+?data',
|
315
312
|
'parameters', r'transformed\s+parameters',
|
316
|
-
'model', r'generated\s+quantities')),
|
313
|
+
'model', r'generated\s+quantities'))),
|
317
314
|
bygroups(Keyword.Namespace, Text, Punctuation)),
|
318
315
|
# target keyword
|
319
316
|
(r'target\s*\+=', Keyword),
|
320
317
|
# Reserved Words
|
321
|
-
(r'(
|
318
|
+
(r'({})\b'.format(r'|'.join(_stan_builtins.KEYWORDS)), Keyword),
|
322
319
|
# Truncation
|
323
320
|
(r'T(?=\s*\[)', Keyword),
|
324
321
|
# Data types
|
325
|
-
(r'(
|
322
|
+
(r'({})\b'.format(r'|'.join(_stan_builtins.TYPES)), Keyword.Type),
|
326
323
|
# < should be punctuation, but elsewhere I can't tell if it is in
|
327
324
|
# a range constraint
|
328
325
|
(r'(<)(\s*)(upper|lower|offset|multiplier)(\s*)(=)',
|
@@ -332,12 +329,12 @@ class StanLexer(RegexLexer):
|
|
332
329
|
# Punctuation
|
333
330
|
(r"[;,\[\]()]", Punctuation),
|
334
331
|
# Builtin
|
335
|
-
(r'(
|
336
|
-
(r'(~)(\s*)(
|
332
|
+
(r'({})(?=\s*\()'.format('|'.join(_stan_builtins.FUNCTIONS)), Name.Builtin),
|
333
|
+
(r'(~)(\s*)({})(?=\s*\()'.format('|'.join(_stan_builtins.DISTRIBUTIONS)),
|
337
334
|
bygroups(Operator, Whitespace, Name.Builtin)),
|
338
335
|
# Special names ending in __, like lp__
|
339
336
|
(r'[A-Za-z]\w*__\b', Name.Builtin.Pseudo),
|
340
|
-
(r'(
|
337
|
+
(r'({})\b'.format(r'|'.join(_stan_builtins.RESERVED)), Keyword.Reserved),
|
341
338
|
# user-defined functions
|
342
339
|
(r'[A-Za-z]\w*(?=\s*\()]', Name.Function),
|
343
340
|
# Imaginary Literals
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Multi-Dialect Lexer for Modula-2.
|
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
|
|
@@ -153,8 +153,6 @@ class Modula2Lexer(RegexLexer):
|
|
153
153
|
``$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...``
|
154
154
|
Render standard library ADTs as ordinary library types.
|
155
155
|
|
156
|
-
.. versionadded:: 1.3
|
157
|
-
|
158
156
|
.. versionchanged:: 2.1
|
159
157
|
Added multi-dialect support.
|
160
158
|
"""
|
@@ -163,6 +161,7 @@ class Modula2Lexer(RegexLexer):
|
|
163
161
|
aliases = ['modula2', 'm2']
|
164
162
|
filenames = ['*.def', '*.mod']
|
165
163
|
mimetypes = ['text/x-modula2']
|
164
|
+
version_added = '1.3'
|
166
165
|
|
167
166
|
flags = re.MULTILINE | re.DOTALL
|
168
167
|
|