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
|
Lexers for C/C++ 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
|
|
@@ -25,9 +25,6 @@ class CFamilyLexer(RegexLexer):
|
|
25
25
|
definitions.
|
26
26
|
"""
|
27
27
|
|
28
|
-
#: optional Comment or Whitespace
|
29
|
-
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
30
|
-
|
31
28
|
# The trailing ?, rather than *, avoids a geometric performance drop here.
|
32
29
|
#: only one /* */ style comment
|
33
30
|
_ws1 = r'\s*(?:/[*].*?[*]/\s*)?'
|
@@ -42,8 +39,19 @@ class CFamilyLexer(RegexLexer):
|
|
42
39
|
_intsuffix = r'(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?'
|
43
40
|
|
44
41
|
# Identifier regex with C and C++ Universal Character Name (UCN) support.
|
45
|
-
_ident = r'(
|
46
|
-
_namespaced_ident = r'(
|
42
|
+
_ident = r'(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+'
|
43
|
+
_namespaced_ident = r'(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+'
|
44
|
+
|
45
|
+
# Single and multiline comment regexes
|
46
|
+
# Beware not to use *? for the inner content! When these regexes
|
47
|
+
# are embedded in larger regexes, that can cause the stuff*? to
|
48
|
+
# match more than it would have if the regex had been used in
|
49
|
+
# a standalone way ...
|
50
|
+
_comment_single = r'//(?:.|(?<=\\)\n)*\n'
|
51
|
+
_comment_multiline = r'/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/'
|
52
|
+
|
53
|
+
# Regex to match optional comments
|
54
|
+
_possible_comments = rf'\s*(?:(?:(?:{_comment_single})|(?:{_comment_multiline}))\s*)*'
|
47
55
|
|
48
56
|
tokens = {
|
49
57
|
'whitespace': [
|
@@ -55,12 +63,20 @@ class CFamilyLexer(RegexLexer):
|
|
55
63
|
bygroups(using(this), Comment.Preproc), 'if0'),
|
56
64
|
('^(' + _ws1 + ')(#)',
|
57
65
|
bygroups(using(this), Comment.Preproc), 'macro'),
|
66
|
+
# Labels:
|
67
|
+
# Line start and possible indentation.
|
68
|
+
(r'(^[ \t]*)'
|
69
|
+
# Not followed by keywords which can be mistaken as labels.
|
70
|
+
r'(?!(?:public|private|protected|default)\b)'
|
71
|
+
# Actual label, followed by a single colon.
|
72
|
+
r'(' + _ident + r')(\s*)(:)(?!:)',
|
73
|
+
bygroups(Whitespace, Name.Label, Whitespace, Punctuation)),
|
58
74
|
(r'\n', Whitespace),
|
59
75
|
(r'[^\S\n]+', Whitespace),
|
60
76
|
(r'\\\n', Text), # line continuation
|
61
|
-
(
|
62
|
-
(
|
63
|
-
# Open until EOF, so no ending
|
77
|
+
(_comment_single, Comment.Single),
|
78
|
+
(_comment_multiline, Comment.Multiline),
|
79
|
+
# Open until EOF, so no ending delimiter
|
64
80
|
(r'/(\\\n)?[*][\w\W]*', Comment.Multiline),
|
65
81
|
],
|
66
82
|
'statements': [
|
@@ -71,10 +87,13 @@ class CFamilyLexer(RegexLexer):
|
|
71
87
|
bygroups(String.Affix, String.Char, String.Char, String.Char)),
|
72
88
|
|
73
89
|
# Hexadecimal floating-point literals (C11, C++17)
|
74
|
-
(r'0[xX](' + _hexpart + r'\.' + _hexpart + r'|\.' + _hexpart +
|
90
|
+
(r'0[xX](' + _hexpart + r'\.' + _hexpart + r'|\.' + _hexpart +
|
91
|
+
r'|' + _hexpart + r')[pP][+-]?' + _hexpart + r'[lL]?', Number.Float),
|
75
92
|
|
76
|
-
(r'(-)?(' + _decpart + r'\.' + _decpart + r'|\.' + _decpart + r'|' +
|
77
|
-
|
93
|
+
(r'(-)?(' + _decpart + r'\.' + _decpart + r'|\.' + _decpart + r'|' +
|
94
|
+
_decpart + r')[eE][+-]?' + _decpart + r'[fFlL]?', Number.Float),
|
95
|
+
(r'(-)?((' + _decpart + r'\.(' + _decpart + r')?|\.' +
|
96
|
+
_decpart + r')[fFlL]?)|(' + _decpart + r'[fFlL])', Number.Float),
|
78
97
|
(r'(-)?0[xX]' + _hexpart + _intsuffix, Number.Hex),
|
79
98
|
(r'(-)?0[bB][01](\'?[01])*' + _intsuffix, Number.Bin),
|
80
99
|
(r'(-)?0(\'?[0-7])+' + _intsuffix, Number.Oct),
|
@@ -82,7 +101,6 @@ class CFamilyLexer(RegexLexer):
|
|
82
101
|
(r'[~!%^&*+=|?:<>/-]', Operator),
|
83
102
|
(r'[()\[\],.]', Punctuation),
|
84
103
|
(r'(true|false|NULL)\b', Name.Builtin),
|
85
|
-
(r'(' + _ident + r')(\s*)(:)(?!:)', bygroups(Name.Label, Text, Punctuation)),
|
86
104
|
(_ident, Name)
|
87
105
|
],
|
88
106
|
'types': [
|
@@ -92,10 +110,11 @@ class CFamilyLexer(RegexLexer):
|
|
92
110
|
'unsigned', 'signed', 'void'), suffix=r'\b'), Keyword.Type)
|
93
111
|
],
|
94
112
|
'keywords': [
|
95
|
-
(r'(struct|union)(\s+)', bygroups(Keyword,
|
96
|
-
(
|
97
|
-
|
98
|
-
'
|
113
|
+
(r'(struct|union)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
114
|
+
(r'case\b', Keyword, 'case-value'),
|
115
|
+
(words(('asm', 'auto', 'break', 'const', 'continue', 'default',
|
116
|
+
'do', 'else', 'enum', 'extern', 'for', 'goto', 'if',
|
117
|
+
'register', 'restricted', 'return', 'sizeof', 'struct',
|
99
118
|
'static', 'switch', 'typedef', 'volatile', 'while', 'union',
|
100
119
|
'thread_local', 'alignas', 'alignof', 'static_assert', '_Pragma'),
|
101
120
|
suffix=r'\b'), Keyword),
|
@@ -116,19 +135,30 @@ class CFamilyLexer(RegexLexer):
|
|
116
135
|
include('keywords'),
|
117
136
|
# functions
|
118
137
|
(r'(' + _namespaced_ident + r'(?:[&*\s])+)' # return arguments
|
138
|
+
r'(' + _possible_comments + r')'
|
119
139
|
r'(' + _namespaced_ident + r')' # method name
|
120
|
-
r'(
|
121
|
-
r'([^;
|
122
|
-
|
123
|
-
|
140
|
+
r'(' + _possible_comments + r')'
|
141
|
+
r'(\([^;"\')]*?\))' # signature
|
142
|
+
r'(' + _possible_comments + r')'
|
143
|
+
r'([^;{/"\']*)(\{)',
|
144
|
+
bygroups(using(this), using(this, state='whitespace'),
|
145
|
+
Name.Function, using(this, state='whitespace'),
|
146
|
+
using(this), using(this, state='whitespace'),
|
147
|
+
using(this), Punctuation),
|
124
148
|
'function'),
|
125
149
|
# function declarations
|
126
150
|
(r'(' + _namespaced_ident + r'(?:[&*\s])+)' # return arguments
|
151
|
+
r'(' + _possible_comments + r')'
|
127
152
|
r'(' + _namespaced_ident + r')' # method name
|
128
|
-
r'(
|
129
|
-
r'([^;]
|
130
|
-
|
131
|
-
|
153
|
+
r'(' + _possible_comments + r')'
|
154
|
+
r'(\([^;"\')]*?\))' # signature
|
155
|
+
r'(' + _possible_comments + r')'
|
156
|
+
r'([^;/"\']*)(;)',
|
157
|
+
bygroups(using(this), using(this, state='whitespace'),
|
158
|
+
Name.Function, using(this, state='whitespace'),
|
159
|
+
using(this), using(this, state='whitespace'),
|
160
|
+
using(this), Punctuation)),
|
161
|
+
include('types'),
|
132
162
|
default('statement'),
|
133
163
|
],
|
134
164
|
'statement': [
|
@@ -154,9 +184,11 @@ class CFamilyLexer(RegexLexer):
|
|
154
184
|
],
|
155
185
|
'macro': [
|
156
186
|
(r'('+_ws1+r')(include)('+_ws1+r')("[^"]+")([^\n]*)',
|
157
|
-
bygroups(using(this), Comment.Preproc, using(this),
|
187
|
+
bygroups(using(this), Comment.Preproc, using(this),
|
188
|
+
Comment.PreprocFile, Comment.Single)),
|
158
189
|
(r'('+_ws1+r')(include)('+_ws1+r')(<[^>]+>)([^\n]*)',
|
159
|
-
bygroups(using(this), Comment.Preproc, using(this),
|
190
|
+
bygroups(using(this), Comment.Preproc, using(this),
|
191
|
+
Comment.PreprocFile, Comment.Single)),
|
160
192
|
(r'[^/\n]+', Comment.Preproc),
|
161
193
|
(r'/[*](.|\n)*?[*]/', Comment.Multiline),
|
162
194
|
(r'//.*?\n', Comment.Single, '#pop'),
|
@@ -175,6 +207,13 @@ class CFamilyLexer(RegexLexer):
|
|
175
207
|
# template specification
|
176
208
|
(r'\s*(?=>)', Text, '#pop'),
|
177
209
|
default('#pop')
|
210
|
+
],
|
211
|
+
# Mark identifiers preceded by `case` keyword as constants.
|
212
|
+
'case-value': [
|
213
|
+
(r'(?<!:)(:)(?!:)', Punctuation, '#pop'),
|
214
|
+
(_ident, Name.Constant),
|
215
|
+
include('whitespace'),
|
216
|
+
include('statements'),
|
178
217
|
]
|
179
218
|
}
|
180
219
|
|
@@ -194,12 +233,12 @@ class CFamilyLexer(RegexLexer):
|
|
194
233
|
'mode_t', 'nfds_t', 'pid_t', 'rlim_t', 'sig_t', 'sighandler_t', 'siginfo_t',
|
195
234
|
'sigset_t', 'sigval_t', 'socklen_t', 'timer_t', 'uid_t'}
|
196
235
|
c11_atomic_types = {
|
197
|
-
'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short',
|
236
|
+
'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short',
|
198
237
|
'atomic_ushort', 'atomic_int', 'atomic_uint', 'atomic_long', 'atomic_ulong',
|
199
|
-
'atomic_llong', 'atomic_ullong', 'atomic_char16_t', 'atomic_char32_t', 'atomic_wchar_t',
|
200
|
-
'atomic_int_least8_t', 'atomic_uint_least8_t', 'atomic_int_least16_t',
|
238
|
+
'atomic_llong', 'atomic_ullong', 'atomic_char16_t', 'atomic_char32_t', 'atomic_wchar_t',
|
239
|
+
'atomic_int_least8_t', 'atomic_uint_least8_t', 'atomic_int_least16_t',
|
201
240
|
'atomic_uint_least16_t', 'atomic_int_least32_t', 'atomic_uint_least32_t',
|
202
|
-
'atomic_int_least64_t', 'atomic_uint_least64_t', 'atomic_int_fast8_t',
|
241
|
+
'atomic_int_least64_t', 'atomic_uint_least64_t', 'atomic_int_fast8_t',
|
203
242
|
'atomic_uint_fast8_t', 'atomic_int_fast16_t', 'atomic_uint_fast16_t',
|
204
243
|
'atomic_int_fast32_t', 'atomic_uint_fast32_t', 'atomic_int_fast64_t',
|
205
244
|
'atomic_uint_fast64_t', 'atomic_intptr_t', 'atomic_uintptr_t', 'atomic_size_t',
|
@@ -212,9 +251,9 @@ class CFamilyLexer(RegexLexer):
|
|
212
251
|
self.platformhighlighting = get_bool_opt(options, 'platformhighlighting', True)
|
213
252
|
RegexLexer.__init__(self, **options)
|
214
253
|
|
215
|
-
def get_tokens_unprocessed(self, text):
|
254
|
+
def get_tokens_unprocessed(self, text, stack=('root',)):
|
216
255
|
for index, token, value in \
|
217
|
-
RegexLexer.get_tokens_unprocessed(self, text):
|
256
|
+
RegexLexer.get_tokens_unprocessed(self, text, stack):
|
218
257
|
if token is Name:
|
219
258
|
if self.stdlibhighlighting and value in self.stdlib_types:
|
220
259
|
token = Keyword.Type
|
@@ -252,14 +291,14 @@ class CLexer(CFamilyLexer):
|
|
252
291
|
"""
|
253
292
|
name = 'C'
|
254
293
|
aliases = ['c']
|
255
|
-
filenames = ['*.c', '*.h', '*.idc']
|
256
|
-
mimetypes = ['text/x-chdr', 'text/x-csrc']
|
294
|
+
filenames = ['*.c', '*.h', '*.idc', '*.x[bp]m']
|
295
|
+
mimetypes = ['text/x-chdr', 'text/x-csrc', 'image/x-xbitmap', 'image/x-xpixmap']
|
257
296
|
priority = 0.1
|
258
297
|
|
259
298
|
tokens = {
|
260
299
|
'keywords': [
|
261
300
|
(words((
|
262
|
-
'_Alignas', '_Alignof', '_Noreturn', '_Generic', '_Thread_local',
|
301
|
+
'_Alignas', '_Alignof', '_Noreturn', '_Generic', '_Thread_local',
|
263
302
|
'_Static_assert', '_Imaginary', 'noreturn', 'imaginary', 'complex'),
|
264
303
|
suffix=r'\b'), Keyword),
|
265
304
|
inherit
|
@@ -301,10 +340,11 @@ class CppLexer(CFamilyLexer):
|
|
301
340
|
(default: ``True``).
|
302
341
|
"""
|
303
342
|
name = 'C++'
|
343
|
+
url = 'https://isocpp.org/'
|
304
344
|
aliases = ['cpp', 'c++']
|
305
345
|
filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++',
|
306
346
|
'*.cc', '*.hh', '*.cxx', '*.hxx',
|
307
|
-
'*.C', '*.H', '*.cp', '*.CPP']
|
347
|
+
'*.C', '*.H', '*.cp', '*.CPP', '*.tpp']
|
308
348
|
mimetypes = ['text/x-c++hdr', 'text/x-c++src']
|
309
349
|
priority = 0.1
|
310
350
|
|
@@ -335,19 +375,19 @@ class CppLexer(CFamilyLexer):
|
|
335
375
|
default('#pop')
|
336
376
|
],
|
337
377
|
'keywords': [
|
338
|
-
(r'(class|concept|typename)(\s+)', bygroups(Keyword,
|
378
|
+
(r'(class|concept|typename)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
339
379
|
(words((
|
340
380
|
'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit',
|
341
381
|
'export', 'friend', 'mutable', 'new', 'operator',
|
342
382
|
'private', 'protected', 'public', 'reinterpret_cast', 'class',
|
343
383
|
'restrict', 'static_cast', 'template', 'this', 'throw', 'throws',
|
344
384
|
'try', 'typeid', 'using', 'virtual', 'constexpr', 'nullptr', 'concept',
|
345
|
-
'decltype', 'noexcept', 'override', 'final', 'constinit', 'consteval',
|
385
|
+
'decltype', 'noexcept', 'override', 'final', 'constinit', 'consteval',
|
346
386
|
'co_await', 'co_return', 'co_yield', 'requires', 'import', 'module',
|
347
387
|
'typename'),
|
348
388
|
suffix=r'\b'), Keyword),
|
349
389
|
(r'namespace\b', Keyword, 'namespace'),
|
350
|
-
(r'(enum)(\s+)', bygroups(Keyword,
|
390
|
+
(r'(enum)(\s+)', bygroups(Keyword, Whitespace), 'enumname'),
|
351
391
|
inherit
|
352
392
|
],
|
353
393
|
'types': [
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lexers for other C-like 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
|
|
@@ -38,10 +38,11 @@ class PikeLexer(CppLexer):
|
|
38
38
|
'statements': [
|
39
39
|
(words((
|
40
40
|
'catch', 'new', 'private', 'protected', 'public', 'gauge',
|
41
|
-
'throw', 'throws', 'class', 'interface', 'implement', 'abstract',
|
42
|
-
'
|
43
|
-
'
|
44
|
-
'
|
41
|
+
'throw', 'throws', 'class', 'interface', 'implement', 'abstract',
|
42
|
+
'extends', 'from', 'this', 'super', 'constant', 'final', 'static',
|
43
|
+
'import', 'use', 'extern', 'inline', 'proto', 'break', 'continue',
|
44
|
+
'if', 'else', 'for', 'while', 'do', 'switch', 'case', 'as', 'in',
|
45
|
+
'version', 'return', 'true', 'false', 'null',
|
45
46
|
'__VERSION__', '__MAJOR__', '__MINOR__', '__BUILD__', '__REAL_VERSION__',
|
46
47
|
'__REAL_MAJOR__', '__REAL_MINOR__', '__REAL_BUILD__', '__DATE__', '__TIME__',
|
47
48
|
'__FILE__', '__DIR__', '__LINE__', '__AUTO_BIGNUM__', '__NT__', '__PIKE__',
|
@@ -51,14 +52,14 @@ class PikeLexer(CppLexer):
|
|
51
52
|
r'array|multiset|program|function|lambda|mixed|'
|
52
53
|
r'[a-z_][a-z0-9_]*_t)\b',
|
53
54
|
Keyword.Type),
|
54
|
-
(r'(class)(\s+)', bygroups(Keyword,
|
55
|
+
(r'(class)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
55
56
|
(r'[~!%^&*+=|?:<>/@-]', Operator),
|
56
57
|
inherit,
|
57
58
|
],
|
58
59
|
'classname': [
|
59
60
|
(r'[a-zA-Z_]\w*', Name.Class, '#pop'),
|
60
61
|
# template specification
|
61
|
-
(r'\s*(?=>)',
|
62
|
+
(r'\s*(?=>)', Whitespace, '#pop'),
|
62
63
|
],
|
63
64
|
}
|
64
65
|
|
@@ -104,7 +105,7 @@ class ClayLexer(RegexLexer):
|
|
104
105
|
mimetypes = ['text/x-clay']
|
105
106
|
tokens = {
|
106
107
|
'root': [
|
107
|
-
(r'\s',
|
108
|
+
(r'\s+', Whitespace),
|
108
109
|
(r'//.*?$', Comment.Single),
|
109
110
|
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
|
110
111
|
(r'\b(public|private|import|as|record|variant|instance'
|
@@ -126,7 +127,7 @@ class ClayLexer(RegexLexer):
|
|
126
127
|
],
|
127
128
|
'strings': [
|
128
129
|
(r'(?i)\\(x[0-9a-f]{2}|.)', String.Escape),
|
129
|
-
(r'
|
130
|
+
(r'[^\\"]+', String),
|
130
131
|
],
|
131
132
|
'nl': [
|
132
133
|
(r'\n', String),
|
@@ -169,7 +170,7 @@ class ECLexer(CLexer):
|
|
169
170
|
(words(('uint', 'uint16', 'uint32', 'uint64', 'bool', 'byte',
|
170
171
|
'unichar', 'int64'), suffix=r'\b'),
|
171
172
|
Keyword.Type),
|
172
|
-
(r'(class)(\s+)', bygroups(Keyword,
|
173
|
+
(r'(class)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
173
174
|
(r'(null|value|this)\b', Name.Builtin),
|
174
175
|
inherit,
|
175
176
|
]
|
@@ -190,8 +191,8 @@ class ValaLexer(RegexLexer):
|
|
190
191
|
tokens = {
|
191
192
|
'whitespace': [
|
192
193
|
(r'^\s*#if\s+0', Comment.Preproc, 'if0'),
|
193
|
-
(r'\n',
|
194
|
-
(r'\s+',
|
194
|
+
(r'\n', Whitespace),
|
195
|
+
(r'\s+', Whitespace),
|
195
196
|
(r'\\\n', Text), # line continuation
|
196
197
|
(r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
197
198
|
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
|
@@ -226,10 +227,10 @@ class ValaLexer(RegexLexer):
|
|
226
227
|
'public', 'ref', 'requires', 'signal', 'static', 'throws', 'unowned',
|
227
228
|
'var', 'virtual', 'volatile', 'weak', 'yields'), suffix=r'\b'),
|
228
229
|
Keyword.Declaration),
|
229
|
-
(r'(namespace|using)(\s+)', bygroups(Keyword.Namespace,
|
230
|
+
(r'(namespace|using)(\s+)', bygroups(Keyword.Namespace, Whitespace),
|
230
231
|
'namespace'),
|
231
232
|
(r'(class|errordomain|interface|struct)(\s+)',
|
232
|
-
bygroups(Keyword.Declaration,
|
233
|
+
bygroups(Keyword.Declaration, Whitespace), 'class'),
|
233
234
|
(r'(\.)([a-zA-Z_]\w*)',
|
234
235
|
bygroups(Operator, Name.Attribute)),
|
235
236
|
# void is an actual keyword, others are in glib-2.0.vapi
|
@@ -304,8 +305,8 @@ class CudaLexer(CLexer):
|
|
304
305
|
'__syncthreads_or'}
|
305
306
|
execution_confs = {'<<<', '>>>'}
|
306
307
|
|
307
|
-
def get_tokens_unprocessed(self, text):
|
308
|
-
for index, token, value in CLexer.get_tokens_unprocessed(self, text):
|
308
|
+
def get_tokens_unprocessed(self, text, stack=('root',)):
|
309
|
+
for index, token, value in CLexer.get_tokens_unprocessed(self, text, stack):
|
309
310
|
if token is Name:
|
310
311
|
if value in self.variable_qualifiers:
|
311
312
|
token = Keyword.Type
|
@@ -525,8 +526,8 @@ class ArduinoLexer(CppLexer):
|
|
525
526
|
'typename', 'this', 'alignof', 'constexpr', 'decltype', 'noexcept',
|
526
527
|
'static_assert', 'thread_local', 'restrict'}
|
527
528
|
|
528
|
-
def get_tokens_unprocessed(self, text):
|
529
|
-
for index, token, value in CppLexer.get_tokens_unprocessed(self, text):
|
529
|
+
def get_tokens_unprocessed(self, text, stack=('root',)):
|
530
|
+
for index, token, value in CppLexer.get_tokens_unprocessed(self, text, stack):
|
530
531
|
if value in self.structure:
|
531
532
|
yield index, Name.Builtin, value
|
532
533
|
elif value in self.operators:
|
@@ -573,12 +574,13 @@ class CharmciLexer(CppLexer):
|
|
573
574
|
|
574
575
|
class OmgIdlLexer(CLexer):
|
575
576
|
"""
|
576
|
-
Lexer for
|
577
|
+
Lexer for Object Management Group Interface Definition Language.
|
577
578
|
|
578
579
|
.. versionadded:: 2.9
|
579
580
|
"""
|
580
581
|
|
581
582
|
name = 'OMG Interface Definition Language'
|
583
|
+
url = 'https://www.omg.org/spec/IDL/About-IDL/'
|
582
584
|
aliases = ['omg-idl']
|
583
585
|
filenames = ['*.idl', '*.pidl']
|
584
586
|
mimetypes = []
|
@@ -4,30 +4,27 @@
|
|
4
4
|
|
5
5
|
Lexers for the Cap'n Proto schema language.
|
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
|
|
11
|
-
import re
|
12
|
-
|
13
11
|
from pygments.lexer import RegexLexer, default
|
14
|
-
from pygments.token import Text, Comment, Keyword, Name, Literal
|
12
|
+
from pygments.token import Text, Comment, Keyword, Name, Literal, Whitespace
|
15
13
|
|
16
14
|
__all__ = ['CapnProtoLexer']
|
17
15
|
|
18
16
|
|
19
17
|
class CapnProtoLexer(RegexLexer):
|
20
18
|
"""
|
21
|
-
For
|
19
|
+
For Cap'n Proto source.
|
22
20
|
|
23
21
|
.. versionadded:: 2.2
|
24
22
|
"""
|
25
23
|
name = 'Cap\'n Proto'
|
24
|
+
url = 'https://capnproto.org'
|
26
25
|
filenames = ['*.capnp']
|
27
26
|
aliases = ['capnp']
|
28
27
|
|
29
|
-
flags = re.MULTILINE | re.UNICODE
|
30
|
-
|
31
28
|
tokens = {
|
32
29
|
'root': [
|
33
30
|
(r'#.*?$', Comment.Single),
|
@@ -39,7 +36,8 @@ class CapnProtoLexer(RegexLexer):
|
|
39
36
|
r'extends|in|of|on|as|with|from|fixed)\b',
|
40
37
|
Keyword),
|
41
38
|
(r'[\w.]+', Name),
|
42
|
-
(r'[^#@=:$\w]+', Text),
|
39
|
+
(r'[^#@=:$\w\s]+', Text),
|
40
|
+
(r'\s+', Whitespace),
|
43
41
|
],
|
44
42
|
'type': [
|
45
43
|
(r'[^][=;,(){}$]+', Name.Class),
|
@@ -0,0 +1,96 @@
|
|
1
|
+
"""
|
2
|
+
pygments.lexers.carbon
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
4
|
+
|
5
|
+
Lexers for the Carbon programming language.
|
6
|
+
|
7
|
+
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
|
8
|
+
:license: BSD, see LICENSE for details.
|
9
|
+
"""
|
10
|
+
import re
|
11
|
+
|
12
|
+
from pygments.lexer import RegexLexer, bygroups, words
|
13
|
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
14
|
+
Number, Punctuation, Whitespace
|
15
|
+
|
16
|
+
__all__ = ['CarbonLexer']
|
17
|
+
|
18
|
+
|
19
|
+
class CarbonLexer(RegexLexer):
|
20
|
+
"""
|
21
|
+
For Carbon source.
|
22
|
+
|
23
|
+
.. versionadded:: 2.15
|
24
|
+
"""
|
25
|
+
name = 'Carbon'
|
26
|
+
url = 'https://github.com/carbon-language/carbon-lang'
|
27
|
+
filenames = ['*.carbon']
|
28
|
+
aliases = ['carbon']
|
29
|
+
mimetypes = ['text/x-carbon']
|
30
|
+
|
31
|
+
flags = re.MULTILINE | re.DOTALL
|
32
|
+
|
33
|
+
tokens = {
|
34
|
+
'root': [
|
35
|
+
(r'\n', Whitespace),
|
36
|
+
(r'\s+', Whitespace),
|
37
|
+
(r'\\\n', Text),
|
38
|
+
# comments
|
39
|
+
(r'//(.*?)\n', Comment.Single),
|
40
|
+
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
|
41
|
+
# Declaration
|
42
|
+
(r'(package|import|api|namespace|library)\b', Keyword.Namespace),
|
43
|
+
(r'(abstract|alias|fn|class|interface|let|var|virtual|external|'
|
44
|
+
r'base|addr|extends|choice|constraint|impl)\b', Keyword.Declaration),
|
45
|
+
# Keywords
|
46
|
+
(words(('as', 'or', 'not', 'and', 'break', 'continue', 'case',
|
47
|
+
'default', 'if', 'else', 'destructor', 'for', 'forall',
|
48
|
+
'while', 'where', 'then', 'in', 'is', 'return', 'returned',
|
49
|
+
'friend', 'partial', 'private', 'protected', 'observe', 'Self',
|
50
|
+
'override', 'final', 'match', 'type', 'like'), suffix=r'\b'), Keyword),
|
51
|
+
(r'(self)\b', Keyword.Pseudo),
|
52
|
+
(r'(true|false)\b', Keyword.Constant),
|
53
|
+
(r'(auto|bool|string|i8|i16|i32|i64|u8|u16|u32|u64|'
|
54
|
+
r'f8|f16|f32|f64)\b', Keyword.Type),
|
55
|
+
# numeric literals
|
56
|
+
(r'[0-9]*[.][0-9]+?', Number.Double),
|
57
|
+
(r'0b[01]+?', Number.Bin),
|
58
|
+
(r'0o[0-7]+?', Number.Oct),
|
59
|
+
(r'0x[0-9a-fA-F]+?', Number.Hex),
|
60
|
+
(r'[0-9]+?', Number.Integer),
|
61
|
+
# string literal
|
62
|
+
(r'"(\\.|[^"\\])*"', String),
|
63
|
+
# char literal
|
64
|
+
(r'\'(\\.|[^\'\\])\'', String.Char),
|
65
|
+
# tokens
|
66
|
+
(r'<<=|>>=|<<|>>|<=|>=|\+=|-=|\*=|/=|\%=|\|=|&=|\^=|&&|\|\||&|\||'
|
67
|
+
r'\+\+|--|\%|\^|\~|==|!=|::|[.]{3}|->|=>|[+\-*/&]', Operator),
|
68
|
+
(r'[|<>=!()\[\]{}.,;:\?]', Punctuation),
|
69
|
+
# identifiers
|
70
|
+
(r'[^\W\d]\w*', Name.Other),
|
71
|
+
]
|
72
|
+
}
|
73
|
+
|
74
|
+
def analyse_text(text):
|
75
|
+
result = 0
|
76
|
+
if 'forall' in text:
|
77
|
+
result += 0.1
|
78
|
+
if 'type' in text:
|
79
|
+
result += 0.1
|
80
|
+
if 'Self' in text:
|
81
|
+
result += 0.1
|
82
|
+
if 'observe' in text:
|
83
|
+
result += 0.1
|
84
|
+
if 'package' in text:
|
85
|
+
result += 0.1
|
86
|
+
if 'library' in text:
|
87
|
+
result += 0.1
|
88
|
+
if 'choice' in text:
|
89
|
+
result += 0.1
|
90
|
+
if 'addr' in text:
|
91
|
+
result += 0.1
|
92
|
+
if 'constraint' in text:
|
93
|
+
result += 0.1
|
94
|
+
if 'impl' in text:
|
95
|
+
result += 0.1
|
96
|
+
return result
|
@@ -8,27 +8,16 @@
|
|
8
8
|
More information:
|
9
9
|
https://datatracker.ietf.org/doc/rfc8610/
|
10
10
|
|
11
|
-
:copyright: Copyright 2006-
|
11
|
+
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
|
12
12
|
:license: BSD, see LICENSE for details.
|
13
13
|
"""
|
14
14
|
|
15
|
-
import
|
15
|
+
from pygments.lexer import RegexLexer, bygroups, include, words
|
16
|
+
from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
|
17
|
+
Punctuation, String, Whitespace
|
16
18
|
|
17
19
|
__all__ = ['CddlLexer']
|
18
20
|
|
19
|
-
from pygments.lexer import RegexLexer, bygroups, include, words
|
20
|
-
from pygments.token import (
|
21
|
-
Comment,
|
22
|
-
Error,
|
23
|
-
Keyword,
|
24
|
-
Name,
|
25
|
-
Number,
|
26
|
-
Operator,
|
27
|
-
Punctuation,
|
28
|
-
String,
|
29
|
-
Text,
|
30
|
-
)
|
31
|
-
|
32
21
|
|
33
22
|
class CddlLexer(RegexLexer):
|
34
23
|
"""
|
@@ -37,6 +26,7 @@ class CddlLexer(RegexLexer):
|
|
37
26
|
.. versionadded:: 2.8
|
38
27
|
"""
|
39
28
|
name = "CDDL"
|
29
|
+
url = 'https://datatracker.ietf.org/doc/rfc8610/'
|
40
30
|
aliases = ["cddl"]
|
41
31
|
filenames = ["*.cddl"]
|
42
32
|
mimetypes = ["text/x-cddl"]
|
@@ -103,7 +93,8 @@ class CddlLexer(RegexLexer):
|
|
103
93
|
|
104
94
|
_re_id = (
|
105
95
|
r"[$@A-Z_a-z]"
|
106
|
-
r"(?:[\-\.]
|
96
|
+
r"(?:[\-\.]+(?=[$@0-9A-Z_a-z])|[$@0-9A-Z_a-z])*"
|
97
|
+
|
107
98
|
)
|
108
99
|
|
109
100
|
# While the spec reads more like "an int must not start with 0" we use a
|
@@ -112,15 +103,13 @@ class CddlLexer(RegexLexer):
|
|
112
103
|
_re_uint = r"(?:0b[01]+|0x[0-9a-fA-F]+|[1-9]\d*|0(?!\d))"
|
113
104
|
_re_int = r"-?" + _re_uint
|
114
105
|
|
115
|
-
flags = re.UNICODE | re.MULTILINE
|
116
|
-
|
117
106
|
tokens = {
|
118
|
-
"commentsandwhitespace": [(r"\s+",
|
107
|
+
"commentsandwhitespace": [(r"\s+", Whitespace), (r";.+$", Comment.Single)],
|
119
108
|
"root": [
|
120
109
|
include("commentsandwhitespace"),
|
121
110
|
# tag types
|
122
111
|
(r"#(\d\.{uint})?".format(uint=_re_uint), Keyword.Type), # type or any
|
123
|
-
#
|
112
|
+
# occurrence
|
124
113
|
(
|
125
114
|
r"({uint})?(\*)({uint})?".format(uint=_re_uint),
|
126
115
|
bygroups(Number, Operator, Number),
|
@@ -142,15 +131,11 @@ class CddlLexer(RegexLexer):
|
|
142
131
|
# Barewords as member keys (must be matched before values, types, typenames,
|
143
132
|
# groupnames).
|
144
133
|
# Token type is String as barewords are always interpreted as such.
|
145
|
-
(
|
146
|
-
|
147
|
-
bygroups(String, Text, Punctuation),
|
148
|
-
),
|
134
|
+
(r"({bareword})(\s*)(:)".format(bareword=_re_id),
|
135
|
+
bygroups(String, Whitespace, Punctuation)),
|
149
136
|
# predefined types
|
150
|
-
(
|
151
|
-
|
152
|
-
Name.Builtin,
|
153
|
-
),
|
137
|
+
(words(_prelude_types, prefix=r"(?![\-_$@])\b", suffix=r"\b(?![\-_$@])"),
|
138
|
+
Name.Builtin),
|
154
139
|
# user-defined groupnames, typenames
|
155
140
|
(_re_id, Name.Class),
|
156
141
|
# values
|
@@ -159,10 +144,8 @@ class CddlLexer(RegexLexer):
|
|
159
144
|
(r"0x[0-9a-fA-F]+(\.[0-9a-fA-F]+)?p[+-]?\d+", Number.Hex), # hexfloat
|
160
145
|
(r"0x[0-9a-fA-F]+", Number.Hex), # hex
|
161
146
|
# Float
|
162
|
-
(
|
163
|
-
|
164
|
-
Number.Float,
|
165
|
-
),
|
147
|
+
(r"{int}(?=(\.\d|e[+-]?\d))(?:\.\d+)?(?:e[+-]?\d+)?".format(int=_re_int),
|
148
|
+
Number.Float),
|
166
149
|
# Int
|
167
150
|
(_re_int, Number.Integer),
|
168
151
|
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
@@ -185,6 +168,6 @@ class CddlLexer(RegexLexer):
|
|
185
168
|
"bstr": [
|
186
169
|
(r"'", String.Single, "#pop"),
|
187
170
|
(r"\\.", String.Escape),
|
188
|
-
(r"[^']", String.Single),
|
171
|
+
(r"[^'\\]+", String.Single),
|
189
172
|
],
|
190
173
|
}
|