pygments.rb 2.3.1 → 2.4.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 +1 -1
- data/.rubocop.yml +7 -0
- data/CHANGELOG.adoc +4 -0
- data/README.adoc +1 -1
- data/bench.rb +1 -1
- data/lib/pygments/popen.rb +3 -7
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -2
- data/test/test_pygments.rb +0 -19
- data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/AUTHORS +21 -1
- data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/LICENSE +1 -1
- data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/METADATA +19 -11
- data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +614 -0
- data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/WHEEL +1 -1
- data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/entry_points.txt +0 -1
- data/vendor/pygments-main/bin/pygmentize +1 -1
- data/vendor/pygments-main/pygments/__init__.py +20 -22
- data/vendor/pygments-main/pygments/__main__.py +1 -1
- data/vendor/pygments-main/pygments/cmdline.py +74 -8
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +6 -3
- data/vendor/pygments-main/pygments/formatter.py +41 -11
- data/vendor/pygments-main/pygments/formatters/__init__.py +21 -16
- data/vendor/pygments-main/pygments/formatters/_mapping.py +5 -65
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/groff.py +170 -0
- data/vendor/pygments-main/pygments/formatters/html.py +54 -32
- data/vendor/pygments-main/pygments/formatters/img.py +9 -5
- data/vendor/pygments-main/pygments/formatters/irc.py +6 -33
- data/vendor/pygments-main/pygments/formatters/latex.py +24 -14
- data/vendor/pygments-main/pygments/formatters/other.py +1 -1
- data/vendor/pygments-main/pygments/formatters/pangomarkup.py +1 -1
- data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal.py +1 -3
- data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -4
- data/vendor/pygments-main/pygments/lexer.py +101 -32
- data/vendor/pygments-main/pygments/lexers/__init__.py +50 -29
- data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +103 -0
- 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 +21 -6
- data/vendor/pygments-main/pygments/lexers/_css_builtins.py +558 -0
- data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +10 -0
- data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +4932 -0
- data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +11 -18
- data/vendor/pygments-main/pygments/lexers/_mapping.py +71 -82
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +58 -4
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_php_builtins.py +408 -1835
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +70 -8
- data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +666 -0
- data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1609 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3 -3
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +9 -18
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +185 -94
- 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 +15 -14
- data/vendor/pygments-main/pygments/lexers/ada.py +144 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +1 -1
- data/vendor/pygments-main/pygments/lexers/algebra.py +72 -9
- data/vendor/pygments-main/pygments/lexers/ambient.py +8 -7
- data/vendor/pygments-main/pygments/lexers/amdgpu.py +4 -3
- data/vendor/pygments-main/pygments/lexers/ampl.py +10 -8
- data/vendor/pygments-main/pygments/lexers/apdlexer.py +164 -20
- data/vendor/pygments-main/pygments/lexers/apl.py +6 -5
- data/vendor/pygments-main/pygments/lexers/archetype.py +23 -21
- data/vendor/pygments-main/pygments/lexers/arrow.py +10 -9
- data/vendor/pygments-main/pygments/lexers/arturo.py +250 -0
- data/vendor/pygments-main/pygments/lexers/asc.py +9 -5
- data/vendor/pygments-main/pygments/lexers/asm.py +68 -63
- data/vendor/pygments-main/pygments/lexers/automation.py +7 -5
- data/vendor/pygments-main/pygments/lexers/bare.py +20 -21
- data/vendor/pygments-main/pygments/lexers/basic.py +45 -41
- data/vendor/pygments-main/pygments/lexers/bdd.py +58 -0
- data/vendor/pygments-main/pygments/lexers/berry.py +99 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +6 -6
- data/vendor/pygments-main/pygments/lexers/boa.py +4 -8
- data/vendor/pygments-main/pygments/lexers/business.py +18 -18
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +80 -40
- data/vendor/pygments-main/pygments/lexers/c_like.py +21 -19
- data/vendor/pygments-main/pygments/lexers/capnproto.py +6 -8
- data/vendor/pygments-main/pygments/lexers/carbon.py +96 -0
- data/vendor/pygments-main/pygments/lexers/cddl.py +16 -33
- data/vendor/pygments-main/pygments/lexers/chapel.py +14 -9
- data/vendor/pygments-main/pygments/lexers/clean.py +3 -2
- data/vendor/pygments-main/pygments/lexers/comal.py +80 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +3 -2
- data/vendor/pygments-main/pygments/lexers/configs.py +235 -120
- data/vendor/pygments-main/pygments/lexers/console.py +5 -4
- data/vendor/pygments-main/pygments/lexers/cplint.py +44 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +22 -23
- data/vendor/pygments-main/pygments/lexers/csound.py +19 -17
- data/vendor/pygments-main/pygments/lexers/css.py +67 -159
- data/vendor/pygments-main/pygments/lexers/d.py +15 -12
- data/vendor/pygments-main/pygments/lexers/dalvik.py +14 -11
- data/vendor/pygments-main/pygments/lexers/data.py +119 -49
- data/vendor/pygments-main/pygments/lexers/dax.py +136 -0
- data/vendor/pygments-main/pygments/lexers/devicetree.py +9 -8
- data/vendor/pygments-main/pygments/lexers/diff.py +23 -19
- data/vendor/pygments-main/pygments/lexers/dotnet.py +216 -81
- data/vendor/pygments-main/pygments/lexers/dsls.py +86 -64
- data/vendor/pygments-main/pygments/lexers/dylan.py +16 -15
- data/vendor/pygments-main/pygments/lexers/ecl.py +46 -38
- data/vendor/pygments-main/pygments/lexers/eiffel.py +15 -10
- data/vendor/pygments-main/pygments/lexers/elm.py +12 -8
- data/vendor/pygments-main/pygments/lexers/elpi.py +165 -0
- data/vendor/pygments-main/pygments/lexers/email.py +21 -39
- data/vendor/pygments-main/pygments/lexers/erlang.py +21 -22
- data/vendor/pygments-main/pygments/lexers/esoteric.py +28 -30
- data/vendor/pygments-main/pygments/lexers/ezhil.py +10 -9
- data/vendor/pygments-main/pygments/lexers/factor.py +104 -83
- data/vendor/pygments-main/pygments/lexers/fantom.py +31 -29
- data/vendor/pygments-main/pygments/lexers/felix.py +18 -14
- data/vendor/pygments-main/pygments/lexers/fift.py +67 -0
- data/vendor/pygments-main/pygments/lexers/floscript.py +7 -7
- data/vendor/pygments-main/pygments/lexers/forth.py +8 -6
- data/vendor/pygments-main/pygments/lexers/fortran.py +16 -11
- data/vendor/pygments-main/pygments/lexers/foxpro.py +2 -2
- data/vendor/pygments-main/pygments/lexers/freefem.py +7 -10
- data/vendor/pygments-main/pygments/lexers/func.py +108 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +1 -1
- data/vendor/pygments-main/pygments/lexers/futhark.py +12 -17
- data/vendor/pygments-main/pygments/lexers/gcodelexer.py +1 -2
- data/vendor/pygments-main/pygments/lexers/gdscript.py +76 -233
- data/vendor/pygments-main/pygments/lexers/go.py +12 -14
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +22 -26
- data/vendor/pygments-main/pygments/lexers/graph.py +36 -15
- data/vendor/pygments-main/pygments/lexers/graphics.py +37 -38
- data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -1
- data/vendor/pygments-main/pygments/lexers/gsql.py +39 -27
- data/vendor/pygments-main/pygments/lexers/haskell.py +73 -71
- data/vendor/pygments-main/pygments/lexers/haxe.py +13 -11
- data/vendor/pygments-main/pygments/lexers/hdl.py +31 -34
- data/vendor/pygments-main/pygments/lexers/hexdump.py +21 -21
- data/vendor/pygments-main/pygments/lexers/html.py +11 -19
- data/vendor/pygments-main/pygments/lexers/idl.py +10 -5
- data/vendor/pygments-main/pygments/lexers/igor.py +3 -2
- data/vendor/pygments-main/pygments/lexers/inferno.py +9 -8
- data/vendor/pygments-main/pygments/lexers/installers.py +39 -33
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +35 -20
- data/vendor/pygments-main/pygments/lexers/iolang.py +9 -9
- data/vendor/pygments-main/pygments/lexers/j.py +20 -13
- data/vendor/pygments-main/pygments/lexers/javascript.py +183 -149
- data/vendor/pygments-main/pygments/lexers/jmespath.py +68 -0
- data/vendor/pygments-main/pygments/lexers/jslt.py +4 -3
- data/vendor/pygments-main/pygments/lexers/jsonnet.py +168 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +44 -32
- data/vendor/pygments-main/pygments/lexers/jvm.py +161 -140
- data/vendor/pygments-main/pygments/lexers/kuin.py +93 -59
- data/vendor/pygments-main/pygments/lexers/lilypond.py +226 -0
- data/vendor/pygments-main/pygments/lexers/lisp.py +244 -107
- data/vendor/pygments-main/pygments/lexers/macaulay2.py +1739 -0
- data/vendor/pygments-main/pygments/lexers/make.py +21 -16
- data/vendor/pygments-main/pygments/lexers/markup.py +752 -11
- data/vendor/pygments-main/pygments/lexers/math.py +1 -1
- data/vendor/pygments-main/pygments/lexers/matlab.py +18 -3
- data/vendor/pygments-main/pygments/lexers/maxima.py +85 -0
- data/vendor/pygments-main/pygments/lexers/meson.py +10 -25
- data/vendor/pygments-main/pygments/lexers/mime.py +2 -2
- data/vendor/pygments-main/pygments/lexers/minecraft.py +394 -0
- data/vendor/pygments-main/pygments/lexers/mips.py +128 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +9 -6
- data/vendor/pygments-main/pygments/lexers/modeling.py +12 -8
- data/vendor/pygments-main/pygments/lexers/modula2.py +3 -2
- data/vendor/pygments-main/pygments/lexers/monte.py +3 -2
- data/vendor/pygments-main/pygments/lexers/mosel.py +1 -1
- data/vendor/pygments-main/pygments/lexers/ncl.py +1 -1
- data/vendor/pygments-main/pygments/lexers/nimrod.py +62 -20
- data/vendor/pygments-main/pygments/lexers/nit.py +3 -2
- data/vendor/pygments-main/pygments/lexers/nix.py +5 -5
- data/vendor/pygments-main/pygments/lexers/oberon.py +2 -2
- data/vendor/pygments-main/pygments/lexers/objective.py +6 -4
- data/vendor/pygments-main/pygments/lexers/ooc.py +3 -2
- data/vendor/pygments-main/pygments/lexers/other.py +1 -1
- data/vendor/pygments-main/pygments/lexers/parasail.py +3 -2
- data/vendor/pygments-main/pygments/lexers/parsers.py +23 -21
- data/vendor/pygments-main/pygments/lexers/pascal.py +196 -198
- data/vendor/pygments-main/pygments/lexers/pawn.py +1 -1
- data/vendor/pygments-main/pygments/lexers/perl.py +17 -15
- data/vendor/pygments-main/pygments/lexers/phix.py +364 -0
- data/vendor/pygments-main/pygments/lexers/php.py +35 -20
- data/vendor/pygments-main/pygments/lexers/pointless.py +3 -2
- data/vendor/pygments-main/pygments/lexers/pony.py +1 -1
- data/vendor/pygments-main/pygments/lexers/praat.py +41 -38
- data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
- data/vendor/pygments-main/pygments/lexers/prolog.py +7 -8
- data/vendor/pygments-main/pygments/lexers/promql.py +5 -12
- data/vendor/pygments-main/pygments/lexers/python.py +145 -119
- data/vendor/pygments-main/pygments/lexers/q.py +188 -0
- data/vendor/pygments-main/pygments/lexers/qlik.py +117 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +1 -1
- data/vendor/pygments-main/pygments/lexers/r.py +4 -4
- data/vendor/pygments-main/pygments/lexers/rdf.py +3 -3
- data/vendor/pygments-main/pygments/lexers/rebol.py +1 -12
- data/vendor/pygments-main/pygments/lexers/resource.py +1 -1
- data/vendor/pygments-main/pygments/lexers/ride.py +3 -2
- data/vendor/pygments-main/pygments/lexers/rita.py +43 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +3 -2
- data/vendor/pygments-main/pygments/lexers/roboconf.py +3 -3
- data/vendor/pygments-main/pygments/lexers/robotframework.py +6 -5
- data/vendor/pygments-main/pygments/lexers/ruby.py +24 -24
- data/vendor/pygments-main/pygments/lexers/rust.py +3 -2
- data/vendor/pygments-main/pygments/lexers/sas.py +2 -2
- data/vendor/pygments-main/pygments/lexers/savi.py +170 -0
- data/vendor/pygments-main/pygments/lexers/scdoc.py +4 -7
- data/vendor/pygments-main/pygments/lexers/scripting.py +24 -21
- data/vendor/pygments-main/pygments/lexers/sgf.py +6 -6
- data/vendor/pygments-main/pygments/lexers/shell.py +29 -21
- data/vendor/pygments-main/pygments/lexers/sieve.py +14 -4
- data/vendor/pygments-main/pygments/lexers/slash.py +1 -1
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +5 -3
- data/vendor/pygments-main/pygments/lexers/smithy.py +5 -6
- data/vendor/pygments-main/pygments/lexers/smv.py +1 -1
- data/vendor/pygments-main/pygments/lexers/snobol.py +1 -1
- data/vendor/pygments-main/pygments/lexers/solidity.py +3 -7
- data/vendor/pygments-main/pygments/lexers/sophia.py +103 -0
- data/vendor/pygments-main/pygments/lexers/special.py +2 -5
- data/vendor/pygments-main/pygments/lexers/spice.py +71 -0
- data/vendor/pygments-main/pygments/lexers/sql.py +212 -17
- data/vendor/pygments-main/pygments/lexers/srcinfo.py +62 -0
- data/vendor/pygments-main/pygments/lexers/stata.py +4 -3
- data/vendor/pygments-main/pygments/lexers/supercollider.py +4 -3
- data/vendor/pygments-main/pygments/lexers/tal.py +74 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +21 -16
- data/vendor/pygments-main/pygments/lexers/teal.py +9 -8
- data/vendor/pygments-main/pygments/lexers/templates.py +62 -29
- data/vendor/pygments-main/pygments/lexers/teraterm.py +12 -20
- data/vendor/pygments-main/pygments/lexers/testing.py +6 -2
- data/vendor/pygments-main/pygments/lexers/text.py +3 -2
- data/vendor/pygments-main/pygments/lexers/textedit.py +41 -7
- data/vendor/pygments-main/pygments/lexers/textfmts.py +7 -5
- data/vendor/pygments-main/pygments/lexers/theorem.py +42 -36
- data/vendor/pygments-main/pygments/lexers/thingsdb.py +2 -4
- data/vendor/pygments-main/pygments/lexers/tlb.py +57 -0
- data/vendor/pygments-main/pygments/lexers/tnt.py +3 -4
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +2 -4
- data/vendor/pygments-main/pygments/lexers/typoscript.py +2 -3
- data/vendor/pygments-main/pygments/lexers/ul4.py +267 -0
- data/vendor/pygments-main/pygments/lexers/unicon.py +1 -1
- data/vendor/pygments-main/pygments/lexers/urbi.py +4 -4
- data/vendor/pygments-main/pygments/lexers/usd.py +2 -1
- data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
- data/vendor/pygments-main/pygments/lexers/verification.py +4 -3
- data/vendor/pygments-main/pygments/lexers/web.py +1 -1
- data/vendor/pygments-main/pygments/lexers/webassembly.py +5 -5
- data/vendor/pygments-main/pygments/lexers/webidl.py +2 -1
- data/vendor/pygments-main/pygments/lexers/webmisc.py +90 -71
- data/vendor/pygments-main/pygments/lexers/wgsl.py +407 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +2 -1
- data/vendor/pygments-main/pygments/lexers/wowtoc.py +120 -0
- data/vendor/pygments-main/pygments/lexers/wren.py +99 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +5 -6
- data/vendor/pygments-main/pygments/lexers/xorg.py +3 -2
- data/vendor/pygments-main/pygments/lexers/yang.py +6 -5
- data/vendor/pygments-main/pygments/lexers/zig.py +3 -2
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +28 -9
- data/vendor/pygments-main/pygments/regexopt.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +2 -2
- data/vendor/pygments-main/pygments/sphinxext.py +63 -1
- data/vendor/pygments-main/pygments/style.py +7 -1
- data/vendor/pygments-main/pygments/styles/__init__.py +19 -5
- data/vendor/pygments-main/pygments/styles/abap.py +2 -2
- data/vendor/pygments-main/pygments/styles/algol.py +1 -2
- data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -2
- data/vendor/pygments-main/pygments/styles/arduino.py +2 -3
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -3
- data/vendor/pygments-main/pygments/styles/borland.py +1 -3
- data/vendor/pygments-main/pygments/styles/bw.py +1 -2
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -3
- data/vendor/pygments-main/pygments/styles/default.py +13 -14
- data/vendor/pygments-main/pygments/styles/dracula.py +102 -0
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -2
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -2
- data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +75 -0
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/gh_dark.py +107 -0
- data/vendor/pygments-main/pygments/styles/gruvbox.py +4 -2
- data/vendor/pygments-main/pygments/styles/igor.py +1 -2
- data/vendor/pygments-main/pygments/styles/inkpot.py +3 -2
- data/vendor/pygments-main/pygments/styles/lilypond.py +56 -0
- data/vendor/pygments-main/pygments/styles/lovelace.py +1 -3
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/material.py +1 -2
- data/vendor/pygments-main/pygments/styles/monokai.py +3 -3
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -3
- data/vendor/pygments-main/pygments/styles/native.py +11 -11
- data/vendor/pygments-main/pygments/styles/nord.py +150 -0
- data/vendor/pygments-main/pygments/styles/onedark.py +59 -0
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -6
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -6
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -3
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -2
- data/vendor/pygments-main/pygments/styles/rainbow_dash.py +3 -3
- data/vendor/pygments-main/pygments/styles/rrt.py +3 -2
- data/vendor/pygments-main/pygments/styles/sas.py +2 -4
- data/vendor/pygments-main/pygments/styles/solarized.py +1 -1
- data/vendor/pygments-main/pygments/styles/staroffice.py +26 -0
- data/vendor/pygments-main/pygments/styles/stata_dark.py +4 -6
- data/vendor/pygments-main/pygments/styles/stata_light.py +1 -2
- data/vendor/pygments-main/pygments/styles/tango.py +2 -3
- data/vendor/pygments-main/pygments/styles/trac.py +1 -3
- data/vendor/pygments-main/pygments/styles/vim.py +1 -2
- data/vendor/pygments-main/pygments/styles/vs.py +1 -2
- data/vendor/pygments-main/pygments/styles/xcode.py +1 -3
- data/vendor/pygments-main/pygments/styles/zenburn.py +4 -6
- data/vendor/pygments-main/pygments/token.py +2 -1
- data/vendor/pygments-main/pygments/unistring.py +4 -6
- data/vendor/pygments-main/pygments/util.py +27 -5
- metadata +59 -14
- data/vendor/pygments-main/Pygments-2.10.0.dist-info/RECORD +0 -524
- /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/INSTALLER +0 -0
- /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/REQUESTED +0 -0
- /data/vendor/pygments-main/{Pygments-2.10.0.dist-info → Pygments-2.15.1.dist-info}/top_level.txt +0 -0
@@ -4,28 +4,27 @@
|
|
4
4
|
|
5
5
|
Lexers for .net languages.
|
6
6
|
|
7
|
-
:copyright: Copyright 2006-
|
7
|
+
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
|
8
8
|
:license: BSD, see LICENSE for details.
|
9
9
|
"""
|
10
10
|
import re
|
11
11
|
|
12
12
|
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \
|
13
13
|
using, this, default, words
|
14
|
-
from pygments.token import Punctuation, \
|
15
|
-
|
14
|
+
from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \
|
15
|
+
Name, String, Number, Literal, Other, Whitespace
|
16
16
|
from pygments.util import get_choice_opt
|
17
17
|
from pygments import unistring as uni
|
18
18
|
|
19
19
|
from pygments.lexers.html import XmlLexer
|
20
20
|
|
21
21
|
__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer',
|
22
|
-
'CSharpAspxLexer', 'VbNetAspxLexer', 'FSharpLexer']
|
22
|
+
'CSharpAspxLexer', 'VbNetAspxLexer', 'FSharpLexer', 'XppLexer']
|
23
23
|
|
24
24
|
|
25
25
|
class CSharpLexer(RegexLexer):
|
26
26
|
"""
|
27
|
-
For
|
28
|
-
source code.
|
27
|
+
For C# source code.
|
29
28
|
|
30
29
|
Additional options accepted:
|
31
30
|
|
@@ -47,11 +46,12 @@ class CSharpLexer(RegexLexer):
|
|
47
46
|
"""
|
48
47
|
|
49
48
|
name = 'C#'
|
50
|
-
|
49
|
+
url = 'https://docs.microsoft.com/en-us/dotnet/csharp/'
|
50
|
+
aliases = ['csharp', 'c#', 'cs']
|
51
51
|
filenames = ['*.cs']
|
52
52
|
mimetypes = ['text/x-csharp'] # inferred
|
53
53
|
|
54
|
-
flags = re.MULTILINE | re.DOTALL
|
54
|
+
flags = re.MULTILINE | re.DOTALL
|
55
55
|
|
56
56
|
# for the range of allowed unicode characters in identifiers, see
|
57
57
|
# http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
|
@@ -62,9 +62,9 @@ class CSharpLexer(RegexLexer):
|
|
62
62
|
'[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
|
63
63
|
'Cf', 'Mn', 'Mc') + ']*'),
|
64
64
|
'full': ('@?(?:_|[^' +
|
65
|
-
uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
|
66
|
-
|
67
|
-
|
65
|
+
uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' +
|
66
|
+
'[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
|
67
|
+
'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'),
|
68
68
|
}
|
69
69
|
|
70
70
|
tokens = {}
|
@@ -74,27 +74,36 @@ class CSharpLexer(RegexLexer):
|
|
74
74
|
tokens[levelname] = {
|
75
75
|
'root': [
|
76
76
|
# method names
|
77
|
-
(r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
|
77
|
+
(r'^([ \t]*)((?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
|
78
78
|
r'(' + cs_ident + ')' # method name
|
79
79
|
r'(\s*)(\()', # signature start
|
80
|
-
bygroups(using(this), Name.Function,
|
81
|
-
|
82
|
-
(r'[
|
83
|
-
(r'
|
80
|
+
bygroups(Whitespace, using(this), Name.Function, Whitespace,
|
81
|
+
Punctuation)),
|
82
|
+
(r'^(\s*)(\[.*?\])', bygroups(Whitespace, Name.Attribute)),
|
83
|
+
(r'[^\S\n]+', Whitespace),
|
84
|
+
(r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation
|
84
85
|
(r'//.*?\n', Comment.Single),
|
85
86
|
(r'/[*].*?[*]/', Comment.Multiline),
|
86
|
-
(r'\n',
|
87
|
-
(
|
87
|
+
(r'\n', Whitespace),
|
88
|
+
(words((
|
89
|
+
'>>>=', '>>=', '<<=', '<=', '>=', '+=', '-=', '*=', '/=',
|
90
|
+
'%=', '&=', '|=', '^=', '??=', '=>', '??', '?.', '!=', '==',
|
91
|
+
'&&', '||', '>>>', '>>', '<<', '++', '--', '+', '-', '*',
|
92
|
+
'/', '%', '&', '|', '^', '<', '>', '?', '!', '~', '=',
|
93
|
+
)), Operator),
|
94
|
+
(r'=~|!=|==|<<|>>|[-+/*%=<>&^|]', Operator),
|
95
|
+
(r'[()\[\];:,.]', Punctuation),
|
88
96
|
(r'[{}]', Punctuation),
|
89
97
|
(r'@"(""|[^"])*"', String),
|
90
98
|
(r'\$?"(\\\\|\\[^\\]|[^"\\\n])*["\n]', String),
|
91
99
|
(r"'\\.'|'[^\\]'", String.Char),
|
92
|
-
(r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
|
100
|
+
(r"[0-9]+(\.[0-9]*)?([eE][+-][0-9]+)?"
|
93
101
|
r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
|
94
|
-
(r'#[ \t]*(if|endif|else|elif|define|undef|'
|
95
|
-
r'line|error|warning|region|endregion|pragma)\b
|
96
|
-
Comment.Preproc
|
97
|
-
|
102
|
+
(r'(#)([ \t]*)(if|endif|else|elif|define|undef|'
|
103
|
+
r'line|error|warning|region|endregion|pragma)\b(.*?)(\n)',
|
104
|
+
bygroups(Comment.Preproc, Whitespace, Comment.Preproc,
|
105
|
+
Comment.Preproc, Whitespace)),
|
106
|
+
(r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Whitespace,
|
98
107
|
Keyword)),
|
99
108
|
(r'(abstract|as|async|await|base|break|by|case|catch|'
|
100
109
|
r'checked|const|continue|default|delegate|'
|
@@ -111,8 +120,8 @@ class CSharpLexer(RegexLexer):
|
|
111
120
|
(r'(global)(::)', bygroups(Keyword, Punctuation)),
|
112
121
|
(r'(bool|byte|char|decimal|double|dynamic|float|int|long|object|'
|
113
122
|
r'sbyte|short|string|uint|ulong|ushort|var)\b\??', Keyword.Type),
|
114
|
-
(r'(class|struct)(\s+)', bygroups(Keyword,
|
115
|
-
(r'(namespace|using)(\s+)', bygroups(Keyword,
|
123
|
+
(r'(class|struct)(\s+)', bygroups(Keyword, Whitespace), 'class'),
|
124
|
+
(r'(namespace|using)(\s+)', bygroups(Keyword, Whitespace), 'namespace'),
|
116
125
|
(cs_ident, Name),
|
117
126
|
],
|
118
127
|
'class': [
|
@@ -138,7 +147,7 @@ class CSharpLexer(RegexLexer):
|
|
138
147
|
|
139
148
|
class NemerleLexer(RegexLexer):
|
140
149
|
"""
|
141
|
-
For
|
150
|
+
For Nemerle source code.
|
142
151
|
|
143
152
|
Additional options accepted:
|
144
153
|
|
@@ -160,11 +169,12 @@ class NemerleLexer(RegexLexer):
|
|
160
169
|
"""
|
161
170
|
|
162
171
|
name = 'Nemerle'
|
172
|
+
url = 'http://nemerle.org'
|
163
173
|
aliases = ['nemerle']
|
164
174
|
filenames = ['*.n']
|
165
175
|
mimetypes = ['text/x-nemerle'] # inferred
|
166
176
|
|
167
|
-
flags = re.MULTILINE | re.DOTALL
|
177
|
+
flags = re.MULTILINE | re.DOTALL
|
168
178
|
|
169
179
|
# for the range of allowed unicode characters in identifiers, see
|
170
180
|
# http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
|
@@ -175,9 +185,9 @@ class NemerleLexer(RegexLexer):
|
|
175
185
|
'[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
|
176
186
|
'Cf', 'Mn', 'Mc') + ']*'),
|
177
187
|
'full': ('@?(?:_|[^' +
|
178
|
-
uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
|
179
|
-
|
180
|
-
|
188
|
+
uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' +
|
189
|
+
'[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
|
190
|
+
'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'),
|
181
191
|
}
|
182
192
|
|
183
193
|
tokens = {}
|
@@ -187,21 +197,25 @@ class NemerleLexer(RegexLexer):
|
|
187
197
|
tokens[levelname] = {
|
188
198
|
'root': [
|
189
199
|
# method names
|
190
|
-
(r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
|
200
|
+
(r'^([ \t]*)((?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
|
191
201
|
r'(' + cs_ident + ')' # method name
|
192
202
|
r'(\s*)(\()', # signature start
|
193
|
-
bygroups(using(this), Name.Function,
|
194
|
-
|
195
|
-
(r'[
|
196
|
-
(r'
|
203
|
+
bygroups(Whitespace, using(this), Name.Function, Whitespace, \
|
204
|
+
Punctuation)),
|
205
|
+
(r'^(\s*)(\[.*?\])', bygroups(Whitespace, Name.Attribute)),
|
206
|
+
(r'[^\S\n]+', Whitespace),
|
207
|
+
(r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation
|
197
208
|
(r'//.*?\n', Comment.Single),
|
198
209
|
(r'/[*].*?[*]/', Comment.Multiline),
|
199
|
-
(r'\n',
|
200
|
-
(r'
|
201
|
-
|
210
|
+
(r'\n', Whitespace),
|
211
|
+
(r'(\$)(\s*)(")', bygroups(String, Whitespace, String),
|
212
|
+
'splice-string'),
|
213
|
+
(r'(\$)(\s*)(<#)', bygroups(String, Whitespace, String),
|
214
|
+
'splice-string2'),
|
202
215
|
(r'<#', String, 'recursive-string'),
|
203
216
|
|
204
|
-
(r'(<\[)\s*(' + cs_ident + ':)?',
|
217
|
+
(r'(<\[)(\s*)(' + cs_ident + ':)?',
|
218
|
+
bygroups(Keyword, Whitespace, Keyword)),
|
205
219
|
(r'\]\>', Keyword),
|
206
220
|
|
207
221
|
# quasiquotation only
|
@@ -216,11 +230,10 @@ class NemerleLexer(RegexLexer):
|
|
216
230
|
(r"'\\.'|'[^\\]'", String.Char),
|
217
231
|
(r"0[xX][0-9a-fA-F]+[Ll]?", Number),
|
218
232
|
(r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?", Number),
|
219
|
-
(r'#[ \t]*(if|endif|else|elif|define|undef|'
|
220
|
-
r'line|error|warning|region|endregion|pragma)\b
|
221
|
-
Comment.Preproc),
|
222
|
-
(r'\b(extern)(\s+)(alias)\b', bygroups(Keyword,
|
223
|
-
Keyword)),
|
233
|
+
(r'(#)([ \t]*)(if|endif|else|elif|define|undef|'
|
234
|
+
r'line|error|warning|region|endregion|pragma)\b',
|
235
|
+
bygroups(Comment.Preproc, Whitespace, Comment.Preproc), 'preproc'),
|
236
|
+
(r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Whitespace, Keyword)),
|
224
237
|
(r'(abstract|and|as|base|catch|def|delegate|'
|
225
238
|
r'enum|event|extern|false|finally|'
|
226
239
|
r'fun|implements|interface|internal|'
|
@@ -237,17 +250,22 @@ class NemerleLexer(RegexLexer):
|
|
237
250
|
(r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
|
238
251
|
r'short|string|uint|ulong|ushort|void|array|list)\b\??',
|
239
252
|
Keyword.Type),
|
240
|
-
(r'(:>?)\s*(' + cs_ident + r'\??)',
|
241
|
-
bygroups(Punctuation, Keyword.Type)),
|
253
|
+
(r'(:>?)(\s*)(' + cs_ident + r'\??)',
|
254
|
+
bygroups(Punctuation, Whitespace, Keyword.Type)),
|
242
255
|
(r'(class|struct|variant|module)(\s+)',
|
243
|
-
bygroups(Keyword,
|
244
|
-
(r'(namespace|using)(\s+)', bygroups(Keyword,
|
256
|
+
bygroups(Keyword, Whitespace), 'class'),
|
257
|
+
(r'(namespace|using)(\s+)', bygroups(Keyword, Whitespace),
|
245
258
|
'namespace'),
|
246
259
|
(cs_ident, Name),
|
247
260
|
],
|
248
261
|
'class': [
|
249
262
|
(cs_ident, Name.Class, '#pop')
|
250
263
|
],
|
264
|
+
'preproc': [
|
265
|
+
(r'\w+', Comment.Preproc),
|
266
|
+
(r'[ \t]+', Whitespace),
|
267
|
+
(r'\n', Whitespace, '#pop')
|
268
|
+
],
|
251
269
|
'namespace': [
|
252
270
|
(r'(?=\()', Text, '#pop'), # using (resource)
|
253
271
|
('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop')
|
@@ -307,21 +325,22 @@ class NemerleLexer(RegexLexer):
|
|
307
325
|
|
308
326
|
class BooLexer(RegexLexer):
|
309
327
|
"""
|
310
|
-
For
|
328
|
+
For Boo source code.
|
311
329
|
"""
|
312
330
|
|
313
331
|
name = 'Boo'
|
332
|
+
url = 'https://github.com/boo-lang/boo'
|
314
333
|
aliases = ['boo']
|
315
334
|
filenames = ['*.boo']
|
316
335
|
mimetypes = ['text/x-boo']
|
317
336
|
|
318
337
|
tokens = {
|
319
338
|
'root': [
|
320
|
-
(r'\s+',
|
339
|
+
(r'\s+', Whitespace),
|
321
340
|
(r'(#|//).*$', Comment.Single),
|
322
341
|
(r'/[*]', Comment.Multiline, 'comment'),
|
323
342
|
(r'[]{}:(),.;[]', Punctuation),
|
324
|
-
(r'
|
343
|
+
(r'(\\)(\n)', bygroups(Text, Whitespace)),
|
325
344
|
(r'\\', Text),
|
326
345
|
(r'(in|is|and|or|not)\b', Operator.Word),
|
327
346
|
(r'/(\\\\|\\[^\\]|[^/\\\s])/', String.Regex),
|
@@ -335,9 +354,9 @@ class BooLexer(RegexLexer):
|
|
335
354
|
r'is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|'
|
336
355
|
r'while|from|as)\b', Keyword),
|
337
356
|
(r'def(?=\s+\(.*?\))', Keyword),
|
338
|
-
(r'(def)(\s+)', bygroups(Keyword,
|
339
|
-
(r'(class)(\s+)', bygroups(Keyword,
|
340
|
-
(r'(namespace)(\s+)', bygroups(Keyword,
|
357
|
+
(r'(def)(\s+)', bygroups(Keyword, Whitespace), 'funcname'),
|
358
|
+
(r'(class)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
359
|
+
(r'(namespace)(\s+)', bygroups(Keyword, Whitespace), 'namespace'),
|
341
360
|
(r'(?<!\.)(true|false|null|self|__eval__|__switch__|array|'
|
342
361
|
r'assert|checked|enumerate|filter|getter|len|lock|map|'
|
343
362
|
r'matrix|max|min|normalArrayIndexing|print|property|range|'
|
@@ -374,13 +393,13 @@ class BooLexer(RegexLexer):
|
|
374
393
|
|
375
394
|
class VbNetLexer(RegexLexer):
|
376
395
|
"""
|
377
|
-
For
|
378
|
-
|
379
|
-
source code.
|
396
|
+
For Visual Basic.NET source code.
|
397
|
+
Also LibreOffice Basic, OpenOffice Basic, and StarOffice Basic.
|
380
398
|
"""
|
381
399
|
|
382
400
|
name = 'VB.net'
|
383
|
-
|
401
|
+
url = 'https://docs.microsoft.com/en-us/dotnet/visual-basic/'
|
402
|
+
aliases = ['vb.net', 'vbnet', 'lobas', 'oobas', 'sobas']
|
384
403
|
filenames = ['*.vb', '*.bas']
|
385
404
|
mimetypes = ['text/x-vbnet', 'text/x-vba'] # (?)
|
386
405
|
|
@@ -392,17 +411,19 @@ class VbNetLexer(RegexLexer):
|
|
392
411
|
tokens = {
|
393
412
|
'root': [
|
394
413
|
(r'^\s*<.*?>', Name.Attribute),
|
395
|
-
(r'\s+',
|
396
|
-
(r'\n',
|
397
|
-
(r'rem\b
|
398
|
-
(r"'
|
414
|
+
(r'\s+', Whitespace),
|
415
|
+
(r'\n', Whitespace),
|
416
|
+
(r'(rem\b.*?)(\n)', bygroups(Comment, Whitespace)),
|
417
|
+
(r"('.*?)(\n)", bygroups(Comment, Whitespace)),
|
399
418
|
(r'#If\s.*?\sThen|#ElseIf\s.*?\sThen|#Else|#End\s+If|#Const|'
|
400
419
|
r'#ExternalSource.*?\n|#End\s+ExternalSource|'
|
401
420
|
r'#Region.*?\n|#End\s+Region|#ExternalChecksum',
|
402
421
|
Comment.Preproc),
|
403
422
|
(r'[(){}!#,.:]', Punctuation),
|
404
|
-
(r'Option\s+(Strict|Explicit|Compare)\s+'
|
405
|
-
r'(On|Off|Binary|Text)',
|
423
|
+
(r'(Option)(\s+)(Strict|Explicit|Compare)(\s+)'
|
424
|
+
r'(On|Off|Binary|Text)',
|
425
|
+
bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration,
|
426
|
+
Whitespace, Keyword.Declaration)),
|
406
427
|
(words((
|
407
428
|
'AddHandler', 'Alias', 'ByRef', 'ByVal', 'Call', 'Case',
|
408
429
|
'Catch', 'CBool', 'CByte', 'CChar', 'CDate', 'CDec', 'CDbl',
|
@@ -426,11 +447,11 @@ class VbNetLexer(RegexLexer):
|
|
426
447
|
(r'(?<!\.)End\b', Keyword, 'end'),
|
427
448
|
(r'(?<!\.)(Dim|Const)\b', Keyword, 'dim'),
|
428
449
|
(r'(?<!\.)(Function|Sub|Property)(\s+)',
|
429
|
-
bygroups(Keyword,
|
450
|
+
bygroups(Keyword, Whitespace), 'funcname'),
|
430
451
|
(r'(?<!\.)(Class|Structure|Enum)(\s+)',
|
431
|
-
bygroups(Keyword,
|
452
|
+
bygroups(Keyword, Whitespace), 'classname'),
|
432
453
|
(r'(?<!\.)(Module|Namespace|Imports)(\s+)',
|
433
|
-
bygroups(Keyword,
|
454
|
+
bygroups(Keyword, Whitespace), 'namespace'),
|
434
455
|
(r'(?<!\.)(Boolean|Byte|Char|Date|Decimal|Double|Integer|Long|'
|
435
456
|
r'Object|SByte|Short|Single|String|Variant|UInteger|ULong|'
|
436
457
|
r'UShort)\b', Keyword.Type),
|
@@ -440,7 +461,7 @@ class VbNetLexer(RegexLexer):
|
|
440
461
|
r'<=|>=|<>|[-&*/\\^+=<>\[\]]',
|
441
462
|
Operator),
|
442
463
|
('"', String, 'string'),
|
443
|
-
(r'_\n', Text), # Line continuation (must be before Name)
|
464
|
+
(r'(_)(\n)', bygroups(Text, Whitespace)), # Line continuation (must be before Name)
|
444
465
|
(uni_name + '[%&@!#$]?', Name),
|
445
466
|
('#.*?#', Literal.Date),
|
446
467
|
(r'(\d+\.\d*|\d*\.\d+)(F[+-]?[0-9]+)?', Number.Float),
|
@@ -469,7 +490,7 @@ class VbNetLexer(RegexLexer):
|
|
469
490
|
default('#pop'),
|
470
491
|
],
|
471
492
|
'end': [
|
472
|
-
(r'\s+',
|
493
|
+
(r'\s+', Whitespace),
|
473
494
|
(r'(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b',
|
474
495
|
Keyword, '#pop'),
|
475
496
|
default('#pop'),
|
@@ -548,14 +569,15 @@ class VbNetAspxLexer(DelegatingLexer):
|
|
548
569
|
# Very close to functional.OcamlLexer
|
549
570
|
class FSharpLexer(RegexLexer):
|
550
571
|
"""
|
551
|
-
For the
|
572
|
+
For the F# language (version 3.0).
|
552
573
|
|
553
574
|
.. versionadded:: 1.5
|
554
575
|
"""
|
555
576
|
|
556
577
|
name = 'F#'
|
578
|
+
url = 'https://fsharp.org/'
|
557
579
|
aliases = ['fsharp', 'f#']
|
558
|
-
filenames = ['*.fs', '*.fsi']
|
580
|
+
filenames = ['*.fs', '*.fsi', '*.fsx']
|
559
581
|
mimetypes = ['text/x-fsharp']
|
560
582
|
|
561
583
|
keywords = [
|
@@ -606,13 +628,13 @@ class FSharpLexer(RegexLexer):
|
|
606
628
|
(r'\\U[0-9a-fA-F]{8}', String.Escape),
|
607
629
|
],
|
608
630
|
'root': [
|
609
|
-
(r'\s+',
|
631
|
+
(r'\s+', Whitespace),
|
610
632
|
(r'\(\)|\[\]', Name.Builtin.Pseudo),
|
611
633
|
(r'\b(?<!\.)([A-Z][\w\']*)(?=\s*\.)',
|
612
634
|
Name.Namespace, 'dotted'),
|
613
635
|
(r'\b([A-Z][\w\']*)', Name),
|
614
|
-
(r'
|
615
|
-
(r'
|
636
|
+
(r'(///.*?)(\n)', bygroups(String.Doc, Whitespace)),
|
637
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
616
638
|
(r'\(\*(?!\))', Comment, 'comment'),
|
617
639
|
|
618
640
|
(r'@"', String, 'lstring'),
|
@@ -620,21 +642,22 @@ class FSharpLexer(RegexLexer):
|
|
620
642
|
(r'"', String, 'string'),
|
621
643
|
|
622
644
|
(r'\b(open|module)(\s+)([\w.]+)',
|
623
|
-
bygroups(Keyword,
|
645
|
+
bygroups(Keyword, Whitespace, Name.Namespace)),
|
624
646
|
(r'\b(let!?)(\s+)(\w+)',
|
625
|
-
bygroups(Keyword,
|
647
|
+
bygroups(Keyword, Whitespace, Name.Variable)),
|
626
648
|
(r'\b(type)(\s+)(\w+)',
|
627
|
-
bygroups(Keyword,
|
649
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
628
650
|
(r'\b(member|override)(\s+)(\w+)(\.)(\w+)',
|
629
|
-
bygroups(Keyword,
|
651
|
+
bygroups(Keyword, Whitespace, Name, Punctuation, Name.Function)),
|
630
652
|
(r'\b(%s)\b' % '|'.join(keywords), Keyword),
|
631
653
|
(r'``([^`\n\r\t]|`[^`\n\r\t])+``', Name),
|
632
654
|
(r'(%s)' % '|'.join(keyopts), Operator),
|
633
655
|
(r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
|
634
656
|
(r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
|
635
657
|
(r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
|
636
|
-
(r'#[ \t]*(if|endif|else|line|nowarn|light|\d+)\b
|
637
|
-
Comment.Preproc
|
658
|
+
(r'(#)([ \t]*)(if|endif|else|line|nowarn|light|\d+)\b(.*?)(\n)',
|
659
|
+
bygroups(Comment.Preproc, Whitespace, Comment.Preproc,
|
660
|
+
Comment.Preproc, Whitespace)),
|
638
661
|
|
639
662
|
(r"[^\W\d][\w']*", Name),
|
640
663
|
|
@@ -655,7 +678,7 @@ class FSharpLexer(RegexLexer):
|
|
655
678
|
(r'[~?][a-z][\w\']*:', Name.Variable),
|
656
679
|
],
|
657
680
|
'dotted': [
|
658
|
-
(r'\s+',
|
681
|
+
(r'\s+', Whitespace),
|
659
682
|
(r'\.', Punctuation),
|
660
683
|
(r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace),
|
661
684
|
(r'[A-Z][\w\']*', Name, '#pop'),
|
@@ -704,3 +727,115 @@ class FSharpLexer(RegexLexer):
|
|
704
727
|
result += 0.05
|
705
728
|
|
706
729
|
return result
|
730
|
+
|
731
|
+
|
732
|
+
class XppLexer(RegexLexer):
|
733
|
+
|
734
|
+
"""
|
735
|
+
For X++ source code. This is based loosely on the CSharpLexer
|
736
|
+
|
737
|
+
.. versionadded:: 2.15
|
738
|
+
"""
|
739
|
+
|
740
|
+
name = 'X++'
|
741
|
+
url = 'https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-language-reference'
|
742
|
+
aliases = ['xpp', 'x++']
|
743
|
+
filenames = ['*.xpp']
|
744
|
+
|
745
|
+
flags = re.MULTILINE
|
746
|
+
|
747
|
+
XPP_CHARS = ('@?(?:_|[^' +
|
748
|
+
uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' +
|
749
|
+
'[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
|
750
|
+
'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*');
|
751
|
+
# Temporary, see
|
752
|
+
# https://github.com/thatch/regexlint/pull/49
|
753
|
+
XPP_CHARS = XPP_CHARS.replace('\x00', '\x01')
|
754
|
+
|
755
|
+
OPERATORS = (
|
756
|
+
'<=', '>=', '+=', '-=', '*=', '/=', '!=', '==',
|
757
|
+
'&&', '||', '>>', '<<', '++', '--', '+', '-', '*',
|
758
|
+
'/', '%', '&', '|', '^', '<', '>', '?', '!', '~', '=',
|
759
|
+
)
|
760
|
+
KEYWORDS = ('abstract','anytype','as','async','asc','at','avg','break','breakpoint','by','byref','case','catch',
|
761
|
+
'changecompany','client','container','continue','count','crosscompany','default','delegate',
|
762
|
+
'delete_from','desc','display','div','do','edit','else','element','eventhandler','exists','false','final',
|
763
|
+
'firstfast','firstonly','firstonly10','firstonly100','firstonly1000','flush','for','forceliterals',
|
764
|
+
'forcenestedloop','forceplaceholders','forceselectorder','forupdate','from','group','if','insert_recordset',
|
765
|
+
'interface','is','join','like','maxof','minof','mod','new','next','nofetch','notexists','null','optimisticlock','order',
|
766
|
+
'outer','pause','pessimisticlock','print','private','protected','public','repeatableread','retry','return',
|
767
|
+
'reverse','select','server','setting','static','sum','super','switch','tablelock','this','throw','true','try','ttsabort','ttsbegin',
|
768
|
+
'ttscommit','update_recordset','validtimestate','void','where','while','window')
|
769
|
+
RUNTIME_FUNCTIONS = ('_duration','abs','acos','any2Date','any2Enum','any2Guid','any2Int','any2Int64','any2Real','any2Str','anytodate',
|
770
|
+
'anytoenum','anytoguid','anytoint','anytoint64','anytoreal','anytostr','asin','atan','beep','cTerm','char2Num','classIdGet',
|
771
|
+
'corrFlagGet','corrFlagSet','cos','cosh','curExt','curUserId','date2Num','date2Str','datetime2Str','dayName','dayOfMth',
|
772
|
+
'dayOfWk','dayOfYr','ddb','decRound','dg','dimOf','endMth','enum2str','exp','exp10','fV','fieldId2Name','fieldId2PName',
|
773
|
+
'fieldName2Id','frac','funcName','getCurrentPartition','getCurrentPartitionRecId','getPrefix','guid2Str','idg','indexId2Name',
|
774
|
+
'indexName2Id','int2Str','int642Str','intvMax','intvName','intvNo','intvNorm','log10','logN','match','max','min','mkDate','mthName',
|
775
|
+
'mthOfYr','newGuid','nextMth','nextQtr','nextYr','num2Char','num2Date','num2Str','pmt','power','prevMth','prevQtr','prevYr',
|
776
|
+
'prmIsDefault','pt','pv','rate','refPrintAll','round','runAs','sessionId','setPrefix','sin','sinh','sleep','sln','str2Date',
|
777
|
+
'str2Datetime','str2Enum','str2Guid','str2Int','str2Int64','str2Num','str2Time','strAlpha','strCmp','strColSeq','strDel',
|
778
|
+
'strFind','strFmt','strIns','strKeep','strLTrim','strLen','strLine','strLwr','strNFind','strPoke','strPrompt','strRTrim',
|
779
|
+
'strRem','strRep','strScan','strUpr','subStr','syd','systemDateGet','systemDateSet','tableId2Name',
|
780
|
+
'tableId2PName','tableName2Id','tan','tanh','term','time2Str','timeNow','today','trunc','typeOf','uint2Str','wkOfYr','year')
|
781
|
+
COMPILE_FUNCTIONS = ('attributeStr','classNum','classStr','configurationKeyNum','configurationKeyStr','dataEntityDataSourceStr','delegateStr',
|
782
|
+
'dimensionHierarchyLevelStr','dimensionHierarchyStr','dimensionReferenceStr','dutyStr','enumCnt','enumLiteralStr','enumNum','enumStr',
|
783
|
+
'extendedTypeNum','extendedTypeStr','fieldNum','fieldPName','fieldStr','formControlStr','formDataFieldStr','formDataSourceStr',
|
784
|
+
'formMethodStr','formStr','identifierStr','indexNum','indexStr','licenseCodeNum','licenseCodeStr','literalStr','maxDate','maxInt',
|
785
|
+
'measureStr','measurementStr','menuItemActionStr','menuItemDisplayStr','menuItemOutputStr','menuStr','methodStr','minInt','privilegeStr',
|
786
|
+
'queryDatasourceStr','queryMethodStr','queryStr','reportStr','resourceStr','roleStr','ssrsReportStr','staticDelegateStr','staticMethodStr',
|
787
|
+
'tableCollectionStr','tableFieldGroupStr','tableMethodStr','tableNum','tablePName','tableStaticMethodStr','tableStr','tileStr','varStr',
|
788
|
+
'webActionItemStr','webDisplayContentItemStr','webFormStr','webMenuStr','webOutputContentItemStr','webReportStr','webSiteTempStr',
|
789
|
+
'webStaticFileStr','webUrlItemStr','webWebPartStr','webletItemStr','webpageDefStr','websiteDefStr','workflowApprovalStr',
|
790
|
+
'workflowCategoryStr','workflowTaskStr','workflowTypeStr')
|
791
|
+
|
792
|
+
tokens = {}
|
793
|
+
|
794
|
+
tokens = {
|
795
|
+
'root': [
|
796
|
+
# method names
|
797
|
+
(r'(\s*)\b(else|if)\b([^\n])', bygroups(Whitespace, Keyword, using(this))), # ensure that if is not treated like a function
|
798
|
+
(r'^([ \t]*)((?:' + XPP_CHARS + r'(?:\[\])?\s+)+?)' # return type
|
799
|
+
r'(' + XPP_CHARS + ')' # method name
|
800
|
+
r'(\s*)(\()', # signature start
|
801
|
+
bygroups(Whitespace, using(this), Name.Function, Whitespace,
|
802
|
+
Punctuation)),
|
803
|
+
(r'^(\s*)(\[)([^\n]*?)(\])', bygroups(Whitespace, Name.Attribute, Name.Variable.Class, Name.Attribute)),
|
804
|
+
(r'[^\S\n]+', Whitespace),
|
805
|
+
(r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation
|
806
|
+
(r'//[^\n]*?\n', Comment.Single),
|
807
|
+
(r'/[*][^\n]*?[*]/', Comment.Multiline),
|
808
|
+
(r'\n', Whitespace),
|
809
|
+
(words(OPERATORS), Operator),
|
810
|
+
(r'=~|!=|==|<<|>>|[-+/*%=<>&^|]', Operator),
|
811
|
+
(r'[()\[\];:,.#@]', Punctuation),
|
812
|
+
(r'[{}]', Punctuation),
|
813
|
+
(r'@"(""|[^"])*"', String),
|
814
|
+
(r'\$?"(\\\\|\\[^\\]|[^"\\\n])*["\n]', String),
|
815
|
+
(r"'\\.'|'[^\\]'", String.Char),
|
816
|
+
(r"[0-9]+(\.[0-9]*)?([eE][+-][0-9]+)?"
|
817
|
+
r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
|
818
|
+
(words(KEYWORDS, suffix=r'\b'), Keyword),
|
819
|
+
(r'(boolean|int|int64|str|real|guid|date)\b\??', Keyword.Type),
|
820
|
+
(r'(class|struct|extends|implements)(\s+)', bygroups(Keyword, Whitespace), 'class'),
|
821
|
+
(r'('+XPP_CHARS+')(::)', bygroups(Name.Variable.Class, Punctuation)),
|
822
|
+
(r'(\s*)(\w+)(\s+\w+(,|=)?[^\n]*;)', bygroups(Whitespace, Name.Variable.Class, using(this))), # declaration
|
823
|
+
# x++ specific function to get field should highlight the classname
|
824
|
+
(r'(fieldNum\()('+XPP_CHARS+r')(\s*,\s*)('+XPP_CHARS+r')(\s*\))',
|
825
|
+
bygroups(using(this), Name.Variable.Class, using(this), Name.Property, using(this))),
|
826
|
+
# x++ specific function to get table should highlight the classname
|
827
|
+
(r'(tableNum\()('+XPP_CHARS+r')(\s*\))',
|
828
|
+
bygroups(using(this), Name.Variable.Class, using(this))),
|
829
|
+
(words(RUNTIME_FUNCTIONS, suffix=r'(?=\()'), Name.Function.Magic),
|
830
|
+
(words(COMPILE_FUNCTIONS, suffix=r'(?=\()'), Name.Function.Magic),
|
831
|
+
(XPP_CHARS, Name),
|
832
|
+
],
|
833
|
+
'class': [
|
834
|
+
(XPP_CHARS, Name.Class, '#pop'),
|
835
|
+
default('#pop'),
|
836
|
+
],
|
837
|
+
'namespace': [
|
838
|
+
(r'(?=\()', Text, '#pop'), # using (resource)
|
839
|
+
('(' + XPP_CHARS + r'|\.)+', Name.Namespace, '#pop'),
|
840
|
+
]
|
841
|
+
}
|