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,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Pygments lexers for JVM 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
|
|
@@ -13,7 +13,7 @@ import re
|
|
13
13
|
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
|
14
14
|
this, combined, default, words
|
15
15
|
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
16
|
-
Number, Punctuation
|
16
|
+
Number, Punctuation, Whitespace
|
17
17
|
from pygments.util import shebang_matches
|
18
18
|
from pygments import unistring as uni
|
19
19
|
|
@@ -25,20 +25,23 @@ __all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer',
|
|
25
25
|
|
26
26
|
class JavaLexer(RegexLexer):
|
27
27
|
"""
|
28
|
-
For
|
28
|
+
For Java source code.
|
29
29
|
"""
|
30
30
|
|
31
31
|
name = 'Java'
|
32
|
+
url = 'https://www.oracle.com/technetwork/java/'
|
32
33
|
aliases = ['java']
|
33
34
|
filenames = ['*.java']
|
34
35
|
mimetypes = ['text/x-java']
|
35
36
|
|
36
|
-
flags = re.MULTILINE | re.DOTALL
|
37
|
+
flags = re.MULTILINE | re.DOTALL
|
37
38
|
|
38
39
|
tokens = {
|
39
40
|
'root': [
|
40
|
-
(r'
|
41
|
-
|
41
|
+
(r'(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b',
|
42
|
+
bygroups(Whitespace, using(this), Keyword.Declaration), 'class'),
|
43
|
+
(r'[^\S\n]+', Whitespace),
|
44
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
42
45
|
(r'/\*.*?\*/', Comment.Multiline),
|
43
46
|
# keywords: go before method names to avoid lexing "throw new XYZ"
|
44
47
|
# as a method signature
|
@@ -49,27 +52,26 @@ class JavaLexer(RegexLexer):
|
|
49
52
|
(r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments
|
50
53
|
r'((?:[^\W\d]|\$)[\w$]*)' # method name
|
51
54
|
r'(\s*)(\()', # signature start
|
52
|
-
bygroups(using(this), Name.Function,
|
55
|
+
bygroups(using(this), Name.Function, Whitespace, Punctuation)),
|
53
56
|
(r'@[^\W\d][\w.]*', Name.Decorator),
|
54
57
|
(r'(abstract|const|enum|extends|final|implements|native|private|'
|
55
|
-
r'protected|public|static|strictfp|super|synchronized|throws|'
|
56
|
-
r'transient|volatile)\b', Keyword.Declaration),
|
58
|
+
r'protected|public|sealed|static|strictfp|super|synchronized|throws|'
|
59
|
+
r'transient|volatile|yield)\b', Keyword.Declaration),
|
57
60
|
(r'(boolean|byte|char|double|float|int|long|short|void)\b',
|
58
61
|
Keyword.Type),
|
59
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace,
|
62
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
60
63
|
(r'(true|false|null)\b', Keyword.Constant),
|
61
|
-
(r'(class|interface)
|
62
|
-
|
63
|
-
(r'(
|
64
|
-
'var'),
|
65
|
-
(r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Text),
|
64
|
+
(r'(class|interface)\b', Keyword.Declaration, 'class'),
|
65
|
+
(r'(var)(\s+)', bygroups(Keyword.Declaration, Whitespace), 'var'),
|
66
|
+
(r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Whitespace),
|
66
67
|
'import'),
|
68
|
+
(r'"""\n', String, 'multiline_string'),
|
67
69
|
(r'"', String, 'string'),
|
68
70
|
(r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char),
|
69
71
|
(r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Punctuation,
|
70
72
|
Name.Attribute)),
|
71
|
-
(r'^(\s*)(default)(:)', bygroups(
|
72
|
-
(r'^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)', bygroups(
|
73
|
+
(r'^(\s*)(default)(:)', bygroups(Whitespace, Keyword, Punctuation)),
|
74
|
+
(r'^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)', bygroups(Whitespace, Name.Label,
|
73
75
|
Punctuation)),
|
74
76
|
(r'([^\W\d]|\$)[\w$]*', Name),
|
75
77
|
(r'([0-9][0-9_]*\.([0-9][0-9_]*)?|'
|
@@ -86,9 +88,10 @@ class JavaLexer(RegexLexer):
|
|
86
88
|
(r'0|[1-9][0-9_]*[lL]?', Number.Integer),
|
87
89
|
(r'[~^*!%&\[\]<>|+=/?-]', Operator),
|
88
90
|
(r'[{}();:.,]', Punctuation),
|
89
|
-
(r'\n',
|
91
|
+
(r'\n', Whitespace)
|
90
92
|
],
|
91
93
|
'class': [
|
94
|
+
(r'\s+', Text),
|
92
95
|
(r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop')
|
93
96
|
],
|
94
97
|
'var': [
|
@@ -97,6 +100,11 @@ class JavaLexer(RegexLexer):
|
|
97
100
|
'import': [
|
98
101
|
(r'[\w.]+\*?', Name.Namespace, '#pop')
|
99
102
|
],
|
103
|
+
'multiline_string': [
|
104
|
+
(r'"""', String, '#pop'),
|
105
|
+
(r'"', String),
|
106
|
+
include('string')
|
107
|
+
],
|
100
108
|
'string': [
|
101
109
|
(r'[^\\"]+', String),
|
102
110
|
(r'\\\\', String), # Escaped backslash
|
@@ -109,12 +117,13 @@ class JavaLexer(RegexLexer):
|
|
109
117
|
|
110
118
|
class AspectJLexer(JavaLexer):
|
111
119
|
"""
|
112
|
-
For
|
120
|
+
For AspectJ source code.
|
113
121
|
|
114
122
|
.. versionadded:: 1.6
|
115
123
|
"""
|
116
124
|
|
117
125
|
name = 'AspectJ'
|
126
|
+
url = 'http://www.eclipse.org/aspectj/'
|
118
127
|
aliases = ['aspectj']
|
119
128
|
filenames = ['*.aj']
|
120
129
|
mimetypes = ['text/x-aspectj']
|
@@ -148,10 +157,11 @@ class AspectJLexer(JavaLexer):
|
|
148
157
|
|
149
158
|
class ScalaLexer(RegexLexer):
|
150
159
|
"""
|
151
|
-
For
|
160
|
+
For Scala source code.
|
152
161
|
"""
|
153
162
|
|
154
163
|
name = 'Scala'
|
164
|
+
url = 'http://www.scala-lang.org'
|
155
165
|
aliases = ['scala']
|
156
166
|
filenames = ['*.scala']
|
157
167
|
mimetypes = ['text/x-scala']
|
@@ -219,7 +229,7 @@ class ScalaLexer(RegexLexer):
|
|
219
229
|
|
220
230
|
# Includes:
|
221
231
|
'whitespace': [
|
222
|
-
(r'\s+',
|
232
|
+
(r'\s+', Whitespace),
|
223
233
|
],
|
224
234
|
'comments': [
|
225
235
|
(r'//.*?\n', Comment.Single),
|
@@ -229,12 +239,12 @@ class ScalaLexer(RegexLexer):
|
|
229
239
|
(r'^#!([^\n]*)$', Comment.Hashbang),
|
230
240
|
],
|
231
241
|
'imports': [
|
232
|
-
(r'\b(import)(\s+)', bygroups(Keyword,
|
242
|
+
(r'\b(import)(\s+)', bygroups(Keyword, Whitespace), 'import-path'),
|
233
243
|
],
|
234
244
|
'exports': [
|
235
245
|
(r'\b(export)(\s+)(given)(\s+)',
|
236
|
-
bygroups(Keyword,
|
237
|
-
(r'\b(export)(\s+)', bygroups(Keyword,
|
246
|
+
bygroups(Keyword, Whitespace, Keyword, Whitespace), 'export-path'),
|
247
|
+
(r'\b(export)(\s+)', bygroups(Keyword, Whitespace), 'export-path'),
|
238
248
|
],
|
239
249
|
'storage-modifiers': [
|
240
250
|
(words(storage_modifiers, prefix=r'\b', suffix=r'\b'), Keyword),
|
@@ -251,56 +261,56 @@ class ScalaLexer(RegexLexer):
|
|
251
261
|
'using': [
|
252
262
|
# using is a soft keyword, can only be used in the first position of
|
253
263
|
# a parameter or argument list.
|
254
|
-
(r'(\()(\s*)(using)(\s)', bygroups(Punctuation,
|
264
|
+
(r'(\()(\s*)(using)(\s)', bygroups(Punctuation, Whitespace, Keyword, Whitespace)),
|
255
265
|
],
|
256
266
|
'declarations': [
|
257
267
|
(r'\b(def)\b(\s*)%s(%s)?' % (notStartOfComment, anyId),
|
258
|
-
bygroups(Keyword,
|
268
|
+
bygroups(Keyword, Whitespace, Name.Function)),
|
259
269
|
(r'\b(trait)\b(\s*)%s(%s)?' % (notStartOfComment, anyId),
|
260
|
-
bygroups(Keyword,
|
270
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
261
271
|
(r'\b(?:(case)(\s+))?(class|object|enum)\b(\s*)%s(%s)?' %
|
262
272
|
(notStartOfComment, anyId),
|
263
|
-
bygroups(Keyword,
|
273
|
+
bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Class)),
|
264
274
|
(r'(?<!\.)\b(type)\b(\s*)%s(%s)?' % (notStartOfComment, anyId),
|
265
|
-
bygroups(Keyword,
|
275
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
266
276
|
(r'\b(val|var)\b', Keyword.Declaration),
|
267
277
|
(r'\b(package)(\s+)(object)\b(\s*)%s(%s)?' %
|
268
278
|
(notStartOfComment, anyId),
|
269
|
-
bygroups(Keyword,
|
270
|
-
(r'\b(package)(\s+)', bygroups(Keyword,
|
279
|
+
bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Namespace)),
|
280
|
+
(r'\b(package)(\s+)', bygroups(Keyword, Whitespace), 'package'),
|
271
281
|
(r'\b(given)\b(\s*)(%s)' % idUpper,
|
272
|
-
bygroups(Keyword,
|
282
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
273
283
|
(r'\b(given)\b(\s*)(%s)?' % anyId,
|
274
|
-
bygroups(Keyword,
|
284
|
+
bygroups(Keyword, Whitespace, Name)),
|
275
285
|
],
|
276
286
|
'inheritance': [
|
277
287
|
(r'\b(extends|with|derives)\b(\s*)'
|
278
288
|
r'(%s|%s|(?=\([^\)]+=>)|(?=%s)|(?="))?' %
|
279
289
|
(idUpper, backQuotedId, plainid),
|
280
|
-
bygroups(Keyword,
|
290
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
281
291
|
],
|
282
292
|
'extension': [
|
283
|
-
(r'\b(extension)(\s+)(?=[\[\(])', bygroups(Keyword,
|
293
|
+
(r'\b(extension)(\s+)(?=[\[\(])', bygroups(Keyword, Whitespace)),
|
284
294
|
],
|
285
295
|
'end': [
|
286
296
|
# end is a soft keyword, should only be highlighted in certain cases
|
287
297
|
(r'\b(end)(\s+)(if|while|for|match|new|extension|val|var)\b',
|
288
|
-
bygroups(Keyword,
|
298
|
+
bygroups(Keyword, Whitespace, Keyword)),
|
289
299
|
(r'\b(end)(\s+)(%s)%s' % (idUpper, endOfLineMaybeWithComment),
|
290
|
-
bygroups(Keyword,
|
300
|
+
bygroups(Keyword, Whitespace, Name.Class)),
|
291
301
|
(r'\b(end)(\s+)(%s|%s)?%s' %
|
292
302
|
(backQuotedId, plainid, endOfLineMaybeWithComment),
|
293
|
-
bygroups(Keyword,
|
303
|
+
bygroups(Keyword, Whitespace, Name.Namespace)),
|
294
304
|
],
|
295
305
|
'punctuation': [
|
296
306
|
(r'[{}()\[\];,.]', Punctuation),
|
297
|
-
(r'(?<!:):(?!:)', Punctuation),
|
307
|
+
(r'(?<!:):(?!:)', Punctuation),
|
298
308
|
],
|
299
309
|
'keywords': [
|
300
310
|
(words(keywords, prefix=r'\b', suffix=r'\b'), Keyword),
|
301
311
|
],
|
302
312
|
'operators': [
|
303
|
-
(r'(%s{2,})(\s+)' % opchar, bygroups(Operator,
|
313
|
+
(r'(%s{2,})(\s+)' % opchar, bygroups(Operator, Whitespace)),
|
304
314
|
(r'/(?![/*])', Operator),
|
305
315
|
(words(operators), Operator),
|
306
316
|
(r'(?<!%s)(!|&&|\|\|)(?!%s)' % (opchar, opchar), Operator),
|
@@ -332,7 +342,7 @@ class ScalaLexer(RegexLexer):
|
|
332
342
|
(r'(\.)(type)\b', bygroups(Punctuation, Keyword)),
|
333
343
|
],
|
334
344
|
'inline': [
|
335
|
-
# inline is a soft
|
345
|
+
# inline is a soft modifier, only highlighted if followed by if,
|
336
346
|
# match or parameters.
|
337
347
|
(r'\b(inline)(?=\s+(%s|%s)\s*:)' % (plainid, backQuotedId),
|
338
348
|
Keyword),
|
@@ -420,7 +430,7 @@ class ScalaLexer(RegexLexer):
|
|
420
430
|
(r'(%s)(\.)' % anyId, bygroups(Name.Namespace, Punctuation)),
|
421
431
|
(r'\.', Punctuation),
|
422
432
|
(anyId, Name),
|
423
|
-
(r'[^\S\n]+',
|
433
|
+
(r'[^\S\n]+', Whitespace),
|
424
434
|
],
|
425
435
|
'interpolated-string-common': [
|
426
436
|
(r'[^"$\\]+', String),
|
@@ -453,8 +463,8 @@ class GosuLexer(RegexLexer):
|
|
453
463
|
(r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # modifiers etc.
|
454
464
|
r'([a-zA-Z_]\w*)' # method name
|
455
465
|
r'(\s*)(\()', # signature start
|
456
|
-
bygroups(using(this), Name.Function,
|
457
|
-
(r'[^\S\n]+',
|
466
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
467
|
+
(r'[^\S\n]+', Whitespace),
|
458
468
|
(r'//.*?\n', Comment.Single),
|
459
469
|
(r'/\*.*?\*/', Comment.Multiline),
|
460
470
|
(r'@[a-zA-Z_][\w.]*', Name.Decorator),
|
@@ -465,15 +475,15 @@ class GosuLexer(RegexLexer):
|
|
465
475
|
(r'(var|delegate|construct|function|private|internal|protected|'
|
466
476
|
r'public|abstract|override|final|static|extends|transient|'
|
467
477
|
r'implements|represents|readonly)\b', Keyword.Declaration),
|
468
|
-
(r'(property\s+)(get|set)?', Keyword.Declaration),
|
478
|
+
(r'(property)(\s+)(get|set)?', bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration)),
|
469
479
|
(r'(boolean|byte|char|double|float|int|long|short|void|block)\b',
|
470
480
|
Keyword.Type),
|
471
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace,
|
481
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)),
|
472
482
|
(r'(true|false|null|NaN|Infinity)\b', Keyword.Constant),
|
473
483
|
(r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_]\w*)',
|
474
|
-
bygroups(Keyword.Declaration,
|
484
|
+
bygroups(Keyword.Declaration, Whitespace, Name.Class)),
|
475
485
|
(r'(uses)(\s+)([\w.]+\*?)',
|
476
|
-
bygroups(Keyword.Namespace,
|
486
|
+
bygroups(Keyword.Namespace, Whitespace, Name.Namespace)),
|
477
487
|
(r'"', String, 'string'),
|
478
488
|
(r'(\??[.#])([a-zA-Z_]\w*)',
|
479
489
|
bygroups(Operator, Name.Attribute)),
|
@@ -483,7 +493,7 @@ class GosuLexer(RegexLexer):
|
|
483
493
|
(r'and|or|not|[\\~^*!%&\[\](){}<>|+=:;,./?-]', Operator),
|
484
494
|
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
485
495
|
(r'[0-9]+', Number.Integer),
|
486
|
-
(r'\n',
|
496
|
+
(r'\n', Whitespace)
|
487
497
|
],
|
488
498
|
'templateText': [
|
489
499
|
(r'(\\<)|(\\\$)', String),
|
@@ -532,12 +542,13 @@ class GosuTemplateLexer(Lexer):
|
|
532
542
|
|
533
543
|
class GroovyLexer(RegexLexer):
|
534
544
|
"""
|
535
|
-
For
|
545
|
+
For Groovy source code.
|
536
546
|
|
537
547
|
.. versionadded:: 1.5
|
538
548
|
"""
|
539
549
|
|
540
550
|
name = 'Groovy'
|
551
|
+
url = 'https://groovy-lang.org/'
|
541
552
|
aliases = ['groovy']
|
542
553
|
filenames = ['*.groovy','*.gradle']
|
543
554
|
mimetypes = ['text/x-groovy']
|
@@ -551,8 +562,8 @@ class GroovyLexer(RegexLexer):
|
|
551
562
|
default('base'),
|
552
563
|
],
|
553
564
|
'base': [
|
554
|
-
(r'[^\S\n]+',
|
555
|
-
(r'
|
565
|
+
(r'[^\S\n]+', Whitespace),
|
566
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
556
567
|
(r'/\*.*?\*/', Comment.Multiline),
|
557
568
|
# keywords: go before method names to avoid lexing "throw new XYZ"
|
558
569
|
# as a method signature
|
@@ -567,18 +578,18 @@ class GroovyLexer(RegexLexer):
|
|
567
578
|
r"|'(?:\\\\|\\[^\\]|[^'\\])*'" # or single-quoted method name
|
568
579
|
r')'
|
569
580
|
r'(\s*)(\()', # signature start
|
570
|
-
bygroups(using(this), Name.Function,
|
581
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
571
582
|
(r'@[a-zA-Z_][\w.]*', Name.Decorator),
|
572
583
|
(r'(abstract|const|enum|extends|final|implements|native|private|'
|
573
584
|
r'protected|public|static|strictfp|super|synchronized|throws|'
|
574
585
|
r'transient|volatile)\b', Keyword.Declaration),
|
575
586
|
(r'(def|boolean|byte|char|double|float|int|long|short|void)\b',
|
576
587
|
Keyword.Type),
|
577
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace,
|
588
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)),
|
578
589
|
(r'(true|false|null)\b', Keyword.Constant),
|
579
|
-
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration,
|
590
|
+
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Whitespace),
|
580
591
|
'class'),
|
581
|
-
(r'(import)(\s+)', bygroups(Keyword.Namespace,
|
592
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
582
593
|
(r'""".*?"""', String.Double),
|
583
594
|
(r"'''.*?'''", String.Single),
|
584
595
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
@@ -593,7 +604,7 @@ class GroovyLexer(RegexLexer):
|
|
593
604
|
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
594
605
|
(r'0x[0-9a-fA-F]+', Number.Hex),
|
595
606
|
(r'[0-9]+L?', Number.Integer),
|
596
|
-
(r'\n',
|
607
|
+
(r'\n', Whitespace)
|
597
608
|
],
|
598
609
|
'class': [
|
599
610
|
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
@@ -609,12 +620,13 @@ class GroovyLexer(RegexLexer):
|
|
609
620
|
|
610
621
|
class IokeLexer(RegexLexer):
|
611
622
|
"""
|
612
|
-
For
|
623
|
+
For Ioke (a strongly typed, dynamic,
|
613
624
|
prototype based programming language) source.
|
614
625
|
|
615
626
|
.. versionadded:: 1.4
|
616
627
|
"""
|
617
628
|
name = 'Ioke'
|
629
|
+
url = 'https://ioke.org/'
|
618
630
|
filenames = ['*.ik']
|
619
631
|
aliases = ['ioke', 'ik']
|
620
632
|
mimetypes = ['text/x-iokesrc']
|
@@ -663,8 +675,8 @@ class IokeLexer(RegexLexer):
|
|
663
675
|
],
|
664
676
|
|
665
677
|
'root': [
|
666
|
-
(r'\n',
|
667
|
-
(r'\s+',
|
678
|
+
(r'\n', Whitespace),
|
679
|
+
(r'\s+', Whitespace),
|
668
680
|
|
669
681
|
# Comments
|
670
682
|
(r';(.*?)\n', Comment),
|
@@ -682,7 +694,7 @@ class IokeLexer(RegexLexer):
|
|
682
694
|
# Documentation
|
683
695
|
(r'((?<=fn\()|(?<=fnx\()|(?<=method\()|(?<=macro\()|(?<=lecro\()'
|
684
696
|
r'|(?<=syntax\()|(?<=dmacro\()|(?<=dlecro\()|(?<=dlecrox\()'
|
685
|
-
r'|(?<=dsyntax\())\s*"', String.Doc, 'documentation'),
|
697
|
+
r'|(?<=dsyntax\())(\s*)"', String.Doc, 'documentation'),
|
686
698
|
|
687
699
|
# Text
|
688
700
|
(r'"', String, 'text'),
|
@@ -800,13 +812,14 @@ class IokeLexer(RegexLexer):
|
|
800
812
|
|
801
813
|
class ClojureLexer(RegexLexer):
|
802
814
|
"""
|
803
|
-
Lexer for
|
815
|
+
Lexer for Clojure source code.
|
804
816
|
|
805
817
|
.. versionadded:: 0.11
|
806
818
|
"""
|
807
819
|
name = 'Clojure'
|
820
|
+
url = 'http://clojure.org/'
|
808
821
|
aliases = ['clojure', 'clj']
|
809
|
-
filenames = ['*.clj']
|
822
|
+
filenames = ['*.clj', '*.cljc']
|
810
823
|
mimetypes = ['text/x-clojure', 'application/x-clojure']
|
811
824
|
|
812
825
|
special_forms = (
|
@@ -887,10 +900,12 @@ class ClojureLexer(RegexLexer):
|
|
887
900
|
(r';.*$', Comment.Single),
|
888
901
|
|
889
902
|
# whitespaces - usually not relevant
|
890
|
-
(r'
|
903
|
+
(r',+', Text),
|
904
|
+
(r'\s+', Whitespace),
|
891
905
|
|
892
906
|
# numbers
|
893
907
|
(r'-?\d+\.\d+', Number.Float),
|
908
|
+
(r'-?\d+/\d+', Number),
|
894
909
|
(r'-?\d+', Number.Integer),
|
895
910
|
(r'0x-?[abcdef\d]+', Number.Hex),
|
896
911
|
|
@@ -938,12 +953,12 @@ class ClojureLexer(RegexLexer):
|
|
938
953
|
|
939
954
|
class ClojureScriptLexer(ClojureLexer):
|
940
955
|
"""
|
941
|
-
Lexer for
|
942
|
-
source code.
|
956
|
+
Lexer for ClojureScript source code.
|
943
957
|
|
944
958
|
.. versionadded:: 2.0
|
945
959
|
"""
|
946
960
|
name = 'ClojureScript'
|
961
|
+
url = 'http://clojure.org/clojurescript'
|
947
962
|
aliases = ['clojurescript', 'cljs']
|
948
963
|
filenames = ['*.cljs']
|
949
964
|
mimetypes = ['text/x-clojurescript', 'application/x-clojurescript']
|
@@ -951,7 +966,7 @@ class ClojureScriptLexer(ClojureLexer):
|
|
951
966
|
|
952
967
|
class TeaLangLexer(RegexLexer):
|
953
968
|
"""
|
954
|
-
For
|
969
|
+
For Tea source code. Only used within a
|
955
970
|
TeaTemplateLexer.
|
956
971
|
|
957
972
|
.. versionadded:: 1.5
|
@@ -965,17 +980,17 @@ class TeaLangLexer(RegexLexer):
|
|
965
980
|
(r'^(\s*(?:[a-zA-Z_][\w\.\[\]]*\s+)+?)' # return arguments
|
966
981
|
r'([a-zA-Z_]\w*)' # method name
|
967
982
|
r'(\s*)(\()', # signature start
|
968
|
-
bygroups(using(this), Name.Function,
|
969
|
-
(r'[^\S\n]+',
|
970
|
-
(r'
|
983
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
984
|
+
(r'[^\S\n]+', Whitespace),
|
985
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
971
986
|
(r'/\*.*?\*/', Comment.Multiline),
|
972
987
|
(r'@[a-zA-Z_][\w\.]*', Name.Decorator),
|
973
988
|
(r'(and|break|else|foreach|if|in|not|or|reverse)\b',
|
974
989
|
Keyword),
|
975
990
|
(r'(as|call|define)\b', Keyword.Declaration),
|
976
991
|
(r'(true|false|null)\b', Keyword.Constant),
|
977
|
-
(r'(template)(\s+)', bygroups(Keyword.Declaration,
|
978
|
-
(r'(import)(\s+)', bygroups(Keyword.Namespace,
|
992
|
+
(r'(template)(\s+)', bygroups(Keyword.Declaration, Whitespace), 'template'),
|
993
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
979
994
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
980
995
|
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
981
996
|
(r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)),
|
@@ -985,7 +1000,7 @@ class TeaLangLexer(RegexLexer):
|
|
985
1000
|
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
986
1001
|
(r'0x[0-9a-fA-F]+', Number.Hex),
|
987
1002
|
(r'[0-9]+L?', Number.Integer),
|
988
|
-
(r'\n',
|
1003
|
+
(r'\n', Whitespace)
|
989
1004
|
],
|
990
1005
|
'template': [
|
991
1006
|
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
@@ -998,12 +1013,13 @@ class TeaLangLexer(RegexLexer):
|
|
998
1013
|
|
999
1014
|
class CeylonLexer(RegexLexer):
|
1000
1015
|
"""
|
1001
|
-
For
|
1016
|
+
For Ceylon source code.
|
1002
1017
|
|
1003
1018
|
.. versionadded:: 1.6
|
1004
1019
|
"""
|
1005
1020
|
|
1006
1021
|
name = 'Ceylon'
|
1022
|
+
url = 'http://ceylon-lang.org/'
|
1007
1023
|
aliases = ['ceylon']
|
1008
1024
|
filenames = ['*.ceylon']
|
1009
1025
|
mimetypes = ['text/x-ceylon']
|
@@ -1019,9 +1035,9 @@ class CeylonLexer(RegexLexer):
|
|
1019
1035
|
(r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
|
1020
1036
|
r'([a-zA-Z_]\w*)' # method name
|
1021
1037
|
r'(\s*)(\()', # signature start
|
1022
|
-
bygroups(using(this), Name.Function,
|
1023
|
-
(r'[^\S\n]+',
|
1024
|
-
(r'
|
1038
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
1039
|
+
(r'[^\S\n]+', Whitespace),
|
1040
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
1025
1041
|
(r'/\*', Comment.Multiline, 'comment'),
|
1026
1042
|
(r'(shared|abstract|formal|default|actual|variable|deprecated|small|'
|
1027
1043
|
r'late|literal|doc|by|see|throws|optional|license|tagged|final|native|'
|
@@ -1033,11 +1049,11 @@ class CeylonLexer(RegexLexer):
|
|
1033
1049
|
r'super|given|of|out|assign)\b', Keyword.Declaration),
|
1034
1050
|
(r'(function|value|void|new)\b',
|
1035
1051
|
Keyword.Type),
|
1036
|
-
(r'(assembly|module|package)(\s+)', bygroups(Keyword.Namespace,
|
1052
|
+
(r'(assembly|module|package)(\s+)', bygroups(Keyword.Namespace, Whitespace)),
|
1037
1053
|
(r'(true|false|null)\b', Keyword.Constant),
|
1038
1054
|
(r'(class|interface|object|alias)(\s+)',
|
1039
|
-
bygroups(Keyword.Declaration,
|
1040
|
-
(r'(import)(\s+)', bygroups(Keyword.Namespace,
|
1055
|
+
bygroups(Keyword.Declaration, Whitespace), 'class'),
|
1056
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
1041
1057
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String),
|
1042
1058
|
(r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char),
|
1043
1059
|
(r'(\.)([a-z_]\w*)',
|
@@ -1057,7 +1073,7 @@ class CeylonLexer(RegexLexer):
|
|
1057
1073
|
(r'\$[01]+', Number.Bin),
|
1058
1074
|
(r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer),
|
1059
1075
|
(r'[0-9]+[kMGTP]?', Number.Integer),
|
1060
|
-
(r'\n',
|
1076
|
+
(r'\n', Whitespace)
|
1061
1077
|
],
|
1062
1078
|
'class': [
|
1063
1079
|
(r'[A-Za-z_]\w*', Name.Class, '#pop')
|
@@ -1077,18 +1093,18 @@ class CeylonLexer(RegexLexer):
|
|
1077
1093
|
|
1078
1094
|
class KotlinLexer(RegexLexer):
|
1079
1095
|
"""
|
1080
|
-
For
|
1081
|
-
source code.
|
1096
|
+
For Kotlin source code.
|
1082
1097
|
|
1083
1098
|
.. versionadded:: 1.5
|
1084
1099
|
"""
|
1085
1100
|
|
1086
1101
|
name = 'Kotlin'
|
1102
|
+
url = 'http://kotlinlang.org/'
|
1087
1103
|
aliases = ['kotlin']
|
1088
1104
|
filenames = ['*.kt', '*.kts']
|
1089
1105
|
mimetypes = ['text/x-kotlin']
|
1090
1106
|
|
1091
|
-
flags = re.MULTILINE | re.DOTALL
|
1107
|
+
flags = re.MULTILINE | re.DOTALL
|
1092
1108
|
|
1093
1109
|
kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
|
1094
1110
|
'[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf',
|
@@ -1104,18 +1120,18 @@ class KotlinLexer(RegexLexer):
|
|
1104
1120
|
modifiers = (r'actual|abstract|annotation|companion|const|crossinline|'
|
1105
1121
|
r'data|enum|expect|external|final|infix|inline|inner|'
|
1106
1122
|
r'internal|lateinit|noinline|open|operator|override|private|'
|
1107
|
-
r'protected|public|sealed|suspend|tailrec')
|
1123
|
+
r'protected|public|sealed|suspend|tailrec|value')
|
1108
1124
|
|
1109
1125
|
tokens = {
|
1110
1126
|
'root': [
|
1111
1127
|
# Whitespaces
|
1112
|
-
(r'[^\S\n]+',
|
1113
|
-
(r'\s+',
|
1114
|
-
(r'
|
1115
|
-
(r'\n',
|
1128
|
+
(r'[^\S\n]+', Whitespace),
|
1129
|
+
(r'\s+', Whitespace),
|
1130
|
+
(r'\\$', String.Escape), # line continuation
|
1131
|
+
(r'\n', Whitespace),
|
1116
1132
|
# Comments
|
1117
|
-
(r'
|
1118
|
-
(r'
|
1133
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
1134
|
+
(r'^(#!/.+?)(\n)', bygroups(Comment.Single, Whitespace)), # shebang for kotlin scripts
|
1119
1135
|
(r'/[*].*?[*]/', Comment.Multiline),
|
1120
1136
|
# Keywords
|
1121
1137
|
(r'as\?', Keyword),
|
@@ -1131,7 +1147,7 @@ class KotlinLexer(RegexLexer):
|
|
1131
1147
|
# Constants
|
1132
1148
|
(r'(true|false|null)\b', Keyword.Constant),
|
1133
1149
|
# Imports
|
1134
|
-
(r'(package|import)(\s+)(\S+)', bygroups(Keyword,
|
1150
|
+
(r'(package|import)(\s+)(\S+)', bygroups(Keyword, Whitespace, Name.Namespace)),
|
1135
1151
|
# Dot access
|
1136
1152
|
(r'(\?\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)),
|
1137
1153
|
(r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Punctuation, Name.Attribute)),
|
@@ -1140,18 +1156,18 @@ class KotlinLexer(RegexLexer):
|
|
1140
1156
|
# Labels
|
1141
1157
|
(r'[^\W\d][\w.]+@', Name.Decorator),
|
1142
1158
|
# Object expression
|
1143
|
-
(r'(object)(\s+)(:)(\s+)', bygroups(Keyword,
|
1159
|
+
(r'(object)(\s+)(:)(\s+)', bygroups(Keyword, Whitespace, Punctuation, Whitespace), 'class'),
|
1144
1160
|
# Types
|
1145
1161
|
(r'((?:(?:' + modifiers + r'|fun)\s+)*)(class|interface|object)(\s+)',
|
1146
|
-
bygroups(using(this, state='modifiers'), Keyword.Declaration,
|
1162
|
+
bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'class'),
|
1147
1163
|
# Variables
|
1148
|
-
(r'(var|val)(\s+)(\()', bygroups(Keyword.Declaration,
|
1164
|
+
(r'(var|val)(\s+)(\()', bygroups(Keyword.Declaration, Whitespace, Punctuation),
|
1149
1165
|
'destructuring_assignment'),
|
1150
1166
|
(r'((?:(?:' + modifiers + r')\s+)*)(var|val)(\s+)',
|
1151
|
-
bygroups(using(this, state='modifiers'), Keyword.Declaration,
|
1167
|
+
bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'variable'),
|
1152
1168
|
# Functions
|
1153
1169
|
(r'((?:(?:' + modifiers + r')\s+)*)(fun)(\s+)',
|
1154
|
-
bygroups(using(this, state='modifiers'), Keyword.Declaration,
|
1170
|
+
bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'function'),
|
1155
1171
|
# Operators
|
1156
1172
|
(r'::|!!|\?[:.]', Operator),
|
1157
1173
|
(r'[~^*!%&\[\]<>|+=/?-]', Operator),
|
@@ -1175,9 +1191,9 @@ class KotlinLexer(RegexLexer):
|
|
1175
1191
|
],
|
1176
1192
|
'destructuring_assignment': [
|
1177
1193
|
(r',', Punctuation),
|
1178
|
-
(r'\s+',
|
1194
|
+
(r'\s+', Whitespace),
|
1179
1195
|
(kt_id, Name.Variable),
|
1180
|
-
(r'(:)(\s+)(' + kt_id + ')', bygroups(Punctuation,
|
1196
|
+
(r'(:)(\s+)(' + kt_id + ')', bygroups(Punctuation, Whitespace, Name)),
|
1181
1197
|
(r'<', Operator, 'generic'),
|
1182
1198
|
(r'\)', Punctuation, '#pop')
|
1183
1199
|
],
|
@@ -1187,16 +1203,16 @@ class KotlinLexer(RegexLexer):
|
|
1187
1203
|
(kt_id, Name.Function, '#pop')
|
1188
1204
|
],
|
1189
1205
|
'generic': [
|
1190
|
-
(r'(>)(\s*)', bygroups(Operator,
|
1206
|
+
(r'(>)(\s*)', bygroups(Operator, Whitespace), '#pop'),
|
1191
1207
|
(r':', Punctuation),
|
1192
1208
|
(r'(reified|out|in)\b', Keyword),
|
1193
1209
|
(r',', Punctuation),
|
1194
|
-
(r'\s+',
|
1210
|
+
(r'\s+', Whitespace),
|
1195
1211
|
(kt_id, Name)
|
1196
1212
|
],
|
1197
1213
|
'modifiers': [
|
1198
1214
|
(r'\w+', Keyword.Declaration),
|
1199
|
-
(r'\s+',
|
1215
|
+
(r'\s+', Whitespace),
|
1200
1216
|
default('#pop')
|
1201
1217
|
],
|
1202
1218
|
'string': [
|
@@ -1211,7 +1227,7 @@ class KotlinLexer(RegexLexer):
|
|
1211
1227
|
'string_common': [
|
1212
1228
|
(r'\\\\', String), # escaped backslash
|
1213
1229
|
(r'\\"', String), # escaped quote
|
1214
|
-
(r'\\', String), # bare backslash
|
1230
|
+
(r'\\', String), # bare backslash
|
1215
1231
|
(r'\$\{', String.Interpol, 'interpolation'),
|
1216
1232
|
(r'(\$)(\w+)', bygroups(String.Interpol, Name)),
|
1217
1233
|
(r'[^\\"$]+', String)
|
@@ -1233,12 +1249,13 @@ class KotlinLexer(RegexLexer):
|
|
1233
1249
|
|
1234
1250
|
class XtendLexer(RegexLexer):
|
1235
1251
|
"""
|
1236
|
-
For
|
1252
|
+
For Xtend source code.
|
1237
1253
|
|
1238
1254
|
.. versionadded:: 1.6
|
1239
1255
|
"""
|
1240
1256
|
|
1241
1257
|
name = 'Xtend'
|
1258
|
+
url = 'https://www.eclipse.org/xtend/'
|
1242
1259
|
aliases = ['xtend']
|
1243
1260
|
filenames = ['*.xtend']
|
1244
1261
|
mimetypes = ['text/x-xtend']
|
@@ -1251,9 +1268,9 @@ class XtendLexer(RegexLexer):
|
|
1251
1268
|
(r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
|
1252
1269
|
r'([a-zA-Z_$][\w$]*)' # method name
|
1253
1270
|
r'(\s*)(\()', # signature start
|
1254
|
-
bygroups(using(this), Name.Function,
|
1255
|
-
(r'[^\S\n]+',
|
1256
|
-
(r'
|
1271
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
1272
|
+
(r'[^\S\n]+', Whitespace),
|
1273
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
1257
1274
|
(r'/\*.*?\*/', Comment.Multiline),
|
1258
1275
|
(r'@[a-zA-Z_][\w.]*', Name.Decorator),
|
1259
1276
|
(r'(assert|break|case|catch|continue|default|do|else|finally|for|'
|
@@ -1265,11 +1282,11 @@ class XtendLexer(RegexLexer):
|
|
1265
1282
|
r'transient|volatile)\b', Keyword.Declaration),
|
1266
1283
|
(r'(boolean|byte|char|double|float|int|long|short|void)\b',
|
1267
1284
|
Keyword.Type),
|
1268
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace,
|
1285
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)),
|
1269
1286
|
(r'(true|false|null)\b', Keyword.Constant),
|
1270
|
-
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration,
|
1287
|
+
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Whitespace),
|
1271
1288
|
'class'),
|
1272
|
-
(r'(import)(\s+)', bygroups(Keyword.Namespace,
|
1289
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
1273
1290
|
(r"(''')", String, 'template'),
|
1274
1291
|
(r'(\u00BB)', String, 'template'),
|
1275
1292
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
@@ -1280,7 +1297,7 @@ class XtendLexer(RegexLexer):
|
|
1280
1297
|
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
1281
1298
|
(r'0x[0-9a-fA-F]+', Number.Hex),
|
1282
1299
|
(r'[0-9]+L?', Number.Integer),
|
1283
|
-
(r'\n',
|
1300
|
+
(r'\n', Whitespace)
|
1284
1301
|
],
|
1285
1302
|
'class': [
|
1286
1303
|
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
@@ -1298,12 +1315,13 @@ class XtendLexer(RegexLexer):
|
|
1298
1315
|
|
1299
1316
|
class PigLexer(RegexLexer):
|
1300
1317
|
"""
|
1301
|
-
For
|
1318
|
+
For Pig Latin source code.
|
1302
1319
|
|
1303
1320
|
.. versionadded:: 2.0
|
1304
1321
|
"""
|
1305
1322
|
|
1306
1323
|
name = 'Pig'
|
1324
|
+
url = 'https://pig.apache.org/'
|
1307
1325
|
aliases = ['pig']
|
1308
1326
|
filenames = ['*.pig']
|
1309
1327
|
mimetypes = ['text/x-pig']
|
@@ -1312,10 +1330,10 @@ class PigLexer(RegexLexer):
|
|
1312
1330
|
|
1313
1331
|
tokens = {
|
1314
1332
|
'root': [
|
1315
|
-
(r'\s+',
|
1333
|
+
(r'\s+', Whitespace),
|
1316
1334
|
(r'--.*', Comment),
|
1317
1335
|
(r'/\*[\w\W]*?\*/', Comment.Multiline),
|
1318
|
-
(r'
|
1336
|
+
(r'\\$', String.Escape),
|
1319
1337
|
(r'\\', Text),
|
1320
1338
|
(r'\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'', String),
|
1321
1339
|
include('keywords'),
|
@@ -1326,9 +1344,9 @@ class PigLexer(RegexLexer):
|
|
1326
1344
|
(r'[0-9]*\.[0-9]+(e[0-9]+)?[fd]?', Number.Float),
|
1327
1345
|
(r'0x[0-9a-f]+', Number.Hex),
|
1328
1346
|
(r'[0-9]+L?', Number.Integer),
|
1329
|
-
(r'\n',
|
1347
|
+
(r'\n', Whitespace),
|
1330
1348
|
(r'([a-z_]\w*)(\s*)(\()',
|
1331
|
-
bygroups(Name.Function,
|
1349
|
+
bygroups(Name.Function, Whitespace, Punctuation)),
|
1332
1350
|
(r'[()#:]', Text),
|
1333
1351
|
(r'[^(:#\'")\s]+', Text),
|
1334
1352
|
(r'\S+\s+', Text) # TODO: make tests pass without \s+
|
@@ -1365,18 +1383,19 @@ class PigLexer(RegexLexer):
|
|
1365
1383
|
|
1366
1384
|
class GoloLexer(RegexLexer):
|
1367
1385
|
"""
|
1368
|
-
For
|
1386
|
+
For Golo source code.
|
1369
1387
|
|
1370
1388
|
.. versionadded:: 2.0
|
1371
1389
|
"""
|
1372
1390
|
|
1373
1391
|
name = 'Golo'
|
1392
|
+
url = 'http://golo-lang.org/'
|
1374
1393
|
filenames = ['*.golo']
|
1375
1394
|
aliases = ['golo']
|
1376
1395
|
|
1377
1396
|
tokens = {
|
1378
1397
|
'root': [
|
1379
|
-
(r'[^\S\n]+',
|
1398
|
+
(r'[^\S\n]+', Whitespace),
|
1380
1399
|
|
1381
1400
|
(r'#.*$', Comment),
|
1382
1401
|
|
@@ -1388,19 +1407,19 @@ class GoloLexer(RegexLexer):
|
|
1388
1407
|
(r'[]{}|(),[]', Punctuation),
|
1389
1408
|
|
1390
1409
|
(r'(module|import)(\s+)',
|
1391
|
-
bygroups(Keyword.Namespace,
|
1410
|
+
bygroups(Keyword.Namespace, Whitespace),
|
1392
1411
|
'modname'),
|
1393
1412
|
(r'\b([a-zA-Z_][\w$.]*)(::)', bygroups(Name.Namespace, Punctuation)),
|
1394
1413
|
(r'\b([a-zA-Z_][\w$]*(?:\.[a-zA-Z_][\w$]*)+)\b', Name.Namespace),
|
1395
1414
|
|
1396
1415
|
(r'(let|var)(\s+)',
|
1397
|
-
bygroups(Keyword.Declaration,
|
1416
|
+
bygroups(Keyword.Declaration, Whitespace),
|
1398
1417
|
'varname'),
|
1399
1418
|
(r'(struct)(\s+)',
|
1400
|
-
bygroups(Keyword.Declaration,
|
1419
|
+
bygroups(Keyword.Declaration, Whitespace),
|
1401
1420
|
'structname'),
|
1402
1421
|
(r'(function)(\s+)',
|
1403
|
-
bygroups(Keyword.Declaration,
|
1422
|
+
bygroups(Keyword.Declaration, Whitespace),
|
1404
1423
|
'funcname'),
|
1405
1424
|
|
1406
1425
|
(r'(null|true|false)\b', Keyword.Constant),
|
@@ -1478,12 +1497,13 @@ class GoloLexer(RegexLexer):
|
|
1478
1497
|
|
1479
1498
|
class JasminLexer(RegexLexer):
|
1480
1499
|
"""
|
1481
|
-
For
|
1500
|
+
For Jasmin assembly code.
|
1482
1501
|
|
1483
1502
|
.. versionadded:: 2.0
|
1484
1503
|
"""
|
1485
1504
|
|
1486
1505
|
name = 'Jasmin'
|
1506
|
+
url = 'http://jasmin.sourceforge.net/'
|
1487
1507
|
aliases = ['jasmin', 'jasminxt']
|
1488
1508
|
filenames = ['*.j']
|
1489
1509
|
|
@@ -1496,12 +1516,12 @@ class JasminLexer(RegexLexer):
|
|
1496
1516
|
|
1497
1517
|
tokens = {
|
1498
1518
|
'default': [
|
1499
|
-
(r'\n',
|
1519
|
+
(r'\n', Whitespace, '#pop'),
|
1500
1520
|
(r"'", String.Single, ('#pop', 'quote')),
|
1501
1521
|
(r'"', String.Double, 'string'),
|
1502
1522
|
(r'=', Punctuation),
|
1503
1523
|
(r':', Punctuation, 'label'),
|
1504
|
-
(_ws,
|
1524
|
+
(_ws, Whitespace),
|
1505
1525
|
(r';.*', Comment.Single),
|
1506
1526
|
(r'(\$[-+])?0x-?[\da-fA-F]+%s' % _break, Number.Hex),
|
1507
1527
|
(r'(\$[-+]|\+)?-?\d+%s' % _break, Number.Integer),
|
@@ -1589,27 +1609,27 @@ class JasminLexer(RegexLexer):
|
|
1589
1609
|
(r'[^"\\]+', String.Double)
|
1590
1610
|
],
|
1591
1611
|
'root': [
|
1592
|
-
(r'\n+',
|
1612
|
+
(r'\n+', Whitespace),
|
1593
1613
|
(r"'", String.Single, 'quote'),
|
1594
1614
|
include('default'),
|
1595
1615
|
(r'(%s)([ \t\r]*)(:)' % _name,
|
1596
|
-
bygroups(Name.Label,
|
1616
|
+
bygroups(Name.Label, Whitespace, Punctuation)),
|
1597
1617
|
(_name, String.Other)
|
1598
1618
|
],
|
1599
1619
|
'annotation': [
|
1600
|
-
(r'\n',
|
1620
|
+
(r'\n', Whitespace, ('#pop', 'annotation-body')),
|
1601
1621
|
(r'default%s' % _break, Keyword.Reserved,
|
1602
1622
|
('#pop', 'annotation-default')),
|
1603
1623
|
include('default')
|
1604
1624
|
],
|
1605
1625
|
'annotation-body': [
|
1606
|
-
(r'\n+',
|
1626
|
+
(r'\n+', Whitespace),
|
1607
1627
|
(r'\.end%s' % _break, Keyword.Reserved, '#pop'),
|
1608
1628
|
include('default'),
|
1609
1629
|
(_name, String.Other, ('annotation-items', 'descriptor/no-dots'))
|
1610
1630
|
],
|
1611
1631
|
'annotation-default': [
|
1612
|
-
(r'\n+',
|
1632
|
+
(r'\n+', Whitespace),
|
1613
1633
|
(r'\.end%s' % _break, Keyword.Reserved, '#pop'),
|
1614
1634
|
include('default'),
|
1615
1635
|
default(('annotation-items', 'descriptor/no-dots'))
|
@@ -1663,7 +1683,7 @@ class JasminLexer(RegexLexer):
|
|
1663
1683
|
default('descriptor/convert-dots')
|
1664
1684
|
],
|
1665
1685
|
'enclosing-method': [
|
1666
|
-
(_ws,
|
1686
|
+
(_ws, Whitespace),
|
1667
1687
|
(r'(?=[^%s]*\()' % _separator, Text, ('#pop', 'invocation')),
|
1668
1688
|
default(('#pop', 'class/convert-dots'))
|
1669
1689
|
],
|
@@ -1709,7 +1729,7 @@ class JasminLexer(RegexLexer):
|
|
1709
1729
|
bygroups(Name.Namespace, Name.Class, Name.Variable.Class), '#pop')
|
1710
1730
|
],
|
1711
1731
|
'table': [
|
1712
|
-
(r'\n+',
|
1732
|
+
(r'\n+', Whitespace),
|
1713
1733
|
(r'default%s' % _break, Keyword.Reserved, '#pop'),
|
1714
1734
|
include('default'),
|
1715
1735
|
(_name, Name.Label)
|
@@ -1742,12 +1762,13 @@ class JasminLexer(RegexLexer):
|
|
1742
1762
|
|
1743
1763
|
class SarlLexer(RegexLexer):
|
1744
1764
|
"""
|
1745
|
-
For
|
1765
|
+
For SARL source code.
|
1746
1766
|
|
1747
1767
|
.. versionadded:: 2.4
|
1748
1768
|
"""
|
1749
1769
|
|
1750
1770
|
name = 'SARL'
|
1771
|
+
url = 'http://www.sarl.io'
|
1751
1772
|
aliases = ['sarl']
|
1752
1773
|
filenames = ['*.sarl']
|
1753
1774
|
mimetypes = ['text/x-sarl']
|
@@ -1760,9 +1781,9 @@ class SarlLexer(RegexLexer):
|
|
1760
1781
|
(r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
|
1761
1782
|
r'([a-zA-Z_$][\w$]*)' # method name
|
1762
1783
|
r'(\s*)(\()', # signature start
|
1763
|
-
bygroups(using(this), Name.Function,
|
1764
|
-
(r'[^\S\n]+',
|
1765
|
-
(r'
|
1784
|
+
bygroups(using(this), Name.Function, Whitespace, Operator)),
|
1785
|
+
(r'[^\S\n]+', Whitespace),
|
1786
|
+
(r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)),
|
1766
1787
|
(r'/\*.*?\*/', Comment.Multiline),
|
1767
1788
|
(r'@[a-zA-Z_][\w.]*', Name.Decorator),
|
1768
1789
|
(r'(as|break|case|catch|default|do|else|extends|extension|finally|'
|
@@ -1774,12 +1795,12 @@ class SarlLexer(RegexLexer):
|
|
1774
1795
|
Keyword.Declaration),
|
1775
1796
|
(r'(boolean|byte|char|double|float|int|long|short|void)\b',
|
1776
1797
|
Keyword.Type),
|
1777
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace,
|
1798
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)),
|
1778
1799
|
(r'(false|it|null|occurrence|this|true|void)\b', Keyword.Constant),
|
1779
1800
|
(r'(agent|annotation|artifact|behavior|capacity|class|enum|event|'
|
1780
|
-
r'interface|skill|space)(\s+)', bygroups(Keyword.Declaration,
|
1801
|
+
r'interface|skill|space)(\s+)', bygroups(Keyword.Declaration, Whitespace),
|
1781
1802
|
'class'),
|
1782
|
-
(r'(import)(\s+)', bygroups(Keyword.Namespace,
|
1803
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'),
|
1783
1804
|
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
1784
1805
|
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
1785
1806
|
(r'[a-zA-Z_]\w*:', Name.Label),
|
@@ -1788,7 +1809,7 @@ class SarlLexer(RegexLexer):
|
|
1788
1809
|
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
1789
1810
|
(r'0x[0-9a-fA-F]+', Number.Hex),
|
1790
1811
|
(r'[0-9]+L?', Number.Integer),
|
1791
|
-
(r'\n',
|
1812
|
+
(r'\n', Whitespace)
|
1792
1813
|
],
|
1793
1814
|
'class': [
|
1794
1815
|
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|