pygments.rb 1.2.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +13 -0
- data/.github/workflows/ci.yml +40 -0
- data/.github/workflows/release.yml +24 -0
- data/.gitignore +4 -6
- data/.rubocop.yml +16 -0
- data/CHANGELOG.adoc +137 -0
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/README.adoc +159 -0
- data/Rakefile +8 -32
- data/bench.rb +14 -8
- data/lib/pygments.rb +16 -14
- data/lib/pygments/lexer.rb +87 -65
- data/lib/pygments/mentos.py +23 -110
- data/lib/pygments/popen.rb +188 -284
- data/lib/pygments/version.rb +2 -2
- data/pygments.rb.gemspec +20 -13
- data/test/test_pygments.rb +50 -110
- data/vendor/pygments-main/{AUTHORS → Pygments-2.8.1.dist-info/AUTHORS} +26 -3
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/INSTALLER +1 -0
- data/vendor/pygments-main/{LICENSE → Pygments-2.8.1.dist-info/LICENSE} +1 -1
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/METADATA +48 -0
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/RECORD +494 -0
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/REQUESTED +0 -0
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/WHEEL +5 -0
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/entry_points.txt +3 -0
- data/vendor/pygments-main/Pygments-2.8.1.dist-info/top_level.txt +1 -0
- data/vendor/pygments-main/bin/pygmentize +8 -0
- data/vendor/pygments-main/pygments/__init__.py +6 -12
- data/vendor/pygments-main/pygments/__main__.py +17 -0
- data/vendor/pygments-main/pygments/cmdline.py +213 -184
- data/vendor/pygments-main/pygments/console.py +6 -10
- data/vendor/pygments-main/pygments/filter.py +4 -7
- data/vendor/pygments-main/pygments/filters/__init__.py +609 -22
- data/vendor/pygments-main/pygments/formatter.py +4 -5
- data/vendor/pygments-main/pygments/formatters/__init__.py +10 -10
- data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -4
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -2
- data/vendor/pygments-main/pygments/formatters/html.py +242 -139
- data/vendor/pygments-main/pygments/formatters/img.py +91 -50
- data/vendor/pygments-main/pygments/formatters/irc.py +39 -40
- data/vendor/pygments-main/pygments/formatters/latex.py +62 -33
- data/vendor/pygments-main/pygments/formatters/other.py +18 -17
- data/vendor/pygments-main/pygments/formatters/rtf.py +29 -30
- data/vendor/pygments-main/pygments/formatters/svg.py +40 -5
- data/vendor/pygments-main/pygments/formatters/terminal.py +25 -32
- data/vendor/pygments-main/pygments/formatters/terminal256.py +45 -14
- data/vendor/pygments-main/pygments/lexer.py +47 -44
- data/vendor/pygments-main/pygments/lexers/__init__.py +341 -0
- data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1644 -0
- data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +231 -0
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +75 -0
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1724 -0
- data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +5326 -0
- data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +292 -0
- data/vendor/pygments-main/pygments/lexers/_mapping.py +554 -0
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1171 -0
- data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +1281 -0
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2600 -0
- data/vendor/pygments-main/pygments/lexers/_php_builtins.py +4752 -0
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +677 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3093 -0
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1160 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +557 -0
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +457 -0
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1003 -0
- data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +112 -0
- data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +279 -0
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1938 -0
- data/vendor/pygments-main/pygments/lexers/actionscript.py +244 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +23 -0
- data/vendor/pygments-main/pygments/lexers/algebra.py +239 -0
- data/vendor/pygments-main/pygments/lexers/ambient.py +75 -0
- data/vendor/pygments-main/pygments/lexers/amdgpu.py +48 -0
- data/vendor/pygments-main/pygments/lexers/ampl.py +86 -0
- data/vendor/pygments-main/pygments/lexers/apl.py +100 -0
- data/vendor/pygments-main/pygments/lexers/archetype.py +317 -0
- data/vendor/pygments-main/pygments/lexers/arrow.py +116 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +1004 -0
- data/vendor/pygments-main/pygments/lexers/automation.py +379 -0
- data/vendor/pygments-main/pygments/lexers/bare.py +103 -0
- data/vendor/pygments-main/pygments/lexers/basic.py +661 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +159 -0
- data/vendor/pygments-main/pygments/lexers/boa.py +101 -0
- data/vendor/pygments-main/pygments/lexers/business.py +626 -0
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +342 -0
- data/vendor/pygments-main/pygments/lexers/c_like.py +565 -0
- data/vendor/pygments-main/pygments/lexers/capnproto.py +77 -0
- data/vendor/pygments-main/pygments/lexers/cddl.py +190 -0
- data/vendor/pygments-main/pygments/lexers/chapel.py +111 -0
- data/vendor/pygments-main/pygments/lexers/clean.py +178 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +33 -0
- data/vendor/pygments-main/pygments/lexers/configs.py +985 -0
- data/vendor/pygments-main/pygments/lexers/console.py +113 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +366 -0
- data/vendor/pygments-main/pygments/lexers/csound.py +466 -0
- data/vendor/pygments-main/pygments/lexers/css.py +694 -0
- data/vendor/pygments-main/pygments/lexers/d.py +255 -0
- data/vendor/pygments-main/pygments/lexers/dalvik.py +124 -0
- data/vendor/pygments-main/pygments/lexers/data.py +697 -0
- data/vendor/pygments-main/pygments/lexers/devicetree.py +108 -0
- data/vendor/pygments-main/pygments/lexers/diff.py +164 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +706 -0
- data/vendor/pygments-main/pygments/lexers/dsls.py +959 -0
- data/vendor/pygments-main/pygments/lexers/dylan.py +286 -0
- data/vendor/pygments-main/pygments/lexers/ecl.py +137 -0
- data/vendor/pygments-main/pygments/lexers/eiffel.py +64 -0
- data/vendor/pygments-main/pygments/lexers/elm.py +120 -0
- data/vendor/pygments-main/pygments/lexers/email.py +150 -0
- data/vendor/pygments-main/pygments/lexers/erlang.py +529 -0
- data/vendor/pygments-main/pygments/lexers/esoteric.py +303 -0
- data/vendor/pygments-main/pygments/lexers/ezhil.py +76 -0
- data/vendor/pygments-main/pygments/lexers/factor.py +343 -0
- data/vendor/pygments-main/pygments/lexers/fantom.py +249 -0
- data/vendor/pygments-main/pygments/lexers/felix.py +272 -0
- data/vendor/pygments-main/pygments/lexers/floscript.py +82 -0
- data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
- data/vendor/pygments-main/pygments/lexers/fortran.py +208 -0
- data/vendor/pygments-main/pygments/lexers/foxpro.py +427 -0
- data/vendor/pygments-main/pygments/lexers/freefem.py +897 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +20 -0
- data/vendor/pygments-main/pygments/lexers/futhark.py +110 -0
- data/vendor/pygments-main/pygments/lexers/gdscript.py +345 -0
- data/vendor/pygments-main/pygments/lexers/go.py +100 -0
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +269 -0
- data/vendor/pygments-main/pygments/lexers/graph.py +84 -0
- data/vendor/pygments-main/pygments/lexers/graphics.py +799 -0
- data/vendor/pygments-main/pygments/lexers/graphviz.py +57 -0
- data/vendor/pygments-main/pygments/lexers/haskell.py +869 -0
- data/vendor/pygments-main/pygments/lexers/haxe.py +935 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +468 -0
- data/vendor/pygments-main/pygments/lexers/hexdump.py +102 -0
- data/vendor/pygments-main/pygments/lexers/html.py +613 -0
- data/vendor/pygments-main/pygments/lexers/idl.py +280 -0
- data/vendor/pygments-main/pygments/lexers/igor.py +419 -0
- data/vendor/pygments-main/pygments/lexers/inferno.py +95 -0
- data/vendor/pygments-main/pygments/lexers/installers.py +321 -0
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +1367 -0
- data/vendor/pygments-main/pygments/lexers/iolang.py +62 -0
- data/vendor/pygments-main/pygments/lexers/j.py +145 -0
- data/vendor/pygments-main/pygments/lexers/javascript.py +1536 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +330 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +1739 -0
- data/vendor/pygments-main/pygments/lexers/lisp.py +2698 -0
- data/vendor/pygments-main/pygments/lexers/make.py +205 -0
- data/vendor/pygments-main/pygments/lexers/markup.py +762 -0
- data/vendor/pygments-main/pygments/lexers/math.py +20 -0
- data/vendor/pygments-main/pygments/lexers/matlab.py +3280 -0
- data/vendor/pygments-main/pygments/lexers/mime.py +225 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +957 -0
- data/vendor/pygments-main/pygments/lexers/modeling.py +365 -0
- data/vendor/pygments-main/pygments/lexers/modula2.py +1579 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
- data/vendor/pygments-main/pygments/lexers/mosel.py +447 -0
- data/vendor/pygments-main/pygments/lexers/ncl.py +893 -0
- data/vendor/pygments-main/pygments/lexers/nimrod.py +158 -0
- data/vendor/pygments-main/pygments/lexers/nit.py +63 -0
- data/vendor/pygments-main/pygments/lexers/nix.py +135 -0
- data/vendor/pygments-main/pygments/lexers/oberon.py +120 -0
- data/vendor/pygments-main/pygments/lexers/objective.py +503 -0
- data/vendor/pygments-main/pygments/lexers/ooc.py +84 -0
- data/vendor/pygments-main/pygments/lexers/other.py +40 -0
- data/vendor/pygments-main/pygments/lexers/parasail.py +78 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +799 -0
- data/vendor/pygments-main/pygments/lexers/pascal.py +643 -0
- data/vendor/pygments-main/pygments/lexers/pawn.py +202 -0
- data/vendor/pygments-main/pygments/lexers/perl.py +731 -0
- data/vendor/pygments-main/pygments/lexers/php.py +320 -0
- data/vendor/pygments-main/pygments/lexers/pointless.py +70 -0
- data/vendor/pygments-main/pygments/lexers/pony.py +93 -0
- data/vendor/pygments-main/pygments/lexers/praat.py +301 -0
- data/vendor/pygments-main/pygments/lexers/prolog.py +305 -0
- data/vendor/pygments-main/pygments/lexers/promql.py +182 -0
- data/vendor/pygments-main/pygments/lexers/python.py +1158 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +151 -0
- data/vendor/pygments-main/pygments/lexers/r.py +190 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +462 -0
- data/vendor/pygments-main/pygments/lexers/rebol.py +430 -0
- data/vendor/pygments-main/pygments/lexers/resource.py +84 -0
- data/vendor/pygments-main/pygments/lexers/ride.py +138 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +66 -0
- data/vendor/pygments-main/pygments/lexers/roboconf.py +81 -0
- data/vendor/pygments-main/pygments/lexers/robotframework.py +551 -0
- data/vendor/pygments-main/pygments/lexers/ruby.py +523 -0
- data/vendor/pygments-main/pygments/lexers/rust.py +223 -0
- data/vendor/pygments-main/pygments/lexers/sas.py +227 -0
- data/vendor/pygments-main/pygments/lexers/scdoc.py +82 -0
- data/vendor/pygments-main/pygments/lexers/scripting.py +1283 -0
- data/vendor/pygments-main/pygments/lexers/sgf.py +60 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +909 -0
- data/vendor/pygments-main/pygments/lexers/sieve.py +68 -0
- data/vendor/pygments-main/pygments/lexers/slash.py +184 -0
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +194 -0
- data/vendor/pygments-main/pygments/lexers/smv.py +78 -0
- data/vendor/pygments-main/pygments/lexers/snobol.py +82 -0
- data/vendor/pygments-main/pygments/lexers/solidity.py +91 -0
- data/vendor/pygments-main/pygments/lexers/special.py +106 -0
- data/vendor/pygments-main/pygments/lexers/sql.py +832 -0
- data/vendor/pygments-main/pygments/lexers/stata.py +170 -0
- data/vendor/pygments-main/pygments/lexers/supercollider.py +94 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +144 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +2263 -0
- data/vendor/pygments-main/pygments/lexers/teraterm.py +334 -0
- data/vendor/pygments-main/pygments/lexers/testing.py +206 -0
- data/vendor/pygments-main/pygments/lexers/text.py +25 -0
- data/vendor/pygments-main/pygments/lexers/textedit.py +168 -0
- data/vendor/pygments-main/pygments/lexers/textfmts.py +429 -0
- data/vendor/pygments-main/pygments/lexers/theorem.py +476 -0
- data/vendor/pygments-main/pygments/lexers/tnt.py +262 -0
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +53 -0
- data/vendor/pygments-main/pygments/lexers/typoscript.py +218 -0
- data/vendor/pygments-main/pygments/lexers/unicon.py +411 -0
- data/vendor/pygments-main/pygments/lexers/urbi.py +145 -0
- data/vendor/pygments-main/pygments/lexers/usd.py +89 -0
- data/vendor/pygments-main/pygments/lexers/varnish.py +189 -0
- data/vendor/pygments-main/pygments/lexers/verification.py +113 -0
- data/vendor/pygments-main/pygments/lexers/web.py +23 -0
- data/vendor/pygments-main/pygments/lexers/webidl.py +298 -0
- data/vendor/pygments-main/pygments/lexers/webmisc.py +991 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +115 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +68 -0
- data/vendor/pygments-main/pygments/lexers/xorg.py +36 -0
- data/vendor/pygments-main/pygments/lexers/yang.py +103 -0
- data/vendor/pygments-main/pygments/lexers/zig.py +123 -0
- data/vendor/pygments-main/pygments/modeline.py +1 -2
- data/vendor/pygments-main/pygments/plugin.py +4 -3
- data/vendor/pygments-main/pygments/regexopt.py +1 -2
- data/vendor/pygments-main/pygments/scanner.py +2 -3
- data/vendor/pygments-main/pygments/sphinxext.py +2 -5
- data/vendor/pygments-main/pygments/style.py +61 -25
- data/vendor/pygments-main/pygments/styles/__init__.py +12 -5
- data/vendor/pygments-main/pygments/styles/abap.py +1 -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 -2
- data/vendor/pygments-main/pygments/styles/borland.py +1 -2
- data/vendor/pygments-main/pygments/styles/bw.py +1 -2
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -2
- data/vendor/pygments-main/pygments/styles/default.py +1 -2
- 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/fruity.py +1 -2
- data/vendor/pygments-main/pygments/styles/igor.py +1 -2
- data/vendor/pygments-main/pygments/styles/inkpot.py +66 -0
- data/vendor/pygments-main/pygments/styles/lovelace.py +1 -2
- data/vendor/pygments-main/pygments/styles/manni.py +1 -2
- data/vendor/pygments-main/pygments/styles/material.py +118 -0
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -2
- data/vendor/pygments-main/pygments/styles/native.py +1 -2
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -2
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -2
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -2
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -2
- data/vendor/pygments-main/pygments/styles/rainbow_dash.py +1 -2
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -2
- data/vendor/pygments-main/pygments/styles/sas.py +1 -2
- data/vendor/pygments-main/pygments/styles/solarized.py +136 -0
- data/vendor/pygments-main/pygments/styles/stata_dark.py +40 -0
- data/vendor/pygments-main/pygments/styles/{stata.py → stata_light.py} +14 -16
- data/vendor/pygments-main/pygments/styles/tango.py +1 -2
- data/vendor/pygments-main/pygments/styles/trac.py +1 -2
- 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 -2
- data/vendor/pygments-main/pygments/styles/zenburn.py +80 -0
- data/vendor/pygments-main/pygments/token.py +1 -2
- data/vendor/pygments-main/pygments/unistring.py +47 -109
- data/vendor/pygments-main/pygments/util.py +16 -96
- metadata +81 -139
- data/CHANGELOG.md +0 -111
- data/README.md +0 -121
- data/cache-lexers.rb +0 -8
- data/circle.yml +0 -20
- data/test/test_data.c +0 -2581
- data/test/test_data.py +0 -514
- data/test/test_data_generated +0 -2582
- data/vendor/custom_lexers/github.py +0 -565
- data/vendor/pygments-main/CHANGES +0 -1186
- data/vendor/pygments-main/MANIFEST.in +0 -6
- data/vendor/pygments-main/Makefile +0 -65
- data/vendor/pygments-main/README.rst +0 -39
- data/vendor/pygments-main/REVISION +0 -1
- data/vendor/pygments-main/TODO +0 -12
- data/vendor/pygments-main/doc/Makefile +0 -153
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +0 -3
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +0 -25
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +0 -98
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +0 -401
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +0 -15
- data/vendor/pygments-main/doc/conf.py +0 -241
- data/vendor/pygments-main/doc/docs/api.rst +0 -354
- data/vendor/pygments-main/doc/docs/authors.rst +0 -4
- data/vendor/pygments-main/doc/docs/changelog.rst +0 -1
- data/vendor/pygments-main/doc/docs/cmdline.rst +0 -166
- data/vendor/pygments-main/doc/docs/filterdevelopment.rst +0 -71
- data/vendor/pygments-main/doc/docs/filters.rst +0 -41
- data/vendor/pygments-main/doc/docs/formatterdevelopment.rst +0 -169
- data/vendor/pygments-main/doc/docs/formatters.rst +0 -48
- data/vendor/pygments-main/doc/docs/index.rst +0 -66
- data/vendor/pygments-main/doc/docs/integrate.rst +0 -40
- data/vendor/pygments-main/doc/docs/java.rst +0 -70
- data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +0 -728
- data/vendor/pygments-main/doc/docs/lexers.rst +0 -69
- data/vendor/pygments-main/doc/docs/moinmoin.rst +0 -39
- data/vendor/pygments-main/doc/docs/plugins.rst +0 -93
- data/vendor/pygments-main/doc/docs/quickstart.rst +0 -205
- data/vendor/pygments-main/doc/docs/rstdirective.rst +0 -22
- data/vendor/pygments-main/doc/docs/styles.rst +0 -201
- data/vendor/pygments-main/doc/docs/tokens.rst +0 -372
- data/vendor/pygments-main/doc/docs/unicode.rst +0 -58
- data/vendor/pygments-main/doc/download.rst +0 -41
- data/vendor/pygments-main/doc/faq.rst +0 -139
- data/vendor/pygments-main/doc/index.rst +0 -54
- data/vendor/pygments-main/doc/languages.rst +0 -154
- data/vendor/pygments-main/doc/make.bat +0 -190
- data/vendor/pygments-main/doc/pygmentize.1 +0 -94
- data/vendor/pygments-main/external/autopygmentize +0 -101
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +0 -162
- data/vendor/pygments-main/external/markdown-processor.py +0 -67
- data/vendor/pygments-main/external/moin-parser.py +0 -112
- data/vendor/pygments-main/external/pygments.bashcomp +0 -38
- data/vendor/pygments-main/external/rst-directive.py +0 -82
- data/vendor/pygments-main/pygmentize +0 -8
- data/vendor/pygments-main/requirements.txt +0 -5
- data/vendor/pygments-main/scripts/check_sources.py +0 -211
- data/vendor/pygments-main/scripts/debug_lexer.py +0 -246
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +0 -33
- data/vendor/pygments-main/scripts/epydoc.css +0 -280
- data/vendor/pygments-main/scripts/get_vimkw.py +0 -74
- data/vendor/pygments-main/scripts/pylintrc +0 -301
- data/vendor/pygments-main/scripts/vim2pygments.py +0 -935
- data/vendor/pygments-main/setup.cfg +0 -10
- data/vendor/pygments-main/setup.py +0 -77
- data/vendor/pygments-main/tox.ini +0 -7
- data/vendor/simplejson/.gitignore +0 -10
- data/vendor/simplejson/.travis.yml +0 -5
- data/vendor/simplejson/CHANGES.txt +0 -291
- data/vendor/simplejson/LICENSE.txt +0 -19
- data/vendor/simplejson/MANIFEST.in +0 -5
- data/vendor/simplejson/README.rst +0 -19
- data/vendor/simplejson/conf.py +0 -179
- data/vendor/simplejson/index.rst +0 -628
- data/vendor/simplejson/scripts/make_docs.py +0 -18
- data/vendor/simplejson/setup.py +0 -104
- data/vendor/simplejson/simplejson/__init__.py +0 -510
- data/vendor/simplejson/simplejson/_speedups.c +0 -2745
- data/vendor/simplejson/simplejson/decoder.py +0 -425
- data/vendor/simplejson/simplejson/encoder.py +0 -567
- data/vendor/simplejson/simplejson/ordered_dict.py +0 -119
- data/vendor/simplejson/simplejson/scanner.py +0 -77
- data/vendor/simplejson/simplejson/tests/__init__.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +0 -55
- data/vendor/simplejson/simplejson/tests/test_check_circular.py +0 -30
- data/vendor/simplejson/simplejson/tests/test_decimal.py +0 -66
- data/vendor/simplejson/simplejson/tests/test_decode.py +0 -83
- data/vendor/simplejson/simplejson/tests/test_default.py +0 -9
- data/vendor/simplejson/simplejson/tests/test_dump.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +0 -46
- data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +0 -32
- data/vendor/simplejson/simplejson/tests/test_errors.py +0 -34
- data/vendor/simplejson/simplejson/tests/test_fail.py +0 -91
- data/vendor/simplejson/simplejson/tests/test_float.py +0 -19
- data/vendor/simplejson/simplejson/tests/test_indent.py +0 -86
- data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_namedtuple.py +0 -121
- data/vendor/simplejson/simplejson/tests/test_pass1.py +0 -76
- data/vendor/simplejson/simplejson/tests/test_pass2.py +0 -14
- data/vendor/simplejson/simplejson/tests/test_pass3.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_recursion.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_scanstring.py +0 -117
- data/vendor/simplejson/simplejson/tests/test_separators.py +0 -42
- data/vendor/simplejson/simplejson/tests/test_speedups.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_tuple.py +0 -49
- data/vendor/simplejson/simplejson/tests/test_unicode.py +0 -109
- data/vendor/simplejson/simplejson/tool.py +0 -39
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pygments.lexers.pascal
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
Lexers for Pascal family languages.
|
|
6
|
+
|
|
7
|
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
|
|
8
|
+
:license: BSD, see LICENSE for details.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
|
|
13
|
+
from pygments.lexer import Lexer, RegexLexer, include, bygroups, words, \
|
|
14
|
+
using, this, default
|
|
15
|
+
from pygments.util import get_bool_opt, get_list_opt
|
|
16
|
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
|
17
|
+
Number, Punctuation, Error
|
|
18
|
+
from pygments.scanner import Scanner
|
|
19
|
+
|
|
20
|
+
# compatibility import
|
|
21
|
+
from pygments.lexers.modula2 import Modula2Lexer
|
|
22
|
+
|
|
23
|
+
__all__ = ['DelphiLexer', 'AdaLexer']
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DelphiLexer(Lexer):
|
|
27
|
+
"""
|
|
28
|
+
For `Delphi <http://www.borland.com/delphi/>`_ (Borland Object Pascal),
|
|
29
|
+
Turbo Pascal and Free Pascal source code.
|
|
30
|
+
|
|
31
|
+
Additional options accepted:
|
|
32
|
+
|
|
33
|
+
`turbopascal`
|
|
34
|
+
Highlight Turbo Pascal specific keywords (default: ``True``).
|
|
35
|
+
`delphi`
|
|
36
|
+
Highlight Borland Delphi specific keywords (default: ``True``).
|
|
37
|
+
`freepascal`
|
|
38
|
+
Highlight Free Pascal specific keywords (default: ``True``).
|
|
39
|
+
`units`
|
|
40
|
+
A list of units that should be considered builtin, supported are
|
|
41
|
+
``System``, ``SysUtils``, ``Classes`` and ``Math``.
|
|
42
|
+
Default is to consider all of them builtin.
|
|
43
|
+
"""
|
|
44
|
+
name = 'Delphi'
|
|
45
|
+
aliases = ['delphi', 'pas', 'pascal', 'objectpascal']
|
|
46
|
+
filenames = ['*.pas', '*.dpr']
|
|
47
|
+
mimetypes = ['text/x-pascal']
|
|
48
|
+
|
|
49
|
+
TURBO_PASCAL_KEYWORDS = (
|
|
50
|
+
'absolute', 'and', 'array', 'asm', 'begin', 'break', 'case',
|
|
51
|
+
'const', 'constructor', 'continue', 'destructor', 'div', 'do',
|
|
52
|
+
'downto', 'else', 'end', 'file', 'for', 'function', 'goto',
|
|
53
|
+
'if', 'implementation', 'in', 'inherited', 'inline', 'interface',
|
|
54
|
+
'label', 'mod', 'nil', 'not', 'object', 'of', 'on', 'operator',
|
|
55
|
+
'or', 'packed', 'procedure', 'program', 'record', 'reintroduce',
|
|
56
|
+
'repeat', 'self', 'set', 'shl', 'shr', 'string', 'then', 'to',
|
|
57
|
+
'type', 'unit', 'until', 'uses', 'var', 'while', 'with', 'xor'
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
DELPHI_KEYWORDS = (
|
|
61
|
+
'as', 'class', 'except', 'exports', 'finalization', 'finally',
|
|
62
|
+
'initialization', 'is', 'library', 'on', 'property', 'raise',
|
|
63
|
+
'threadvar', 'try'
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
FREE_PASCAL_KEYWORDS = (
|
|
67
|
+
'dispose', 'exit', 'false', 'new', 'true'
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
BLOCK_KEYWORDS = {
|
|
71
|
+
'begin', 'class', 'const', 'constructor', 'destructor', 'end',
|
|
72
|
+
'finalization', 'function', 'implementation', 'initialization',
|
|
73
|
+
'label', 'library', 'operator', 'procedure', 'program', 'property',
|
|
74
|
+
'record', 'threadvar', 'type', 'unit', 'uses', 'var'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
FUNCTION_MODIFIERS = {
|
|
78
|
+
'alias', 'cdecl', 'export', 'inline', 'interrupt', 'nostackframe',
|
|
79
|
+
'pascal', 'register', 'safecall', 'softfloat', 'stdcall',
|
|
80
|
+
'varargs', 'name', 'dynamic', 'near', 'virtual', 'external',
|
|
81
|
+
'override', 'assembler'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# XXX: those aren't global. but currently we know no way for defining
|
|
85
|
+
# them just for the type context.
|
|
86
|
+
DIRECTIVES = {
|
|
87
|
+
'absolute', 'abstract', 'assembler', 'cppdecl', 'default', 'far',
|
|
88
|
+
'far16', 'forward', 'index', 'oldfpccall', 'private', 'protected',
|
|
89
|
+
'published', 'public'
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
BUILTIN_TYPES = {
|
|
93
|
+
'ansichar', 'ansistring', 'bool', 'boolean', 'byte', 'bytebool',
|
|
94
|
+
'cardinal', 'char', 'comp', 'currency', 'double', 'dword',
|
|
95
|
+
'extended', 'int64', 'integer', 'iunknown', 'longbool', 'longint',
|
|
96
|
+
'longword', 'pansichar', 'pansistring', 'pbool', 'pboolean',
|
|
97
|
+
'pbyte', 'pbytearray', 'pcardinal', 'pchar', 'pcomp', 'pcurrency',
|
|
98
|
+
'pdate', 'pdatetime', 'pdouble', 'pdword', 'pextended', 'phandle',
|
|
99
|
+
'pint64', 'pinteger', 'plongint', 'plongword', 'pointer',
|
|
100
|
+
'ppointer', 'pshortint', 'pshortstring', 'psingle', 'psmallint',
|
|
101
|
+
'pstring', 'pvariant', 'pwidechar', 'pwidestring', 'pword',
|
|
102
|
+
'pwordarray', 'pwordbool', 'real', 'real48', 'shortint',
|
|
103
|
+
'shortstring', 'single', 'smallint', 'string', 'tclass', 'tdate',
|
|
104
|
+
'tdatetime', 'textfile', 'thandle', 'tobject', 'ttime', 'variant',
|
|
105
|
+
'widechar', 'widestring', 'word', 'wordbool'
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
BUILTIN_UNITS = {
|
|
109
|
+
'System': (
|
|
110
|
+
'abs', 'acquireexceptionobject', 'addr', 'ansitoutf8',
|
|
111
|
+
'append', 'arctan', 'assert', 'assigned', 'assignfile',
|
|
112
|
+
'beginthread', 'blockread', 'blockwrite', 'break', 'chdir',
|
|
113
|
+
'chr', 'close', 'closefile', 'comptocurrency', 'comptodouble',
|
|
114
|
+
'concat', 'continue', 'copy', 'cos', 'dec', 'delete',
|
|
115
|
+
'dispose', 'doubletocomp', 'endthread', 'enummodules',
|
|
116
|
+
'enumresourcemodules', 'eof', 'eoln', 'erase', 'exceptaddr',
|
|
117
|
+
'exceptobject', 'exclude', 'exit', 'exp', 'filepos', 'filesize',
|
|
118
|
+
'fillchar', 'finalize', 'findclasshinstance', 'findhinstance',
|
|
119
|
+
'findresourcehinstance', 'flush', 'frac', 'freemem',
|
|
120
|
+
'get8087cw', 'getdir', 'getlasterror', 'getmem',
|
|
121
|
+
'getmemorymanager', 'getmodulefilename', 'getvariantmanager',
|
|
122
|
+
'halt', 'hi', 'high', 'inc', 'include', 'initialize', 'insert',
|
|
123
|
+
'int', 'ioresult', 'ismemorymanagerset', 'isvariantmanagerset',
|
|
124
|
+
'length', 'ln', 'lo', 'low', 'mkdir', 'move', 'new', 'odd',
|
|
125
|
+
'olestrtostring', 'olestrtostrvar', 'ord', 'paramcount',
|
|
126
|
+
'paramstr', 'pi', 'pos', 'pred', 'ptr', 'pucs4chars', 'random',
|
|
127
|
+
'randomize', 'read', 'readln', 'reallocmem',
|
|
128
|
+
'releaseexceptionobject', 'rename', 'reset', 'rewrite', 'rmdir',
|
|
129
|
+
'round', 'runerror', 'seek', 'seekeof', 'seekeoln',
|
|
130
|
+
'set8087cw', 'setlength', 'setlinebreakstyle',
|
|
131
|
+
'setmemorymanager', 'setstring', 'settextbuf',
|
|
132
|
+
'setvariantmanager', 'sin', 'sizeof', 'slice', 'sqr', 'sqrt',
|
|
133
|
+
'str', 'stringofchar', 'stringtoolestr', 'stringtowidechar',
|
|
134
|
+
'succ', 'swap', 'trunc', 'truncate', 'typeinfo',
|
|
135
|
+
'ucs4stringtowidestring', 'unicodetoutf8', 'uniquestring',
|
|
136
|
+
'upcase', 'utf8decode', 'utf8encode', 'utf8toansi',
|
|
137
|
+
'utf8tounicode', 'val', 'vararrayredim', 'varclear',
|
|
138
|
+
'widecharlentostring', 'widecharlentostrvar',
|
|
139
|
+
'widechartostring', 'widechartostrvar',
|
|
140
|
+
'widestringtoucs4string', 'write', 'writeln'
|
|
141
|
+
),
|
|
142
|
+
'SysUtils': (
|
|
143
|
+
'abort', 'addexitproc', 'addterminateproc', 'adjustlinebreaks',
|
|
144
|
+
'allocmem', 'ansicomparefilename', 'ansicomparestr',
|
|
145
|
+
'ansicomparetext', 'ansidequotedstr', 'ansiextractquotedstr',
|
|
146
|
+
'ansilastchar', 'ansilowercase', 'ansilowercasefilename',
|
|
147
|
+
'ansipos', 'ansiquotedstr', 'ansisamestr', 'ansisametext',
|
|
148
|
+
'ansistrcomp', 'ansistricomp', 'ansistrlastchar', 'ansistrlcomp',
|
|
149
|
+
'ansistrlicomp', 'ansistrlower', 'ansistrpos', 'ansistrrscan',
|
|
150
|
+
'ansistrscan', 'ansistrupper', 'ansiuppercase',
|
|
151
|
+
'ansiuppercasefilename', 'appendstr', 'assignstr', 'beep',
|
|
152
|
+
'booltostr', 'bytetocharindex', 'bytetocharlen', 'bytetype',
|
|
153
|
+
'callterminateprocs', 'changefileext', 'charlength',
|
|
154
|
+
'chartobyteindex', 'chartobytelen', 'comparemem', 'comparestr',
|
|
155
|
+
'comparetext', 'createdir', 'createguid', 'currentyear',
|
|
156
|
+
'currtostr', 'currtostrf', 'date', 'datetimetofiledate',
|
|
157
|
+
'datetimetostr', 'datetimetostring', 'datetimetosystemtime',
|
|
158
|
+
'datetimetotimestamp', 'datetostr', 'dayofweek', 'decodedate',
|
|
159
|
+
'decodedatefully', 'decodetime', 'deletefile', 'directoryexists',
|
|
160
|
+
'diskfree', 'disksize', 'disposestr', 'encodedate', 'encodetime',
|
|
161
|
+
'exceptionerrormessage', 'excludetrailingbackslash',
|
|
162
|
+
'excludetrailingpathdelimiter', 'expandfilename',
|
|
163
|
+
'expandfilenamecase', 'expanduncfilename', 'extractfiledir',
|
|
164
|
+
'extractfiledrive', 'extractfileext', 'extractfilename',
|
|
165
|
+
'extractfilepath', 'extractrelativepath', 'extractshortpathname',
|
|
166
|
+
'fileage', 'fileclose', 'filecreate', 'filedatetodatetime',
|
|
167
|
+
'fileexists', 'filegetattr', 'filegetdate', 'fileisreadonly',
|
|
168
|
+
'fileopen', 'fileread', 'filesearch', 'fileseek', 'filesetattr',
|
|
169
|
+
'filesetdate', 'filesetreadonly', 'filewrite', 'finalizepackage',
|
|
170
|
+
'findclose', 'findcmdlineswitch', 'findfirst', 'findnext',
|
|
171
|
+
'floattocurr', 'floattodatetime', 'floattodecimal', 'floattostr',
|
|
172
|
+
'floattostrf', 'floattotext', 'floattotextfmt', 'fmtloadstr',
|
|
173
|
+
'fmtstr', 'forcedirectories', 'format', 'formatbuf', 'formatcurr',
|
|
174
|
+
'formatdatetime', 'formatfloat', 'freeandnil', 'getcurrentdir',
|
|
175
|
+
'getenvironmentvariable', 'getfileversion', 'getformatsettings',
|
|
176
|
+
'getlocaleformatsettings', 'getmodulename', 'getpackagedescription',
|
|
177
|
+
'getpackageinfo', 'gettime', 'guidtostring', 'incamonth',
|
|
178
|
+
'includetrailingbackslash', 'includetrailingpathdelimiter',
|
|
179
|
+
'incmonth', 'initializepackage', 'interlockeddecrement',
|
|
180
|
+
'interlockedexchange', 'interlockedexchangeadd',
|
|
181
|
+
'interlockedincrement', 'inttohex', 'inttostr', 'isdelimiter',
|
|
182
|
+
'isequalguid', 'isleapyear', 'ispathdelimiter', 'isvalidident',
|
|
183
|
+
'languages', 'lastdelimiter', 'loadpackage', 'loadstr',
|
|
184
|
+
'lowercase', 'msecstotimestamp', 'newstr', 'nextcharindex', 'now',
|
|
185
|
+
'outofmemoryerror', 'quotedstr', 'raiselastoserror',
|
|
186
|
+
'raiselastwin32error', 'removedir', 'renamefile', 'replacedate',
|
|
187
|
+
'replacetime', 'safeloadlibrary', 'samefilename', 'sametext',
|
|
188
|
+
'setcurrentdir', 'showexception', 'sleep', 'stralloc', 'strbufsize',
|
|
189
|
+
'strbytetype', 'strcat', 'strcharlength', 'strcomp', 'strcopy',
|
|
190
|
+
'strdispose', 'strecopy', 'strend', 'strfmt', 'stricomp',
|
|
191
|
+
'stringreplace', 'stringtoguid', 'strlcat', 'strlcomp', 'strlcopy',
|
|
192
|
+
'strlen', 'strlfmt', 'strlicomp', 'strlower', 'strmove', 'strnew',
|
|
193
|
+
'strnextchar', 'strpas', 'strpcopy', 'strplcopy', 'strpos',
|
|
194
|
+
'strrscan', 'strscan', 'strtobool', 'strtobooldef', 'strtocurr',
|
|
195
|
+
'strtocurrdef', 'strtodate', 'strtodatedef', 'strtodatetime',
|
|
196
|
+
'strtodatetimedef', 'strtofloat', 'strtofloatdef', 'strtoint',
|
|
197
|
+
'strtoint64', 'strtoint64def', 'strtointdef', 'strtotime',
|
|
198
|
+
'strtotimedef', 'strupper', 'supports', 'syserrormessage',
|
|
199
|
+
'systemtimetodatetime', 'texttofloat', 'time', 'timestamptodatetime',
|
|
200
|
+
'timestamptomsecs', 'timetostr', 'trim', 'trimleft', 'trimright',
|
|
201
|
+
'tryencodedate', 'tryencodetime', 'tryfloattocurr', 'tryfloattodatetime',
|
|
202
|
+
'trystrtobool', 'trystrtocurr', 'trystrtodate', 'trystrtodatetime',
|
|
203
|
+
'trystrtofloat', 'trystrtoint', 'trystrtoint64', 'trystrtotime',
|
|
204
|
+
'unloadpackage', 'uppercase', 'widecomparestr', 'widecomparetext',
|
|
205
|
+
'widefmtstr', 'wideformat', 'wideformatbuf', 'widelowercase',
|
|
206
|
+
'widesamestr', 'widesametext', 'wideuppercase', 'win32check',
|
|
207
|
+
'wraptext'
|
|
208
|
+
),
|
|
209
|
+
'Classes': (
|
|
210
|
+
'activateclassgroup', 'allocatehwnd', 'bintohex', 'checksynchronize',
|
|
211
|
+
'collectionsequal', 'countgenerations', 'deallocatehwnd', 'equalrect',
|
|
212
|
+
'extractstrings', 'findclass', 'findglobalcomponent', 'getclass',
|
|
213
|
+
'groupdescendantswith', 'hextobin', 'identtoint',
|
|
214
|
+
'initinheritedcomponent', 'inttoident', 'invalidpoint',
|
|
215
|
+
'isuniqueglobalcomponentname', 'linestart', 'objectbinarytotext',
|
|
216
|
+
'objectresourcetotext', 'objecttexttobinary', 'objecttexttoresource',
|
|
217
|
+
'pointsequal', 'readcomponentres', 'readcomponentresex',
|
|
218
|
+
'readcomponentresfile', 'rect', 'registerclass', 'registerclassalias',
|
|
219
|
+
'registerclasses', 'registercomponents', 'registerintegerconsts',
|
|
220
|
+
'registernoicon', 'registernonactivex', 'smallpoint', 'startclassgroup',
|
|
221
|
+
'teststreamformat', 'unregisterclass', 'unregisterclasses',
|
|
222
|
+
'unregisterintegerconsts', 'unregistermoduleclasses',
|
|
223
|
+
'writecomponentresfile'
|
|
224
|
+
),
|
|
225
|
+
'Math': (
|
|
226
|
+
'arccos', 'arccosh', 'arccot', 'arccoth', 'arccsc', 'arccsch', 'arcsec',
|
|
227
|
+
'arcsech', 'arcsin', 'arcsinh', 'arctan2', 'arctanh', 'ceil',
|
|
228
|
+
'comparevalue', 'cosecant', 'cosh', 'cot', 'cotan', 'coth', 'csc',
|
|
229
|
+
'csch', 'cycletodeg', 'cycletograd', 'cycletorad', 'degtocycle',
|
|
230
|
+
'degtograd', 'degtorad', 'divmod', 'doubledecliningbalance',
|
|
231
|
+
'ensurerange', 'floor', 'frexp', 'futurevalue', 'getexceptionmask',
|
|
232
|
+
'getprecisionmode', 'getroundmode', 'gradtocycle', 'gradtodeg',
|
|
233
|
+
'gradtorad', 'hypot', 'inrange', 'interestpayment', 'interestrate',
|
|
234
|
+
'internalrateofreturn', 'intpower', 'isinfinite', 'isnan', 'iszero',
|
|
235
|
+
'ldexp', 'lnxp1', 'log10', 'log2', 'logn', 'max', 'maxintvalue',
|
|
236
|
+
'maxvalue', 'mean', 'meanandstddev', 'min', 'minintvalue', 'minvalue',
|
|
237
|
+
'momentskewkurtosis', 'netpresentvalue', 'norm', 'numberofperiods',
|
|
238
|
+
'payment', 'periodpayment', 'poly', 'popnstddev', 'popnvariance',
|
|
239
|
+
'power', 'presentvalue', 'radtocycle', 'radtodeg', 'radtograd',
|
|
240
|
+
'randg', 'randomrange', 'roundto', 'samevalue', 'sec', 'secant',
|
|
241
|
+
'sech', 'setexceptionmask', 'setprecisionmode', 'setroundmode',
|
|
242
|
+
'sign', 'simpleroundto', 'sincos', 'sinh', 'slndepreciation', 'stddev',
|
|
243
|
+
'sum', 'sumint', 'sumofsquares', 'sumsandsquares', 'syddepreciation',
|
|
244
|
+
'tan', 'tanh', 'totalvariance', 'variance'
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
ASM_REGISTERS = {
|
|
249
|
+
'ah', 'al', 'ax', 'bh', 'bl', 'bp', 'bx', 'ch', 'cl', 'cr0',
|
|
250
|
+
'cr1', 'cr2', 'cr3', 'cr4', 'cs', 'cx', 'dh', 'di', 'dl', 'dr0',
|
|
251
|
+
'dr1', 'dr2', 'dr3', 'dr4', 'dr5', 'dr6', 'dr7', 'ds', 'dx',
|
|
252
|
+
'eax', 'ebp', 'ebx', 'ecx', 'edi', 'edx', 'es', 'esi', 'esp',
|
|
253
|
+
'fs', 'gs', 'mm0', 'mm1', 'mm2', 'mm3', 'mm4', 'mm5', 'mm6',
|
|
254
|
+
'mm7', 'si', 'sp', 'ss', 'st0', 'st1', 'st2', 'st3', 'st4', 'st5',
|
|
255
|
+
'st6', 'st7', 'xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5',
|
|
256
|
+
'xmm6', 'xmm7'
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
ASM_INSTRUCTIONS = {
|
|
260
|
+
'aaa', 'aad', 'aam', 'aas', 'adc', 'add', 'and', 'arpl', 'bound',
|
|
261
|
+
'bsf', 'bsr', 'bswap', 'bt', 'btc', 'btr', 'bts', 'call', 'cbw',
|
|
262
|
+
'cdq', 'clc', 'cld', 'cli', 'clts', 'cmc', 'cmova', 'cmovae',
|
|
263
|
+
'cmovb', 'cmovbe', 'cmovc', 'cmovcxz', 'cmove', 'cmovg',
|
|
264
|
+
'cmovge', 'cmovl', 'cmovle', 'cmovna', 'cmovnae', 'cmovnb',
|
|
265
|
+
'cmovnbe', 'cmovnc', 'cmovne', 'cmovng', 'cmovnge', 'cmovnl',
|
|
266
|
+
'cmovnle', 'cmovno', 'cmovnp', 'cmovns', 'cmovnz', 'cmovo',
|
|
267
|
+
'cmovp', 'cmovpe', 'cmovpo', 'cmovs', 'cmovz', 'cmp', 'cmpsb',
|
|
268
|
+
'cmpsd', 'cmpsw', 'cmpxchg', 'cmpxchg486', 'cmpxchg8b', 'cpuid',
|
|
269
|
+
'cwd', 'cwde', 'daa', 'das', 'dec', 'div', 'emms', 'enter', 'hlt',
|
|
270
|
+
'ibts', 'icebp', 'idiv', 'imul', 'in', 'inc', 'insb', 'insd',
|
|
271
|
+
'insw', 'int', 'int01', 'int03', 'int1', 'int3', 'into', 'invd',
|
|
272
|
+
'invlpg', 'iret', 'iretd', 'iretw', 'ja', 'jae', 'jb', 'jbe',
|
|
273
|
+
'jc', 'jcxz', 'jcxz', 'je', 'jecxz', 'jg', 'jge', 'jl', 'jle',
|
|
274
|
+
'jmp', 'jna', 'jnae', 'jnb', 'jnbe', 'jnc', 'jne', 'jng', 'jnge',
|
|
275
|
+
'jnl', 'jnle', 'jno', 'jnp', 'jns', 'jnz', 'jo', 'jp', 'jpe',
|
|
276
|
+
'jpo', 'js', 'jz', 'lahf', 'lar', 'lcall', 'lds', 'lea', 'leave',
|
|
277
|
+
'les', 'lfs', 'lgdt', 'lgs', 'lidt', 'ljmp', 'lldt', 'lmsw',
|
|
278
|
+
'loadall', 'loadall286', 'lock', 'lodsb', 'lodsd', 'lodsw',
|
|
279
|
+
'loop', 'loope', 'loopne', 'loopnz', 'loopz', 'lsl', 'lss', 'ltr',
|
|
280
|
+
'mov', 'movd', 'movq', 'movsb', 'movsd', 'movsw', 'movsx',
|
|
281
|
+
'movzx', 'mul', 'neg', 'nop', 'not', 'or', 'out', 'outsb', 'outsd',
|
|
282
|
+
'outsw', 'pop', 'popa', 'popad', 'popaw', 'popf', 'popfd', 'popfw',
|
|
283
|
+
'push', 'pusha', 'pushad', 'pushaw', 'pushf', 'pushfd', 'pushfw',
|
|
284
|
+
'rcl', 'rcr', 'rdmsr', 'rdpmc', 'rdshr', 'rdtsc', 'rep', 'repe',
|
|
285
|
+
'repne', 'repnz', 'repz', 'ret', 'retf', 'retn', 'rol', 'ror',
|
|
286
|
+
'rsdc', 'rsldt', 'rsm', 'sahf', 'sal', 'salc', 'sar', 'sbb',
|
|
287
|
+
'scasb', 'scasd', 'scasw', 'seta', 'setae', 'setb', 'setbe',
|
|
288
|
+
'setc', 'setcxz', 'sete', 'setg', 'setge', 'setl', 'setle',
|
|
289
|
+
'setna', 'setnae', 'setnb', 'setnbe', 'setnc', 'setne', 'setng',
|
|
290
|
+
'setnge', 'setnl', 'setnle', 'setno', 'setnp', 'setns', 'setnz',
|
|
291
|
+
'seto', 'setp', 'setpe', 'setpo', 'sets', 'setz', 'sgdt', 'shl',
|
|
292
|
+
'shld', 'shr', 'shrd', 'sidt', 'sldt', 'smi', 'smint', 'smintold',
|
|
293
|
+
'smsw', 'stc', 'std', 'sti', 'stosb', 'stosd', 'stosw', 'str',
|
|
294
|
+
'sub', 'svdc', 'svldt', 'svts', 'syscall', 'sysenter', 'sysexit',
|
|
295
|
+
'sysret', 'test', 'ud1', 'ud2', 'umov', 'verr', 'verw', 'wait',
|
|
296
|
+
'wbinvd', 'wrmsr', 'wrshr', 'xadd', 'xbts', 'xchg', 'xlat',
|
|
297
|
+
'xlatb', 'xor'
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
def __init__(self, **options):
|
|
301
|
+
Lexer.__init__(self, **options)
|
|
302
|
+
self.keywords = set()
|
|
303
|
+
if get_bool_opt(options, 'turbopascal', True):
|
|
304
|
+
self.keywords.update(self.TURBO_PASCAL_KEYWORDS)
|
|
305
|
+
if get_bool_opt(options, 'delphi', True):
|
|
306
|
+
self.keywords.update(self.DELPHI_KEYWORDS)
|
|
307
|
+
if get_bool_opt(options, 'freepascal', True):
|
|
308
|
+
self.keywords.update(self.FREE_PASCAL_KEYWORDS)
|
|
309
|
+
self.builtins = set()
|
|
310
|
+
for unit in get_list_opt(options, 'units', list(self.BUILTIN_UNITS)):
|
|
311
|
+
self.builtins.update(self.BUILTIN_UNITS[unit])
|
|
312
|
+
|
|
313
|
+
def get_tokens_unprocessed(self, text):
|
|
314
|
+
scanner = Scanner(text, re.DOTALL | re.MULTILINE | re.IGNORECASE)
|
|
315
|
+
stack = ['initial']
|
|
316
|
+
in_function_block = False
|
|
317
|
+
in_property_block = False
|
|
318
|
+
was_dot = False
|
|
319
|
+
next_token_is_function = False
|
|
320
|
+
next_token_is_property = False
|
|
321
|
+
collect_labels = False
|
|
322
|
+
block_labels = set()
|
|
323
|
+
brace_balance = [0, 0]
|
|
324
|
+
|
|
325
|
+
while not scanner.eos:
|
|
326
|
+
token = Error
|
|
327
|
+
|
|
328
|
+
if stack[-1] == 'initial':
|
|
329
|
+
if scanner.scan(r'\s+'):
|
|
330
|
+
token = Text
|
|
331
|
+
elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
|
|
332
|
+
if scanner.match.startswith('$'):
|
|
333
|
+
token = Comment.Preproc
|
|
334
|
+
else:
|
|
335
|
+
token = Comment.Multiline
|
|
336
|
+
elif scanner.scan(r'//.*?$'):
|
|
337
|
+
token = Comment.Single
|
|
338
|
+
elif scanner.scan(r'[-+*\/=<>:;,.@\^]'):
|
|
339
|
+
token = Operator
|
|
340
|
+
# stop label highlighting on next ";"
|
|
341
|
+
if collect_labels and scanner.match == ';':
|
|
342
|
+
collect_labels = False
|
|
343
|
+
elif scanner.scan(r'[\(\)\[\]]+'):
|
|
344
|
+
token = Punctuation
|
|
345
|
+
# abort function naming ``foo = Function(...)``
|
|
346
|
+
next_token_is_function = False
|
|
347
|
+
# if we are in a function block we count the open
|
|
348
|
+
# braces because ootherwise it's impossible to
|
|
349
|
+
# determine the end of the modifier context
|
|
350
|
+
if in_function_block or in_property_block:
|
|
351
|
+
if scanner.match == '(':
|
|
352
|
+
brace_balance[0] += 1
|
|
353
|
+
elif scanner.match == ')':
|
|
354
|
+
brace_balance[0] -= 1
|
|
355
|
+
elif scanner.match == '[':
|
|
356
|
+
brace_balance[1] += 1
|
|
357
|
+
elif scanner.match == ']':
|
|
358
|
+
brace_balance[1] -= 1
|
|
359
|
+
elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
|
|
360
|
+
lowercase_name = scanner.match.lower()
|
|
361
|
+
if lowercase_name == 'result':
|
|
362
|
+
token = Name.Builtin.Pseudo
|
|
363
|
+
elif lowercase_name in self.keywords:
|
|
364
|
+
token = Keyword
|
|
365
|
+
# if we are in a special block and a
|
|
366
|
+
# block ending keyword occours (and the parenthesis
|
|
367
|
+
# is balanced) we end the current block context
|
|
368
|
+
if (in_function_block or in_property_block) and \
|
|
369
|
+
lowercase_name in self.BLOCK_KEYWORDS and \
|
|
370
|
+
brace_balance[0] <= 0 and \
|
|
371
|
+
brace_balance[1] <= 0:
|
|
372
|
+
in_function_block = False
|
|
373
|
+
in_property_block = False
|
|
374
|
+
brace_balance = [0, 0]
|
|
375
|
+
block_labels = set()
|
|
376
|
+
if lowercase_name in ('label', 'goto'):
|
|
377
|
+
collect_labels = True
|
|
378
|
+
elif lowercase_name == 'asm':
|
|
379
|
+
stack.append('asm')
|
|
380
|
+
elif lowercase_name == 'property':
|
|
381
|
+
in_property_block = True
|
|
382
|
+
next_token_is_property = True
|
|
383
|
+
elif lowercase_name in ('procedure', 'operator',
|
|
384
|
+
'function', 'constructor',
|
|
385
|
+
'destructor'):
|
|
386
|
+
in_function_block = True
|
|
387
|
+
next_token_is_function = True
|
|
388
|
+
# we are in a function block and the current name
|
|
389
|
+
# is in the set of registered modifiers. highlight
|
|
390
|
+
# it as pseudo keyword
|
|
391
|
+
elif in_function_block and \
|
|
392
|
+
lowercase_name in self.FUNCTION_MODIFIERS:
|
|
393
|
+
token = Keyword.Pseudo
|
|
394
|
+
# if we are in a property highlight some more
|
|
395
|
+
# modifiers
|
|
396
|
+
elif in_property_block and \
|
|
397
|
+
lowercase_name in ('read', 'write'):
|
|
398
|
+
token = Keyword.Pseudo
|
|
399
|
+
next_token_is_function = True
|
|
400
|
+
# if the last iteration set next_token_is_function
|
|
401
|
+
# to true we now want this name highlighted as
|
|
402
|
+
# function. so do that and reset the state
|
|
403
|
+
elif next_token_is_function:
|
|
404
|
+
# Look if the next token is a dot. If yes it's
|
|
405
|
+
# not a function, but a class name and the
|
|
406
|
+
# part after the dot a function name
|
|
407
|
+
if scanner.test(r'\s*\.\s*'):
|
|
408
|
+
token = Name.Class
|
|
409
|
+
# it's not a dot, our job is done
|
|
410
|
+
else:
|
|
411
|
+
token = Name.Function
|
|
412
|
+
next_token_is_function = False
|
|
413
|
+
# same for properties
|
|
414
|
+
elif next_token_is_property:
|
|
415
|
+
token = Name.Property
|
|
416
|
+
next_token_is_property = False
|
|
417
|
+
# Highlight this token as label and add it
|
|
418
|
+
# to the list of known labels
|
|
419
|
+
elif collect_labels:
|
|
420
|
+
token = Name.Label
|
|
421
|
+
block_labels.add(scanner.match.lower())
|
|
422
|
+
# name is in list of known labels
|
|
423
|
+
elif lowercase_name in block_labels:
|
|
424
|
+
token = Name.Label
|
|
425
|
+
elif lowercase_name in self.BUILTIN_TYPES:
|
|
426
|
+
token = Keyword.Type
|
|
427
|
+
elif lowercase_name in self.DIRECTIVES:
|
|
428
|
+
token = Keyword.Pseudo
|
|
429
|
+
# builtins are just builtins if the token
|
|
430
|
+
# before isn't a dot
|
|
431
|
+
elif not was_dot and lowercase_name in self.builtins:
|
|
432
|
+
token = Name.Builtin
|
|
433
|
+
else:
|
|
434
|
+
token = Name
|
|
435
|
+
elif scanner.scan(r"'"):
|
|
436
|
+
token = String
|
|
437
|
+
stack.append('string')
|
|
438
|
+
elif scanner.scan(r'\#(\d+|\$[0-9A-Fa-f]+)'):
|
|
439
|
+
token = String.Char
|
|
440
|
+
elif scanner.scan(r'\$[0-9A-Fa-f]+'):
|
|
441
|
+
token = Number.Hex
|
|
442
|
+
elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
|
|
443
|
+
token = Number.Integer
|
|
444
|
+
elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
|
|
445
|
+
token = Number.Float
|
|
446
|
+
else:
|
|
447
|
+
# if the stack depth is deeper than once, pop
|
|
448
|
+
if len(stack) > 1:
|
|
449
|
+
stack.pop()
|
|
450
|
+
scanner.get_char()
|
|
451
|
+
|
|
452
|
+
elif stack[-1] == 'string':
|
|
453
|
+
if scanner.scan(r"''"):
|
|
454
|
+
token = String.Escape
|
|
455
|
+
elif scanner.scan(r"'"):
|
|
456
|
+
token = String
|
|
457
|
+
stack.pop()
|
|
458
|
+
elif scanner.scan(r"[^']*"):
|
|
459
|
+
token = String
|
|
460
|
+
else:
|
|
461
|
+
scanner.get_char()
|
|
462
|
+
stack.pop()
|
|
463
|
+
|
|
464
|
+
elif stack[-1] == 'asm':
|
|
465
|
+
if scanner.scan(r'\s+'):
|
|
466
|
+
token = Text
|
|
467
|
+
elif scanner.scan(r'end'):
|
|
468
|
+
token = Keyword
|
|
469
|
+
stack.pop()
|
|
470
|
+
elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
|
|
471
|
+
if scanner.match.startswith('$'):
|
|
472
|
+
token = Comment.Preproc
|
|
473
|
+
else:
|
|
474
|
+
token = Comment.Multiline
|
|
475
|
+
elif scanner.scan(r'//.*?$'):
|
|
476
|
+
token = Comment.Single
|
|
477
|
+
elif scanner.scan(r"'"):
|
|
478
|
+
token = String
|
|
479
|
+
stack.append('string')
|
|
480
|
+
elif scanner.scan(r'@@[A-Za-z_][A-Za-z_0-9]*'):
|
|
481
|
+
token = Name.Label
|
|
482
|
+
elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
|
|
483
|
+
lowercase_name = scanner.match.lower()
|
|
484
|
+
if lowercase_name in self.ASM_INSTRUCTIONS:
|
|
485
|
+
token = Keyword
|
|
486
|
+
elif lowercase_name in self.ASM_REGISTERS:
|
|
487
|
+
token = Name.Builtin
|
|
488
|
+
else:
|
|
489
|
+
token = Name
|
|
490
|
+
elif scanner.scan(r'[-+*\/=<>:;,.@\^]+'):
|
|
491
|
+
token = Operator
|
|
492
|
+
elif scanner.scan(r'[\(\)\[\]]+'):
|
|
493
|
+
token = Punctuation
|
|
494
|
+
elif scanner.scan(r'\$[0-9A-Fa-f]+'):
|
|
495
|
+
token = Number.Hex
|
|
496
|
+
elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
|
|
497
|
+
token = Number.Integer
|
|
498
|
+
elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
|
|
499
|
+
token = Number.Float
|
|
500
|
+
else:
|
|
501
|
+
scanner.get_char()
|
|
502
|
+
stack.pop()
|
|
503
|
+
|
|
504
|
+
# save the dot!!!11
|
|
505
|
+
if scanner.match.strip():
|
|
506
|
+
was_dot = scanner.match == '.'
|
|
507
|
+
yield scanner.start_pos, token, scanner.match or ''
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
class AdaLexer(RegexLexer):
|
|
511
|
+
"""
|
|
512
|
+
For Ada source code.
|
|
513
|
+
|
|
514
|
+
.. versionadded:: 1.3
|
|
515
|
+
"""
|
|
516
|
+
|
|
517
|
+
name = 'Ada'
|
|
518
|
+
aliases = ['ada', 'ada95', 'ada2005']
|
|
519
|
+
filenames = ['*.adb', '*.ads', '*.ada']
|
|
520
|
+
mimetypes = ['text/x-ada']
|
|
521
|
+
|
|
522
|
+
flags = re.MULTILINE | re.IGNORECASE
|
|
523
|
+
|
|
524
|
+
tokens = {
|
|
525
|
+
'root': [
|
|
526
|
+
(r'[^\S\n]+', Text),
|
|
527
|
+
(r'--.*?\n', Comment.Single),
|
|
528
|
+
(r'[^\S\n]+', Text),
|
|
529
|
+
(r'function|procedure|entry', Keyword.Declaration, 'subprogram'),
|
|
530
|
+
(r'(subtype|type)(\s+)(\w+)',
|
|
531
|
+
bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
|
|
532
|
+
(r'task|protected', Keyword.Declaration),
|
|
533
|
+
(r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)),
|
|
534
|
+
(r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'),
|
|
535
|
+
(r'(pragma)(\s+)(\w+)', bygroups(Keyword.Reserved, Text,
|
|
536
|
+
Comment.Preproc)),
|
|
537
|
+
(r'(true|false|null)\b', Keyword.Constant),
|
|
538
|
+
(words((
|
|
539
|
+
'Address', 'Byte', 'Boolean', 'Character', 'Controlled', 'Count',
|
|
540
|
+
'Cursor', 'Duration', 'File_Mode', 'File_Type', 'Float', 'Generator',
|
|
541
|
+
'Integer', 'Long_Float', 'Long_Integer', 'Long_Long_Float',
|
|
542
|
+
'Long_Long_Integer', 'Natural', 'Positive', 'Reference_Type',
|
|
543
|
+
'Short_Float', 'Short_Integer', 'Short_Short_Float',
|
|
544
|
+
'Short_Short_Integer', 'String', 'Wide_Character', 'Wide_String'),
|
|
545
|
+
suffix=r'\b'),
|
|
546
|
+
Keyword.Type),
|
|
547
|
+
(r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word),
|
|
548
|
+
(r'generic|private', Keyword.Declaration),
|
|
549
|
+
(r'package', Keyword.Declaration, 'package'),
|
|
550
|
+
(r'array\b', Keyword.Reserved, 'array_def'),
|
|
551
|
+
(r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
|
|
552
|
+
(r'(\w+)(\s*)(:)(\s*)(constant)',
|
|
553
|
+
bygroups(Name.Constant, Text, Punctuation, Text,
|
|
554
|
+
Keyword.Reserved)),
|
|
555
|
+
(r'<<\w+>>', Name.Label),
|
|
556
|
+
(r'(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)',
|
|
557
|
+
bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)),
|
|
558
|
+
(words((
|
|
559
|
+
'abort', 'abs', 'abstract', 'accept', 'access', 'aliased', 'all',
|
|
560
|
+
'array', 'at', 'begin', 'body', 'case', 'constant', 'declare',
|
|
561
|
+
'delay', 'delta', 'digits', 'do', 'else', 'elsif', 'end', 'entry',
|
|
562
|
+
'exception', 'exit', 'interface', 'for', 'goto', 'if', 'is', 'limited',
|
|
563
|
+
'loop', 'new', 'null', 'of', 'or', 'others', 'out', 'overriding',
|
|
564
|
+
'pragma', 'protected', 'raise', 'range', 'record', 'renames', 'requeue',
|
|
565
|
+
'return', 'reverse', 'select', 'separate', 'some', 'subtype',
|
|
566
|
+
'synchronized', 'task', 'tagged', 'terminate', 'then', 'type', 'until',
|
|
567
|
+
'when', 'while', 'xor'), prefix=r'\b', suffix=r'\b'),
|
|
568
|
+
Keyword.Reserved),
|
|
569
|
+
(r'"[^"]*"', String),
|
|
570
|
+
include('attribute'),
|
|
571
|
+
include('numbers'),
|
|
572
|
+
(r"'[^']'", String.Character),
|
|
573
|
+
(r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
|
|
574
|
+
(r"(<>|=>|:=|[()|:;,.'])", Punctuation),
|
|
575
|
+
(r'[*<>+=/&-]', Operator),
|
|
576
|
+
(r'\n+', Text),
|
|
577
|
+
],
|
|
578
|
+
'numbers': [
|
|
579
|
+
(r'[0-9_]+#[0-9a-f_\.]+#', Number.Hex),
|
|
580
|
+
(r'[0-9_]+\.[0-9_]*', Number.Float),
|
|
581
|
+
(r'[0-9_]+', Number.Integer),
|
|
582
|
+
],
|
|
583
|
+
'attribute': [
|
|
584
|
+
(r"(')(\w+)", bygroups(Punctuation, Name.Attribute)),
|
|
585
|
+
],
|
|
586
|
+
'subprogram': [
|
|
587
|
+
(r'\(', Punctuation, ('#pop', 'formal_part')),
|
|
588
|
+
(r';', Punctuation, '#pop'),
|
|
589
|
+
(r'is\b', Keyword.Reserved, '#pop'),
|
|
590
|
+
(r'"[^"]+"|\w+', Name.Function),
|
|
591
|
+
include('root'),
|
|
592
|
+
],
|
|
593
|
+
'end': [
|
|
594
|
+
('(if|case|record|loop|select)', Keyword.Reserved),
|
|
595
|
+
(r'"[^"]+"|[\w.]+', Name.Function),
|
|
596
|
+
(r'\s+', Text),
|
|
597
|
+
(';', Punctuation, '#pop'),
|
|
598
|
+
],
|
|
599
|
+
'type_def': [
|
|
600
|
+
(r';', Punctuation, '#pop'),
|
|
601
|
+
(r'\(', Punctuation, 'formal_part'),
|
|
602
|
+
(r'with|and|use', Keyword.Reserved),
|
|
603
|
+
(r'array\b', Keyword.Reserved, ('#pop', 'array_def')),
|
|
604
|
+
(r'record\b', Keyword.Reserved, ('record_def')),
|
|
605
|
+
(r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'),
|
|
606
|
+
include('root'),
|
|
607
|
+
],
|
|
608
|
+
'array_def': [
|
|
609
|
+
(r';', Punctuation, '#pop'),
|
|
610
|
+
(r'(\w+)(\s+)(range)', bygroups(Keyword.Type, Text, Keyword.Reserved)),
|
|
611
|
+
include('root'),
|
|
612
|
+
],
|
|
613
|
+
'record_def': [
|
|
614
|
+
(r'end record', Keyword.Reserved, '#pop'),
|
|
615
|
+
include('root'),
|
|
616
|
+
],
|
|
617
|
+
'import': [
|
|
618
|
+
(r'[\w.]+', Name.Namespace, '#pop'),
|
|
619
|
+
default('#pop'),
|
|
620
|
+
],
|
|
621
|
+
'formal_part': [
|
|
622
|
+
(r'\)', Punctuation, '#pop'),
|
|
623
|
+
(r'\w+', Name.Variable),
|
|
624
|
+
(r',|:[^=]', Punctuation),
|
|
625
|
+
(r'(in|not|null|out|access)\b', Keyword.Reserved),
|
|
626
|
+
include('root'),
|
|
627
|
+
],
|
|
628
|
+
'package': [
|
|
629
|
+
('body', Keyword.Declaration),
|
|
630
|
+
(r'is\s+new|renames', Keyword.Reserved),
|
|
631
|
+
('is', Keyword.Reserved, '#pop'),
|
|
632
|
+
(';', Punctuation, '#pop'),
|
|
633
|
+
(r'\(', Punctuation, 'package_instantiation'),
|
|
634
|
+
(r'([\w.]+)', Name.Class),
|
|
635
|
+
include('root'),
|
|
636
|
+
],
|
|
637
|
+
'package_instantiation': [
|
|
638
|
+
(r'("[^"]+"|\w+)(\s+)(=>)', bygroups(Name.Variable, Text, Punctuation)),
|
|
639
|
+
(r'[\w.\'"]', Text),
|
|
640
|
+
(r'\)', Punctuation, '#pop'),
|
|
641
|
+
include('root'),
|
|
642
|
+
],
|
|
643
|
+
}
|