pygments.rb 0.6.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +11 -0
- data/README.md +6 -6
- data/Rakefile +2 -1
- data/cache-lexers.rb +1 -1
- data/circle.yml +7 -0
- data/lib/pygments/lexer.rb +3 -3
- data/lib/pygments/popen.rb +67 -30
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/test/test_pygments.rb +16 -16
- data/vendor/pygments-main/AUTHORS +54 -8
- data/vendor/pygments-main/CHANGES +247 -25
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/Makefile +15 -6
- data/vendor/pygments-main/README.rst +39 -0
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/TODO +0 -3
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +1 -1
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +1 -1
- data/vendor/pygments-main/doc/conf.py +3 -11
- data/vendor/pygments-main/doc/docs/api.rst +15 -0
- data/vendor/pygments-main/doc/docs/cmdline.rst +6 -2
- data/vendor/pygments-main/doc/docs/filterdevelopment.rst +4 -3
- data/vendor/pygments-main/doc/docs/integrate.rst +11 -15
- data/vendor/pygments-main/doc/docs/java.rst +7 -7
- data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +258 -171
- data/vendor/pygments-main/doc/docs/lexers.rst +2 -2
- data/vendor/pygments-main/doc/docs/styles.rst +58 -0
- data/vendor/pygments-main/doc/docs/tokens.rst +22 -2
- data/vendor/pygments-main/doc/docs/unicode.rst +15 -7
- data/vendor/pygments-main/doc/faq.rst +17 -21
- data/vendor/pygments-main/doc/index.rst +12 -11
- data/vendor/pygments-main/doc/languages.rst +10 -7
- data/vendor/pygments-main/external/autopygmentize +9 -6
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +70 -52
- data/vendor/pygments-main/external/markdown-processor.py +1 -1
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +1 -1
- data/vendor/pygments-main/pygmentize +2 -1
- data/vendor/pygments-main/pygments/__init__.py +14 -15
- data/vendor/pygments-main/pygments/cmdline.py +188 -113
- data/vendor/pygments-main/pygments/console.py +13 -13
- data/vendor/pygments-main/pygments/filter.py +7 -7
- data/vendor/pygments-main/pygments/filters/__init__.py +24 -32
- data/vendor/pygments-main/pygments/formatter.py +5 -5
- data/vendor/pygments-main/pygments/formatters/__init__.py +92 -44
- data/vendor/pygments-main/pygments/formatters/_mapping.py +51 -69
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +63 -51
- data/vendor/pygments-main/pygments/formatters/img.py +25 -22
- data/vendor/pygments-main/pygments/formatters/irc.py +182 -0
- data/vendor/pygments-main/pygments/formatters/latex.py +34 -22
- data/vendor/pygments-main/pygments/formatters/other.py +5 -7
- data/vendor/pygments-main/pygments/formatters/rtf.py +28 -31
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +29 -45
- data/vendor/pygments-main/pygments/formatters/terminal256.py +118 -31
- data/vendor/pygments-main/pygments/lexer.py +120 -34
- data/vendor/pygments-main/pygments/lexers/__init__.py +85 -53
- data/vendor/pygments-main/pygments/lexers/{_asybuiltins.py → _asy_builtins.py} +7 -7
- data/vendor/pygments-main/pygments/lexers/{_clbuiltins.py → _cl_builtins.py} +17 -17
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +72 -0
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1346 -0
- data/vendor/pygments-main/pygments/lexers/{_lassobuiltins.py → _lasso_builtins.py} +4699 -4561
- data/vendor/pygments-main/pygments/lexers/{_luabuiltins.py → _lua_builtins.py} +91 -51
- data/vendor/pygments-main/pygments/lexers/_mapping.py +342 -242
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1172 -0
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2547 -0
- data/vendor/pygments-main/pygments/lexers/{_phpbuiltins.py → _php_builtins.py} +350 -353
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +600 -212
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3084 -30
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1163 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +91 -13
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +419 -0
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1004 -0
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1939 -0
- data/vendor/pygments-main/pygments/lexers/actionscript.py +240 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +14 -2542
- data/vendor/pygments-main/pygments/lexers/algebra.py +221 -0
- data/vendor/pygments-main/pygments/lexers/ambient.py +76 -0
- data/vendor/pygments-main/pygments/lexers/ampl.py +87 -0
- data/vendor/pygments-main/pygments/lexers/apl.py +101 -0
- data/vendor/pygments-main/pygments/lexers/archetype.py +318 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +276 -81
- data/vendor/pygments-main/pygments/lexers/automation.py +374 -0
- data/vendor/pygments-main/pygments/lexers/basic.py +500 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +156 -0
- data/vendor/pygments-main/pygments/lexers/business.py +594 -0
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +252 -0
- data/vendor/pygments-main/pygments/lexers/c_like.py +541 -0
- data/vendor/pygments-main/pygments/lexers/capnproto.py +79 -0
- data/vendor/pygments-main/pygments/lexers/chapel.py +101 -0
- data/vendor/pygments-main/pygments/lexers/clean.py +288 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +24 -5182
- data/vendor/pygments-main/pygments/lexers/configs.py +833 -0
- data/vendor/pygments-main/pygments/lexers/console.py +114 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +384 -0
- data/vendor/pygments-main/pygments/lexers/csound.py +366 -0
- data/vendor/pygments-main/pygments/lexers/css.py +689 -0
- data/vendor/pygments-main/pygments/lexers/d.py +251 -0
- data/vendor/pygments-main/pygments/lexers/dalvik.py +6 -6
- data/vendor/pygments-main/pygments/lexers/data.py +555 -0
- data/vendor/pygments-main/pygments/lexers/diff.py +165 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +96 -88
- data/vendor/pygments-main/pygments/lexers/dsls.py +878 -0
- data/vendor/pygments-main/pygments/lexers/dylan.py +289 -0
- data/vendor/pygments-main/pygments/lexers/ecl.py +125 -0
- data/vendor/pygments-main/pygments/lexers/eiffel.py +65 -0
- data/vendor/pygments-main/pygments/lexers/elm.py +121 -0
- data/vendor/pygments-main/pygments/lexers/erlang.py +533 -0
- data/vendor/pygments-main/pygments/lexers/esoteric.py +275 -0
- data/vendor/pygments-main/pygments/lexers/ezhil.py +68 -0
- data/vendor/pygments-main/pygments/lexers/factor.py +344 -0
- data/vendor/pygments-main/pygments/lexers/fantom.py +250 -0
- data/vendor/pygments-main/pygments/lexers/felix.py +273 -0
- data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
- data/vendor/pygments-main/pygments/lexers/fortran.py +205 -0
- data/vendor/pygments-main/pygments/lexers/foxpro.py +1 -1
- data/vendor/pygments-main/pygments/lexers/functional.py +11 -3661
- data/vendor/pygments-main/pygments/lexers/go.py +101 -0
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +213 -0
- data/vendor/pygments-main/pygments/lexers/graph.py +7 -8
- data/vendor/pygments-main/pygments/lexers/graphics.py +553 -0
- data/vendor/pygments-main/pygments/lexers/haskell.py +840 -0
- data/vendor/pygments-main/pygments/lexers/haxe.py +936 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +172 -145
- data/vendor/pygments-main/pygments/lexers/hexdump.py +97 -0
- data/vendor/pygments-main/pygments/lexers/html.py +602 -0
- data/vendor/pygments-main/pygments/lexers/idl.py +270 -0
- data/vendor/pygments-main/pygments/lexers/igor.py +288 -0
- data/vendor/pygments-main/pygments/lexers/inferno.py +3 -3
- data/vendor/pygments-main/pygments/lexers/installers.py +322 -0
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +1343 -0
- data/vendor/pygments-main/pygments/lexers/iolang.py +63 -0
- data/vendor/pygments-main/pygments/lexers/j.py +146 -0
- data/vendor/pygments-main/pygments/lexers/javascript.py +1506 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +333 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +232 -186
- data/vendor/pygments-main/pygments/lexers/lisp.py +2621 -0
- data/vendor/pygments-main/pygments/lexers/make.py +202 -0
- data/vendor/pygments-main/pygments/lexers/markup.py +595 -0
- data/vendor/pygments-main/pygments/lexers/math.py +11 -2276
- data/vendor/pygments-main/pygments/lexers/matlab.py +663 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +769 -0
- data/vendor/pygments-main/pygments/lexers/modeling.py +358 -0
- data/vendor/pygments-main/pygments/lexers/modula2.py +1561 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
- data/vendor/pygments-main/pygments/lexers/ncl.py +1053 -0
- data/vendor/pygments-main/pygments/lexers/nimrod.py +159 -0
- data/vendor/pygments-main/pygments/lexers/nit.py +64 -0
- data/vendor/pygments-main/pygments/lexers/nix.py +136 -0
- data/vendor/pygments-main/pygments/lexers/oberon.py +105 -0
- data/vendor/pygments-main/pygments/lexers/objective.py +504 -0
- data/vendor/pygments-main/pygments/lexers/ooc.py +85 -0
- data/vendor/pygments-main/pygments/lexers/other.py +30 -4481
- data/vendor/pygments-main/pygments/lexers/parasail.py +79 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +171 -114
- data/vendor/pygments-main/pygments/lexers/pascal.py +644 -0
- data/vendor/pygments-main/pygments/lexers/pawn.py +199 -0
- data/vendor/pygments-main/pygments/lexers/perl.py +616 -0
- data/vendor/pygments-main/pygments/lexers/php.py +267 -0
- data/vendor/pygments-main/pygments/lexers/praat.py +294 -0
- data/vendor/pygments-main/pygments/lexers/prolog.py +306 -0
- data/vendor/pygments-main/pygments/lexers/python.py +938 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +152 -0
- data/vendor/pygments-main/pygments/lexers/r.py +453 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +195 -24
- data/vendor/pygments-main/pygments/lexers/rebol.py +431 -0
- data/vendor/pygments-main/pygments/lexers/resource.py +85 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +67 -0
- data/vendor/pygments-main/pygments/lexers/roboconf.py +82 -0
- data/vendor/pygments-main/pygments/lexers/{_robotframeworklexer.py → robotframework.py} +20 -18
- data/vendor/pygments-main/pygments/lexers/ruby.py +519 -0
- data/vendor/pygments-main/pygments/lexers/rust.py +209 -0
- data/vendor/pygments-main/pygments/lexers/sas.py +228 -0
- data/vendor/pygments-main/pygments/lexers/scripting.py +1222 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +478 -115
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +195 -0
- data/vendor/pygments-main/pygments/lexers/smv.py +75 -0
- data/vendor/pygments-main/pygments/lexers/snobol.py +83 -0
- data/vendor/pygments-main/pygments/lexers/special.py +6 -2
- data/vendor/pygments-main/pygments/lexers/sql.py +209 -120
- data/vendor/pygments-main/pygments/lexers/stata.py +106 -0
- data/vendor/pygments-main/pygments/lexers/supercollider.py +90 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +145 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +282 -90
- data/vendor/pygments-main/pygments/lexers/testing.py +207 -0
- data/vendor/pygments-main/pygments/lexers/text.py +15 -2045
- data/vendor/pygments-main/pygments/lexers/textedit.py +169 -0
- data/vendor/pygments-main/pygments/lexers/textfmts.py +297 -0
- data/vendor/pygments-main/pygments/lexers/theorem.py +458 -0
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +54 -0
- data/vendor/pygments-main/pygments/lexers/typoscript.py +225 -0
- data/vendor/pygments-main/pygments/lexers/urbi.py +133 -0
- data/vendor/pygments-main/pygments/lexers/varnish.py +190 -0
- data/vendor/pygments-main/pygments/lexers/verification.py +111 -0
- data/vendor/pygments-main/pygments/lexers/web.py +13 -4499
- data/vendor/pygments-main/pygments/lexers/webmisc.py +979 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +117 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +69 -0
- data/vendor/pygments-main/pygments/modeline.py +5 -2
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/regexopt.py +92 -0
- data/vendor/pygments-main/pygments/scanner.py +3 -2
- data/vendor/pygments-main/pygments/sphinxext.py +11 -6
- data/vendor/pygments-main/pygments/style.py +41 -4
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/algol.py +63 -0
- data/vendor/pygments-main/pygments/styles/algol_nu.py +63 -0
- data/vendor/pygments-main/pygments/styles/arduino.py +98 -0
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +1 -1
- data/vendor/pygments-main/pygments/styles/lovelace.py +97 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +2 -2
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/sas.py +41 -0
- data/vendor/pygments-main/pygments/styles/stata.py +37 -0
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
- data/vendor/pygments-main/pygments/token.py +31 -16
- data/vendor/pygments-main/pygments/unistring.py +141 -65
- data/vendor/pygments-main/pygments/util.py +129 -33
- data/vendor/pygments-main/requirements.txt +5 -0
- data/vendor/pygments-main/scripts/check_sources.py +25 -40
- data/vendor/pygments-main/scripts/debug_lexer.py +246 -0
- data/vendor/pygments-main/scripts/find_error.py +1 -0
- data/vendor/pygments-main/scripts/get_vimkw.py +35 -4
- data/vendor/pygments-main/setup.cfg +3 -0
- data/vendor/pygments-main/setup.py +17 -30
- data/vendor/pygments-main/tox.ini +7 -0
- metadata +159 -387
- data/vendor/pygments-main/ez_setup.py +0 -382
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +0 -73
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +0 -562
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +0 -1077
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +0 -13
- data/vendor/pygments-main/pygments/lexers/qbasic.py +0 -157
- data/vendor/pygments-main/scripts/find_codetags.py +0 -213
- data/vendor/pygments-main/scripts/find_error.py +0 -173
- data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +0 -37
- data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +0 -869
- data/vendor/pygments-main/tests/dtds/HTML4.dcl +0 -88
- data/vendor/pygments-main/tests/dtds/HTML4.dtd +0 -1092
- data/vendor/pygments-main/tests/dtds/HTML4.soc +0 -9
- data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +0 -195
- data/vendor/pygments-main/tests/dtds/HTMLspec.ent +0 -77
- data/vendor/pygments-main/tests/dtds/HTMLsym.ent +0 -241
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +0 -118
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +0 -209
- data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +0 -102
- data/vendor/pygments-main/tests/examplefiles/BOM.js +0 -1
- data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +0 -611
- data/vendor/pygments-main/tests/examplefiles/Config.in.cache +0 -1973
- data/vendor/pygments-main/tests/examplefiles/Constants.mo +0 -158
- data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +0 -411
- data/vendor/pygments-main/tests/examplefiles/Deflate.fs +0 -578
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +0 -38
- data/vendor/pygments-main/tests/examplefiles/Errors.scala +0 -18
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +0 -360
- data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +0 -66
- data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +0 -104
- data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +0 -671
- data/vendor/pygments-main/tests/examplefiles/Intro.java +0 -1660
- data/vendor/pygments-main/tests/examplefiles/Makefile +0 -1131
- data/vendor/pygments-main/tests/examplefiles/Object.st +0 -4394
- data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +0 -584
- data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +0 -23
- data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +0 -378
- data/vendor/pygments-main/tests/examplefiles/Sorting.mod +0 -470
- data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +0 -382
- data/vendor/pygments-main/tests/examplefiles/addressbook.proto +0 -30
- data/vendor/pygments-main/tests/examplefiles/antlr_ANTLRv3.g +0 -608
- data/vendor/pygments-main/tests/examplefiles/antlr_throws +0 -1
- data/vendor/pygments-main/tests/examplefiles/apache2.conf +0 -393
- data/vendor/pygments-main/tests/examplefiles/as3_test.as +0 -143
- data/vendor/pygments-main/tests/examplefiles/as3_test2.as +0 -46
- data/vendor/pygments-main/tests/examplefiles/as3_test3.as +0 -3
- data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +0 -27
- data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +0 -25
- data/vendor/pygments-main/tests/examplefiles/badcase.java +0 -2
- data/vendor/pygments-main/tests/examplefiles/batchfile.bat +0 -49
- data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +0 -308
- data/vendor/pygments-main/tests/examplefiles/boot-9.scm +0 -1557
- data/vendor/pygments-main/tests/examplefiles/ca65_example +0 -284
- data/vendor/pygments-main/tests/examplefiles/cbmbas_example +0 -9
- data/vendor/pygments-main/tests/examplefiles/cells.ps +0 -515
- data/vendor/pygments-main/tests/examplefiles/ceval.c +0 -2604
- data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +0 -13
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +0 -125
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +0 -5
- data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +0 -10
- data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +0 -447
- data/vendor/pygments-main/tests/examplefiles/core.cljs +0 -52
- data/vendor/pygments-main/tests/examplefiles/database.pytb +0 -20
- data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +0 -2461
- data/vendor/pygments-main/tests/examplefiles/demo.ahk +0 -181
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +0 -50
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +0 -12
- data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +0 -68
- data/vendor/pygments-main/tests/examplefiles/dwarf.cw +0 -17
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +0 -33
- data/vendor/pygments-main/tests/examplefiles/erl_session +0 -10
- data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +0 -1
- data/vendor/pygments-main/tests/examplefiles/evil_regex.js +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.Rd +0 -78
- data/vendor/pygments-main/tests/examplefiles/example.als +0 -217
- data/vendor/pygments-main/tests/examplefiles/example.bug +0 -54
- data/vendor/pygments-main/tests/examplefiles/example.c +0 -2080
- data/vendor/pygments-main/tests/examplefiles/example.ceylon +0 -52
- data/vendor/pygments-main/tests/examplefiles/example.chai +0 -6
- data/vendor/pygments-main/tests/examplefiles/example.clay +0 -33
- data/vendor/pygments-main/tests/examplefiles/example.cls +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.cob +0 -3556
- data/vendor/pygments-main/tests/examplefiles/example.coffee +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.cpp +0 -2363
- data/vendor/pygments-main/tests/examplefiles/example.e +0 -124
- data/vendor/pygments-main/tests/examplefiles/example.f90 +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.feature +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.gd +0 -23
- data/vendor/pygments-main/tests/examplefiles/example.gi +0 -64
- data/vendor/pygments-main/tests/examplefiles/example.groovy +0 -2
- data/vendor/pygments-main/tests/examplefiles/example.gs +0 -106
- data/vendor/pygments-main/tests/examplefiles/example.gst +0 -7
- data/vendor/pygments-main/tests/examplefiles/example.hs +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.hx +0 -185
- data/vendor/pygments-main/tests/examplefiles/example.i6t +0 -32
- data/vendor/pygments-main/tests/examplefiles/example.i7x +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.inf +0 -374
- data/vendor/pygments-main/tests/examplefiles/example.j +0 -564
- data/vendor/pygments-main/tests/examplefiles/example.jag +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.java +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.kal +0 -75
- data/vendor/pygments-main/tests/examplefiles/example.kt +0 -47
- data/vendor/pygments-main/tests/examplefiles/example.lagda +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.liquid +0 -42
- data/vendor/pygments-main/tests/examplefiles/example.lua +0 -250
- data/vendor/pygments-main/tests/examplefiles/example.ma +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.monkey +0 -152
- data/vendor/pygments-main/tests/examplefiles/example.moo +0 -26
- data/vendor/pygments-main/tests/examplefiles/example.moon +0 -629
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +0 -187
- data/vendor/pygments-main/tests/examplefiles/example.mqh +0 -123
- data/vendor/pygments-main/tests/examplefiles/example.msc +0 -43
- data/vendor/pygments-main/tests/examplefiles/example.ni +0 -57
- data/vendor/pygments-main/tests/examplefiles/example.nim +0 -1010
- data/vendor/pygments-main/tests/examplefiles/example.nix +0 -80
- data/vendor/pygments-main/tests/examplefiles/example.ns2 +0 -69
- data/vendor/pygments-main/tests/examplefiles/example.pas +0 -2708
- data/vendor/pygments-main/tests/examplefiles/example.pp +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.prg +0 -161
- data/vendor/pygments-main/tests/examplefiles/example.rb +0 -1852
- data/vendor/pygments-main/tests/examplefiles/example.red +0 -257
- data/vendor/pygments-main/tests/examplefiles/example.reds +0 -150
- data/vendor/pygments-main/tests/examplefiles/example.reg +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.rexx +0 -50
- data/vendor/pygments-main/tests/examplefiles/example.rhtml +0 -561
- data/vendor/pygments-main/tests/examplefiles/example.rkt +0 -743
- data/vendor/pygments-main/tests/examplefiles/example.rpf +0 -4
- data/vendor/pygments-main/tests/examplefiles/example.sh +0 -22
- data/vendor/pygments-main/tests/examplefiles/example.sh-session +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.shell-session +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.slim +0 -31
- data/vendor/pygments-main/tests/examplefiles/example.sls +0 -51
- data/vendor/pygments-main/tests/examplefiles/example.sml +0 -156
- data/vendor/pygments-main/tests/examplefiles/example.snobol +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.stan +0 -110
- data/vendor/pygments-main/tests/examplefiles/example.tea +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.ts +0 -28
- data/vendor/pygments-main/tests/examplefiles/example.u +0 -548
- data/vendor/pygments-main/tests/examplefiles/example.weechatlog +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.xhtml +0 -376
- data/vendor/pygments-main/tests/examplefiles/example.xtend +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.yaml +0 -302
- data/vendor/pygments-main/tests/examplefiles/example2.aspx +0 -29
- data/vendor/pygments-main/tests/examplefiles/example2.msc +0 -79
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +0 -241
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +0 -18
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +0 -205
- data/vendor/pygments-main/tests/examplefiles/example_file.fy +0 -128
- data/vendor/pygments-main/tests/examplefiles/firefox.mak +0 -586
- data/vendor/pygments-main/tests/examplefiles/flipflop.sv +0 -19
- data/vendor/pygments-main/tests/examplefiles/foo.sce +0 -6
- data/vendor/pygments-main/tests/examplefiles/format.ml +0 -1213
- data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +0 -77
- data/vendor/pygments-main/tests/examplefiles/function.mu +0 -1
- data/vendor/pygments-main/tests/examplefiles/functional.rst +0 -1472
- data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +0 -133
- data/vendor/pygments-main/tests/examplefiles/genclass.clj +0 -510
- data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +0 -193
- data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +0 -33
- data/vendor/pygments-main/tests/examplefiles/glsl.frag +0 -7
- data/vendor/pygments-main/tests/examplefiles/glsl.vert +0 -13
- data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +0 -22
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.at +0 -6
- data/vendor/pygments-main/tests/examplefiles/hello.golo +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +0 -12
- data/vendor/pygments-main/tests/examplefiles/hello.smali +0 -40
- data/vendor/pygments-main/tests/examplefiles/hello.sp +0 -9
- data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +0 -1
- data/vendor/pygments-main/tests/examplefiles/http_request_example +0 -15
- data/vendor/pygments-main/tests/examplefiles/http_response_example +0 -29
- data/vendor/pygments-main/tests/examplefiles/hybris_File.hy +0 -174
- data/vendor/pygments-main/tests/examplefiles/idl_sample.pro +0 -73
- data/vendor/pygments-main/tests/examplefiles/iex_example +0 -23
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +0 -71
- data/vendor/pygments-main/tests/examplefiles/intro.ik +0 -24
- data/vendor/pygments-main/tests/examplefiles/ints.php +0 -10
- data/vendor/pygments-main/tests/examplefiles/intsyn.fun +0 -675
- data/vendor/pygments-main/tests/examplefiles/intsyn.sig +0 -286
- data/vendor/pygments-main/tests/examplefiles/irb_heredoc +0 -8
- data/vendor/pygments-main/tests/examplefiles/irc.lsp +0 -214
- data/vendor/pygments-main/tests/examplefiles/java.properties +0 -16
- data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +0 -28
- data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +0 -45
- data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +0 -713
- data/vendor/pygments-main/tests/examplefiles/json.lasso +0 -301
- data/vendor/pygments-main/tests/examplefiles/json.lasso9 +0 -213
- data/vendor/pygments-main/tests/examplefiles/language.hy +0 -165
- data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +0 -13
- data/vendor/pygments-main/tests/examplefiles/limbo.b +0 -456
- data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +0 -47
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +0 -43
- data/vendor/pygments-main/tests/examplefiles/logos_example.xm +0 -28
- data/vendor/pygments-main/tests/examplefiles/ltmain.sh +0 -2849
- data/vendor/pygments-main/tests/examplefiles/main.cmake +0 -44
- data/vendor/pygments-main/tests/examplefiles/markdown.lsp +0 -679
- data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +0 -3
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +0 -30
- data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +0 -37
- data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +0 -455
- data/vendor/pygments-main/tests/examplefiles/minehunt.qml +0 -112
- data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +0 -4
- data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +0 -340
- data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +0 -38
- data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +0 -95
- data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +0 -96
- data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +0 -30
- data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +0 -87
- data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +0 -118
- data/vendor/pygments-main/tests/examplefiles/numbers.c +0 -12
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +0 -179
- data/vendor/pygments-main/tests/examplefiles/openedge_example +0 -34
- data/vendor/pygments-main/tests/examplefiles/pawn_example +0 -25
- data/vendor/pygments-main/tests/examplefiles/perl_misc +0 -62
- data/vendor/pygments-main/tests/examplefiles/perl_perl5db +0 -998
- data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +0 -120
- data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +0 -856
- data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +0 -163
- data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +0 -567
- data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +0 -1223
- data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +0 -47
- data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +0 -10
- data/vendor/pygments-main/tests/examplefiles/psql_session.txt +0 -122
- data/vendor/pygments-main/tests/examplefiles/py3_test.txt +0 -2
- data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +0 -4
- data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +0 -14
- data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +0 -2
- data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +0 -4
- data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +0 -234
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +0 -2
- data/vendor/pygments-main/tests/examplefiles/qsort.prolog +0 -13
- data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +0 -38
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +0 -23
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +0 -280
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +0 -2
- data/vendor/pygments-main/tests/examplefiles/regex.js +0 -22
- data/vendor/pygments-main/tests/examplefiles/reversi.lsp +0 -427
- data/vendor/pygments-main/tests/examplefiles/robotframework_test.txt +0 -39
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +0 -34
- data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +0 -11
- data/vendor/pygments-main/tests/examplefiles/rust_example.rs +0 -233
- data/vendor/pygments-main/tests/examplefiles/scilab.sci +0 -30
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +0 -43
- data/vendor/pygments-main/tests/examplefiles/session.dylan-console +0 -9
- data/vendor/pygments-main/tests/examplefiles/sibling.prolog +0 -19
- data/vendor/pygments-main/tests/examplefiles/simple.md +0 -747
- data/vendor/pygments-main/tests/examplefiles/smarty_example.html +0 -209
- data/vendor/pygments-main/tests/examplefiles/source.lgt +0 -343
- data/vendor/pygments-main/tests/examplefiles/sources.list +0 -62
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +0 -23
- data/vendor/pygments-main/tests/examplefiles/sphere.pov +0 -18
- data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +0 -27
- data/vendor/pygments-main/tests/examplefiles/squid.conf +0 -30
- data/vendor/pygments-main/tests/examplefiles/string.jl +0 -1031
- data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +0 -21
- data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +0 -3
- data/vendor/pygments-main/tests/examplefiles/swig_java.swg +0 -1329
- data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +0 -225
- data/vendor/pygments-main/tests/examplefiles/test.R +0 -185
- data/vendor/pygments-main/tests/examplefiles/test.adb +0 -211
- data/vendor/pygments-main/tests/examplefiles/test.agda +0 -102
- data/vendor/pygments-main/tests/examplefiles/test.apl +0 -26
- data/vendor/pygments-main/tests/examplefiles/test.asy +0 -131
- data/vendor/pygments-main/tests/examplefiles/test.awk +0 -121
- data/vendor/pygments-main/tests/examplefiles/test.bb +0 -95
- data/vendor/pygments-main/tests/examplefiles/test.bmx +0 -145
- data/vendor/pygments-main/tests/examplefiles/test.boo +0 -39
- data/vendor/pygments-main/tests/examplefiles/test.bro +0 -250
- data/vendor/pygments-main/tests/examplefiles/test.cs +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.css +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.cu +0 -36
- data/vendor/pygments-main/tests/examplefiles/test.cyp +0 -123
- data/vendor/pygments-main/tests/examplefiles/test.d +0 -135
- data/vendor/pygments-main/tests/examplefiles/test.dart +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.dtd +0 -89
- data/vendor/pygments-main/tests/examplefiles/test.ebnf +0 -31
- data/vendor/pygments-main/tests/examplefiles/test.ec +0 -605
- data/vendor/pygments-main/tests/examplefiles/test.ecl +0 -58
- data/vendor/pygments-main/tests/examplefiles/test.eh +0 -315
- data/vendor/pygments-main/tests/examplefiles/test.erl +0 -169
- data/vendor/pygments-main/tests/examplefiles/test.evoque +0 -33
- data/vendor/pygments-main/tests/examplefiles/test.fan +0 -818
- data/vendor/pygments-main/tests/examplefiles/test.flx +0 -57
- data/vendor/pygments-main/tests/examplefiles/test.gdc +0 -13
- data/vendor/pygments-main/tests/examplefiles/test.groovy +0 -97
- data/vendor/pygments-main/tests/examplefiles/test.html +0 -339
- data/vendor/pygments-main/tests/examplefiles/test.idr +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.ini +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.java +0 -653
- data/vendor/pygments-main/tests/examplefiles/test.jsp +0 -24
- data/vendor/pygments-main/tests/examplefiles/test.maql +0 -45
- data/vendor/pygments-main/tests/examplefiles/test.mask +0 -41
- data/vendor/pygments-main/tests/examplefiles/test.mod +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.moo +0 -51
- data/vendor/pygments-main/tests/examplefiles/test.myt +0 -166
- data/vendor/pygments-main/tests/examplefiles/test.nim +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.opa +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.p6 +0 -252
- data/vendor/pygments-main/tests/examplefiles/test.pan +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.pas +0 -743
- data/vendor/pygments-main/tests/examplefiles/test.php +0 -507
- data/vendor/pygments-main/tests/examplefiles/test.pig +0 -148
- data/vendor/pygments-main/tests/examplefiles/test.plot +0 -333
- data/vendor/pygments-main/tests/examplefiles/test.ps1 +0 -108
- data/vendor/pygments-main/tests/examplefiles/test.pwn +0 -253
- data/vendor/pygments-main/tests/examplefiles/test.pypylog +0 -1839
- data/vendor/pygments-main/tests/examplefiles/test.r3 +0 -114
- data/vendor/pygments-main/tests/examplefiles/test.rb +0 -177
- data/vendor/pygments-main/tests/examplefiles/test.rhtml +0 -43
- data/vendor/pygments-main/tests/examplefiles/test.rsl +0 -111
- data/vendor/pygments-main/tests/examplefiles/test.scaml +0 -8
- data/vendor/pygments-main/tests/examplefiles/test.ssp +0 -12
- data/vendor/pygments-main/tests/examplefiles/test.swift +0 -65
- data/vendor/pygments-main/tests/examplefiles/test.tcsh +0 -830
- data/vendor/pygments-main/tests/examplefiles/test.vb +0 -407
- data/vendor/pygments-main/tests/examplefiles/test.vhdl +0 -161
- data/vendor/pygments-main/tests/examplefiles/test.xqy +0 -138
- data/vendor/pygments-main/tests/examplefiles/test.xsl +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.zep +0 -33
- data/vendor/pygments-main/tests/examplefiles/test2.pypylog +0 -120
- data/vendor/pygments-main/tests/examplefiles/truncated.pytb +0 -15
- data/vendor/pygments-main/tests/examplefiles/type.lisp +0 -1218
- data/vendor/pygments-main/tests/examplefiles/underscore.coffee +0 -603
- data/vendor/pygments-main/tests/examplefiles/unicode.applescript +0 -5
- data/vendor/pygments-main/tests/examplefiles/unicode.go +0 -10
- data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +0 -11
- data/vendor/pygments-main/tests/examplefiles/unix-io.lid +0 -37
- data/vendor/pygments-main/tests/examplefiles/vbnet_test.bas +0 -29
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +0 -4
- data/vendor/pygments-main/tests/examplefiles/vimrc +0 -21
- data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +0 -3
- data/vendor/pygments-main/tests/examplefiles/while.pov +0 -13
- data/vendor/pygments-main/tests/examplefiles/wiki.factor +0 -384
- data/vendor/pygments-main/tests/examplefiles/xml_example +0 -1897
- data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +0 -798
- data/vendor/pygments-main/tests/run.py +0 -44
- data/vendor/pygments-main/tests/string_asserts.py +0 -22
- data/vendor/pygments-main/tests/support.py +0 -15
- data/vendor/pygments-main/tests/support/tags +0 -36
- data/vendor/pygments-main/tests/test_basic_api.py +0 -309
- data/vendor/pygments-main/tests/test_cfm.py +0 -46
- data/vendor/pygments-main/tests/test_clexer.py +0 -236
- data/vendor/pygments-main/tests/test_cmdline.py +0 -106
- data/vendor/pygments-main/tests/test_examplefiles.py +0 -110
- data/vendor/pygments-main/tests/test_html_formatter.py +0 -180
- data/vendor/pygments-main/tests/test_latex_formatter.py +0 -57
- data/vendor/pygments-main/tests/test_lexers_other.py +0 -68
- data/vendor/pygments-main/tests/test_objectiveclexer.py +0 -81
- data/vendor/pygments-main/tests/test_perllexer.py +0 -137
- data/vendor/pygments-main/tests/test_qbasiclexer.py +0 -43
- data/vendor/pygments-main/tests/test_regexlexer.py +0 -54
- data/vendor/pygments-main/tests/test_rtf_formatter.py +0 -109
- data/vendor/pygments-main/tests/test_string_asserts.py +0 -39
- data/vendor/pygments-main/tests/test_token.py +0 -46
- data/vendor/pygments-main/tests/test_using_api.py +0 -40
- data/vendor/pygments-main/tests/test_util.py +0 -135
@@ -0,0 +1,85 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
pygments.lexers.ooc
|
4
|
+
~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
Lexers for the Ooc language.
|
7
|
+
|
8
|
+
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
|
9
|
+
:license: BSD, see LICENSE for details.
|
10
|
+
"""
|
11
|
+
|
12
|
+
from pygments.lexer import RegexLexer, bygroups, words
|
13
|
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
14
|
+
Number, Punctuation
|
15
|
+
|
16
|
+
__all__ = ['OocLexer']
|
17
|
+
|
18
|
+
|
19
|
+
class OocLexer(RegexLexer):
|
20
|
+
"""
|
21
|
+
For `Ooc <http://ooc-lang.org/>`_ source code
|
22
|
+
|
23
|
+
.. versionadded:: 1.2
|
24
|
+
"""
|
25
|
+
name = 'Ooc'
|
26
|
+
aliases = ['ooc']
|
27
|
+
filenames = ['*.ooc']
|
28
|
+
mimetypes = ['text/x-ooc']
|
29
|
+
|
30
|
+
tokens = {
|
31
|
+
'root': [
|
32
|
+
(words((
|
33
|
+
'class', 'interface', 'implement', 'abstract', 'extends', 'from',
|
34
|
+
'this', 'super', 'new', 'const', 'final', 'static', 'import',
|
35
|
+
'use', 'extern', 'inline', 'proto', 'break', 'continue',
|
36
|
+
'fallthrough', 'operator', 'if', 'else', 'for', 'while', 'do',
|
37
|
+
'switch', 'case', 'as', 'in', 'version', 'return', 'true',
|
38
|
+
'false', 'null'), prefix=r'\b', suffix=r'\b'),
|
39
|
+
Keyword),
|
40
|
+
(r'include\b', Keyword, 'include'),
|
41
|
+
(r'(cover)([ \t]+)(from)([ \t]+)(\w+[*@]?)',
|
42
|
+
bygroups(Keyword, Text, Keyword, Text, Name.Class)),
|
43
|
+
(r'(func)((?:[ \t]|\\\n)+)(~[a-z_]\w*)',
|
44
|
+
bygroups(Keyword, Text, Name.Function)),
|
45
|
+
(r'\bfunc\b', Keyword),
|
46
|
+
# Note: %= and ^= not listed on http://ooc-lang.org/syntax
|
47
|
+
(r'//.*', Comment),
|
48
|
+
(r'(?s)/\*.*?\*/', Comment.Multiline),
|
49
|
+
(r'(==?|\+=?|-[=>]?|\*=?|/=?|:=|!=?|%=?|\?|>{1,3}=?|<{1,3}=?|\.\.|'
|
50
|
+
r'&&?|\|\|?|\^=?)', Operator),
|
51
|
+
(r'(\.)([ \t]*)([a-z]\w*)', bygroups(Operator, Text,
|
52
|
+
Name.Function)),
|
53
|
+
(r'[A-Z][A-Z0-9_]+', Name.Constant),
|
54
|
+
(r'[A-Z]\w*([@*]|\[[ \t]*\])?', Name.Class),
|
55
|
+
|
56
|
+
(r'([a-z]\w*(?:~[a-z]\w*)?)((?:[ \t]|\\\n)*)(?=\()',
|
57
|
+
bygroups(Name.Function, Text)),
|
58
|
+
(r'[a-z]\w*', Name.Variable),
|
59
|
+
|
60
|
+
# : introduces types
|
61
|
+
(r'[:(){}\[\];,]', Punctuation),
|
62
|
+
|
63
|
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
64
|
+
(r'0c[0-9]+', Number.Oct),
|
65
|
+
(r'0b[01]+', Number.Bin),
|
66
|
+
(r'[0-9_]\.[0-9_]*(?!\.)', Number.Float),
|
67
|
+
(r'[0-9_]+', Number.Decimal),
|
68
|
+
|
69
|
+
(r'"(?:\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\"])*"',
|
70
|
+
String.Double),
|
71
|
+
(r"'(?:\\.|\\[0-9]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
|
72
|
+
String.Char),
|
73
|
+
(r'@', Punctuation), # pointer dereference
|
74
|
+
(r'\.', Punctuation), # imports or chain operator
|
75
|
+
|
76
|
+
(r'\\[ \t\n]', Text),
|
77
|
+
(r'[ \t]+', Text),
|
78
|
+
],
|
79
|
+
'include': [
|
80
|
+
(r'[\w/]+', Name),
|
81
|
+
(r',', Punctuation),
|
82
|
+
(r'[ \t]', Text),
|
83
|
+
(r'[;\n]', Text, '#pop'),
|
84
|
+
],
|
85
|
+
}
|
@@ -3,4490 +3,39 @@
|
|
3
3
|
pygments.lexers.other
|
4
4
|
~~~~~~~~~~~~~~~~~~~~~
|
5
5
|
|
6
|
-
|
6
|
+
Just export lexer classes previously contained in this module.
|
7
7
|
|
8
|
-
:copyright: Copyright 2006-
|
8
|
+
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
|
9
9
|
:license: BSD, see LICENSE for details.
|
10
10
|
"""
|
11
11
|
|
12
|
-
import re
|
13
|
-
|
14
|
-
from pygments.lexer import RegexLexer, include, bygroups, using, \
|
15
|
-
this, combined, ExtendedRegexLexer, default
|
16
|
-
from pygments.token import Error, Punctuation, Literal, Token, \
|
17
|
-
Text, Comment, Operator, Keyword, Name, String, Number, Generic, \
|
18
|
-
Whitespace
|
19
|
-
from pygments.util import get_bool_opt
|
20
|
-
from pygments.lexers.web import HtmlLexer
|
21
|
-
|
22
|
-
from pygments.lexers._openedgebuiltins import OPENEDGEKEYWORDS
|
23
|
-
from pygments.lexers._robotframeworklexer import RobotFrameworkLexer
|
24
|
-
|
25
|
-
# backwards compatibility
|
26
12
|
from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
|
27
13
|
from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
lsl_keywords = r'\b(?:do|else|for|if|jump|return|while)\b'
|
57
|
-
lsl_types = r'\b(?:float|integer|key|list|quaternion|rotation|string|vector)\b'
|
58
|
-
lsl_states = r'\b(?:(?:state)\s+\w+|default)\b'
|
59
|
-
lsl_events = r'\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\b'
|
60
|
-
lsl_functions_builtin = r'\b(?:ll(?:ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|RequestPermissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\b'
|
61
|
-
lsl_constants_float = r'\b(?:DEG_TO_RAD|PI(?:_BY_TWO)?|RAD_TO_DEG|SQRT2|TWO_PI)\b'
|
62
|
-
lsl_constants_integer = r'\b(?:JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASSIVE|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_ON_REZ|NAME|DESC|POS|PRIM_EQUIVALENCE|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|ROO?T|VELOCITY|OWNER|GROUP|CREATOR|ATTACHED_POINT|RENDER_WEIGHT|PATHFINDING_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?))|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE|SET_MODE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[ABCD]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\b'
|
63
|
-
lsl_constants_integer_boolean = r'\b(?:FALSE|TRUE)\b'
|
64
|
-
lsl_constants_rotation = r'\b(?:ZERO_ROTATION)\b'
|
65
|
-
lsl_constants_string = r'\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\b'
|
66
|
-
lsl_constants_vector = r'\b(?:TOUCH_INVALID_(?:TEXCOORD|VECTOR)|ZERO_VECTOR)\b'
|
67
|
-
lsl_invalid_broken = r'\b(?:LAND_(?:LARGE|MEDIUM|SMALL)_BRUSH)\b'
|
68
|
-
lsl_invalid_deprecated = r'\b(?:ATTACH_[LR]PEC|DATA_RATING|OBJECT_ATTACHMENT_(?:GEOMETRY_BYTES|SURFACE_AREA)|PRIM_(?:CAST_SHADOWS|MATERIAL_LIGHT|TYPE_LEGACY)|PSYS_SRC_(?:INNER|OUTER)ANGLE|VEHICLE_FLAG_NO_FLY_UP|ll(?:Cloud|Make(?:Explosion|Fountain|Smoke|Fire)|RemoteDataSetRegion|Sound(?:Preload)?|XorBase64Strings(?:Correct)?))\b'
|
69
|
-
lsl_invalid_illegal = r'\b(?:event)\b'
|
70
|
-
lsl_invalid_unimplemented = r'\b(?:CHARACTER_(?:MAX_ANGULAR_(?:ACCEL|SPEED)|TURN_SPEED_MULTIPLIER)|PERMISSION_(?:CHANGE_(?:JOINTS|PERMISSIONS)|RELEASE_OWNERSHIP|REMAP_CONTROLS)|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|ll(?:CollisionSprite|(?:Stop)?PointAt|(?:(?:Refresh|Set)Prim)URL|(?:Take|Release)Camera|RemoteLoadScript))\b'
|
71
|
-
lsl_reserved_godmode = r'\b(?:ll(?:GodLikeRezObject|Set(?:Inventory|Object)PermMask))\b'
|
72
|
-
lsl_reserved_log = r'\b(?:print)\b'
|
73
|
-
lsl_operators = r'\+\+|\-\-|<<|>>|&&?|\|\|?|\^|~|[!%<>=*+\-\/]=?'
|
74
|
-
|
75
|
-
tokens = {
|
76
|
-
'root':
|
77
|
-
[
|
78
|
-
(r'//.*?\n', Comment.Single),
|
79
|
-
(r'/\*', Comment.Multiline, 'comment'),
|
80
|
-
(r'"', String.Double, 'string'),
|
81
|
-
(lsl_keywords, Keyword),
|
82
|
-
(lsl_types, Keyword.Type),
|
83
|
-
(lsl_states, Name.Class),
|
84
|
-
(lsl_events, Name.Builtin),
|
85
|
-
(lsl_functions_builtin, Name.Function),
|
86
|
-
(lsl_constants_float, Keyword.Constant),
|
87
|
-
(lsl_constants_integer, Keyword.Constant),
|
88
|
-
(lsl_constants_integer_boolean, Keyword.Constant),
|
89
|
-
(lsl_constants_rotation, Keyword.Constant),
|
90
|
-
(lsl_constants_string, Keyword.Constant),
|
91
|
-
(lsl_constants_vector, Keyword.Constant),
|
92
|
-
(lsl_invalid_broken, Error),
|
93
|
-
(lsl_invalid_deprecated, Error),
|
94
|
-
(lsl_invalid_illegal, Error),
|
95
|
-
(lsl_invalid_unimplemented, Error),
|
96
|
-
(lsl_reserved_godmode, Keyword.Reserved),
|
97
|
-
(lsl_reserved_log, Keyword.Reserved),
|
98
|
-
(r'\b([a-zA-Z_]\w*)\b', Name.Variable),
|
99
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d*', Number.Float),
|
100
|
-
(r'(\d+\.\d*|\.\d+)', Number.Float),
|
101
|
-
(r'0[xX][0-9a-fA-F]+', Number.Hex),
|
102
|
-
(r'\d+', Number.Integer),
|
103
|
-
(lsl_operators, Operator),
|
104
|
-
(r':=?', Error),
|
105
|
-
(r'[,;{}\(\)\[\]]', Punctuation),
|
106
|
-
(r'\n+', Whitespace),
|
107
|
-
(r'\s+', Whitespace)
|
108
|
-
],
|
109
|
-
'comment':
|
110
|
-
[
|
111
|
-
(r'[^*/]+', Comment.Multiline),
|
112
|
-
(r'/\*', Comment.Multiline, '#push'),
|
113
|
-
(r'\*/', Comment.Multiline, '#pop'),
|
114
|
-
(r'[*/]', Comment.Multiline)
|
115
|
-
],
|
116
|
-
'string':
|
117
|
-
[
|
118
|
-
(r'\\([nt"\\])', String.Escape),
|
119
|
-
(r'"', String.Double, '#pop'),
|
120
|
-
(r'\\.', Error),
|
121
|
-
(r'[^"\\]+', String.Double),
|
122
|
-
]
|
123
|
-
}
|
124
|
-
|
125
|
-
|
126
|
-
class ECLLexer(RegexLexer):
|
127
|
-
"""
|
128
|
-
Lexer for the declarative big-data `ECL
|
129
|
-
<http://hpccsystems.com/community/docs/ecl-language-reference/html>`_
|
130
|
-
language.
|
131
|
-
|
132
|
-
.. versionadded:: 1.5
|
133
|
-
"""
|
134
|
-
|
135
|
-
name = 'ECL'
|
136
|
-
aliases = ['ecl']
|
137
|
-
filenames = ['*.ecl']
|
138
|
-
mimetypes = ['application/x-ecl']
|
139
|
-
|
140
|
-
flags = re.IGNORECASE | re.MULTILINE
|
141
|
-
|
142
|
-
tokens = {
|
143
|
-
'root': [
|
144
|
-
include('whitespace'),
|
145
|
-
include('statements'),
|
146
|
-
],
|
147
|
-
'whitespace': [
|
148
|
-
(r'\s+', Text),
|
149
|
-
(r'\/\/.*', Comment.Single),
|
150
|
-
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
|
151
|
-
],
|
152
|
-
'statements': [
|
153
|
-
include('types'),
|
154
|
-
include('keywords'),
|
155
|
-
include('functions'),
|
156
|
-
include('hash'),
|
157
|
-
(r'"', String, 'string'),
|
158
|
-
(r'\'', String, 'string'),
|
159
|
-
(r'(\d+\.\d*|\.\d+|\d+)e[+-]?\d+[lu]*', Number.Float),
|
160
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
161
|
-
(r'0x[0-9a-f]+[lu]*', Number.Hex),
|
162
|
-
(r'0[0-7]+[lu]*', Number.Oct),
|
163
|
-
(r'\d+[LlUu]*', Number.Integer),
|
164
|
-
(r'\*/', Error),
|
165
|
-
(r'[~!%^&*+=|?:<>/-]+', Operator),
|
166
|
-
(r'[{}()\[\],.;]', Punctuation),
|
167
|
-
(r'[a-z_]\w*', Name),
|
168
|
-
],
|
169
|
-
'hash': [
|
170
|
-
(r'^#.*$', Comment.Preproc),
|
171
|
-
],
|
172
|
-
'types': [
|
173
|
-
(r'(RECORD|END)\D', Keyword.Declaration),
|
174
|
-
(r'((?:ASCII|BIG_ENDIAN|BOOLEAN|DATA|DECIMAL|EBCDIC|INTEGER|PATTERN|'
|
175
|
-
r'QSTRING|REAL|RECORD|RULE|SET OF|STRING|TOKEN|UDECIMAL|UNICODE|'
|
176
|
-
r'UNSIGNED|VARSTRING|VARUNICODE)\d*)(\s+)',
|
177
|
-
bygroups(Keyword.Type, Text)),
|
178
|
-
],
|
179
|
-
'keywords': [
|
180
|
-
(r'(APPLY|ASSERT|BUILD|BUILDINDEX|EVALUATE|FAIL|KEYDIFF|KEYPATCH|'
|
181
|
-
r'LOADXML|NOTHOR|NOTIFY|OUTPUT|PARALLEL|SEQUENTIAL|SOAPCALL|WAIT'
|
182
|
-
r'CHECKPOINT|DEPRECATED|FAILCODE|FAILMESSAGE|FAILURE|GLOBAL|'
|
183
|
-
r'INDEPENDENT|ONWARNING|PERSIST|PRIORITY|RECOVERY|STORED|SUCCESS|'
|
184
|
-
r'WAIT|WHEN)\b', Keyword.Reserved),
|
185
|
-
# These are classed differently, check later
|
186
|
-
(r'(ALL|AND|ANY|AS|ATMOST|BEFORE|BEGINC\+\+|BEST|BETWEEN|CASE|CONST|'
|
187
|
-
r'COUNTER|CSV|DESCEND|ENCRYPT|ENDC\+\+|ENDMACRO|EXCEPT|EXCLUSIVE|'
|
188
|
-
r'EXPIRE|EXPORT|EXTEND|FALSE|FEW|FIRST|FLAT|FULL|FUNCTION|GROUP|'
|
189
|
-
r'HEADER|HEADING|HOLE|IFBLOCK|IMPORT|IN|JOINED|KEEP|KEYED|LAST|'
|
190
|
-
r'LEFT|LIMIT|LOAD|LOCAL|LOCALE|LOOKUP|MACRO|MANY|MAXCOUNT|'
|
191
|
-
r'MAXLENGTH|MIN SKEW|MODULE|INTERFACE|NAMED|NOCASE|NOROOT|NOSCAN|'
|
192
|
-
r'NOSORT|NOT|OF|ONLY|OPT|OR|OUTER|OVERWRITE|PACKED|PARTITION|'
|
193
|
-
r'PENALTY|PHYSICALLENGTH|PIPE|QUOTE|RELATIONSHIP|REPEAT|RETURN|'
|
194
|
-
r'RIGHT|SCAN|SELF|SEPARATOR|SERVICE|SHARED|SKEW|SKIP|SQL|STORE|'
|
195
|
-
r'TERMINATOR|THOR|THRESHOLD|TOKEN|TRANSFORM|TRIM|TRUE|TYPE|'
|
196
|
-
r'UNICODEORDER|UNSORTED|VALIDATE|VIRTUAL|WHOLE|WILD|WITHIN|XML|'
|
197
|
-
r'XPATH|__COMPRESSED__)\b', Keyword.Reserved),
|
198
|
-
],
|
199
|
-
'functions': [
|
200
|
-
(r'(ABS|ACOS|ALLNODES|ASCII|ASIN|ASSTRING|ATAN|ATAN2|AVE|CASE|'
|
201
|
-
r'CHOOSE|CHOOSEN|CHOOSESETS|CLUSTERSIZE|COMBINE|CORRELATION|COS|'
|
202
|
-
r'COSH|COUNT|COVARIANCE|CRON|DATASET|DEDUP|DEFINE|DENORMALIZE|'
|
203
|
-
r'DISTRIBUTE|DISTRIBUTED|DISTRIBUTION|EBCDIC|ENTH|ERROR|EVALUATE|'
|
204
|
-
r'EVENT|EVENTEXTRA|EVENTNAME|EXISTS|EXP|FAILCODE|FAILMESSAGE|'
|
205
|
-
r'FETCH|FROMUNICODE|GETISVALID|GLOBAL|GRAPH|GROUP|HASH|HASH32|'
|
206
|
-
r'HASH64|HASHCRC|HASHMD5|HAVING|IF|INDEX|INTFORMAT|ISVALID|'
|
207
|
-
r'ITERATE|JOIN|KEYUNICODE|LENGTH|LIBRARY|LIMIT|LN|LOCAL|LOG|LOOP|'
|
208
|
-
r'MAP|MATCHED|MATCHLENGTH|MATCHPOSITION|MATCHTEXT|MATCHUNICODE|'
|
209
|
-
r'MAX|MERGE|MERGEJOIN|MIN|NOLOCAL|NONEMPTY|NORMALIZE|PARSE|PIPE|'
|
210
|
-
r'POWER|PRELOAD|PROCESS|PROJECT|PULL|RANDOM|RANGE|RANK|RANKED|'
|
211
|
-
r'REALFORMAT|RECORDOF|REGEXFIND|REGEXREPLACE|REGROUP|REJECTED|'
|
212
|
-
r'ROLLUP|ROUND|ROUNDUP|ROW|ROWDIFF|SAMPLE|SET|SIN|SINH|SIZEOF|'
|
213
|
-
r'SOAPCALL|SORT|SORTED|SQRT|STEPPED|STORED|SUM|TABLE|TAN|TANH|'
|
214
|
-
r'THISNODE|TOPN|TOUNICODE|TRANSFER|TRIM|TRUNCATE|TYPEOF|UNGROUP|'
|
215
|
-
r'UNICODEORDER|VARIANCE|WHICH|WORKUNIT|XMLDECODE|XMLENCODE|'
|
216
|
-
r'XMLTEXT|XMLUNICODE)\b', Name.Function),
|
217
|
-
],
|
218
|
-
'string': [
|
219
|
-
(r'"', String, '#pop'),
|
220
|
-
(r'\'', String, '#pop'),
|
221
|
-
(r'[^"\']+', String),
|
222
|
-
],
|
223
|
-
}
|
224
|
-
|
225
|
-
|
226
|
-
class BrainfuckLexer(RegexLexer):
|
227
|
-
"""
|
228
|
-
Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_
|
229
|
-
language.
|
230
|
-
"""
|
231
|
-
|
232
|
-
name = 'Brainfuck'
|
233
|
-
aliases = ['brainfuck', 'bf']
|
234
|
-
filenames = ['*.bf', '*.b']
|
235
|
-
mimetypes = ['application/x-brainfuck']
|
236
|
-
|
237
|
-
tokens = {
|
238
|
-
'common': [
|
239
|
-
# use different colors for different instruction types
|
240
|
-
(r'[.,]+', Name.Tag),
|
241
|
-
(r'[+-]+', Name.Builtin),
|
242
|
-
(r'[<>]+', Name.Variable),
|
243
|
-
(r'[^.,+\-<>\[\]]+', Comment),
|
244
|
-
],
|
245
|
-
'root': [
|
246
|
-
(r'\[', Keyword, 'loop'),
|
247
|
-
(r'\]', Error),
|
248
|
-
include('common'),
|
249
|
-
],
|
250
|
-
'loop': [
|
251
|
-
(r'\[', Keyword, '#push'),
|
252
|
-
(r'\]', Keyword, '#pop'),
|
253
|
-
include('common'),
|
254
|
-
]
|
255
|
-
}
|
256
|
-
|
257
|
-
|
258
|
-
class BefungeLexer(RegexLexer):
|
259
|
-
"""
|
260
|
-
Lexer for the esoteric `Befunge <http://en.wikipedia.org/wiki/Befunge>`_
|
261
|
-
language.
|
262
|
-
|
263
|
-
.. versionadded:: 0.7
|
264
|
-
"""
|
265
|
-
name = 'Befunge'
|
266
|
-
aliases = ['befunge']
|
267
|
-
filenames = ['*.befunge']
|
268
|
-
mimetypes = ['application/x-befunge']
|
269
|
-
|
270
|
-
tokens = {
|
271
|
-
'root': [
|
272
|
-
(r'[0-9a-f]', Number),
|
273
|
-
(r'[\+\*/%!`-]', Operator), # Traditional math
|
274
|
-
(r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives
|
275
|
-
(r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives
|
276
|
-
(r'[|_mw]', Keyword),
|
277
|
-
(r'[{}]', Name.Tag), # Befunge-98 stack ops
|
278
|
-
(r'".*?"', String.Double), # Strings don't appear to allow escapes
|
279
|
-
(r'\'.', String.Single), # Single character
|
280
|
-
(r'[#;]', Comment), # Trampoline... depends on direction hit
|
281
|
-
(r'[pg&~=@iotsy]', Keyword), # Misc
|
282
|
-
(r'[()A-Z]', Comment), # Fingerprints
|
283
|
-
(r'\s+', Text), # Whitespace doesn't matter
|
284
|
-
],
|
285
|
-
}
|
286
|
-
|
287
|
-
|
288
|
-
class RedcodeLexer(RegexLexer):
|
289
|
-
"""
|
290
|
-
A simple Redcode lexer based on ICWS'94.
|
291
|
-
Contributed by Adam Blinkinsop <blinks@acm.org>.
|
292
|
-
|
293
|
-
.. versionadded:: 0.8
|
294
|
-
"""
|
295
|
-
name = 'Redcode'
|
296
|
-
aliases = ['redcode']
|
297
|
-
filenames = ['*.cw']
|
298
|
-
|
299
|
-
opcodes = ['DAT','MOV','ADD','SUB','MUL','DIV','MOD',
|
300
|
-
'JMP','JMZ','JMN','DJN','CMP','SLT','SPL',
|
301
|
-
'ORG','EQU','END']
|
302
|
-
modifiers = ['A','B','AB','BA','F','X','I']
|
303
|
-
|
304
|
-
tokens = {
|
305
|
-
'root': [
|
306
|
-
# Whitespace:
|
307
|
-
(r'\s+', Text),
|
308
|
-
(r';.*$', Comment.Single),
|
309
|
-
# Lexemes:
|
310
|
-
# Identifiers
|
311
|
-
(r'\b(%s)\b' % '|'.join(opcodes), Name.Function),
|
312
|
-
(r'\b(%s)\b' % '|'.join(modifiers), Name.Decorator),
|
313
|
-
(r'[A-Za-z_][A-Za-z_0-9]+', Name),
|
314
|
-
# Operators
|
315
|
-
(r'[-+*/%]', Operator),
|
316
|
-
(r'[#$@<>]', Operator), # mode
|
317
|
-
(r'[.,]', Punctuation), # mode
|
318
|
-
# Numbers
|
319
|
-
(r'[-+]?\d+', Number.Integer),
|
320
|
-
],
|
321
|
-
}
|
322
|
-
|
323
|
-
|
324
|
-
class MOOCodeLexer(RegexLexer):
|
325
|
-
"""
|
326
|
-
For `MOOCode <http://www.moo.mud.org/>`_ (the MOO scripting
|
327
|
-
language).
|
328
|
-
|
329
|
-
.. versionadded:: 0.9
|
330
|
-
"""
|
331
|
-
name = 'MOOCode'
|
332
|
-
filenames = ['*.moo']
|
333
|
-
aliases = ['moocode', 'moo']
|
334
|
-
mimetypes = ['text/x-moocode']
|
335
|
-
|
336
|
-
tokens = {
|
337
|
-
'root' : [
|
338
|
-
# Numbers
|
339
|
-
(r'(0|[1-9][0-9_]*)', Number.Integer),
|
340
|
-
# Strings
|
341
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
342
|
-
# exceptions
|
343
|
-
(r'(E_PERM|E_DIV)', Name.Exception),
|
344
|
-
# db-refs
|
345
|
-
(r'((#[-0-9]+)|(\$[a-z_A-Z0-9]+))', Name.Entity),
|
346
|
-
# Keywords
|
347
|
-
(r'\b(if|else|elseif|endif|for|endfor|fork|endfork|while'
|
348
|
-
r'|endwhile|break|continue|return|try'
|
349
|
-
r'|except|endtry|finally|in)\b', Keyword),
|
350
|
-
# builtins
|
351
|
-
(r'(random|length)', Name.Builtin),
|
352
|
-
# special variables
|
353
|
-
(r'(player|caller|this|args)', Name.Variable.Instance),
|
354
|
-
# skip whitespace
|
355
|
-
(r'\s+', Text),
|
356
|
-
(r'\n', Text),
|
357
|
-
# other operators
|
358
|
-
(r'([!;=,{}&\|:\.\[\]@\(\)\<\>\?]+)', Operator),
|
359
|
-
# function call
|
360
|
-
(r'([a-z_A-Z0-9]+)(\()', bygroups(Name.Function, Operator)),
|
361
|
-
# variables
|
362
|
-
(r'([a-zA-Z_0-9]+)', Text),
|
363
|
-
]
|
364
|
-
}
|
365
|
-
|
366
|
-
|
367
|
-
class SmalltalkLexer(RegexLexer):
|
368
|
-
"""
|
369
|
-
For `Smalltalk <http://www.smalltalk.org/>`_ syntax.
|
370
|
-
Contributed by Stefan Matthias Aust.
|
371
|
-
Rewritten by Nils Winter.
|
372
|
-
|
373
|
-
.. versionadded:: 0.10
|
374
|
-
"""
|
375
|
-
name = 'Smalltalk'
|
376
|
-
filenames = ['*.st']
|
377
|
-
aliases = ['smalltalk', 'squeak', 'st']
|
378
|
-
mimetypes = ['text/x-smalltalk']
|
379
|
-
|
380
|
-
tokens = {
|
381
|
-
'root' : [
|
382
|
-
(r'(<)(\w+:)(.*?)(>)', bygroups(Text, Keyword, Text, Text)),
|
383
|
-
include('squeak fileout'),
|
384
|
-
include('whitespaces'),
|
385
|
-
include('method definition'),
|
386
|
-
(r'(\|)([\w\s]*)(\|)', bygroups(Operator, Name.Variable, Operator)),
|
387
|
-
include('objects'),
|
388
|
-
(r'\^|\:=|\_', Operator),
|
389
|
-
# temporaries
|
390
|
-
(r'[\]({}.;!]', Text),
|
391
|
-
],
|
392
|
-
'method definition' : [
|
393
|
-
# Not perfect can't allow whitespaces at the beginning and the
|
394
|
-
# without breaking everything
|
395
|
-
(r'([a-zA-Z]+\w*:)(\s*)(\w+)',
|
396
|
-
bygroups(Name.Function, Text, Name.Variable)),
|
397
|
-
(r'^(\b[a-zA-Z]+\w*\b)(\s*)$', bygroups(Name.Function, Text)),
|
398
|
-
(r'^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$',
|
399
|
-
bygroups(Name.Function, Text, Name.Variable, Text)),
|
400
|
-
],
|
401
|
-
'blockvariables' : [
|
402
|
-
include('whitespaces'),
|
403
|
-
(r'(:)(\s*)(\w+)',
|
404
|
-
bygroups(Operator, Text, Name.Variable)),
|
405
|
-
(r'\|', Operator, '#pop'),
|
406
|
-
default('#pop'), # else pop
|
407
|
-
],
|
408
|
-
'literals' : [
|
409
|
-
(r"'(''|[^'])*'", String, 'afterobject'),
|
410
|
-
(r'\$.', String.Char, 'afterobject'),
|
411
|
-
(r'#\(', String.Symbol, 'parenth'),
|
412
|
-
(r'\)', Text, 'afterobject'),
|
413
|
-
(r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number, 'afterobject'),
|
414
|
-
],
|
415
|
-
'_parenth_helper' : [
|
416
|
-
include('whitespaces'),
|
417
|
-
(r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
|
418
|
-
(r'[-+*/\\~<>=|&#!?,@%\w:]+', String.Symbol),
|
419
|
-
# literals
|
420
|
-
(r"'(''|[^'])*'", String),
|
421
|
-
(r'\$.', String.Char),
|
422
|
-
(r'#*\(', String.Symbol, 'inner_parenth'),
|
423
|
-
],
|
424
|
-
'parenth' : [
|
425
|
-
# This state is a bit tricky since
|
426
|
-
# we can't just pop this state
|
427
|
-
(r'\)', String.Symbol, ('root', 'afterobject')),
|
428
|
-
include('_parenth_helper'),
|
429
|
-
],
|
430
|
-
'inner_parenth': [
|
431
|
-
(r'\)', String.Symbol, '#pop'),
|
432
|
-
include('_parenth_helper'),
|
433
|
-
],
|
434
|
-
'whitespaces' : [
|
435
|
-
# skip whitespace and comments
|
436
|
-
(r'\s+', Text),
|
437
|
-
(r'"(""|[^"])*"', Comment),
|
438
|
-
],
|
439
|
-
'objects' : [
|
440
|
-
(r'\[', Text, 'blockvariables'),
|
441
|
-
(r'\]', Text, 'afterobject'),
|
442
|
-
(r'\b(self|super|true|false|nil|thisContext)\b',
|
443
|
-
Name.Builtin.Pseudo, 'afterobject'),
|
444
|
-
(r'\b[A-Z]\w*(?!:)\b', Name.Class, 'afterobject'),
|
445
|
-
(r'\b[a-z]\w*(?!:)\b', Name.Variable, 'afterobject'),
|
446
|
-
(r'#("(""|[^"])*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)',
|
447
|
-
String.Symbol, 'afterobject'),
|
448
|
-
include('literals'),
|
449
|
-
],
|
450
|
-
'afterobject' : [
|
451
|
-
(r'! !$', Keyword , '#pop'), # squeak chunk delimiter
|
452
|
-
include('whitespaces'),
|
453
|
-
(r'\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)',
|
454
|
-
Name.Builtin, '#pop'),
|
455
|
-
(r'\b(new\b(?!:))', Name.Builtin),
|
456
|
-
(r'\:=|\_', Operator, '#pop'),
|
457
|
-
(r'\b[a-zA-Z]+\w*:', Name.Function, '#pop'),
|
458
|
-
(r'\b[a-zA-Z]+\w*', Name.Function),
|
459
|
-
(r'\w+:?|[-+*/\\~<>=|&!?,@%]+', Name.Function, '#pop'),
|
460
|
-
(r'\.', Punctuation, '#pop'),
|
461
|
-
(r';', Punctuation),
|
462
|
-
(r'[\])}]', Text),
|
463
|
-
(r'[\[({]', Text, '#pop'),
|
464
|
-
],
|
465
|
-
'squeak fileout' : [
|
466
|
-
# Squeak fileout format (optional)
|
467
|
-
(r'^"(""|[^"])*"!', Keyword),
|
468
|
-
(r"^'(''|[^'])*'!", Keyword),
|
469
|
-
(r'^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)',
|
470
|
-
bygroups(Keyword, Name.Class, Keyword, String, Keyword, Text, Keyword)),
|
471
|
-
(r"^(!)(\w+(?: class)?)( methodsFor: )('(?:''|[^'])*')(.*?!)",
|
472
|
-
bygroups(Keyword, Name.Class, Keyword, String, Keyword)),
|
473
|
-
(r'^(\w+)( subclass: )(#\w+)'
|
474
|
-
r'(\s+instanceVariableNames: )(.*?)'
|
475
|
-
r'(\s+classVariableNames: )(.*?)'
|
476
|
-
r'(\s+poolDictionaries: )(.*?)'
|
477
|
-
r'(\s+category: )(.*?)(!)',
|
478
|
-
bygroups(Name.Class, Keyword, String.Symbol, Keyword, String, Keyword,
|
479
|
-
String, Keyword, String, Keyword, String, Keyword)),
|
480
|
-
(r'^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)',
|
481
|
-
bygroups(Name.Class, Keyword, String, Keyword)),
|
482
|
-
(r'(!\n)(\].*)(! !)$', bygroups(Keyword, Text, Keyword)),
|
483
|
-
(r'! !$', Keyword),
|
484
|
-
],
|
485
|
-
}
|
486
|
-
|
487
|
-
|
488
|
-
class LogtalkLexer(RegexLexer):
|
489
|
-
"""
|
490
|
-
For `Logtalk <http://logtalk.org/>`_ source code.
|
491
|
-
|
492
|
-
.. versionadded:: 0.10
|
493
|
-
"""
|
494
|
-
|
495
|
-
name = 'Logtalk'
|
496
|
-
aliases = ['logtalk']
|
497
|
-
filenames = ['*.lgt']
|
498
|
-
mimetypes = ['text/x-logtalk']
|
499
|
-
|
500
|
-
tokens = {
|
501
|
-
'root': [
|
502
|
-
# Directives
|
503
|
-
(r'^\s*:-\s',Punctuation,'directive'),
|
504
|
-
# Comments
|
505
|
-
(r'%.*?\n', Comment),
|
506
|
-
(r'/\*(.|\n)*?\*/',Comment),
|
507
|
-
# Whitespace
|
508
|
-
(r'\n', Text),
|
509
|
-
(r'\s+', Text),
|
510
|
-
# Numbers
|
511
|
-
(r"0'.", Number),
|
512
|
-
(r'0b[01]+', Number.Bin),
|
513
|
-
(r'0o[0-7]+', Number.Oct),
|
514
|
-
(r'0x[0-9a-fA-F]+', Number.Hex),
|
515
|
-
(r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number.Float),
|
516
|
-
# Variables
|
517
|
-
(r'([A-Z_]\w*)', Name.Variable),
|
518
|
-
# Event handlers
|
519
|
-
(r'(after|before)(?=[(])', Keyword),
|
520
|
-
# Execution-context methods
|
521
|
-
(r'(parameter|this|se(lf|nder))(?=[(])', Keyword),
|
522
|
-
# Reflection
|
523
|
-
(r'(current_predicate|predicate_property)(?=[(])', Keyword),
|
524
|
-
# DCGs and term expansion
|
525
|
-
(r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])',
|
526
|
-
Keyword),
|
527
|
-
# Entity
|
528
|
-
(r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])',
|
529
|
-
Keyword),
|
530
|
-
(r'(object|protocol|category)_property(?=[(])', Keyword),
|
531
|
-
# Entity relations
|
532
|
-
(r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword),
|
533
|
-
(r'extends_(object|protocol|category)(?=[(])', Keyword),
|
534
|
-
(r'imp(lements_protocol|orts_category)(?=[(])', Keyword),
|
535
|
-
(r'(instantiat|specializ)es_class(?=[(])', Keyword),
|
536
|
-
# Events
|
537
|
-
(r'(current_event|(abolish|define)_events)(?=[(])', Keyword),
|
538
|
-
# Flags
|
539
|
-
(r'(current|set)_logtalk_flag(?=[(])', Keyword),
|
540
|
-
# Compiling, loading, and library paths
|
541
|
-
(r'logtalk_(compile|l(ibrary_path|oad_context|oad))(?=[(])',
|
542
|
-
Keyword),
|
543
|
-
# Database
|
544
|
-
(r'(clause|retract(all)?)(?=[(])', Keyword),
|
545
|
-
(r'a(bolish|ssert(a|z))(?=[(])', Keyword),
|
546
|
-
# Control constructs
|
547
|
-
(r'(ca(ll|tch)|throw)(?=[(])', Keyword),
|
548
|
-
(r'(fail|true)\b', Keyword),
|
549
|
-
# All solutions
|
550
|
-
(r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
|
551
|
-
# Multi-threading meta-predicates
|
552
|
-
(r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])',
|
553
|
-
Keyword),
|
554
|
-
# Term unification
|
555
|
-
(r'unify_with_occurs_check(?=[(])', Keyword),
|
556
|
-
# Term creation and decomposition
|
557
|
-
(r'(functor|arg|copy_term|numbervars)(?=[(])', Keyword),
|
558
|
-
# Evaluable functors
|
559
|
-
(r'(rem|mod|abs|sign)(?=[(])', Keyword),
|
560
|
-
(r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
|
561
|
-
(r'(floor|truncate|round|ceiling)(?=[(])', Keyword),
|
562
|
-
# Other arithmetic functors
|
563
|
-
(r'(cos|atan|exp|log|s(in|qrt))(?=[(])', Keyword),
|
564
|
-
# Term testing
|
565
|
-
(r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|'
|
566
|
-
r'ground)(?=[(])', Keyword),
|
567
|
-
# Term comparison
|
568
|
-
(r'compare(?=[(])', Keyword),
|
569
|
-
# Stream selection and control
|
570
|
-
(r'(curren|se)t_(in|out)put(?=[(])', Keyword),
|
571
|
-
(r'(open|close)(?=[(])', Keyword),
|
572
|
-
(r'flush_output(?=[(])', Keyword),
|
573
|
-
(r'(at_end_of_stream|flush_output)\b', Keyword),
|
574
|
-
(r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])',
|
575
|
-
Keyword),
|
576
|
-
# Character and byte input/output
|
577
|
-
(r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword),
|
578
|
-
(r'\bnl\b', Keyword),
|
579
|
-
# Term input/output
|
580
|
-
(r'read(_term)?(?=[(])', Keyword),
|
581
|
-
(r'write(q|_(canonical|term))?(?=[(])', Keyword),
|
582
|
-
(r'(current_)?op(?=[(])', Keyword),
|
583
|
-
(r'(current_)?char_conversion(?=[(])', Keyword),
|
584
|
-
# Atomic term processing
|
585
|
-
(r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword),
|
586
|
-
(r'(char_code|sub_atom)(?=[(])', Keyword),
|
587
|
-
(r'number_c(har|ode)s(?=[(])', Keyword),
|
588
|
-
# Implementation defined hooks functions
|
589
|
-
(r'(se|curren)t_prolog_flag(?=[(])', Keyword),
|
590
|
-
(r'\bhalt\b', Keyword),
|
591
|
-
(r'halt(?=[(])', Keyword),
|
592
|
-
# Message sending operators
|
593
|
-
(r'(::|:|\^\^)', Operator),
|
594
|
-
# External call
|
595
|
-
(r'[{}]', Keyword),
|
596
|
-
# Logic and control
|
597
|
-
(r'\b(ignore|once)(?=[(])', Keyword),
|
598
|
-
(r'\brepeat\b', Keyword),
|
599
|
-
# Sorting
|
600
|
-
(r'(key)?sort(?=[(])', Keyword),
|
601
|
-
# Bitwise functors
|
602
|
-
(r'(>>|<<|/\\|\\\\|\\)', Operator),
|
603
|
-
# Arithemtic evaluation
|
604
|
-
(r'\bis\b', Keyword),
|
605
|
-
# Arithemtic comparison
|
606
|
-
(r'(=:=|=\\=|<|=<|>=|>)', Operator),
|
607
|
-
# Term creation and decomposition
|
608
|
-
(r'=\.\.', Operator),
|
609
|
-
# Term unification
|
610
|
-
(r'(=|\\=)', Operator),
|
611
|
-
# Term comparison
|
612
|
-
(r'(==|\\==|@=<|@<|@>=|@>)', Operator),
|
613
|
-
# Evaluable functors
|
614
|
-
(r'(//|[-+*/])', Operator),
|
615
|
-
(r'\b(e|pi|mod|rem)\b', Operator),
|
616
|
-
# Other arithemtic functors
|
617
|
-
(r'\b\*\*\b', Operator),
|
618
|
-
# DCG rules
|
619
|
-
(r'-->', Operator),
|
620
|
-
# Control constructs
|
621
|
-
(r'([!;]|->)', Operator),
|
622
|
-
# Logic and control
|
623
|
-
(r'\\+', Operator),
|
624
|
-
# Mode operators
|
625
|
-
(r'[?@]', Operator),
|
626
|
-
# Existential quantifier
|
627
|
-
(r'\^', Operator),
|
628
|
-
# Strings
|
629
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
630
|
-
# Ponctuation
|
631
|
-
(r'[()\[\],.|]', Text),
|
632
|
-
# Atoms
|
633
|
-
(r"[a-z]\w*", Text),
|
634
|
-
(r"'", String, 'quoted_atom'),
|
635
|
-
],
|
636
|
-
|
637
|
-
'quoted_atom': [
|
638
|
-
(r"''", String),
|
639
|
-
(r"'", String, '#pop'),
|
640
|
-
(r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
|
641
|
-
(r"[^\\'\n]+", String),
|
642
|
-
(r'\\', String),
|
643
|
-
],
|
644
|
-
|
645
|
-
'directive': [
|
646
|
-
# Conditional compilation directives
|
647
|
-
(r'(el)?if(?=[(])', Keyword, 'root'),
|
648
|
-
(r'(e(lse|ndif))[.]', Keyword, 'root'),
|
649
|
-
# Entity directives
|
650
|
-
(r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
|
651
|
-
(r'(end_(category|object|protocol))[.]',Keyword, 'root'),
|
652
|
-
# Predicate scope directives
|
653
|
-
(r'(public|protected|private)(?=[(])', Keyword, 'root'),
|
654
|
-
# Other directives
|
655
|
-
(r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
|
656
|
-
(r'in(fo|itialization)(?=[(])', Keyword, 'root'),
|
657
|
-
(r'(dynamic|synchronized|threaded)[.]', Keyword, 'root'),
|
658
|
-
(r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|'
|
659
|
-
r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])',
|
660
|
-
Keyword, 'root'),
|
661
|
-
(r'op(?=[(])', Keyword, 'root'),
|
662
|
-
(r'(c(alls|oinductive)|reexport|use(s|_module))(?=[(])',
|
663
|
-
Keyword, 'root'),
|
664
|
-
(r'[a-z]\w*(?=[(])', Text, 'root'),
|
665
|
-
(r'[a-z]\w*[.]', Text, 'root'),
|
666
|
-
],
|
667
|
-
|
668
|
-
'entityrelations': [
|
669
|
-
(r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)'
|
670
|
-
r'(?=[(])', Keyword),
|
671
|
-
# Numbers
|
672
|
-
(r"0'.", Number),
|
673
|
-
(r'0b[01]+', Number.Bin),
|
674
|
-
(r'0o[0-7]+', Number.Oct),
|
675
|
-
(r'0x[0-9a-fA-F]+', Number.Hex),
|
676
|
-
(r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number.Float),
|
677
|
-
# Variables
|
678
|
-
(r'([A-Z_]\w*)', Name.Variable),
|
679
|
-
# Atoms
|
680
|
-
(r"[a-z]\w*", Text),
|
681
|
-
(r"'", String, 'quoted_atom'),
|
682
|
-
# Strings
|
683
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
684
|
-
# End of entity-opening directive
|
685
|
-
(r'([)]\.)', Text, 'root'),
|
686
|
-
# Scope operator
|
687
|
-
(r'(::)', Operator),
|
688
|
-
# Ponctuation
|
689
|
-
(r'[()\[\],.|]', Text),
|
690
|
-
# Comments
|
691
|
-
(r'%.*?\n', Comment),
|
692
|
-
(r'/\*(.|\n)*?\*/',Comment),
|
693
|
-
# Whitespace
|
694
|
-
(r'\n', Text),
|
695
|
-
(r'\s+', Text),
|
696
|
-
]
|
697
|
-
}
|
698
|
-
|
699
|
-
def analyse_text(text):
|
700
|
-
if ':- object(' in text:
|
701
|
-
return True
|
702
|
-
if ':- protocol(' in text:
|
703
|
-
return True
|
704
|
-
if ':- category(' in text:
|
705
|
-
return True
|
706
|
-
return False
|
707
|
-
|
708
|
-
|
709
|
-
def _shortened(word):
|
710
|
-
dpos = word.find('$')
|
711
|
-
return '|'.join([word[:dpos] + word[dpos+1:i] + r'\b'
|
712
|
-
for i in range(len(word), dpos, -1)])
|
713
|
-
def _shortened_many(*words):
|
714
|
-
return '|'.join(map(_shortened, words))
|
715
|
-
|
716
|
-
class GnuplotLexer(RegexLexer):
|
717
|
-
"""
|
718
|
-
For `Gnuplot <http://gnuplot.info/>`_ plotting scripts.
|
719
|
-
|
720
|
-
.. versionadded:: 0.11
|
721
|
-
"""
|
722
|
-
|
723
|
-
name = 'Gnuplot'
|
724
|
-
aliases = ['gnuplot']
|
725
|
-
filenames = ['*.plot', '*.plt']
|
726
|
-
mimetypes = ['text/x-gnuplot']
|
727
|
-
|
728
|
-
tokens = {
|
729
|
-
'root': [
|
730
|
-
include('whitespace'),
|
731
|
-
(_shortened('bi$nd'), Keyword, 'bind'),
|
732
|
-
(_shortened_many('ex$it', 'q$uit'), Keyword, 'quit'),
|
733
|
-
(_shortened('f$it'), Keyword, 'fit'),
|
734
|
-
(r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation), 'if'),
|
735
|
-
(r'else\b', Keyword),
|
736
|
-
(_shortened('pa$use'), Keyword, 'pause'),
|
737
|
-
(_shortened_many('p$lot', 'rep$lot', 'sp$lot'), Keyword, 'plot'),
|
738
|
-
(_shortened('sa$ve'), Keyword, 'save'),
|
739
|
-
(_shortened('se$t'), Keyword, ('genericargs', 'optionarg')),
|
740
|
-
(_shortened_many('sh$ow', 'uns$et'),
|
741
|
-
Keyword, ('noargs', 'optionarg')),
|
742
|
-
(_shortened_many('low$er', 'ra$ise', 'ca$ll', 'cd$', 'cl$ear',
|
743
|
-
'h$elp', '\\?$', 'hi$story', 'l$oad', 'pr$int',
|
744
|
-
'pwd$', 're$read', 'res$et', 'scr$eendump',
|
745
|
-
'she$ll', 'sy$stem', 'up$date'),
|
746
|
-
Keyword, 'genericargs'),
|
747
|
-
(_shortened_many('pwd$', 're$read', 'res$et', 'scr$eendump',
|
748
|
-
'she$ll', 'test$'),
|
749
|
-
Keyword, 'noargs'),
|
750
|
-
('([a-zA-Z_]\w*)(\s*)(=)',
|
751
|
-
bygroups(Name.Variable, Text, Operator), 'genericargs'),
|
752
|
-
('([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)',
|
753
|
-
bygroups(Name.Function, Text, Operator), 'genericargs'),
|
754
|
-
(r'@[a-zA-Z_]\w*', Name.Constant), # macros
|
755
|
-
(r';', Keyword),
|
756
|
-
],
|
757
|
-
'comment': [
|
758
|
-
(r'[^\\\n]', Comment),
|
759
|
-
(r'\\\n', Comment),
|
760
|
-
(r'\\', Comment),
|
761
|
-
# don't add the newline to the Comment token
|
762
|
-
('', Comment, '#pop'),
|
763
|
-
],
|
764
|
-
'whitespace': [
|
765
|
-
('#', Comment, 'comment'),
|
766
|
-
(r'[ \t\v\f]+', Text),
|
767
|
-
],
|
768
|
-
'noargs': [
|
769
|
-
include('whitespace'),
|
770
|
-
# semicolon and newline end the argument list
|
771
|
-
(r';', Punctuation, '#pop'),
|
772
|
-
(r'\n', Text, '#pop'),
|
773
|
-
],
|
774
|
-
'dqstring': [
|
775
|
-
(r'"', String, '#pop'),
|
776
|
-
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
777
|
-
(r'[^\\"\n]+', String), # all other characters
|
778
|
-
(r'\\\n', String), # line continuation
|
779
|
-
(r'\\', String), # stray backslash
|
780
|
-
(r'\n', String, '#pop'), # newline ends the string too
|
781
|
-
],
|
782
|
-
'sqstring': [
|
783
|
-
(r"''", String), # escaped single quote
|
784
|
-
(r"'", String, '#pop'),
|
785
|
-
(r"[^\\'\n]+", String), # all other characters
|
786
|
-
(r'\\\n', String), # line continuation
|
787
|
-
(r'\\', String), # normal backslash
|
788
|
-
(r'\n', String, '#pop'), # newline ends the string too
|
789
|
-
],
|
790
|
-
'genericargs': [
|
791
|
-
include('noargs'),
|
792
|
-
(r'"', String, 'dqstring'),
|
793
|
-
(r"'", String, 'sqstring'),
|
794
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
|
795
|
-
(r'(\d+\.\d*|\.\d+)', Number.Float),
|
796
|
-
(r'-?\d+', Number.Integer),
|
797
|
-
('[,.~!%^&*+=|?:<>/-]', Operator),
|
798
|
-
('[{}()\[\]]', Punctuation),
|
799
|
-
(r'(eq|ne)\b', Operator.Word),
|
800
|
-
(r'([a-zA-Z_]\w*)(\s*)(\()',
|
801
|
-
bygroups(Name.Function, Text, Punctuation)),
|
802
|
-
(r'[a-zA-Z_]\w*', Name),
|
803
|
-
(r'@[a-zA-Z_]\w*', Name.Constant), # macros
|
804
|
-
(r'\\\n', Text),
|
805
|
-
],
|
806
|
-
'optionarg': [
|
807
|
-
include('whitespace'),
|
808
|
-
(_shortened_many(
|
809
|
-
"a$ll","an$gles","ar$row","au$toscale","b$ars","bor$der",
|
810
|
-
"box$width","cl$abel","c$lip","cn$trparam","co$ntour","da$ta",
|
811
|
-
"data$file","dg$rid3d","du$mmy","enc$oding","dec$imalsign",
|
812
|
-
"fit$","font$path","fo$rmat","fu$nction","fu$nctions","g$rid",
|
813
|
-
"hid$den3d","his$torysize","is$osamples","k$ey","keyt$itle",
|
814
|
-
"la$bel","li$nestyle","ls$","loa$dpath","loc$ale","log$scale",
|
815
|
-
"mac$ros","map$ping","map$ping3d","mar$gin","lmar$gin",
|
816
|
-
"rmar$gin","tmar$gin","bmar$gin","mo$use","multi$plot",
|
817
|
-
"mxt$ics","nomxt$ics","mx2t$ics","nomx2t$ics","myt$ics",
|
818
|
-
"nomyt$ics","my2t$ics","nomy2t$ics","mzt$ics","nomzt$ics",
|
819
|
-
"mcbt$ics","nomcbt$ics","of$fsets","or$igin","o$utput",
|
820
|
-
"pa$rametric","pm$3d","pal$ette","colorb$ox","p$lot",
|
821
|
-
"poi$ntsize","pol$ar","pr$int","obj$ect","sa$mples","si$ze",
|
822
|
-
"st$yle","su$rface","table$","t$erminal","termo$ptions","ti$cs",
|
823
|
-
"ticsc$ale","ticsl$evel","timef$mt","tim$estamp","tit$le",
|
824
|
-
"v$ariables","ve$rsion","vi$ew","xyp$lane","xda$ta","x2da$ta",
|
825
|
-
"yda$ta","y2da$ta","zda$ta","cbda$ta","xl$abel","x2l$abel",
|
826
|
-
"yl$abel","y2l$abel","zl$abel","cbl$abel","xti$cs","noxti$cs",
|
827
|
-
"x2ti$cs","nox2ti$cs","yti$cs","noyti$cs","y2ti$cs","noy2ti$cs",
|
828
|
-
"zti$cs","nozti$cs","cbti$cs","nocbti$cs","xdti$cs","noxdti$cs",
|
829
|
-
"x2dti$cs","nox2dti$cs","ydti$cs","noydti$cs","y2dti$cs",
|
830
|
-
"noy2dti$cs","zdti$cs","nozdti$cs","cbdti$cs","nocbdti$cs",
|
831
|
-
"xmti$cs","noxmti$cs","x2mti$cs","nox2mti$cs","ymti$cs",
|
832
|
-
"noymti$cs","y2mti$cs","noy2mti$cs","zmti$cs","nozmti$cs",
|
833
|
-
"cbmti$cs","nocbmti$cs","xr$ange","x2r$ange","yr$ange",
|
834
|
-
"y2r$ange","zr$ange","cbr$ange","rr$ange","tr$ange","ur$ange",
|
835
|
-
"vr$ange","xzeroa$xis","x2zeroa$xis","yzeroa$xis","y2zeroa$xis",
|
836
|
-
"zzeroa$xis","zeroa$xis","z$ero"), Name.Builtin, '#pop'),
|
837
|
-
],
|
838
|
-
'bind': [
|
839
|
-
('!', Keyword, '#pop'),
|
840
|
-
(_shortened('all$windows'), Name.Builtin),
|
841
|
-
include('genericargs'),
|
842
|
-
],
|
843
|
-
'quit': [
|
844
|
-
(r'gnuplot\b', Keyword),
|
845
|
-
include('noargs'),
|
846
|
-
],
|
847
|
-
'fit': [
|
848
|
-
(r'via\b', Name.Builtin),
|
849
|
-
include('plot'),
|
850
|
-
],
|
851
|
-
'if': [
|
852
|
-
(r'\)', Punctuation, '#pop'),
|
853
|
-
include('genericargs'),
|
854
|
-
],
|
855
|
-
'pause': [
|
856
|
-
(r'(mouse|any|button1|button2|button3)\b', Name.Builtin),
|
857
|
-
(_shortened('key$press'), Name.Builtin),
|
858
|
-
include('genericargs'),
|
859
|
-
],
|
860
|
-
'plot': [
|
861
|
-
(_shortened_many('ax$es', 'axi$s', 'bin$ary', 'ev$ery', 'i$ndex',
|
862
|
-
'mat$rix', 's$mooth', 'thru$', 't$itle',
|
863
|
-
'not$itle', 'u$sing', 'w$ith'),
|
864
|
-
Name.Builtin),
|
865
|
-
include('genericargs'),
|
866
|
-
],
|
867
|
-
'save': [
|
868
|
-
(_shortened_many('f$unctions', 's$et', 't$erminal', 'v$ariables'),
|
869
|
-
Name.Builtin),
|
870
|
-
include('genericargs'),
|
871
|
-
],
|
872
|
-
}
|
873
|
-
|
874
|
-
|
875
|
-
class PovrayLexer(RegexLexer):
|
876
|
-
"""
|
877
|
-
For `Persistence of Vision Raytracer <http://www.povray.org/>`_ files.
|
878
|
-
|
879
|
-
.. versionadded:: 0.11
|
880
|
-
"""
|
881
|
-
name = 'POVRay'
|
882
|
-
aliases = ['pov']
|
883
|
-
filenames = ['*.pov', '*.inc']
|
884
|
-
mimetypes = ['text/x-povray']
|
885
|
-
|
886
|
-
tokens = {
|
887
|
-
'root': [
|
888
|
-
(r'/\*[\w\W]*?\*/', Comment.Multiline),
|
889
|
-
(r'//.*\n', Comment.Single),
|
890
|
-
(r'(?s)"(?:\\.|[^"\\])+"', String.Double),
|
891
|
-
(r'#(debug|default|else|end|error|fclose|fopen|ifdef|ifndef|'
|
892
|
-
r'include|range|read|render|statistics|switch|undef|version|'
|
893
|
-
r'warning|while|write|define|macro|local|declare)\b',
|
894
|
-
Comment.Preproc),
|
895
|
-
(r'\b(aa_level|aa_threshold|abs|acos|acosh|adaptive|adc_bailout|'
|
896
|
-
r'agate|agate_turb|all|alpha|ambient|ambient_light|angle|'
|
897
|
-
r'aperture|arc_angle|area_light|asc|asin|asinh|assumed_gamma|'
|
898
|
-
r'atan|atan2|atanh|atmosphere|atmospheric_attenuation|'
|
899
|
-
r'attenuating|average|background|black_hole|blue|blur_samples|'
|
900
|
-
r'bounded_by|box_mapping|bozo|break|brick|brick_size|'
|
901
|
-
r'brightness|brilliance|bumps|bumpy1|bumpy2|bumpy3|bump_map|'
|
902
|
-
r'bump_size|case|caustics|ceil|checker|chr|clipped_by|clock|'
|
903
|
-
r'color|color_map|colour|colour_map|component|composite|concat|'
|
904
|
-
r'confidence|conic_sweep|constant|control0|control1|cos|cosh|'
|
905
|
-
r'count|crackle|crand|cube|cubic_spline|cylindrical_mapping|'
|
906
|
-
r'debug|declare|default|degrees|dents|diffuse|direction|'
|
907
|
-
r'distance|distance_maximum|div|dust|dust_type|eccentricity|'
|
908
|
-
r'else|emitting|end|error|error_bound|exp|exponent|'
|
909
|
-
r'fade_distance|fade_power|falloff|falloff_angle|false|'
|
910
|
-
r'file_exists|filter|finish|fisheye|flatness|flip|floor|'
|
911
|
-
r'focal_point|fog|fog_alt|fog_offset|fog_type|frequency|gif|'
|
912
|
-
r'global_settings|glowing|gradient|granite|gray_threshold|'
|
913
|
-
r'green|halo|hexagon|hf_gray_16|hierarchy|hollow|hypercomplex|'
|
914
|
-
r'if|ifdef|iff|image_map|incidence|include|int|interpolate|'
|
915
|
-
r'inverse|ior|irid|irid_wavelength|jitter|lambda|leopard|'
|
916
|
-
r'linear|linear_spline|linear_sweep|location|log|looks_like|'
|
917
|
-
r'look_at|low_error_factor|mandel|map_type|marble|material_map|'
|
918
|
-
r'matrix|max|max_intersections|max_iteration|max_trace_level|'
|
919
|
-
r'max_value|metallic|min|minimum_reuse|mod|mortar|'
|
920
|
-
r'nearest_count|no|normal|normal_map|no_shadow|number_of_waves|'
|
921
|
-
r'octaves|off|offset|omega|omnimax|on|once|onion|open|'
|
922
|
-
r'orthographic|panoramic|pattern1|pattern2|pattern3|'
|
923
|
-
r'perspective|pgm|phase|phong|phong_size|pi|pigment|'
|
924
|
-
r'pigment_map|planar_mapping|png|point_at|pot|pow|ppm|'
|
925
|
-
r'precision|pwr|quadratic_spline|quaternion|quick_color|'
|
926
|
-
r'quick_colour|quilted|radial|radians|radiosity|radius|rainbow|'
|
927
|
-
r'ramp_wave|rand|range|reciprocal|recursion_limit|red|'
|
928
|
-
r'reflection|refraction|render|repeat|rgb|rgbf|rgbft|rgbt|'
|
929
|
-
r'right|ripples|rotate|roughness|samples|scale|scallop_wave|'
|
930
|
-
r'scattering|seed|shadowless|sin|sine_wave|sinh|sky|sky_sphere|'
|
931
|
-
r'slice|slope_map|smooth|specular|spherical_mapping|spiral|'
|
932
|
-
r'spiral1|spiral2|spotlight|spotted|sqr|sqrt|statistics|str|'
|
933
|
-
r'strcmp|strength|strlen|strlwr|strupr|sturm|substr|switch|sys|'
|
934
|
-
r't|tan|tanh|test_camera_1|test_camera_2|test_camera_3|'
|
935
|
-
r'test_camera_4|texture|texture_map|tga|thickness|threshold|'
|
936
|
-
r'tightness|tile2|tiles|track|transform|translate|transmit|'
|
937
|
-
r'triangle_wave|true|ttf|turbulence|turb_depth|type|'
|
938
|
-
r'ultra_wide_angle|up|use_color|use_colour|use_index|u_steps|'
|
939
|
-
r'val|variance|vaxis_rotate|vcross|vdot|version|vlength|'
|
940
|
-
r'vnormalize|volume_object|volume_rendered|vol_with_light|'
|
941
|
-
r'vrotate|v_steps|warning|warp|water_level|waves|while|width|'
|
942
|
-
r'wood|wrinkles|yes)\b', Keyword),
|
943
|
-
(r'(bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|'
|
944
|
-
r'disc|height_field|intersection|julia_fractal|lathe|'
|
945
|
-
r'light_source|merge|mesh|object|plane|poly|polygon|prism|'
|
946
|
-
r'quadric|quartic|smooth_triangle|sor|sphere|superellipsoid|'
|
947
|
-
r'text|torus|triangle|union)\b', Name.Builtin),
|
948
|
-
# TODO: <=, etc
|
949
|
-
(r'[\[\](){}<>;,]', Punctuation),
|
950
|
-
(r'[-+*/=]', Operator),
|
951
|
-
(r'\b(x|y|z|u|v)\b', Name.Builtin.Pseudo),
|
952
|
-
(r'[a-zA-Z_][a-zA-Z_0-9]*', Name),
|
953
|
-
(r'[0-9]+\.[0-9]*', Number.Float),
|
954
|
-
(r'\.[0-9]+', Number.Float),
|
955
|
-
(r'[0-9]+', Number.Integer),
|
956
|
-
(r'\s+', Text),
|
957
|
-
]
|
958
|
-
}
|
959
|
-
|
960
|
-
|
961
|
-
class AppleScriptLexer(RegexLexer):
|
962
|
-
"""
|
963
|
-
For `AppleScript source code
|
964
|
-
<http://developer.apple.com/documentation/AppleScript/
|
965
|
-
Conceptual/AppleScriptLangGuide>`_,
|
966
|
-
including `AppleScript Studio
|
967
|
-
<http://developer.apple.com/documentation/AppleScript/
|
968
|
-
Reference/StudioReference>`_.
|
969
|
-
Contributed by Andreas Amann <aamann@mac.com>.
|
970
|
-
"""
|
971
|
-
|
972
|
-
name = 'AppleScript'
|
973
|
-
aliases = ['applescript']
|
974
|
-
filenames = ['*.applescript']
|
975
|
-
|
976
|
-
flags = re.MULTILINE | re.DOTALL
|
977
|
-
|
978
|
-
Identifiers = r'[a-zA-Z]\w*'
|
979
|
-
Literals = ['AppleScript', 'current application', 'false', 'linefeed',
|
980
|
-
'missing value', 'pi','quote', 'result', 'return', 'space',
|
981
|
-
'tab', 'text item delimiters', 'true', 'version']
|
982
|
-
Classes = ['alias ', 'application ', 'boolean ', 'class ', 'constant ',
|
983
|
-
'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ',
|
984
|
-
'real ', 'record ', 'reference ', 'RGB color ', 'script ',
|
985
|
-
'text ', 'unit types', '(?:Unicode )?text', 'string']
|
986
|
-
BuiltIn = ['attachment', 'attribute run', 'character', 'day', 'month',
|
987
|
-
'paragraph', 'word', 'year']
|
988
|
-
HandlerParams = ['about', 'above', 'against', 'apart from', 'around',
|
989
|
-
'aside from', 'at', 'below', 'beneath', 'beside',
|
990
|
-
'between', 'for', 'given', 'instead of', 'on', 'onto',
|
991
|
-
'out of', 'over', 'since']
|
992
|
-
Commands = ['ASCII (character|number)', 'activate', 'beep', 'choose URL',
|
993
|
-
'choose application', 'choose color', 'choose file( name)?',
|
994
|
-
'choose folder', 'choose from list',
|
995
|
-
'choose remote application', 'clipboard info',
|
996
|
-
'close( access)?', 'copy', 'count', 'current date', 'delay',
|
997
|
-
'delete', 'display (alert|dialog)', 'do shell script',
|
998
|
-
'duplicate', 'exists', 'get eof', 'get volume settings',
|
999
|
-
'info for', 'launch', 'list (disks|folder)', 'load script',
|
1000
|
-
'log', 'make', 'mount volume', 'new', 'offset',
|
1001
|
-
'open( (for access|location))?', 'path to', 'print', 'quit',
|
1002
|
-
'random number', 'read', 'round', 'run( script)?',
|
1003
|
-
'say', 'scripting components',
|
1004
|
-
'set (eof|the clipboard to|volume)', 'store script',
|
1005
|
-
'summarize', 'system attribute', 'system info',
|
1006
|
-
'the clipboard', 'time to GMT', 'write', 'quoted form']
|
1007
|
-
References = ['(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)',
|
1008
|
-
'first', 'second', 'third', 'fourth', 'fifth', 'sixth',
|
1009
|
-
'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back',
|
1010
|
-
'before', 'behind', 'every', 'front', 'index', 'last',
|
1011
|
-
'middle', 'some', 'that', 'through', 'thru', 'where', 'whose']
|
1012
|
-
Operators = ["and", "or", "is equal", "equals", "(is )?equal to", "is not",
|
1013
|
-
"isn't", "isn't equal( to)?", "is not equal( to)?",
|
1014
|
-
"doesn't equal", "does not equal", "(is )?greater than",
|
1015
|
-
"comes after", "is not less than or equal( to)?",
|
1016
|
-
"isn't less than or equal( to)?", "(is )?less than",
|
1017
|
-
"comes before", "is not greater than or equal( to)?",
|
1018
|
-
"isn't greater than or equal( to)?",
|
1019
|
-
"(is )?greater than or equal( to)?", "is not less than",
|
1020
|
-
"isn't less than", "does not come before",
|
1021
|
-
"doesn't come before", "(is )?less than or equal( to)?",
|
1022
|
-
"is not greater than", "isn't greater than",
|
1023
|
-
"does not come after", "doesn't come after", "starts? with",
|
1024
|
-
"begins? with", "ends? with", "contains?", "does not contain",
|
1025
|
-
"doesn't contain", "is in", "is contained by", "is not in",
|
1026
|
-
"is not contained by", "isn't contained by", "div", "mod",
|
1027
|
-
"not", "(a )?(ref( to)?|reference to)", "is", "does"]
|
1028
|
-
Control = ['considering', 'else', 'error', 'exit', 'from', 'if',
|
1029
|
-
'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to',
|
1030
|
-
'try', 'until', 'using terms from', 'while', 'whith',
|
1031
|
-
'with timeout( of)?', 'with transaction', 'by', 'continue',
|
1032
|
-
'end', 'its?', 'me', 'my', 'return', 'of' , 'as']
|
1033
|
-
Declarations = ['global', 'local', 'prop(erty)?', 'set', 'get']
|
1034
|
-
Reserved = ['but', 'put', 'returning', 'the']
|
1035
|
-
StudioClasses = ['action cell', 'alert reply', 'application', 'box',
|
1036
|
-
'browser( cell)?', 'bundle', 'button( cell)?', 'cell',
|
1037
|
-
'clip view', 'color well', 'color-panel',
|
1038
|
-
'combo box( item)?', 'control',
|
1039
|
-
'data( (cell|column|item|row|source))?', 'default entry',
|
1040
|
-
'dialog reply', 'document', 'drag info', 'drawer',
|
1041
|
-
'event', 'font(-panel)?', 'formatter',
|
1042
|
-
'image( (cell|view))?', 'matrix', 'menu( item)?', 'item',
|
1043
|
-
'movie( view)?', 'open-panel', 'outline view', 'panel',
|
1044
|
-
'pasteboard', 'plugin', 'popup button',
|
1045
|
-
'progress indicator', 'responder', 'save-panel',
|
1046
|
-
'scroll view', 'secure text field( cell)?', 'slider',
|
1047
|
-
'sound', 'split view', 'stepper', 'tab view( item)?',
|
1048
|
-
'table( (column|header cell|header view|view))',
|
1049
|
-
'text( (field( cell)?|view))?', 'toolbar( item)?',
|
1050
|
-
'user-defaults', 'view', 'window']
|
1051
|
-
StudioEvents = ['accept outline drop', 'accept table drop', 'action',
|
1052
|
-
'activated', 'alert ended', 'awake from nib', 'became key',
|
1053
|
-
'became main', 'begin editing', 'bounds changed',
|
1054
|
-
'cell value', 'cell value changed', 'change cell value',
|
1055
|
-
'change item value', 'changed', 'child of item',
|
1056
|
-
'choose menu item', 'clicked', 'clicked toolbar item',
|
1057
|
-
'closed', 'column clicked', 'column moved',
|
1058
|
-
'column resized', 'conclude drop', 'data representation',
|
1059
|
-
'deminiaturized', 'dialog ended', 'document nib name',
|
1060
|
-
'double clicked', 'drag( (entered|exited|updated))?',
|
1061
|
-
'drop', 'end editing', 'exposed', 'idle', 'item expandable',
|
1062
|
-
'item value', 'item value changed', 'items changed',
|
1063
|
-
'keyboard down', 'keyboard up', 'launched',
|
1064
|
-
'load data representation', 'miniaturized', 'mouse down',
|
1065
|
-
'mouse dragged', 'mouse entered', 'mouse exited',
|
1066
|
-
'mouse moved', 'mouse up', 'moved',
|
1067
|
-
'number of browser rows', 'number of items',
|
1068
|
-
'number of rows', 'open untitled', 'opened', 'panel ended',
|
1069
|
-
'parameters updated', 'plugin loaded', 'prepare drop',
|
1070
|
-
'prepare outline drag', 'prepare outline drop',
|
1071
|
-
'prepare table drag', 'prepare table drop',
|
1072
|
-
'read from file', 'resigned active', 'resigned key',
|
1073
|
-
'resigned main', 'resized( sub views)?',
|
1074
|
-
'right mouse down', 'right mouse dragged',
|
1075
|
-
'right mouse up', 'rows changed', 'scroll wheel',
|
1076
|
-
'selected tab view item', 'selection changed',
|
1077
|
-
'selection changing', 'should begin editing',
|
1078
|
-
'should close', 'should collapse item',
|
1079
|
-
'should end editing', 'should expand item',
|
1080
|
-
'should open( untitled)?',
|
1081
|
-
'should quit( after last window closed)?',
|
1082
|
-
'should select column', 'should select item',
|
1083
|
-
'should select row', 'should select tab view item',
|
1084
|
-
'should selection change', 'should zoom', 'shown',
|
1085
|
-
'update menu item', 'update parameters',
|
1086
|
-
'update toolbar item', 'was hidden', 'was miniaturized',
|
1087
|
-
'will become active', 'will close', 'will dismiss',
|
1088
|
-
'will display browser cell', 'will display cell',
|
1089
|
-
'will display item cell', 'will display outline cell',
|
1090
|
-
'will finish launching', 'will hide', 'will miniaturize',
|
1091
|
-
'will move', 'will open', 'will pop up', 'will quit',
|
1092
|
-
'will resign active', 'will resize( sub views)?',
|
1093
|
-
'will select tab view item', 'will show', 'will zoom',
|
1094
|
-
'write to file', 'zoomed']
|
1095
|
-
StudioCommands = ['animate', 'append', 'call method', 'center',
|
1096
|
-
'close drawer', 'close panel', 'display',
|
1097
|
-
'display alert', 'display dialog', 'display panel', 'go',
|
1098
|
-
'hide', 'highlight', 'increment', 'item for',
|
1099
|
-
'load image', 'load movie', 'load nib', 'load panel',
|
1100
|
-
'load sound', 'localized string', 'lock focus', 'log',
|
1101
|
-
'open drawer', 'path for', 'pause', 'perform action',
|
1102
|
-
'play', 'register', 'resume', 'scroll', 'select( all)?',
|
1103
|
-
'show', 'size to fit', 'start', 'step back',
|
1104
|
-
'step forward', 'stop', 'synchronize', 'unlock focus',
|
1105
|
-
'update']
|
1106
|
-
StudioProperties = ['accepts arrow key', 'action method', 'active',
|
1107
|
-
'alignment', 'allowed identifiers',
|
1108
|
-
'allows branch selection', 'allows column reordering',
|
1109
|
-
'allows column resizing', 'allows column selection',
|
1110
|
-
'allows customization',
|
1111
|
-
'allows editing text attributes',
|
1112
|
-
'allows empty selection', 'allows mixed state',
|
1113
|
-
'allows multiple selection', 'allows reordering',
|
1114
|
-
'allows undo', 'alpha( value)?', 'alternate image',
|
1115
|
-
'alternate increment value', 'alternate title',
|
1116
|
-
'animation delay', 'associated file name',
|
1117
|
-
'associated object', 'auto completes', 'auto display',
|
1118
|
-
'auto enables items', 'auto repeat',
|
1119
|
-
'auto resizes( outline column)?',
|
1120
|
-
'auto save expanded items', 'auto save name',
|
1121
|
-
'auto save table columns', 'auto saves configuration',
|
1122
|
-
'auto scroll', 'auto sizes all columns to fit',
|
1123
|
-
'auto sizes cells', 'background color', 'bezel state',
|
1124
|
-
'bezel style', 'bezeled', 'border rect', 'border type',
|
1125
|
-
'bordered', 'bounds( rotation)?', 'box type',
|
1126
|
-
'button returned', 'button type',
|
1127
|
-
'can choose directories', 'can choose files',
|
1128
|
-
'can draw', 'can hide',
|
1129
|
-
'cell( (background color|size|type))?', 'characters',
|
1130
|
-
'class', 'click count', 'clicked( data)? column',
|
1131
|
-
'clicked data item', 'clicked( data)? row',
|
1132
|
-
'closeable', 'collating', 'color( (mode|panel))',
|
1133
|
-
'command key down', 'configuration',
|
1134
|
-
'content(s| (size|view( margins)?))?', 'context',
|
1135
|
-
'continuous', 'control key down', 'control size',
|
1136
|
-
'control tint', 'control view',
|
1137
|
-
'controller visible', 'coordinate system',
|
1138
|
-
'copies( on scroll)?', 'corner view', 'current cell',
|
1139
|
-
'current column', 'current( field)? editor',
|
1140
|
-
'current( menu)? item', 'current row',
|
1141
|
-
'current tab view item', 'data source',
|
1142
|
-
'default identifiers', 'delta (x|y|z)',
|
1143
|
-
'destination window', 'directory', 'display mode',
|
1144
|
-
'displayed cell', 'document( (edited|rect|view))?',
|
1145
|
-
'double value', 'dragged column', 'dragged distance',
|
1146
|
-
'dragged items', 'draws( cell)? background',
|
1147
|
-
'draws grid', 'dynamically scrolls', 'echos bullets',
|
1148
|
-
'edge', 'editable', 'edited( data)? column',
|
1149
|
-
'edited data item', 'edited( data)? row', 'enabled',
|
1150
|
-
'enclosing scroll view', 'ending page',
|
1151
|
-
'error handling', 'event number', 'event type',
|
1152
|
-
'excluded from windows menu', 'executable path',
|
1153
|
-
'expanded', 'fax number', 'field editor', 'file kind',
|
1154
|
-
'file name', 'file type', 'first responder',
|
1155
|
-
'first visible column', 'flipped', 'floating',
|
1156
|
-
'font( panel)?', 'formatter', 'frameworks path',
|
1157
|
-
'frontmost', 'gave up', 'grid color', 'has data items',
|
1158
|
-
'has horizontal ruler', 'has horizontal scroller',
|
1159
|
-
'has parent data item', 'has resize indicator',
|
1160
|
-
'has shadow', 'has sub menu', 'has vertical ruler',
|
1161
|
-
'has vertical scroller', 'header cell', 'header view',
|
1162
|
-
'hidden', 'hides when deactivated', 'highlights by',
|
1163
|
-
'horizontal line scroll', 'horizontal page scroll',
|
1164
|
-
'horizontal ruler view', 'horizontally resizable',
|
1165
|
-
'icon image', 'id', 'identifier',
|
1166
|
-
'ignores multiple clicks',
|
1167
|
-
'image( (alignment|dims when disabled|frame style|'
|
1168
|
-
'scaling))?',
|
1169
|
-
'imports graphics', 'increment value',
|
1170
|
-
'indentation per level', 'indeterminate', 'index',
|
1171
|
-
'integer value', 'intercell spacing', 'item height',
|
1172
|
-
'key( (code|equivalent( modifier)?|window))?',
|
1173
|
-
'knob thickness', 'label', 'last( visible)? column',
|
1174
|
-
'leading offset', 'leaf', 'level', 'line scroll',
|
1175
|
-
'loaded', 'localized sort', 'location', 'loop mode',
|
1176
|
-
'main( (bunde|menu|window))?', 'marker follows cell',
|
1177
|
-
'matrix mode', 'maximum( content)? size',
|
1178
|
-
'maximum visible columns',
|
1179
|
-
'menu( form representation)?', 'miniaturizable',
|
1180
|
-
'miniaturized', 'minimized image', 'minimized title',
|
1181
|
-
'minimum column width', 'minimum( content)? size',
|
1182
|
-
'modal', 'modified', 'mouse down state',
|
1183
|
-
'movie( (controller|file|rect))?', 'muted', 'name',
|
1184
|
-
'needs display', 'next state', 'next text',
|
1185
|
-
'number of tick marks', 'only tick mark values',
|
1186
|
-
'opaque', 'open panel', 'option key down',
|
1187
|
-
'outline table column', 'page scroll', 'pages across',
|
1188
|
-
'pages down', 'palette label', 'pane splitter',
|
1189
|
-
'parent data item', 'parent window', 'pasteboard',
|
1190
|
-
'path( (names|separator))?', 'playing',
|
1191
|
-
'plays every frame', 'plays selection only', 'position',
|
1192
|
-
'preferred edge', 'preferred type', 'pressure',
|
1193
|
-
'previous text', 'prompt', 'properties',
|
1194
|
-
'prototype cell', 'pulls down', 'rate',
|
1195
|
-
'released when closed', 'repeated',
|
1196
|
-
'requested print time', 'required file type',
|
1197
|
-
'resizable', 'resized column', 'resource path',
|
1198
|
-
'returns records', 'reuses columns', 'rich text',
|
1199
|
-
'roll over', 'row height', 'rulers visible',
|
1200
|
-
'save panel', 'scripts path', 'scrollable',
|
1201
|
-
'selectable( identifiers)?', 'selected cell',
|
1202
|
-
'selected( data)? columns?', 'selected data items?',
|
1203
|
-
'selected( data)? rows?', 'selected item identifier',
|
1204
|
-
'selection by rect', 'send action on arrow key',
|
1205
|
-
'sends action when done editing', 'separates columns',
|
1206
|
-
'separator item', 'sequence number', 'services menu',
|
1207
|
-
'shared frameworks path', 'shared support path',
|
1208
|
-
'sheet', 'shift key down', 'shows alpha',
|
1209
|
-
'shows state by', 'size( mode)?',
|
1210
|
-
'smart insert delete enabled', 'sort case sensitivity',
|
1211
|
-
'sort column', 'sort order', 'sort type',
|
1212
|
-
'sorted( data rows)?', 'sound', 'source( mask)?',
|
1213
|
-
'spell checking enabled', 'starting page', 'state',
|
1214
|
-
'string value', 'sub menu', 'super menu', 'super view',
|
1215
|
-
'tab key traverses cells', 'tab state', 'tab type',
|
1216
|
-
'tab view', 'table view', 'tag', 'target( printer)?',
|
1217
|
-
'text color', 'text container insert',
|
1218
|
-
'text container origin', 'text returned',
|
1219
|
-
'tick mark position', 'time stamp',
|
1220
|
-
'title(d| (cell|font|height|position|rect))?',
|
1221
|
-
'tool tip', 'toolbar', 'trailing offset', 'transparent',
|
1222
|
-
'treat packages as directories', 'truncated labels',
|
1223
|
-
'types', 'unmodified characters', 'update views',
|
1224
|
-
'use sort indicator', 'user defaults',
|
1225
|
-
'uses data source', 'uses ruler',
|
1226
|
-
'uses threaded animation',
|
1227
|
-
'uses title from previous column', 'value wraps',
|
1228
|
-
'version',
|
1229
|
-
'vertical( (line scroll|page scroll|ruler view))?',
|
1230
|
-
'vertically resizable', 'view',
|
1231
|
-
'visible( document rect)?', 'volume', 'width', 'window',
|
1232
|
-
'windows menu', 'wraps', 'zoomable', 'zoomed']
|
1233
|
-
|
1234
|
-
tokens = {
|
1235
|
-
'root': [
|
1236
|
-
(r'\s+', Text),
|
1237
|
-
(u'¬\\n', String.Escape),
|
1238
|
-
(r"'s\s+", Text), # This is a possessive, consider moving
|
1239
|
-
(r'(--|#).*?$', Comment),
|
1240
|
-
(r'\(\*', Comment.Multiline, 'comment'),
|
1241
|
-
(r'[\(\){}!,.:]', Punctuation),
|
1242
|
-
(u'(«)([^»]+)(»)',
|
1243
|
-
bygroups(Text, Name.Builtin, Text)),
|
1244
|
-
(r'\b((?:considering|ignoring)\s*)'
|
1245
|
-
r'(application responses|case|diacriticals|hyphens|'
|
1246
|
-
r'numeric strings|punctuation|white space)',
|
1247
|
-
bygroups(Keyword, Name.Builtin)),
|
1248
|
-
(u'(-|\\*|\\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\\^)', Operator),
|
1249
|
-
(r"\b(%s)\b" % '|'.join(Operators), Operator.Word),
|
1250
|
-
(r'^(\s*(?:on|end)\s+)'
|
1251
|
-
r'(%s)' % '|'.join(StudioEvents[::-1]),
|
1252
|
-
bygroups(Keyword, Name.Function)),
|
1253
|
-
(r'^(\s*)(in|on|script|to)(\s+)', bygroups(Text, Keyword, Text)),
|
1254
|
-
(r'\b(as )(%s)\b' % '|'.join(Classes),
|
1255
|
-
bygroups(Keyword, Name.Class)),
|
1256
|
-
(r'\b(%s)\b' % '|'.join(Literals), Name.Constant),
|
1257
|
-
(r'\b(%s)\b' % '|'.join(Commands), Name.Builtin),
|
1258
|
-
(r'\b(%s)\b' % '|'.join(Control), Keyword),
|
1259
|
-
(r'\b(%s)\b' % '|'.join(Declarations), Keyword),
|
1260
|
-
(r'\b(%s)\b' % '|'.join(Reserved), Name.Builtin),
|
1261
|
-
(r'\b(%s)s?\b' % '|'.join(BuiltIn), Name.Builtin),
|
1262
|
-
(r'\b(%s)\b' % '|'.join(HandlerParams), Name.Builtin),
|
1263
|
-
(r'\b(%s)\b' % '|'.join(StudioProperties), Name.Attribute),
|
1264
|
-
(r'\b(%s)s?\b' % '|'.join(StudioClasses), Name.Builtin),
|
1265
|
-
(r'\b(%s)\b' % '|'.join(StudioCommands), Name.Builtin),
|
1266
|
-
(r'\b(%s)\b' % '|'.join(References), Name.Builtin),
|
1267
|
-
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
1268
|
-
(r'\b(%s)\b' % Identifiers, Name.Variable),
|
1269
|
-
(r'[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?', Number.Float),
|
1270
|
-
(r'[-+]?\d+', Number.Integer),
|
1271
|
-
],
|
1272
|
-
'comment': [
|
1273
|
-
('\(\*', Comment.Multiline, '#push'),
|
1274
|
-
('\*\)', Comment.Multiline, '#pop'),
|
1275
|
-
('[^*(]+', Comment.Multiline),
|
1276
|
-
('[*(]', Comment.Multiline),
|
1277
|
-
],
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
|
1281
|
-
class ModelicaLexer(RegexLexer):
|
1282
|
-
"""
|
1283
|
-
For `Modelica <http://www.modelica.org/>`_ source code.
|
1284
|
-
|
1285
|
-
.. versionadded:: 1.1
|
1286
|
-
"""
|
1287
|
-
name = 'Modelica'
|
1288
|
-
aliases = ['modelica']
|
1289
|
-
filenames = ['*.mo']
|
1290
|
-
mimetypes = ['text/x-modelica']
|
1291
|
-
|
1292
|
-
flags = re.IGNORECASE | re.DOTALL
|
1293
|
-
|
1294
|
-
tokens = {
|
1295
|
-
'whitespace': [
|
1296
|
-
(r'\n', Text),
|
1297
|
-
(r'\s+', Text),
|
1298
|
-
(r'\\\n', Text), # line continuation
|
1299
|
-
(r'//(\n|(.|\n)*?[^\\]\n)', Comment),
|
1300
|
-
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment),
|
1301
|
-
],
|
1302
|
-
'statements': [
|
1303
|
-
(r'"', String, 'string'),
|
1304
|
-
(r'(\d+\.\d*|\.\d+|\d+|\d.)[eE][+-]?\d+[lL]?', Number.Float),
|
1305
|
-
(r'(\d+\.\d*|\.\d+)', Number.Float),
|
1306
|
-
(r'\d+[Ll]?', Number.Integer),
|
1307
|
-
(r'[~!%^&*+=|?:<>/-]', Operator),
|
1308
|
-
(r'(true|false|NULL|Real|Integer|Boolean)\b', Name.Builtin),
|
1309
|
-
(r'([a-z_][\w]*|\'[^\']+\')'
|
1310
|
-
r'([\[\d,:\]]*)'
|
1311
|
-
r'(\.([a-z_][\w]*|\'[^\']+\'))+'
|
1312
|
-
r'([\[\d,:\]]*)', Name.Class),
|
1313
|
-
(r'(\'[\w\+\-\*\/\^]+\'|\w+)', Name),
|
1314
|
-
(r'[()\[\]{},.;]', Punctuation),
|
1315
|
-
(r'\'', Name, 'quoted_ident'),
|
1316
|
-
],
|
1317
|
-
'root': [
|
1318
|
-
include('whitespace'),
|
1319
|
-
include('classes'),
|
1320
|
-
include('functions'),
|
1321
|
-
include('keywords'),
|
1322
|
-
include('operators'),
|
1323
|
-
(r'("<html>|<html>)', Name.Tag, 'html-content'),
|
1324
|
-
include('statements'),
|
1325
|
-
],
|
1326
|
-
'keywords': [
|
1327
|
-
(r'(algorithm|annotation|break|connect|constant|constrainedby|'
|
1328
|
-
r'discrete|each|end|else|elseif|elsewhen|encapsulated|enumeration|'
|
1329
|
-
r'equation|exit|expandable|extends|'
|
1330
|
-
r'external|false|final|flow|for|if|import|impure|in|initial\sequation|'
|
1331
|
-
r'inner|input|loop|nondiscrete|outer|output|parameter|partial|'
|
1332
|
-
r'protected|public|pure|redeclare|replaceable|stream|time|then|true|'
|
1333
|
-
r'when|while|within)\b', Keyword),
|
1334
|
-
],
|
1335
|
-
'functions': [
|
1336
|
-
(r'(abs|acos|acosh|asin|asinh|atan|atan2|atan3|ceil|cos|cosh|'
|
1337
|
-
r'cross|diagonal|div|exp|fill|floor|getInstanceName|identity|'
|
1338
|
-
r'linspace|log|log10|matrix|mod|max|min|ndims|ones|outerProduct|'
|
1339
|
-
r'product|rem|scalar|semiLinear|skew|sign|sin|sinh|size|'
|
1340
|
-
r'spatialDistribution|sum|sqrt|symmetric|tan|tanh|transpose|'
|
1341
|
-
r'vector|zeros)\b', Name.Function),
|
1342
|
-
],
|
1343
|
-
'operators': [
|
1344
|
-
(r'(actualStream|and|assert|backSample|cardinality|change|Clock|'
|
1345
|
-
r'delay|der|edge|hold|homotopy|initial|inStream|noClock|noEvent|'
|
1346
|
-
r'not|or|pre|previous|reinit|return|sample|smooth|'
|
1347
|
-
r'spatialDistribution|shiftSample|subSample|superSample|terminal|'
|
1348
|
-
r'terminate)\b', Name.Builtin),
|
1349
|
-
],
|
1350
|
-
'classes': [
|
1351
|
-
(r'(operator)?(\s+)?(block|class|connector|end|function|model|'
|
1352
|
-
r'operator|package|record|type)(\s+)'
|
1353
|
-
r'((?!if|for|when|while)[a-z_]\w*|\'[^\']+\')([;]?)',
|
1354
|
-
bygroups(Keyword, Text, Keyword, Text, Name.Class, Text))
|
1355
|
-
],
|
1356
|
-
'quoted_ident': [
|
1357
|
-
(r'\'', Name, '#pop'),
|
1358
|
-
(r'[^\']+', Name), # all other characters
|
1359
|
-
],
|
1360
|
-
'string': [
|
1361
|
-
(r'"', String, '#pop'),
|
1362
|
-
(r'\\([\\abfnrtv"\']|x[a-f0-9]{2,4}|[0-7]{1,3})',
|
1363
|
-
String.Escape),
|
1364
|
-
(r'[^\\"\n]+', String), # all other characters
|
1365
|
-
(r'\\\n', String), # line continuation
|
1366
|
-
(r'\\', String), # stray backslash
|
1367
|
-
],
|
1368
|
-
'html-content': [
|
1369
|
-
(r'<\s*/\s*html\s*>"', Name.Tag, '#pop'),
|
1370
|
-
(r'.+?(?=<\s*/\s*html\s*>)', using(HtmlLexer)),
|
1371
|
-
]
|
1372
|
-
}
|
1373
|
-
|
1374
|
-
|
1375
|
-
class RebolLexer(RegexLexer):
|
1376
|
-
"""
|
1377
|
-
A `REBOL <http://www.rebol.com/>`_ lexer.
|
1378
|
-
|
1379
|
-
.. versionadded:: 1.1
|
1380
|
-
"""
|
1381
|
-
name = 'REBOL'
|
1382
|
-
aliases = ['rebol']
|
1383
|
-
filenames = ['*.r', '*.r3', '*.reb']
|
1384
|
-
mimetypes = ['text/x-rebol']
|
1385
|
-
|
1386
|
-
flags = re.IGNORECASE | re.MULTILINE
|
1387
|
-
|
1388
|
-
re.IGNORECASE
|
1389
|
-
|
1390
|
-
escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
|
1391
|
-
|
1392
|
-
def word_callback(lexer, match):
|
1393
|
-
word = match.group()
|
1394
|
-
|
1395
|
-
if re.match(".*:$", word):
|
1396
|
-
yield match.start(), Generic.Subheading, word
|
1397
|
-
elif re.match(
|
1398
|
-
r'(native|alias|all|any|as-string|as-binary|bind|bound\?|case|'
|
1399
|
-
r'catch|checksum|comment|debase|dehex|exclude|difference|disarm|'
|
1400
|
-
r'either|else|enbase|foreach|remove-each|form|free|get|get-env|if|'
|
1401
|
-
r'in|intersect|loop|minimum-of|maximum-of|mold|new-line|'
|
1402
|
-
r'new-line\?|not|now|prin|print|reduce|compose|construct|repeat|'
|
1403
|
-
r'reverse|save|script\?|set|shift|switch|throw|to-hex|trace|try|'
|
1404
|
-
r'type\?|union|unique|unless|unprotect|unset|until|use|value\?|'
|
1405
|
-
r'while|compress|decompress|secure|open|close|read|read-io|'
|
1406
|
-
r'write-io|write|update|query|wait|input\?|exp|log-10|log-2|'
|
1407
|
-
r'log-e|square-root|cosine|sine|tangent|arccosine|arcsine|'
|
1408
|
-
r'arctangent|protect|lowercase|uppercase|entab|detab|connected\?|'
|
1409
|
-
r'browse|launch|stats|get-modes|set-modes|to-local-file|'
|
1410
|
-
r'to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|'
|
1411
|
-
r'hide|draw|show|size-text|textinfo|offset-to-caret|'
|
1412
|
-
r'caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|'
|
1413
|
-
r'crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|'
|
1414
|
-
r'dsa-make-key|dsa-generate-key|dsa-make-signature|'
|
1415
|
-
r'dsa-verify-signature|rsa-make-key|rsa-generate-key|'
|
1416
|
-
r'rsa-encrypt)$', word):
|
1417
|
-
yield match.start(), Name.Builtin, word
|
1418
|
-
elif re.match(
|
1419
|
-
r'(add|subtract|multiply|divide|remainder|power|and~|or~|xor~|'
|
1420
|
-
r'minimum|maximum|negate|complement|absolute|random|head|tail|'
|
1421
|
-
r'next|back|skip|at|pick|first|second|third|fourth|fifth|sixth|'
|
1422
|
-
r'seventh|eighth|ninth|tenth|last|path|find|select|make|to|copy\*|'
|
1423
|
-
r'insert|remove|change|poke|clear|trim|sort|min|max|abs|cp|'
|
1424
|
-
r'copy)$', word):
|
1425
|
-
yield match.start(), Name.Function, word
|
1426
|
-
elif re.match(
|
1427
|
-
r'(error|source|input|license|help|install|echo|Usage|with|func|'
|
1428
|
-
r'throw-on-error|function|does|has|context|probe|\?\?|as-pair|'
|
1429
|
-
r'mod|modulo|round|repend|about|set-net|append|join|rejoin|reform|'
|
1430
|
-
r'remold|charset|array|replace|move|extract|forskip|forall|alter|'
|
1431
|
-
r'first+|also|take|for|forever|dispatch|attempt|what-dir|'
|
1432
|
-
r'change-dir|clean-path|list-dir|dirize|rename|split-path|delete|'
|
1433
|
-
r'make-dir|delete-dir|in-dir|confirm|dump-obj|upgrade|what|'
|
1434
|
-
r'build-tag|process-source|build-markup|decode-cgi|read-cgi|'
|
1435
|
-
r'write-user|save-user|set-user-name|protect-system|parse-xml|'
|
1436
|
-
r'cvs-date|cvs-version|do-boot|get-net-info|desktop|layout|'
|
1437
|
-
r'scroll-para|get-face|alert|set-face|uninstall|unfocus|'
|
1438
|
-
r'request-dir|center-face|do-events|net-error|decode-url|'
|
1439
|
-
r'parse-header|parse-header-date|parse-email-addrs|import-email|'
|
1440
|
-
r'send|build-attach-body|resend|show-popup|hide-popup|open-events|'
|
1441
|
-
r'find-key-face|do-face|viewtop|confine|find-window|'
|
1442
|
-
r'insert-event-func|remove-event-func|inform|dump-pane|dump-face|'
|
1443
|
-
r'flag-face|deflag-face|clear-fields|read-net|vbug|path-thru|'
|
1444
|
-
r'read-thru|load-thru|do-thru|launch-thru|load-image|'
|
1445
|
-
r'request-download|do-face-alt|set-font|set-para|get-style|'
|
1446
|
-
r'set-style|make-face|stylize|choose|hilight-text|hilight-all|'
|
1447
|
-
r'unlight-text|focus|scroll-drag|clear-face|reset-face|scroll-face|'
|
1448
|
-
r'resize-face|load-stock|load-stock-block|notify|request|flash|'
|
1449
|
-
r'request-color|request-pass|request-text|request-list|'
|
1450
|
-
r'request-date|request-file|dbug|editor|link-relative-path|'
|
1451
|
-
r'emailer|parse-error)$', word):
|
1452
|
-
yield match.start(), Keyword.Namespace, word
|
1453
|
-
elif re.match(
|
1454
|
-
r'(halt|quit|do|load|q|recycle|call|run|ask|parse|view|unview|'
|
1455
|
-
r'return|exit|break)$', word):
|
1456
|
-
yield match.start(), Name.Exception, word
|
1457
|
-
elif re.match('REBOL$', word):
|
1458
|
-
yield match.start(), Generic.Heading, word
|
1459
|
-
elif re.match("to-.*", word):
|
1460
|
-
yield match.start(), Keyword, word
|
1461
|
-
elif re.match('(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$',
|
1462
|
-
word):
|
1463
|
-
yield match.start(), Operator, word
|
1464
|
-
elif re.match(".*\?$", word):
|
1465
|
-
yield match.start(), Keyword, word
|
1466
|
-
elif re.match(".*\!$", word):
|
1467
|
-
yield match.start(), Keyword.Type, word
|
1468
|
-
elif re.match("'.*", word):
|
1469
|
-
yield match.start(), Name.Variable.Instance, word # lit-word
|
1470
|
-
elif re.match("#.*", word):
|
1471
|
-
yield match.start(), Name.Label, word # issue
|
1472
|
-
elif re.match("%.*", word):
|
1473
|
-
yield match.start(), Name.Decorator, word # file
|
1474
|
-
else:
|
1475
|
-
yield match.start(), Name.Variable, word
|
1476
|
-
|
1477
|
-
tokens = {
|
1478
|
-
'root': [
|
1479
|
-
(r'[^R]+', Comment),
|
1480
|
-
(r'REBOL\s+\[', Generic.Strong, 'script'),
|
1481
|
-
(r'R', Comment)
|
1482
|
-
],
|
1483
|
-
'script': [
|
1484
|
-
(r'\s+', Text),
|
1485
|
-
(r'#"', String.Char, 'char'),
|
1486
|
-
(r'#{[0-9a-f]*}', Number.Hex),
|
1487
|
-
(r'2#{', Number.Hex, 'bin2'),
|
1488
|
-
(r'64#{[0-9a-z+/=\s]*}', Number.Hex),
|
1489
|
-
(r'"', String, 'string'),
|
1490
|
-
(r'{', String, 'string2'),
|
1491
|
-
(r';#+.*\n', Comment.Special),
|
1492
|
-
(r';\*+.*\n', Comment.Preproc),
|
1493
|
-
(r';.*\n', Comment),
|
1494
|
-
(r'%"', Name.Decorator, 'stringFile'),
|
1495
|
-
(r'%[^(\^{^")\s\[\]]+', Name.Decorator),
|
1496
|
-
(r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
|
1497
|
-
(r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
|
1498
|
-
(r'\d+[\-\/][0-9a-z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?'
|
1499
|
-
r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
|
1500
|
-
(r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
|
1501
|
-
(r'\d+[xX]\d+', Keyword.Constant), # pair
|
1502
|
-
(r'[+-]?\d+(\'\d+)?([\.,]\d*)?[eE][+-]?\d+', Number.Float),
|
1503
|
-
(r'[+-]?\d+(\'\d+)?[\.,]\d*', Number.Float),
|
1504
|
-
(r'[+-]?\d+(\'\d+)?', Number),
|
1505
|
-
(r'[\[\]\(\)]', Generic.Strong),
|
1506
|
-
(r'[a-z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url
|
1507
|
-
(r'mailto:[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # url
|
1508
|
-
(r'[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # email
|
1509
|
-
(r'comment\s"', Comment, 'commentString1'),
|
1510
|
-
(r'comment\s{', Comment, 'commentString2'),
|
1511
|
-
(r'comment\s\[', Comment, 'commentBlock'),
|
1512
|
-
(r'comment\s[^(\s{\"\[]+', Comment),
|
1513
|
-
(r'/[^(\^{^")\s/[\]]*', Name.Attribute),
|
1514
|
-
(r'([^(\^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
|
1515
|
-
(r'<[\w:.-]*>', Name.Tag),
|
1516
|
-
(r'<[^(<>\s")]+', Name.Tag, 'tag'),
|
1517
|
-
(r'([^(\^{^")\s]+)', Text),
|
1518
|
-
],
|
1519
|
-
'string': [
|
1520
|
-
(r'[^(\^")]+', String),
|
1521
|
-
(escape_re, String.Escape),
|
1522
|
-
(r'[\(|\)]+', String),
|
1523
|
-
(r'\^.', String.Escape),
|
1524
|
-
(r'"', String, '#pop'),
|
1525
|
-
],
|
1526
|
-
'string2': [
|
1527
|
-
(r'[^(\^{^})]+', String),
|
1528
|
-
(escape_re, String.Escape),
|
1529
|
-
(r'[\(|\)]+', String),
|
1530
|
-
(r'\^.', String.Escape),
|
1531
|
-
(r'{', String, '#push'),
|
1532
|
-
(r'}', String, '#pop'),
|
1533
|
-
],
|
1534
|
-
'stringFile': [
|
1535
|
-
(r'[^(\^")]+', Name.Decorator),
|
1536
|
-
(escape_re, Name.Decorator),
|
1537
|
-
(r'\^.', Name.Decorator),
|
1538
|
-
(r'"', Name.Decorator, '#pop'),
|
1539
|
-
],
|
1540
|
-
'char': [
|
1541
|
-
(escape_re + '"', String.Char, '#pop'),
|
1542
|
-
(r'\^."', String.Char, '#pop'),
|
1543
|
-
(r'."', String.Char, '#pop'),
|
1544
|
-
],
|
1545
|
-
'tag': [
|
1546
|
-
(escape_re, Name.Tag),
|
1547
|
-
(r'"', Name.Tag, 'tagString'),
|
1548
|
-
(r'[^(<>\r\n")]+', Name.Tag),
|
1549
|
-
(r'>', Name.Tag, '#pop'),
|
1550
|
-
],
|
1551
|
-
'tagString': [
|
1552
|
-
(r'[^(\^")]+', Name.Tag),
|
1553
|
-
(escape_re, Name.Tag),
|
1554
|
-
(r'[\(|\)]+', Name.Tag),
|
1555
|
-
(r'\^.', Name.Tag),
|
1556
|
-
(r'"', Name.Tag, '#pop'),
|
1557
|
-
],
|
1558
|
-
'tuple': [
|
1559
|
-
(r'(\d+\.)+', Keyword.Constant),
|
1560
|
-
(r'\d+', Keyword.Constant, '#pop'),
|
1561
|
-
],
|
1562
|
-
'bin2': [
|
1563
|
-
(r'\s+', Number.Hex),
|
1564
|
-
(r'([0-1]\s*){8}', Number.Hex),
|
1565
|
-
(r'}', Number.Hex, '#pop'),
|
1566
|
-
],
|
1567
|
-
'commentString1': [
|
1568
|
-
(r'[^(\^")]+', Comment),
|
1569
|
-
(escape_re, Comment),
|
1570
|
-
(r'[\(|\)]+', Comment),
|
1571
|
-
(r'\^.', Comment),
|
1572
|
-
(r'"', Comment, '#pop'),
|
1573
|
-
],
|
1574
|
-
'commentString2': [
|
1575
|
-
(r'[^(\^{^})]+', Comment),
|
1576
|
-
(escape_re, Comment),
|
1577
|
-
(r'[\(|\)]+', Comment),
|
1578
|
-
(r'\^.', Comment),
|
1579
|
-
(r'{', Comment, '#push'),
|
1580
|
-
(r'}', Comment, '#pop'),
|
1581
|
-
],
|
1582
|
-
'commentBlock': [
|
1583
|
-
(r'\[', Comment, '#push'),
|
1584
|
-
(r'\]', Comment, '#pop'),
|
1585
|
-
(r'"', Comment, "commentString1"),
|
1586
|
-
(r'{', Comment, "commentString2"),
|
1587
|
-
(r'[^(\[\]\"{)]+', Comment),
|
1588
|
-
],
|
1589
|
-
}
|
1590
|
-
def analyse_text(text):
|
1591
|
-
"""
|
1592
|
-
Check if code contains REBOL header and so it probably not R code
|
1593
|
-
"""
|
1594
|
-
if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
|
1595
|
-
# The code starts with REBOL header
|
1596
|
-
return 1.0
|
1597
|
-
elif re.search(r'\s*REBOL\s*[', text, re.IGNORECASE):
|
1598
|
-
# The code contains REBOL header but also some text before it
|
1599
|
-
return 0.5
|
1600
|
-
|
1601
|
-
|
1602
|
-
class ABAPLexer(RegexLexer):
|
1603
|
-
"""
|
1604
|
-
Lexer for ABAP, SAP's integrated language.
|
1605
|
-
|
1606
|
-
.. versionadded:: 1.1
|
1607
|
-
"""
|
1608
|
-
name = 'ABAP'
|
1609
|
-
aliases = ['abap']
|
1610
|
-
filenames = ['*.abap']
|
1611
|
-
mimetypes = ['text/x-abap']
|
1612
|
-
|
1613
|
-
flags = re.IGNORECASE | re.MULTILINE
|
1614
|
-
|
1615
|
-
tokens = {
|
1616
|
-
'common': [
|
1617
|
-
(r'\s+', Text),
|
1618
|
-
(r'^\*.*$', Comment.Single),
|
1619
|
-
(r'\".*?\n', Comment.Single),
|
1620
|
-
],
|
1621
|
-
'variable-names': [
|
1622
|
-
(r'<\S+>', Name.Variable),
|
1623
|
-
(r'\w[\w~]*(?:(\[\])|->\*)?', Name.Variable),
|
1624
|
-
],
|
1625
|
-
'root': [
|
1626
|
-
include('common'),
|
1627
|
-
#function calls
|
1628
|
-
(r'(CALL\s+(?:BADI|CUSTOMER-FUNCTION|FUNCTION))(\s+)(\'?\S+\'?)',
|
1629
|
-
bygroups(Keyword, Text, Name.Function)),
|
1630
|
-
(r'(CALL\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|'
|
1631
|
-
r'TRANSACTION|TRANSFORMATION))\b',
|
1632
|
-
Keyword),
|
1633
|
-
(r'(FORM|PERFORM)(\s+)(\w+)',
|
1634
|
-
bygroups(Keyword, Text, Name.Function)),
|
1635
|
-
(r'(PERFORM)(\s+)(\()(\w+)(\))',
|
1636
|
-
bygroups(Keyword, Text, Punctuation, Name.Variable, Punctuation )),
|
1637
|
-
(r'(MODULE)(\s+)(\S+)(\s+)(INPUT|OUTPUT)',
|
1638
|
-
bygroups(Keyword, Text, Name.Function, Text, Keyword)),
|
1639
|
-
|
1640
|
-
# method implementation
|
1641
|
-
(r'(METHOD)(\s+)([\w~]+)',
|
1642
|
-
bygroups(Keyword, Text, Name.Function)),
|
1643
|
-
# method calls
|
1644
|
-
(r'(\s+)([\w\-]+)([=\-]>)([\w\-~]+)',
|
1645
|
-
bygroups(Text, Name.Variable, Operator, Name.Function)),
|
1646
|
-
# call methodnames returning style
|
1647
|
-
(r'(?<=(=|-)>)([\w\-~]+)(?=\()', Name.Function),
|
1648
|
-
|
1649
|
-
# keywords with dashes in them.
|
1650
|
-
# these need to be first, because for instance the -ID part
|
1651
|
-
# of MESSAGE-ID wouldn't get highlighted if MESSAGE was
|
1652
|
-
# first in the list of keywords.
|
1653
|
-
(r'(ADD-CORRESPONDING|AUTHORITY-CHECK|'
|
1654
|
-
r'CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|'
|
1655
|
-
r'DELETE-ADJACENT|DIVIDE-CORRESPONDING|'
|
1656
|
-
r'EDITOR-CALL|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|EXIT-COMMAND|'
|
1657
|
-
r'FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|'
|
1658
|
-
r'INTERFACE-POOL|INVERTED-DATE|'
|
1659
|
-
r'LOAD-OF-PROGRAM|LOG-POINT|'
|
1660
|
-
r'MESSAGE-ID|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|'
|
1661
|
-
r'NEW-LINE|NEW-PAGE|NEW-SECTION|NO-EXTENSION|'
|
1662
|
-
r'OUTPUT-LENGTH|PRINT-CONTROL|'
|
1663
|
-
r'SELECT-OPTIONS|START-OF-SELECTION|SUBTRACT-CORRESPONDING|'
|
1664
|
-
r'SYNTAX-CHECK|SYSTEM-EXCEPTIONS|'
|
1665
|
-
r'TYPE-POOL|TYPE-POOLS'
|
1666
|
-
r')\b', Keyword),
|
1667
|
-
|
1668
|
-
# keyword kombinations
|
1669
|
-
(r'CREATE\s+(PUBLIC|PRIVATE|DATA|OBJECT)|'
|
1670
|
-
r'((PUBLIC|PRIVATE|PROTECTED)\s+SECTION|'
|
1671
|
-
r'(TYPE|LIKE)(\s+(LINE\s+OF|REF\s+TO|'
|
1672
|
-
r'(SORTED|STANDARD|HASHED)\s+TABLE\s+OF))?|'
|
1673
|
-
r'FROM\s+(DATABASE|MEMORY)|CALL\s+METHOD|'
|
1674
|
-
r'(GROUP|ORDER) BY|HAVING|SEPARATED BY|'
|
1675
|
-
r'GET\s+(BADI|BIT|CURSOR|DATASET|LOCALE|PARAMETER|'
|
1676
|
-
r'PF-STATUS|(PROPERTY|REFERENCE)\s+OF|'
|
1677
|
-
r'RUN\s+TIME|TIME\s+(STAMP)?)?|'
|
1678
|
-
r'SET\s+(BIT|BLANK\s+LINES|COUNTRY|CURSOR|DATASET|EXTENDED\s+CHECK|'
|
1679
|
-
r'HANDLER|HOLD\s+DATA|LANGUAGE|LEFT\s+SCROLL-BOUNDARY|'
|
1680
|
-
r'LOCALE|MARGIN|PARAMETER|PF-STATUS|PROPERTY\s+OF|'
|
1681
|
-
r'RUN\s+TIME\s+(ANALYZER|CLOCK\s+RESOLUTION)|SCREEN|'
|
1682
|
-
r'TITLEBAR|UPADTE\s+TASK\s+LOCAL|USER-COMMAND)|'
|
1683
|
-
r'CONVERT\s+((INVERTED-)?DATE|TIME|TIME\s+STAMP|TEXT)|'
|
1684
|
-
r'(CLOSE|OPEN)\s+(DATASET|CURSOR)|'
|
1685
|
-
r'(TO|FROM)\s+(DATA BUFFER|INTERNAL TABLE|MEMORY ID|'
|
1686
|
-
r'DATABASE|SHARED\s+(MEMORY|BUFFER))|'
|
1687
|
-
r'DESCRIBE\s+(DISTANCE\s+BETWEEN|FIELD|LIST|TABLE)|'
|
1688
|
-
r'FREE\s(MEMORY|OBJECT)?|'
|
1689
|
-
r'PROCESS\s+(BEFORE\s+OUTPUT|AFTER\s+INPUT|'
|
1690
|
-
r'ON\s+(VALUE-REQUEST|HELP-REQUEST))|'
|
1691
|
-
r'AT\s+(LINE-SELECTION|USER-COMMAND|END\s+OF|NEW)|'
|
1692
|
-
r'AT\s+SELECTION-SCREEN(\s+(ON(\s+(BLOCK|(HELP|VALUE)-REQUEST\s+FOR|'
|
1693
|
-
r'END\s+OF|RADIOBUTTON\s+GROUP))?|OUTPUT))?|'
|
1694
|
-
r'SELECTION-SCREEN:?\s+((BEGIN|END)\s+OF\s+((TABBED\s+)?BLOCK|LINE|'
|
1695
|
-
r'SCREEN)|COMMENT|FUNCTION\s+KEY|'
|
1696
|
-
r'INCLUDE\s+BLOCKS|POSITION|PUSHBUTTON|'
|
1697
|
-
r'SKIP|ULINE)|'
|
1698
|
-
r'LEAVE\s+(LIST-PROCESSING|PROGRAM|SCREEN|'
|
1699
|
-
r'TO LIST-PROCESSING|TO TRANSACTION)'
|
1700
|
-
r'(ENDING|STARTING)\s+AT|'
|
1701
|
-
r'FORMAT\s+(COLOR|INTENSIFIED|INVERSE|HOTSPOT|INPUT|FRAMES|RESET)|'
|
1702
|
-
r'AS\s+(CHECKBOX|SUBSCREEN|WINDOW)|'
|
1703
|
-
r'WITH\s+(((NON-)?UNIQUE)?\s+KEY|FRAME)|'
|
1704
|
-
r'(BEGIN|END)\s+OF|'
|
1705
|
-
r'DELETE(\s+ADJACENT\s+DUPLICATES\sFROM)?|'
|
1706
|
-
r'COMPARING(\s+ALL\s+FIELDS)?|'
|
1707
|
-
r'INSERT(\s+INITIAL\s+LINE\s+INTO|\s+LINES\s+OF)?|'
|
1708
|
-
r'IN\s+((BYTE|CHARACTER)\s+MODE|PROGRAM)|'
|
1709
|
-
r'END-OF-(DEFINITION|PAGE|SELECTION)|'
|
1710
|
-
r'WITH\s+FRAME(\s+TITLE)|'
|
1711
|
-
|
1712
|
-
# simple kombinations
|
1713
|
-
r'AND\s+(MARK|RETURN)|CLIENT\s+SPECIFIED|CORRESPONDING\s+FIELDS\s+OF|'
|
1714
|
-
r'IF\s+FOUND|FOR\s+EVENT|INHERITING\s+FROM|LEAVE\s+TO\s+SCREEN|'
|
1715
|
-
r'LOOP\s+AT\s+(SCREEN)?|LOWER\s+CASE|MATCHCODE\s+OBJECT|MODIF\s+ID|'
|
1716
|
-
r'MODIFY\s+SCREEN|NESTING\s+LEVEL|NO\s+INTERVALS|OF\s+STRUCTURE|'
|
1717
|
-
r'RADIOBUTTON\s+GROUP|RANGE\s+OF|REF\s+TO|SUPPRESS DIALOG|'
|
1718
|
-
r'TABLE\s+OF|UPPER\s+CASE|TRANSPORTING\s+NO\s+FIELDS|'
|
1719
|
-
r'VALUE\s+CHECK|VISIBLE\s+LENGTH|HEADER\s+LINE)\b', Keyword),
|
1720
|
-
|
1721
|
-
# single word keywords.
|
1722
|
-
(r'(^|(?<=(\s|\.)))(ABBREVIATED|ADD|ALIASES|APPEND|ASSERT|'
|
1723
|
-
r'ASSIGN(ING)?|AT(\s+FIRST)?|'
|
1724
|
-
r'BACK|BLOCK|BREAK-POINT|'
|
1725
|
-
r'CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|'
|
1726
|
-
r'CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|'
|
1727
|
-
r'CONSTANTS|CONTEXTS|CONTINUE|CONTROLS|'
|
1728
|
-
r'DATA|DECIMALS|DEFAULT|DEFINE|DEFINITION|DEFERRED|DEMAND|'
|
1729
|
-
r'DETAIL|DIRECTORY|DIVIDE|DO|'
|
1730
|
-
r'ELSE(IF)?|ENDAT|ENDCASE|ENDCLASS|ENDDO|ENDFORM|ENDFUNCTION|'
|
1731
|
-
r'ENDIF|ENDLOOP|ENDMETHOD|ENDMODULE|ENDSELECT|ENDTRY|'
|
1732
|
-
r'ENHANCEMENT|EVENTS|EXCEPTIONS|EXIT|EXPORT|EXPORTING|EXTRACT|'
|
1733
|
-
r'FETCH|FIELDS?|FIND|FOR|FORM|FORMAT|FREE|FROM|'
|
1734
|
-
r'HIDE|'
|
1735
|
-
r'ID|IF|IMPORT|IMPLEMENTATION|IMPORTING|IN|INCLUDE|INCLUDING|'
|
1736
|
-
r'INDEX|INFOTYPES|INITIALIZATION|INTERFACE|INTERFACES|INTO|'
|
1737
|
-
r'LENGTH|LINES|LOAD|LOCAL|'
|
1738
|
-
r'JOIN|'
|
1739
|
-
r'KEY|'
|
1740
|
-
r'MAXIMUM|MESSAGE|METHOD[S]?|MINIMUM|MODULE|MODIFY|MOVE|MULTIPLY|'
|
1741
|
-
r'NODES|'
|
1742
|
-
r'OBLIGATORY|OF|OFF|ON|OVERLAY|'
|
1743
|
-
r'PACK|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|'
|
1744
|
-
r'RAISE|RAISING|RANGES|READ|RECEIVE|REFRESH|REJECT|REPORT|RESERVE|'
|
1745
|
-
r'RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|'
|
1746
|
-
r'SCROLL|SEARCH|SELECT|SHIFT|SINGLE|SKIP|SORT|SPLIT|STATICS|STOP|'
|
1747
|
-
r'SUBMIT|SUBTRACT|SUM|SUMMARY|SUMMING|SUPPLY|'
|
1748
|
-
r'TABLE|TABLES|TIMES|TITLE|TO|TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|'
|
1749
|
-
r'ULINE|UNDER|UNPACK|UPDATE|USING|'
|
1750
|
-
r'VALUE|VALUES|VIA|'
|
1751
|
-
r'WAIT|WHEN|WHERE|WHILE|WITH|WINDOW|WRITE)\b', Keyword),
|
1752
|
-
|
1753
|
-
# builtins
|
1754
|
-
(r'(abs|acos|asin|atan|'
|
1755
|
-
r'boolc|boolx|bit_set|'
|
1756
|
-
r'char_off|charlen|ceil|cmax|cmin|condense|contains|'
|
1757
|
-
r'contains_any_of|contains_any_not_of|concat_lines_of|cos|cosh|'
|
1758
|
-
r'count|count_any_of|count_any_not_of|'
|
1759
|
-
r'dbmaxlen|distance|'
|
1760
|
-
r'escape|exp|'
|
1761
|
-
r'find|find_end|find_any_of|find_any_not_of|floor|frac|from_mixed|'
|
1762
|
-
r'insert|'
|
1763
|
-
r'lines|log|log10|'
|
1764
|
-
r'match|matches|'
|
1765
|
-
r'nmax|nmin|numofchar|'
|
1766
|
-
r'repeat|replace|rescale|reverse|round|'
|
1767
|
-
r'segment|shift_left|shift_right|sign|sin|sinh|sqrt|strlen|'
|
1768
|
-
r'substring|substring_after|substring_from|substring_before|substring_to|'
|
1769
|
-
r'tan|tanh|to_upper|to_lower|to_mixed|translate|trunc|'
|
1770
|
-
r'xstrlen)(\()\b', bygroups(Name.Builtin, Punctuation)),
|
1771
|
-
|
1772
|
-
(r'&[0-9]', Name),
|
1773
|
-
(r'[0-9]+', Number.Integer),
|
1774
|
-
|
1775
|
-
# operators which look like variable names before
|
1776
|
-
# parsing variable names.
|
1777
|
-
(r'(?<=(\s|.))(AND|EQ|NE|GT|LT|GE|LE|CO|CN|CA|NA|CS|NOT|NS|CP|NP|'
|
1778
|
-
r'BYTE-CO|BYTE-CN|BYTE-CA|BYTE-NA|BYTE-CS|BYTE-NS|'
|
1779
|
-
r'IS\s+(NOT\s+)?(INITIAL|ASSIGNED|REQUESTED|BOUND))\b', Operator),
|
1780
|
-
|
1781
|
-
include('variable-names'),
|
1782
|
-
|
1783
|
-
# standard oparators after variable names,
|
1784
|
-
# because < and > are part of field symbols.
|
1785
|
-
(r'[?*<>=\-+]', Operator),
|
1786
|
-
(r"'(''|[^'])*'", String.Single),
|
1787
|
-
(r"`([^`])*`", String.Single),
|
1788
|
-
(r'[/;:()\[\],\.]', Punctuation)
|
1789
|
-
],
|
1790
|
-
}
|
1791
|
-
|
1792
|
-
|
1793
|
-
class NewspeakLexer(RegexLexer):
|
1794
|
-
"""
|
1795
|
-
For `Newspeak <http://newspeaklanguage.org/>` syntax.
|
1796
|
-
"""
|
1797
|
-
name = 'Newspeak'
|
1798
|
-
filenames = ['*.ns2']
|
1799
|
-
aliases = ['newspeak', ]
|
1800
|
-
mimetypes = ['text/x-newspeak']
|
1801
|
-
|
1802
|
-
tokens = {
|
1803
|
-
'root' : [
|
1804
|
-
(r'\b(Newsqueak2)\b',Keyword.Declaration),
|
1805
|
-
(r"'[^']*'",String),
|
1806
|
-
(r'\b(class)(\s+)(\w+)(\s*)',
|
1807
|
-
bygroups(Keyword.Declaration,Text,Name.Class,Text)),
|
1808
|
-
(r'\b(mixin|self|super|private|public|protected|nil|true|false)\b',
|
1809
|
-
Keyword),
|
1810
|
-
(r'(\w+\:)(\s*)([a-zA-Z_]\w+)',
|
1811
|
-
bygroups(Name.Function,Text,Name.Variable)),
|
1812
|
-
(r'(\w+)(\s*)(=)',
|
1813
|
-
bygroups(Name.Attribute,Text,Operator)),
|
1814
|
-
(r'<\w+>', Comment.Special),
|
1815
|
-
include('expressionstat'),
|
1816
|
-
include('whitespace')
|
1817
|
-
],
|
1818
|
-
|
1819
|
-
'expressionstat': [
|
1820
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
1821
|
-
(r'\d+', Number.Integer),
|
1822
|
-
(r':\w+',Name.Variable),
|
1823
|
-
(r'(\w+)(::)', bygroups(Name.Variable, Operator)),
|
1824
|
-
(r'\w+:', Name.Function),
|
1825
|
-
(r'\w+', Name.Variable),
|
1826
|
-
(r'\(|\)', Punctuation),
|
1827
|
-
(r'\[|\]', Punctuation),
|
1828
|
-
(r'\{|\}', Punctuation),
|
1829
|
-
|
1830
|
-
(r'(\^|\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-|:)', Operator),
|
1831
|
-
(r'\.|;', Punctuation),
|
1832
|
-
include('whitespace'),
|
1833
|
-
include('literals'),
|
1834
|
-
],
|
1835
|
-
'literals': [
|
1836
|
-
(r'\$.', String),
|
1837
|
-
(r"'[^']*'", String),
|
1838
|
-
(r"#'[^']*'", String.Symbol),
|
1839
|
-
(r"#\w+:?", String.Symbol),
|
1840
|
-
(r"#(\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-)+", String.Symbol)
|
1841
|
-
|
1842
|
-
],
|
1843
|
-
'whitespace' : [
|
1844
|
-
(r'\s+', Text),
|
1845
|
-
(r'"[^"]*"', Comment)
|
1846
|
-
]
|
1847
|
-
}
|
1848
|
-
|
1849
|
-
|
1850
|
-
class GherkinLexer(RegexLexer):
|
1851
|
-
"""
|
1852
|
-
For `Gherkin <http://github.com/aslakhellesoy/gherkin/>` syntax.
|
1853
|
-
|
1854
|
-
.. versionadded:: 1.2
|
1855
|
-
"""
|
1856
|
-
name = 'Gherkin'
|
1857
|
-
aliases = ['cucumber', 'gherkin']
|
1858
|
-
filenames = ['*.feature']
|
1859
|
-
mimetypes = ['text/x-gherkin']
|
1860
|
-
|
1861
|
-
feature_keywords = u'^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$'
|
1862
|
-
feature_element_keywords = u'^(\\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$'
|
1863
|
-
examples_keywords = u'^(\\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$'
|
1864
|
-
step_keywords = u'^(\\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y\'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )'
|
1865
|
-
|
1866
|
-
tokens = {
|
1867
|
-
'comments': [
|
1868
|
-
(r'^\s*#.*$', Comment),
|
1869
|
-
],
|
1870
|
-
'feature_elements' : [
|
1871
|
-
(step_keywords, Keyword, "step_content_stack"),
|
1872
|
-
include('comments'),
|
1873
|
-
(r"(\s|.)", Name.Function),
|
1874
|
-
],
|
1875
|
-
'feature_elements_on_stack' : [
|
1876
|
-
(step_keywords, Keyword, "#pop:2"),
|
1877
|
-
include('comments'),
|
1878
|
-
(r"(\s|.)", Name.Function),
|
1879
|
-
],
|
1880
|
-
'examples_table': [
|
1881
|
-
(r"\s+\|", Keyword, 'examples_table_header'),
|
1882
|
-
include('comments'),
|
1883
|
-
(r"(\s|.)", Name.Function),
|
1884
|
-
],
|
1885
|
-
'examples_table_header': [
|
1886
|
-
(r"\s+\|\s*$", Keyword, "#pop:2"),
|
1887
|
-
include('comments'),
|
1888
|
-
(r"\\\|", Name.Variable),
|
1889
|
-
(r"\s*\|", Keyword),
|
1890
|
-
(r"[^\|]", Name.Variable),
|
1891
|
-
],
|
1892
|
-
'scenario_sections_on_stack': [
|
1893
|
-
(feature_element_keywords,
|
1894
|
-
bygroups(Name.Function, Keyword, Keyword, Name.Function),
|
1895
|
-
"feature_elements_on_stack"),
|
1896
|
-
],
|
1897
|
-
'narrative': [
|
1898
|
-
include('scenario_sections_on_stack'),
|
1899
|
-
include('comments'),
|
1900
|
-
(r"(\s|.)", Name.Function),
|
1901
|
-
],
|
1902
|
-
'table_vars': [
|
1903
|
-
(r'(<[^>]+>)', Name.Variable),
|
1904
|
-
],
|
1905
|
-
'numbers': [
|
1906
|
-
(r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', String),
|
1907
|
-
],
|
1908
|
-
'string': [
|
1909
|
-
include('table_vars'),
|
1910
|
-
(r'(\s|.)', String),
|
1911
|
-
],
|
1912
|
-
'py_string': [
|
1913
|
-
(r'"""', Keyword, "#pop"),
|
1914
|
-
include('string'),
|
1915
|
-
],
|
1916
|
-
'step_content_root':[
|
1917
|
-
(r"$", Keyword, "#pop"),
|
1918
|
-
include('step_content'),
|
1919
|
-
],
|
1920
|
-
'step_content_stack':[
|
1921
|
-
(r"$", Keyword, "#pop:2"),
|
1922
|
-
include('step_content'),
|
1923
|
-
],
|
1924
|
-
'step_content':[
|
1925
|
-
(r'"', Name.Function, "double_string"),
|
1926
|
-
include('table_vars'),
|
1927
|
-
include('numbers'),
|
1928
|
-
include('comments'),
|
1929
|
-
(r'(\s|.)', Name.Function),
|
1930
|
-
],
|
1931
|
-
'table_content': [
|
1932
|
-
(r"\s+\|\s*$", Keyword, "#pop"),
|
1933
|
-
include('comments'),
|
1934
|
-
(r"\\\|", String),
|
1935
|
-
(r"\s*\|", Keyword),
|
1936
|
-
include('string'),
|
1937
|
-
],
|
1938
|
-
'double_string': [
|
1939
|
-
(r'"', Name.Function, "#pop"),
|
1940
|
-
include('string'),
|
1941
|
-
],
|
1942
|
-
'root': [
|
1943
|
-
(r'\n', Name.Function),
|
1944
|
-
include('comments'),
|
1945
|
-
(r'"""', Keyword, "py_string"),
|
1946
|
-
(r'\s+\|', Keyword, 'table_content'),
|
1947
|
-
(r'"', Name.Function, "double_string"),
|
1948
|
-
include('table_vars'),
|
1949
|
-
include('numbers'),
|
1950
|
-
(r'(\s*)(@[^@\r\n\t ]+)', bygroups(Name.Function, Name.Tag)),
|
1951
|
-
(step_keywords, bygroups(Name.Function, Keyword),
|
1952
|
-
'step_content_root'),
|
1953
|
-
(feature_keywords, bygroups(Keyword, Keyword, Name.Function),
|
1954
|
-
'narrative'),
|
1955
|
-
(feature_element_keywords,
|
1956
|
-
bygroups(Name.Function, Keyword, Keyword, Name.Function),
|
1957
|
-
'feature_elements'),
|
1958
|
-
(examples_keywords,
|
1959
|
-
bygroups(Name.Function, Keyword, Keyword, Name.Function),
|
1960
|
-
'examples_table'),
|
1961
|
-
(r'(\s|.)', Name.Function),
|
1962
|
-
]
|
1963
|
-
}
|
1964
|
-
|
1965
|
-
class AsymptoteLexer(RegexLexer):
|
1966
|
-
"""
|
1967
|
-
For `Asymptote <http://asymptote.sf.net/>`_ source code.
|
1968
|
-
|
1969
|
-
.. versionadded:: 1.2
|
1970
|
-
"""
|
1971
|
-
name = 'Asymptote'
|
1972
|
-
aliases = ['asy', 'asymptote']
|
1973
|
-
filenames = ['*.asy']
|
1974
|
-
mimetypes = ['text/x-asymptote']
|
1975
|
-
|
1976
|
-
#: optional Comment or Whitespace
|
1977
|
-
_ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
|
1978
|
-
|
1979
|
-
tokens = {
|
1980
|
-
'whitespace': [
|
1981
|
-
(r'\n', Text),
|
1982
|
-
(r'\s+', Text),
|
1983
|
-
(r'\\\n', Text), # line continuation
|
1984
|
-
(r'//(\n|(.|\n)*?[^\\]\n)', Comment),
|
1985
|
-
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment),
|
1986
|
-
],
|
1987
|
-
'statements': [
|
1988
|
-
# simple string (TeX friendly)
|
1989
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
1990
|
-
# C style string (with character escapes)
|
1991
|
-
(r"'", String, 'string'),
|
1992
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
|
1993
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
1994
|
-
(r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
|
1995
|
-
(r'0[0-7]+[Ll]?', Number.Oct),
|
1996
|
-
(r'\d+[Ll]?', Number.Integer),
|
1997
|
-
(r'[~!%^&*+=|?:<>/-]', Operator),
|
1998
|
-
(r'[()\[\],.]', Punctuation),
|
1999
|
-
(r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
|
2000
|
-
(r'(and|controls|tension|atleast|curl|if|else|while|for|do|'
|
2001
|
-
r'return|break|continue|struct|typedef|new|access|import|'
|
2002
|
-
r'unravel|from|include|quote|static|public|private|restricted|'
|
2003
|
-
r'this|explicit|true|false|null|cycle|newframe|operator)\b', Keyword),
|
2004
|
-
# Since an asy-type-name can be also an asy-function-name,
|
2005
|
-
# in the following we test if the string " [a-zA-Z]" follows
|
2006
|
-
# the Keyword.Type.
|
2007
|
-
# Of course it is not perfect !
|
2008
|
-
(r'(Braid|FitResult|Label|Legend|TreeNode|abscissa|arc|arrowhead|'
|
2009
|
-
r'binarytree|binarytreeNode|block|bool|bool3|bounds|bqe|circle|'
|
2010
|
-
r'conic|coord|coordsys|cputime|ellipse|file|filltype|frame|grid3|'
|
2011
|
-
r'guide|horner|hsv|hyperbola|indexedTransform|int|inversion|key|'
|
2012
|
-
r'light|line|linefit|marginT|marker|mass|object|pair|parabola|path|'
|
2013
|
-
r'path3|pen|picture|point|position|projection|real|revolution|'
|
2014
|
-
r'scaleT|scientific|segment|side|slice|splitface|string|surface|'
|
2015
|
-
r'tensionSpecifier|ticklocate|ticksgridT|tickvalues|transform|'
|
2016
|
-
r'transformation|tree|triangle|trilinear|triple|vector|'
|
2017
|
-
r'vertex|void)(?=([ ]{1,}[a-zA-Z]))', Keyword.Type),
|
2018
|
-
# Now the asy-type-name which are not asy-function-name
|
2019
|
-
# except yours !
|
2020
|
-
# Perhaps useless
|
2021
|
-
(r'(Braid|FitResult|TreeNode|abscissa|arrowhead|block|bool|bool3|'
|
2022
|
-
r'bounds|coord|frame|guide|horner|int|linefit|marginT|pair|pen|'
|
2023
|
-
r'picture|position|real|revolution|slice|splitface|ticksgridT|'
|
2024
|
-
r'tickvalues|tree|triple|vertex|void)\b', Keyword.Type),
|
2025
|
-
('[a-zA-Z_]\w*:(?!:)', Name.Label),
|
2026
|
-
('[a-zA-Z_]\w*', Name),
|
2027
|
-
],
|
2028
|
-
'root': [
|
2029
|
-
include('whitespace'),
|
2030
|
-
# functions
|
2031
|
-
(r'((?:[\w*\s])+?(?:\s|\*))' # return arguments
|
2032
|
-
r'([a-zA-Z_]\w*)' # method name
|
2033
|
-
r'(\s*\([^;]*?\))' # signature
|
2034
|
-
r'(' + _ws + r')({)',
|
2035
|
-
bygroups(using(this), Name.Function, using(this), using(this),
|
2036
|
-
Punctuation),
|
2037
|
-
'function'),
|
2038
|
-
# function declarations
|
2039
|
-
(r'((?:[\w*\s])+?(?:\s|\*))' # return arguments
|
2040
|
-
r'([a-zA-Z_]\w*)' # method name
|
2041
|
-
r'(\s*\([^;]*?\))' # signature
|
2042
|
-
r'(' + _ws + r')(;)',
|
2043
|
-
bygroups(using(this), Name.Function, using(this), using(this),
|
2044
|
-
Punctuation)),
|
2045
|
-
('', Text, 'statement'),
|
2046
|
-
],
|
2047
|
-
'statement' : [
|
2048
|
-
include('whitespace'),
|
2049
|
-
include('statements'),
|
2050
|
-
('[{}]', Punctuation),
|
2051
|
-
(';', Punctuation, '#pop'),
|
2052
|
-
],
|
2053
|
-
'function': [
|
2054
|
-
include('whitespace'),
|
2055
|
-
include('statements'),
|
2056
|
-
(';', Punctuation),
|
2057
|
-
('{', Punctuation, '#push'),
|
2058
|
-
('}', Punctuation, '#pop'),
|
2059
|
-
],
|
2060
|
-
'string': [
|
2061
|
-
(r"'", String, '#pop'),
|
2062
|
-
(r'\\([\\abfnrtv"\'?]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
2063
|
-
(r'\n', String),
|
2064
|
-
(r"[^\\'\n]+", String), # all other characters
|
2065
|
-
(r'\\\n', String),
|
2066
|
-
(r'\\n', String), # line continuation
|
2067
|
-
(r'\\', String), # stray backslash
|
2068
|
-
]
|
2069
|
-
}
|
2070
|
-
|
2071
|
-
def get_tokens_unprocessed(self, text):
|
2072
|
-
from pygments.lexers._asybuiltins import ASYFUNCNAME, ASYVARNAME
|
2073
|
-
for index, token, value in \
|
2074
|
-
RegexLexer.get_tokens_unprocessed(self, text):
|
2075
|
-
if token is Name and value in ASYFUNCNAME:
|
2076
|
-
token = Name.Function
|
2077
|
-
elif token is Name and value in ASYVARNAME:
|
2078
|
-
token = Name.Variable
|
2079
|
-
yield index, token, value
|
2080
|
-
|
2081
|
-
|
2082
|
-
class PostScriptLexer(RegexLexer):
|
2083
|
-
"""
|
2084
|
-
Lexer for PostScript files.
|
2085
|
-
|
2086
|
-
The PostScript Language Reference published by Adobe at
|
2087
|
-
<http://partners.adobe.com/public/developer/en/ps/PLRM.pdf>
|
2088
|
-
is the authority for this.
|
2089
|
-
|
2090
|
-
.. versionadded:: 1.4
|
2091
|
-
"""
|
2092
|
-
name = 'PostScript'
|
2093
|
-
aliases = ['postscript', 'postscr']
|
2094
|
-
filenames = ['*.ps', '*.eps']
|
2095
|
-
mimetypes = ['application/postscript']
|
2096
|
-
|
2097
|
-
delimiter = r'\(\)\<\>\[\]\{\}\/\%\s'
|
2098
|
-
delimiter_end = r'(?=[%s])' % delimiter
|
2099
|
-
|
2100
|
-
valid_name_chars = r'[^%s]' % delimiter
|
2101
|
-
valid_name = r"%s+%s" % (valid_name_chars, delimiter_end)
|
2102
|
-
|
2103
|
-
tokens = {
|
2104
|
-
'root': [
|
2105
|
-
# All comment types
|
2106
|
-
(r'^%!.+\n', Comment.Preproc),
|
2107
|
-
(r'%%.*\n', Comment.Special),
|
2108
|
-
(r'(^%.*\n){2,}', Comment.Multiline),
|
2109
|
-
(r'%.*\n', Comment.Single),
|
2110
|
-
|
2111
|
-
# String literals are awkward; enter separate state.
|
2112
|
-
(r'\(', String, 'stringliteral'),
|
2113
|
-
|
2114
|
-
(r'[\{\}(\<\<)(\>\>)\[\]]', Punctuation),
|
2115
|
-
|
2116
|
-
# Numbers
|
2117
|
-
(r'<[0-9A-Fa-f]+>' + delimiter_end, Number.Hex),
|
2118
|
-
# Slight abuse: use Oct to signify any explicit base system
|
2119
|
-
(r'[0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)'
|
2120
|
-
r'((e|E)[0-9]+)?' + delimiter_end, Number.Oct),
|
2121
|
-
(r'(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?'
|
2122
|
-
+ delimiter_end, Number.Float),
|
2123
|
-
(r'(\-|\+)?[0-9]+' + delimiter_end, Number.Integer),
|
2124
|
-
|
2125
|
-
# References
|
2126
|
-
(r'\/%s' % valid_name, Name.Variable),
|
2127
|
-
|
2128
|
-
# Names
|
2129
|
-
(valid_name, Name.Function), # Anything else is executed
|
2130
|
-
|
2131
|
-
# These keywords taken from
|
2132
|
-
# <http://www.math.ubc.ca/~cass/graphics/manual/pdf/a1.pdf>
|
2133
|
-
# Is there an authoritative list anywhere that doesn't involve
|
2134
|
-
# trawling documentation?
|
2135
|
-
|
2136
|
-
(r'(false|true)' + delimiter_end, Keyword.Constant),
|
2137
|
-
|
2138
|
-
# Conditionals / flow control
|
2139
|
-
(r'(eq|ne|ge|gt|le|lt|and|or|not|if|ifelse|for|forall)'
|
2140
|
-
+ delimiter_end, Keyword.Reserved),
|
2141
|
-
|
2142
|
-
('(abs|add|aload|arc|arcn|array|atan|begin|bind|ceiling|charpath|'
|
2143
|
-
'clip|closepath|concat|concatmatrix|copy|cos|currentlinewidth|'
|
2144
|
-
'currentmatrix|currentpoint|curveto|cvi|cvs|def|defaultmatrix|'
|
2145
|
-
'dict|dictstackoverflow|div|dtransform|dup|end|exch|exec|exit|exp|'
|
2146
|
-
'fill|findfont|floor|get|getinterval|grestore|gsave|gt|'
|
2147
|
-
'identmatrix|idiv|idtransform|index|invertmatrix|itransform|'
|
2148
|
-
'length|lineto|ln|load|log|loop|matrix|mod|moveto|mul|neg|newpath|'
|
2149
|
-
'pathforall|pathbbox|pop|print|pstack|put|quit|rand|rangecheck|'
|
2150
|
-
'rcurveto|repeat|restore|rlineto|rmoveto|roll|rotate|round|run|'
|
2151
|
-
'save|scale|scalefont|setdash|setfont|setgray|setlinecap|'
|
2152
|
-
'setlinejoin|setlinewidth|setmatrix|setrgbcolor|shfill|show|'
|
2153
|
-
'showpage|sin|sqrt|stack|stringwidth|stroke|strokepath|sub|'
|
2154
|
-
'syntaxerror|transform|translate|truncate|typecheck|undefined|'
|
2155
|
-
'undefinedfilename|undefinedresult)' + delimiter_end,
|
2156
|
-
Name.Builtin),
|
2157
|
-
|
2158
|
-
(r'\s+', Text),
|
2159
|
-
],
|
2160
|
-
|
2161
|
-
'stringliteral': [
|
2162
|
-
(r'[^\(\)\\]+', String),
|
2163
|
-
(r'\\', String.Escape, 'escape'),
|
2164
|
-
(r'\(', String, '#push'),
|
2165
|
-
(r'\)', String, '#pop'),
|
2166
|
-
],
|
2167
|
-
|
2168
|
-
'escape': [
|
2169
|
-
(r'([0-8]{3}|n|r|t|b|f|\\|\(|\))?', String.Escape, '#pop'),
|
2170
|
-
],
|
2171
|
-
}
|
2172
|
-
|
2173
|
-
|
2174
|
-
class AutohotkeyLexer(RegexLexer):
|
2175
|
-
"""
|
2176
|
-
For `autohotkey <http://www.autohotkey.com/>`_ source code.
|
2177
|
-
|
2178
|
-
.. versionadded:: 1.4
|
2179
|
-
"""
|
2180
|
-
name = 'autohotkey'
|
2181
|
-
aliases = ['ahk', 'autohotkey']
|
2182
|
-
filenames = ['*.ahk', '*.ahkl']
|
2183
|
-
mimetypes = ['text/x-autohotkey']
|
2184
|
-
|
2185
|
-
tokens = {
|
2186
|
-
'root': [
|
2187
|
-
(r'^(\s*)(/\*)', bygroups(Text, Comment.Multiline),
|
2188
|
-
'incomment'),
|
2189
|
-
(r'^(\s*)(\()', bygroups(Text, Generic), 'incontinuation'),
|
2190
|
-
(r'\s+;.*?$', Comment.Singleline),
|
2191
|
-
(r'^;.*?$', Comment.Singleline),
|
2192
|
-
(r'[]{}(),;[]', Punctuation),
|
2193
|
-
(r'(in|is|and|or|not)\b', Operator.Word),
|
2194
|
-
(r'\%[a-zA-Z_#@$][\w#@$]*\%', Name.Variable),
|
2195
|
-
(r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
|
2196
|
-
include('commands'),
|
2197
|
-
include('labels'),
|
2198
|
-
include('builtInFunctions'),
|
2199
|
-
include('builtInVariables'),
|
2200
|
-
(r'"', String, combined('stringescape', 'dqs')),
|
2201
|
-
include('numbers'),
|
2202
|
-
(r'[a-zA-Z_#@$][\w#@$]*', Name),
|
2203
|
-
(r'\\|\'', Text),
|
2204
|
-
(r'\`([\,\%\`abfnrtv\-\+;])', String.Escape),
|
2205
|
-
include('garbage'),
|
2206
|
-
],
|
2207
|
-
'incomment': [
|
2208
|
-
(r'^\s*\*/', Comment.Multiline, '#pop'),
|
2209
|
-
(r'[^*/]', Comment.Multiline),
|
2210
|
-
(r'[*/]', Comment.Multiline)
|
2211
|
-
],
|
2212
|
-
'incontinuation': [
|
2213
|
-
(r'^\s*\)', Generic, '#pop'),
|
2214
|
-
(r'[^)]', Generic),
|
2215
|
-
(r'[)]', Generic),
|
2216
|
-
],
|
2217
|
-
'commands': [
|
2218
|
-
(r'(?i)^(\s*)(global|local|static|'
|
2219
|
-
r'#AllowSameLineComments|#ClipboardTimeout|#CommentFlag|'
|
2220
|
-
r'#ErrorStdOut|#EscapeChar|#HotkeyInterval|#HotkeyModifierTimeout|'
|
2221
|
-
r'#Hotstring|#IfWinActive|#IfWinExist|#IfWinNotActive|'
|
2222
|
-
r'#IfWinNotExist|#IncludeAgain|#Include|#InstallKeybdHook|'
|
2223
|
-
r'#InstallMouseHook|#KeyHistory|#LTrim|#MaxHotkeysPerInterval|'
|
2224
|
-
r'#MaxMem|#MaxThreads|#MaxThreadsBuffer|#MaxThreadsPerHotkey|'
|
2225
|
-
r'#NoEnv|#NoTrayIcon|#Persistent|#SingleInstance|#UseHook|'
|
2226
|
-
r'#WinActivateForce|AutoTrim|BlockInput|Break|Click|ClipWait|'
|
2227
|
-
r'Continue|Control|ControlClick|ControlFocus|ControlGetFocus|'
|
2228
|
-
r'ControlGetPos|ControlGetText|ControlGet|ControlMove|ControlSend|'
|
2229
|
-
r'ControlSendRaw|ControlSetText|CoordMode|Critical|'
|
2230
|
-
r'DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|'
|
2231
|
-
r'DriveSpaceFree|Edit|Else|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|'
|
2232
|
-
r'EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|'
|
2233
|
-
r'FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|'
|
2234
|
-
r'FileDelete|FileGetAttrib|FileGetShortcut|FileGetSize|'
|
2235
|
-
r'FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|'
|
2236
|
-
r'FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|'
|
2237
|
-
r'FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|'
|
2238
|
-
r'FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|'
|
2239
|
-
r'GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|'
|
2240
|
-
r'GuiControlGet|Hotkey|IfEqual|IfExist|IfGreaterOrEqual|IfGreater|'
|
2241
|
-
r'IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|'
|
2242
|
-
r'IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|'
|
2243
|
-
r'IfWinNotExist|If |ImageSearch|IniDelete|IniRead|IniWrite|'
|
2244
|
-
r'InputBox|Input|KeyHistory|KeyWait|ListHotkeys|ListLines|'
|
2245
|
-
r'ListVars|Loop|Menu|MouseClickDrag|MouseClick|MouseGetPos|'
|
2246
|
-
r'MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|'
|
2247
|
-
r'PixelSearch|PostMessage|Process|Progress|Random|RegDelete|'
|
2248
|
-
r'RegRead|RegWrite|Reload|Repeat|Return|RunAs|RunWait|Run|'
|
2249
|
-
r'SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|Send|'
|
2250
|
-
r'SetBatchLines|SetCapslockState|SetControlDelay|'
|
2251
|
-
r'SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|'
|
2252
|
-
r'SetMouseDelay|SetNumlockState|SetScrollLockState|'
|
2253
|
-
r'SetStoreCapslockMode|SetTimer|SetTitleMatchMode|'
|
2254
|
-
r'SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|'
|
2255
|
-
r'SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|'
|
2256
|
-
r'SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|'
|
2257
|
-
r'SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|'
|
2258
|
-
r'StringGetPos|StringLeft|StringLen|StringLower|StringMid|'
|
2259
|
-
r'StringReplace|StringRight|StringSplit|StringTrimLeft|'
|
2260
|
-
r'StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|'
|
2261
|
-
r'Transform|TrayTip|URLDownloadToFile|While|WinActivate|'
|
2262
|
-
r'WinActivateBottom|WinClose|WinGetActiveStats|WinGetActiveTitle|'
|
2263
|
-
r'WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinGet|WinHide|'
|
2264
|
-
r'WinKill|WinMaximize|WinMenuSelectItem|WinMinimizeAllUndo|'
|
2265
|
-
r'WinMinimizeAll|WinMinimize|WinMove|WinRestore|WinSetTitle|'
|
2266
|
-
r'WinSet|WinShow|WinWaitActive|WinWaitClose|WinWaitNotActive|'
|
2267
|
-
r'WinWait)\b', bygroups(Text, Name.Builtin)),
|
2268
|
-
],
|
2269
|
-
'builtInFunctions': [
|
2270
|
-
(r'(?i)(Abs|ACos|Asc|ASin|ATan|Ceil|Chr|Cos|DllCall|Exp|FileExist|'
|
2271
|
-
r'Floor|GetKeyState|IL_Add|IL_Create|IL_Destroy|InStr|IsFunc|'
|
2272
|
-
r'IsLabel|Ln|Log|LV_Add|LV_Delete|LV_DeleteCol|LV_GetCount|'
|
2273
|
-
r'LV_GetNext|LV_GetText|LV_Insert|LV_InsertCol|LV_Modify|'
|
2274
|
-
r'LV_ModifyCol|LV_SetImageList|Mod|NumGet|NumPut|OnMessage|'
|
2275
|
-
r'RegExMatch|RegExReplace|RegisterCallback|Round|SB_SetIcon|'
|
2276
|
-
r'SB_SetParts|SB_SetText|Sin|Sqrt|StrLen|SubStr|Tan|TV_Add|'
|
2277
|
-
r'TV_Delete|TV_GetChild|TV_GetCount|TV_GetNext|TV_Get|'
|
2278
|
-
r'TV_GetParent|TV_GetPrev|TV_GetSelection|TV_GetText|TV_Modify|'
|
2279
|
-
r'VarSetCapacity|WinActive|WinExist|Object|ComObjActive|'
|
2280
|
-
r'ComObjArray|ComObjEnwrap|ComObjUnwrap|ComObjParameter|'
|
2281
|
-
r'ComObjType|ComObjConnect|ComObjCreate|ComObjGet|ComObjError|'
|
2282
|
-
r'ComObjValue|Insert|MinIndex|MaxIndex|Remove|SetCapacity|'
|
2283
|
-
r'GetCapacity|GetAddress|_NewEnum|FileOpen|Read|Write|ReadLine|'
|
2284
|
-
r'WriteLine|ReadNumType|WriteNumType|RawRead|RawWrite|Seek|Tell|'
|
2285
|
-
r'Close|Next|IsObject|StrPut|StrGet|Trim|LTrim|RTrim)\b',
|
2286
|
-
Name.Function),
|
2287
|
-
],
|
2288
|
-
'builtInVariables': [
|
2289
|
-
(r'(?i)(A_AhkPath|A_AhkVersion|A_AppData|A_AppDataCommon|'
|
2290
|
-
r'A_AutoTrim|A_BatchLines|A_CaretX|A_CaretY|A_ComputerName|'
|
2291
|
-
r'A_ControlDelay|A_Cursor|A_DDDD|A_DDD|A_DD|A_DefaultMouseSpeed|'
|
2292
|
-
r'A_Desktop|A_DesktopCommon|A_DetectHiddenText|'
|
2293
|
-
r'A_DetectHiddenWindows|A_EndChar|A_EventInfo|A_ExitReason|'
|
2294
|
-
r'A_FormatFloat|A_FormatInteger|A_Gui|A_GuiEvent|A_GuiControl|'
|
2295
|
-
r'A_GuiControlEvent|A_GuiHeight|A_GuiWidth|A_GuiX|A_GuiY|A_Hour|'
|
2296
|
-
r'A_IconFile|A_IconHidden|A_IconNumber|A_IconTip|A_Index|'
|
2297
|
-
r'A_IPAddress1|A_IPAddress2|A_IPAddress3|A_IPAddress4|A_ISAdmin|'
|
2298
|
-
r'A_IsCompiled|A_IsCritical|A_IsPaused|A_IsSuspended|A_KeyDelay|'
|
2299
|
-
r'A_Language|A_LastError|A_LineFile|A_LineNumber|A_LoopField|'
|
2300
|
-
r'A_LoopFileAttrib|A_LoopFileDir|A_LoopFileExt|A_LoopFileFullPath|'
|
2301
|
-
r'A_LoopFileLongPath|A_LoopFileName|A_LoopFileShortName|'
|
2302
|
-
r'A_LoopFileShortPath|A_LoopFileSize|A_LoopFileSizeKB|'
|
2303
|
-
r'A_LoopFileSizeMB|A_LoopFileTimeAccessed|A_LoopFileTimeCreated|'
|
2304
|
-
r'A_LoopFileTimeModified|A_LoopReadLine|A_LoopRegKey|'
|
2305
|
-
r'A_LoopRegName|A_LoopRegSubkey|A_LoopRegTimeModified|'
|
2306
|
-
r'A_LoopRegType|A_MDAY|A_Min|A_MM|A_MMM|A_MMMM|A_Mon|A_MouseDelay|'
|
2307
|
-
r'A_MSec|A_MyDocuments|A_Now|A_NowUTC|A_NumBatchLines|A_OSType|'
|
2308
|
-
r'A_OSVersion|A_PriorHotkey|A_ProgramFiles|A_Programs|'
|
2309
|
-
r'A_ProgramsCommon|A_ScreenHeight|A_ScreenWidth|A_ScriptDir|'
|
2310
|
-
r'A_ScriptFullPath|A_ScriptName|A_Sec|A_Space|A_StartMenu|'
|
2311
|
-
r'A_StartMenuCommon|A_Startup|A_StartupCommon|A_StringCaseSense|'
|
2312
|
-
r'A_Tab|A_Temp|A_ThisFunc|A_ThisHotkey|A_ThisLabel|A_ThisMenu|'
|
2313
|
-
r'A_ThisMenuItem|A_ThisMenuItemPos|A_TickCount|A_TimeIdle|'
|
2314
|
-
r'A_TimeIdlePhysical|A_TimeSincePriorHotkey|A_TimeSinceThisHotkey|'
|
2315
|
-
r'A_TitleMatchMode|A_TitleMatchModeSpeed|A_UserName|A_WDay|'
|
2316
|
-
r'A_WinDelay|A_WinDir|A_WorkingDir|A_YDay|A_YEAR|A_YWeek|A_YYYY|'
|
2317
|
-
r'Clipboard|ClipboardAll|ComSpec|ErrorLevel|ProgramFiles|True|'
|
2318
|
-
r'False|A_IsUnicode|A_FileEncoding|A_OSVersion|A_PtrSize)\b',
|
2319
|
-
Name.Variable),
|
2320
|
-
],
|
2321
|
-
'labels': [
|
2322
|
-
# hotkeys and labels
|
2323
|
-
# technically, hotkey names are limited to named keys and buttons
|
2324
|
-
(r'(^\s*)([^:\s\(\"]+?:{1,2})', bygroups(Text, Name.Label)),
|
2325
|
-
(r'(^\s*)(::[^:\s]+?::)', bygroups(Text, Name.Label)),
|
2326
|
-
],
|
2327
|
-
'numbers': [
|
2328
|
-
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
2329
|
-
(r'\d+[eE][+-]?[0-9]+', Number.Float),
|
2330
|
-
(r'0\d+', Number.Oct),
|
2331
|
-
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
2332
|
-
(r'\d+L', Number.Integer.Long),
|
2333
|
-
(r'\d+', Number.Integer)
|
2334
|
-
],
|
2335
|
-
'stringescape': [
|
2336
|
-
(r'\"\"|\`([\,\%\`abfnrtv])', String.Escape),
|
2337
|
-
],
|
2338
|
-
'strings': [
|
2339
|
-
(r'[^"\n]+', String),
|
2340
|
-
],
|
2341
|
-
'dqs': [
|
2342
|
-
(r'"', String, '#pop'),
|
2343
|
-
include('strings')
|
2344
|
-
],
|
2345
|
-
'garbage': [
|
2346
|
-
(r'[^\S\n]', Text),
|
2347
|
-
# (r'.', Text), # no cheating
|
2348
|
-
],
|
2349
|
-
}
|
2350
|
-
|
2351
|
-
|
2352
|
-
class MaqlLexer(RegexLexer):
|
2353
|
-
"""
|
2354
|
-
Lexer for `GoodData MAQL
|
2355
|
-
<https://secure.gooddata.com/docs/html/advanced.metric.tutorial.html>`_
|
2356
|
-
scripts.
|
2357
|
-
|
2358
|
-
.. versionadded:: 1.4
|
2359
|
-
"""
|
2360
|
-
|
2361
|
-
name = 'MAQL'
|
2362
|
-
aliases = ['maql']
|
2363
|
-
filenames = ['*.maql']
|
2364
|
-
mimetypes = ['text/x-gooddata-maql','application/x-gooddata-maql']
|
2365
|
-
|
2366
|
-
flags = re.IGNORECASE
|
2367
|
-
tokens = {
|
2368
|
-
'root': [
|
2369
|
-
# IDENTITY
|
2370
|
-
(r'IDENTIFIER\b', Name.Builtin),
|
2371
|
-
# IDENTIFIER
|
2372
|
-
(r'\{[^}]+\}', Name.Variable),
|
2373
|
-
# NUMBER
|
2374
|
-
(r'[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?', Literal.Number),
|
2375
|
-
# STRING
|
2376
|
-
(r'"', Literal.String, 'string-literal'),
|
2377
|
-
# RELATION
|
2378
|
-
(r'\<\>|\!\=', Operator),
|
2379
|
-
(r'\=|\>\=|\>|\<\=|\<', Operator),
|
2380
|
-
# :=
|
2381
|
-
(r'\:\=', Operator),
|
2382
|
-
# OBJECT
|
2383
|
-
(r'\[[^]]+\]', Name.Variable.Class),
|
2384
|
-
# keywords
|
2385
|
-
(r'(DIMENSIONS?|BOTTOM|METRIC|COUNT|OTHER|FACT|WITH|TOP|OR|'
|
2386
|
-
r'ATTRIBUTE|CREATE|PARENT|FALSE|ROWS?|FROM|ALL|AS|PF|'
|
2387
|
-
r'COLUMNS?|DEFINE|REPORT|LIMIT|TABLE|LIKE|AND|BY|'
|
2388
|
-
r'BETWEEN|EXCEPT|SELECT|MATCH|WHERE|TRUE|FOR|IN|'
|
2389
|
-
r'WITHOUT|FILTER|ALIAS|ORDER|FACT|WHEN|NOT|ON|'
|
2390
|
-
r'KEYS|KEY|FULLSET|PRIMARY|LABELS|LABEL|VISUAL|'
|
2391
|
-
r'TITLE|DESCRIPTION|FOLDER|ALTER|DROP|ADD|DATASET|'
|
2392
|
-
r'DATATYPE|INT|BIGINT|DOUBLE|DATE|VARCHAR|DECIMAL|'
|
2393
|
-
r'SYNCHRONIZE|TYPE|DEFAULT|ORDER|ASC|DESC|HYPERLINK|'
|
2394
|
-
r'INCLUDE|TEMPLATE|MODIFY)\b', Keyword),
|
2395
|
-
# FUNCNAME
|
2396
|
-
(r'[a-z]\w*\b', Name.Function),
|
2397
|
-
# Comments
|
2398
|
-
(r'#.*', Comment.Single),
|
2399
|
-
# Punctuation
|
2400
|
-
(r'[,;\(\)]', Token.Punctuation),
|
2401
|
-
# Space is not significant
|
2402
|
-
(r'\s+', Text)
|
2403
|
-
],
|
2404
|
-
'string-literal': [
|
2405
|
-
(r'\\[tnrfbae"\\]', String.Escape),
|
2406
|
-
(r'"', Literal.String, '#pop'),
|
2407
|
-
(r'[^\\"]+', Literal.String)
|
2408
|
-
],
|
2409
|
-
}
|
2410
|
-
|
2411
|
-
|
2412
|
-
class GoodDataCLLexer(RegexLexer):
|
2413
|
-
"""
|
2414
|
-
Lexer for `GoodData-CL <http://github.com/gooddata/GoodData-CL/raw/master/cli/src/main/resources/com/gooddata/processor/COMMANDS.txt>`_
|
2415
|
-
script files.
|
2416
|
-
|
2417
|
-
.. versionadded:: 1.4
|
2418
|
-
"""
|
2419
|
-
|
2420
|
-
name = 'GoodData-CL'
|
2421
|
-
aliases = ['gooddata-cl']
|
2422
|
-
filenames = ['*.gdc']
|
2423
|
-
mimetypes = ['text/x-gooddata-cl']
|
2424
|
-
|
2425
|
-
flags = re.IGNORECASE
|
2426
|
-
tokens = {
|
2427
|
-
'root': [
|
2428
|
-
# Comments
|
2429
|
-
(r'#.*', Comment.Single),
|
2430
|
-
# Function call
|
2431
|
-
(r'[a-z]\w*', Name.Function),
|
2432
|
-
# Argument list
|
2433
|
-
(r'\(', Token.Punctuation, 'args-list'),
|
2434
|
-
# Punctuation
|
2435
|
-
(r';', Token.Punctuation),
|
2436
|
-
# Space is not significant
|
2437
|
-
(r'\s+', Text)
|
2438
|
-
],
|
2439
|
-
'args-list': [
|
2440
|
-
(r'\)', Token.Punctuation, '#pop'),
|
2441
|
-
(r',', Token.Punctuation),
|
2442
|
-
(r'[a-z]\w*', Name.Variable),
|
2443
|
-
(r'=', Operator),
|
2444
|
-
(r'"', Literal.String, 'string-literal'),
|
2445
|
-
(r'[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?', Literal.Number),
|
2446
|
-
# Space is not significant
|
2447
|
-
(r'\s', Text)
|
2448
|
-
],
|
2449
|
-
'string-literal': [
|
2450
|
-
(r'\\[tnrfbae"\\]', String.Escape),
|
2451
|
-
(r'"', Literal.String, '#pop'),
|
2452
|
-
(r'[^\\"]+', Literal.String)
|
2453
|
-
]
|
2454
|
-
}
|
2455
|
-
|
2456
|
-
|
2457
|
-
class ProtoBufLexer(RegexLexer):
|
2458
|
-
"""
|
2459
|
-
Lexer for `Protocol Buffer <http://code.google.com/p/protobuf/>`_
|
2460
|
-
definition files.
|
2461
|
-
|
2462
|
-
.. versionadded:: 1.4
|
2463
|
-
"""
|
2464
|
-
|
2465
|
-
name = 'Protocol Buffer'
|
2466
|
-
aliases = ['protobuf', 'proto']
|
2467
|
-
filenames = ['*.proto']
|
2468
|
-
|
2469
|
-
tokens = {
|
2470
|
-
'root': [
|
2471
|
-
(r'[ \t]+', Text),
|
2472
|
-
(r'[,;{}\[\]\(\)]', Punctuation),
|
2473
|
-
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
2474
|
-
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
|
2475
|
-
(r'\b(import|option|optional|required|repeated|default|packed|'
|
2476
|
-
r'ctype|extensions|to|max|rpc|returns)\b', Keyword),
|
2477
|
-
(r'(int32|int64|uint32|uint64|sint32|sint64|'
|
2478
|
-
r'fixed32|fixed64|sfixed32|sfixed64|'
|
2479
|
-
r'float|double|bool|string|bytes)\b', Keyword.Type),
|
2480
|
-
(r'(true|false)\b', Keyword.Constant),
|
2481
|
-
(r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'package'),
|
2482
|
-
(r'(message|extend)(\s+)',
|
2483
|
-
bygroups(Keyword.Declaration, Text), 'message'),
|
2484
|
-
(r'(enum|group|service)(\s+)',
|
2485
|
-
bygroups(Keyword.Declaration, Text), 'type'),
|
2486
|
-
(r'\".*\"', String),
|
2487
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
|
2488
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
2489
|
-
(r'(\-?(inf|nan))', Number.Float),
|
2490
|
-
(r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
|
2491
|
-
(r'0[0-7]+[LlUu]*', Number.Oct),
|
2492
|
-
(r'\d+[LlUu]*', Number.Integer),
|
2493
|
-
(r'[+-=]', Operator),
|
2494
|
-
(r'([a-zA-Z_][\w\.]*)([ \t]*)(=)',
|
2495
|
-
bygroups(Name.Attribute, Text, Operator)),
|
2496
|
-
('[a-zA-Z_][\w\.]*', Name),
|
2497
|
-
],
|
2498
|
-
'package': [
|
2499
|
-
(r'[a-zA-Z_]\w*', Name.Namespace, '#pop')
|
2500
|
-
],
|
2501
|
-
'message': [
|
2502
|
-
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
2503
|
-
],
|
2504
|
-
'type': [
|
2505
|
-
(r'[a-zA-Z_]\w*', Name, '#pop')
|
2506
|
-
],
|
2507
|
-
}
|
2508
|
-
|
2509
|
-
|
2510
|
-
class HybrisLexer(RegexLexer):
|
2511
|
-
"""
|
2512
|
-
For `Hybris <http://www.hybris-lang.org>`_ source code.
|
2513
|
-
|
2514
|
-
.. versionadded:: 1.4
|
2515
|
-
"""
|
2516
|
-
|
2517
|
-
name = 'Hybris'
|
2518
|
-
aliases = ['hybris', 'hy']
|
2519
|
-
filenames = ['*.hy', '*.hyb']
|
2520
|
-
mimetypes = ['text/x-hybris', 'application/x-hybris']
|
2521
|
-
|
2522
|
-
flags = re.MULTILINE | re.DOTALL
|
2523
|
-
|
2524
|
-
tokens = {
|
2525
|
-
'root': [
|
2526
|
-
# method names
|
2527
|
-
(r'^(\s*(?:function|method|operator\s+)+?)'
|
2528
|
-
r'([a-zA-Z_]\w*)'
|
2529
|
-
r'(\s*)(\()', bygroups(Keyword, Name.Function, Text, Operator)),
|
2530
|
-
(r'[^\S\n]+', Text),
|
2531
|
-
(r'//.*?\n', Comment.Single),
|
2532
|
-
(r'/\*.*?\*/', Comment.Multiline),
|
2533
|
-
(r'@[a-zA-Z_][\w\.]*', Name.Decorator),
|
2534
|
-
(r'(break|case|catch|next|default|do|else|finally|for|foreach|of|'
|
2535
|
-
r'unless|if|new|return|switch|me|throw|try|while)\b', Keyword),
|
2536
|
-
(r'(extends|private|protected|public|static|throws|function|method|'
|
2537
|
-
r'operator)\b', Keyword.Declaration),
|
2538
|
-
(r'(true|false|null|__FILE__|__LINE__|__VERSION__|__LIB_PATH__|'
|
2539
|
-
r'__INC_PATH__)\b', Keyword.Constant),
|
2540
|
-
(r'(class|struct)(\s+)',
|
2541
|
-
bygroups(Keyword.Declaration, Text), 'class'),
|
2542
|
-
(r'(import|include)(\s+)',
|
2543
|
-
bygroups(Keyword.Namespace, Text), 'import'),
|
2544
|
-
(r'(gc_collect|gc_mm_items|gc_mm_usage|gc_collect_threshold|'
|
2545
|
-
r'urlencode|urldecode|base64encode|base64decode|sha1|crc32|sha2|'
|
2546
|
-
r'md5|md5_file|acos|asin|atan|atan2|ceil|cos|cosh|exp|fabs|floor|'
|
2547
|
-
r'fmod|log|log10|pow|sin|sinh|sqrt|tan|tanh|isint|isfloat|ischar|'
|
2548
|
-
r'isstring|isarray|ismap|isalias|typeof|sizeof|toint|tostring|'
|
2549
|
-
r'fromxml|toxml|binary|pack|load|eval|var_names|var_values|'
|
2550
|
-
r'user_functions|dyn_functions|methods|call|call_method|mknod|'
|
2551
|
-
r'mkfifo|mount|umount2|umount|ticks|usleep|sleep|time|strtime|'
|
2552
|
-
r'strdate|dllopen|dlllink|dllcall|dllcall_argv|dllclose|env|exec|'
|
2553
|
-
r'fork|getpid|wait|popen|pclose|exit|kill|pthread_create|'
|
2554
|
-
r'pthread_create_argv|pthread_exit|pthread_join|pthread_kill|'
|
2555
|
-
r'smtp_send|http_get|http_post|http_download|socket|bind|listen|'
|
2556
|
-
r'accept|getsockname|getpeername|settimeout|connect|server|recv|'
|
2557
|
-
r'send|close|print|println|printf|input|readline|serial_open|'
|
2558
|
-
r'serial_fcntl|serial_get_attr|serial_get_ispeed|serial_get_ospeed|'
|
2559
|
-
r'serial_set_attr|serial_set_ispeed|serial_set_ospeed|serial_write|'
|
2560
|
-
r'serial_read|serial_close|xml_load|xml_parse|fopen|fseek|ftell|'
|
2561
|
-
r'fsize|fread|fwrite|fgets|fclose|file|readdir|pcre_replace|size|'
|
2562
|
-
r'pop|unmap|has|keys|values|length|find|substr|replace|split|trim|'
|
2563
|
-
r'remove|contains|join)\b', Name.Builtin),
|
2564
|
-
(r'(MethodReference|Runner|Dll|Thread|Pipe|Process|Runnable|'
|
2565
|
-
r'CGI|ClientSocket|Socket|ServerSocket|File|Console|Directory|'
|
2566
|
-
r'Exception)\b', Keyword.Type),
|
2567
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
2568
|
-
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
|
2569
|
-
(r'(\.)([a-zA-Z_]\w*)',
|
2570
|
-
bygroups(Operator, Name.Attribute)),
|
2571
|
-
(r'[a-zA-Z_]\w*:', Name.Label),
|
2572
|
-
(r'[a-zA-Z_\$]\w*', Name),
|
2573
|
-
(r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?\-@]+', Operator),
|
2574
|
-
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
2575
|
-
(r'0x[0-9a-f]+', Number.Hex),
|
2576
|
-
(r'[0-9]+L?', Number.Integer),
|
2577
|
-
(r'\n', Text),
|
2578
|
-
],
|
2579
|
-
'class': [
|
2580
|
-
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
2581
|
-
],
|
2582
|
-
'import': [
|
2583
|
-
(r'[\w.]+\*?', Name.Namespace, '#pop')
|
2584
|
-
],
|
2585
|
-
}
|
2586
|
-
|
2587
|
-
|
2588
|
-
class AwkLexer(RegexLexer):
|
2589
|
-
"""
|
2590
|
-
For Awk scripts.
|
2591
|
-
|
2592
|
-
.. versionadded:: 1.5
|
2593
|
-
"""
|
2594
|
-
|
2595
|
-
name = 'Awk'
|
2596
|
-
aliases = ['awk', 'gawk', 'mawk', 'nawk']
|
2597
|
-
filenames = ['*.awk']
|
2598
|
-
mimetypes = ['application/x-awk']
|
2599
|
-
|
2600
|
-
tokens = {
|
2601
|
-
'commentsandwhitespace': [
|
2602
|
-
(r'\s+', Text),
|
2603
|
-
(r'#.*$', Comment.Single)
|
2604
|
-
],
|
2605
|
-
'slashstartsregex': [
|
2606
|
-
include('commentsandwhitespace'),
|
2607
|
-
(r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
|
2608
|
-
r'\B', String.Regex, '#pop'),
|
2609
|
-
(r'(?=/)', Text, ('#pop', 'badregex')),
|
2610
|
-
default('#pop')
|
2611
|
-
],
|
2612
|
-
'badregex': [
|
2613
|
-
(r'\n', Text, '#pop')
|
2614
|
-
],
|
2615
|
-
'root': [
|
2616
|
-
(r'^(?=\s|/)', Text, 'slashstartsregex'),
|
2617
|
-
include('commentsandwhitespace'),
|
2618
|
-
(r'\+\+|--|\|\||&&|in\b|\$|!?~|'
|
2619
|
-
r'(\*\*|[-<>+*%\^/!=])=?', Operator, 'slashstartsregex'),
|
2620
|
-
(r'[{(\[;,]', Punctuation, 'slashstartsregex'),
|
2621
|
-
(r'[})\].]', Punctuation),
|
2622
|
-
(r'(break|continue|do|while|exit|for|if|else|'
|
2623
|
-
r'return)\b', Keyword, 'slashstartsregex'),
|
2624
|
-
(r'function\b', Keyword.Declaration, 'slashstartsregex'),
|
2625
|
-
(r'(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|'
|
2626
|
-
r'length|match|split|sprintf|sub|substr|tolower|toupper|close|'
|
2627
|
-
r'fflush|getline|next|nextfile|print|printf|strftime|systime|'
|
2628
|
-
r'delete|system)\b', Keyword.Reserved),
|
2629
|
-
(r'(ARGC|ARGIND|ARGV|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|'
|
2630
|
-
r'IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|'
|
2631
|
-
r'SUBSEP)\b', Name.Builtin),
|
2632
|
-
(r'[$a-zA-Z_]\w*', Name.Other),
|
2633
|
-
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
2634
|
-
(r'0x[0-9a-fA-F]+', Number.Hex),
|
2635
|
-
(r'[0-9]+', Number.Integer),
|
2636
|
-
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
2637
|
-
(r"'(\\\\|\\'|[^'])*'", String.Single),
|
2638
|
-
]
|
2639
|
-
}
|
2640
|
-
|
2641
|
-
|
2642
|
-
class Cfengine3Lexer(RegexLexer):
|
2643
|
-
"""
|
2644
|
-
Lexer for `CFEngine3 <http://cfengine.org>`_ policy files.
|
2645
|
-
|
2646
|
-
.. versionadded:: 1.5
|
2647
|
-
"""
|
2648
|
-
|
2649
|
-
name = 'CFEngine3'
|
2650
|
-
aliases = ['cfengine3', 'cf3']
|
2651
|
-
filenames = ['*.cf']
|
2652
|
-
mimetypes = []
|
2653
|
-
|
2654
|
-
tokens = {
|
2655
|
-
'root': [
|
2656
|
-
(r'#.*?\n', Comment),
|
2657
|
-
(r'(body)(\s+)(\S+)(\s+)(control)',
|
2658
|
-
bygroups(Keyword, Text, Keyword, Text, Keyword)),
|
2659
|
-
(r'(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()',
|
2660
|
-
bygroups(Keyword, Text, Keyword, Text, Name.Function, Punctuation),
|
2661
|
-
'arglist'),
|
2662
|
-
(r'(body|bundle)(\s+)(\S+)(\s+)(\w+)',
|
2663
|
-
bygroups(Keyword, Text, Keyword, Text, Name.Function)),
|
2664
|
-
(r'(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)',
|
2665
|
-
bygroups(Punctuation,Name.Variable,Punctuation,
|
2666
|
-
Text,Keyword.Type,Text,Operator,Text)),
|
2667
|
-
(r'(\S+)(\s*)(=>)(\s*)',
|
2668
|
-
bygroups(Keyword.Reserved,Text,Operator,Text)),
|
2669
|
-
(r'"', String, 'string'),
|
2670
|
-
(r'(\w+)(\()', bygroups(Name.Function, Punctuation)),
|
2671
|
-
(r'([\w.!&|\(\)]+)(::)', bygroups(Name.Class, Punctuation)),
|
2672
|
-
(r'(\w+)(:)', bygroups(Keyword.Declaration,Punctuation)),
|
2673
|
-
(r'@[\{\(][^\)\}]+[\}\)]', Name.Variable),
|
2674
|
-
(r'[(){},;]', Punctuation),
|
2675
|
-
(r'=>', Operator),
|
2676
|
-
(r'->', Operator),
|
2677
|
-
(r'\d+\.\d+', Number.Float),
|
2678
|
-
(r'\d+', Number.Integer),
|
2679
|
-
(r'\w+', Name.Function),
|
2680
|
-
(r'\s+', Text),
|
2681
|
-
],
|
2682
|
-
'string': [
|
2683
|
-
(r'\$[\{\(]', String.Interpol, 'interpol'),
|
2684
|
-
(r'\\.', String.Escape),
|
2685
|
-
(r'"', String, '#pop'),
|
2686
|
-
(r'\n', String),
|
2687
|
-
(r'.', String),
|
2688
|
-
],
|
2689
|
-
'interpol': [
|
2690
|
-
(r'\$[\{\(]', String.Interpol, '#push'),
|
2691
|
-
(r'[\}\)]', String.Interpol, '#pop'),
|
2692
|
-
(r'[^\$\{\(\)\}]+', String.Interpol),
|
2693
|
-
],
|
2694
|
-
'arglist': [
|
2695
|
-
(r'\)', Punctuation, '#pop'),
|
2696
|
-
(r',', Punctuation),
|
2697
|
-
(r'\w+', Name.Variable),
|
2698
|
-
(r'\s+', Text),
|
2699
|
-
],
|
2700
|
-
}
|
2701
|
-
|
2702
|
-
|
2703
|
-
class SnobolLexer(RegexLexer):
|
2704
|
-
"""
|
2705
|
-
Lexer for the SNOBOL4 programming language.
|
2706
|
-
|
2707
|
-
Recognizes the common ASCII equivalents of the original SNOBOL4 operators.
|
2708
|
-
Does not require spaces around binary operators.
|
2709
|
-
|
2710
|
-
.. versionadded:: 1.5
|
2711
|
-
"""
|
2712
|
-
|
2713
|
-
name = "Snobol"
|
2714
|
-
aliases = ["snobol"]
|
2715
|
-
filenames = ['*.snobol']
|
2716
|
-
mimetypes = ['text/x-snobol']
|
2717
|
-
|
2718
|
-
tokens = {
|
2719
|
-
# root state, start of line
|
2720
|
-
# comments, continuation lines, and directives start in column 1
|
2721
|
-
# as do labels
|
2722
|
-
'root': [
|
2723
|
-
(r'\*.*\n', Comment),
|
2724
|
-
(r'[\+\.] ', Punctuation, 'statement'),
|
2725
|
-
(r'-.*\n', Comment),
|
2726
|
-
(r'END\s*\n', Name.Label, 'heredoc'),
|
2727
|
-
(r'[A-Za-z\$][\w$]*', Name.Label, 'statement'),
|
2728
|
-
(r'\s+', Text, 'statement'),
|
2729
|
-
],
|
2730
|
-
# statement state, line after continuation or label
|
2731
|
-
'statement': [
|
2732
|
-
(r'\s*\n', Text, '#pop'),
|
2733
|
-
(r'\s+', Text),
|
2734
|
-
(r'(?<=[^\w.])(LT|LE|EQ|NE|GE|GT|INTEGER|IDENT|DIFFER|LGT|SIZE|'
|
2735
|
-
r'REPLACE|TRIM|DUPL|REMDR|DATE|TIME|EVAL|APPLY|OPSYN|LOAD|UNLOAD|'
|
2736
|
-
r'LEN|SPAN|BREAK|ANY|NOTANY|TAB|RTAB|REM|POS|RPOS|FAIL|FENCE|'
|
2737
|
-
r'ABORT|ARB|ARBNO|BAL|SUCCEED|INPUT|OUTPUT|TERMINAL)(?=[^\w.])',
|
2738
|
-
Name.Builtin),
|
2739
|
-
(r'[A-Za-z][\w\.]*', Name),
|
2740
|
-
# ASCII equivalents of original operators
|
2741
|
-
# | for the EBCDIC equivalent, ! likewise
|
2742
|
-
# \ for EBCDIC negation
|
2743
|
-
(r'\*\*|[\?\$\.!%\*/#+\-@\|&\\=]', Operator),
|
2744
|
-
(r'"[^"]*"', String),
|
2745
|
-
(r"'[^']*'", String),
|
2746
|
-
# Accept SPITBOL syntax for real numbers
|
2747
|
-
# as well as Macro SNOBOL4
|
2748
|
-
(r'[0-9]+(?=[^\.EeDd])', Number.Integer),
|
2749
|
-
(r'[0-9]+(\.[0-9]*)?([EDed][-+]?[0-9]+)?', Number.Float),
|
2750
|
-
# Goto
|
2751
|
-
(r':', Punctuation, 'goto'),
|
2752
|
-
(r'[\(\)<>,;]', Punctuation),
|
2753
|
-
],
|
2754
|
-
# Goto block
|
2755
|
-
'goto': [
|
2756
|
-
(r'\s*\n', Text, "#pop:2"),
|
2757
|
-
(r'\s+', Text),
|
2758
|
-
(r'F|S', Keyword),
|
2759
|
-
(r'(\()([A-Za-z][\w.]*)(\))',
|
2760
|
-
bygroups(Punctuation, Name.Label, Punctuation))
|
2761
|
-
],
|
2762
|
-
# everything after the END statement is basically one
|
2763
|
-
# big heredoc.
|
2764
|
-
'heredoc': [
|
2765
|
-
(r'.*\n', String.Heredoc)
|
2766
|
-
]
|
2767
|
-
}
|
2768
|
-
|
2769
|
-
|
2770
|
-
class UrbiscriptLexer(ExtendedRegexLexer):
|
2771
|
-
"""
|
2772
|
-
For UrbiScript source code.
|
2773
|
-
|
2774
|
-
.. versionadded:: 1.5
|
2775
|
-
"""
|
2776
|
-
|
2777
|
-
name = 'UrbiScript'
|
2778
|
-
aliases = ['urbiscript']
|
2779
|
-
filenames = ['*.u']
|
2780
|
-
mimetypes = ['application/x-urbiscript']
|
2781
|
-
|
2782
|
-
flags = re.DOTALL
|
2783
|
-
|
2784
|
-
## TODO
|
2785
|
-
# - handle Experimental and deprecated tags with specific tokens
|
2786
|
-
# - handle Angles and Durations with specific tokens
|
2787
|
-
|
2788
|
-
def blob_callback(lexer, match, ctx):
|
2789
|
-
text_before_blob = match.group(1)
|
2790
|
-
blob_start = match.group(2)
|
2791
|
-
blob_size_str = match.group(3)
|
2792
|
-
blob_size = int(blob_size_str)
|
2793
|
-
yield match.start(), String, text_before_blob
|
2794
|
-
ctx.pos += len(text_before_blob)
|
2795
|
-
|
2796
|
-
# if blob size doesn't match blob format (example : "\B(2)(aaa)")
|
2797
|
-
# yield blob as a string
|
2798
|
-
if ctx.text[match.end() + blob_size] != ")":
|
2799
|
-
result = "\\B(" + blob_size_str + ")("
|
2800
|
-
yield match.start(), String, result
|
2801
|
-
ctx.pos += len(result)
|
2802
|
-
return
|
2803
|
-
|
2804
|
-
# if blob is well formated, yield as Escape
|
2805
|
-
blob_text = blob_start + ctx.text[match.end():match.end()+blob_size] + ")"
|
2806
|
-
yield match.start(), String.Escape, blob_text
|
2807
|
-
ctx.pos = match.end() + blob_size + 1 # +1 is the ending ")"
|
2808
|
-
|
2809
|
-
tokens = {
|
2810
|
-
'root': [
|
2811
|
-
(r'\s+', Text),
|
2812
|
-
# comments
|
2813
|
-
(r'//.*?\n', Comment),
|
2814
|
-
(r'/\*', Comment.Multiline, 'comment'),
|
2815
|
-
(r'(?:every|for|loop|while)(?:;|&|\||,)',Keyword),
|
2816
|
-
(r'(?:assert|at|break|case|catch|closure|compl|continue|'
|
2817
|
-
r'default|else|enum|every|external|finally|for|freezeif|if|new|'
|
2818
|
-
r'onleave|return|stopif|switch|this|throw|timeout|try|'
|
2819
|
-
r'waituntil|whenever|while)\b', Keyword),
|
2820
|
-
(r'(?:asm|auto|bool|char|const_cast|delete|double|dynamic_cast|'
|
2821
|
-
r'explicit|export|extern|float|friend|goto|inline|int|'
|
2822
|
-
r'long|mutable|namespace|register|reinterpret_cast|short|'
|
2823
|
-
r'signed|sizeof|static_cast|struct|template|typedef|typeid|'
|
2824
|
-
r'typename|union|unsigned|using|virtual|volatile|'
|
2825
|
-
r'wchar_t)\b', Keyword.Reserved),
|
2826
|
-
# deprecated keywords, use a meaningfull token when available
|
2827
|
-
(r'(?:emit|foreach|internal|loopn|static)\b', Keyword),
|
2828
|
-
# ignored keywords, use a meaningfull token when available
|
2829
|
-
(r'(?:private|protected|public)\b', Keyword),
|
2830
|
-
(r'(?:var|do|const|function|class)\b', Keyword.Declaration),
|
2831
|
-
(r'(?:true|false|nil|void)\b', Keyword.Constant),
|
2832
|
-
(r'(?:Barrier|Binary|Boolean|CallMessage|Channel|Code|'
|
2833
|
-
r'Comparable|Container|Control|Date|Dictionary|Directory|'
|
2834
|
-
r'Duration|Enumeration|Event|Exception|Executable|File|Finalizable|'
|
2835
|
-
r'Float|FormatInfo|Formatter|Global|Group|Hash|InputStream|'
|
2836
|
-
r'IoService|Job|Kernel|Lazy|List|Loadable|Lobby|Location|Logger|Math|'
|
2837
|
-
r'Mutex|nil|Object|Orderable|OutputStream|Pair|Path|Pattern|Position|'
|
2838
|
-
r'Primitive|Process|Profile|PseudoLazy|PubSub|RangeIterable|Regexp|'
|
2839
|
-
r'Semaphore|Server|Singleton|Socket|StackFrame|Stream|String|System|'
|
2840
|
-
r'Tag|Timeout|Traceable|TrajectoryGenerator|Triplet|Tuple'
|
2841
|
-
r'|UObject|UValue|UVar)\b', Name.Builtin),
|
2842
|
-
(r'(?:this)\b', Name.Builtin.Pseudo),
|
2843
|
-
# don't match single | and &
|
2844
|
-
(r'(?:[-=+*%/<>~^:]+|\.&?|\|\||&&)', Operator),
|
2845
|
-
(r'(?:and_eq|and|bitand|bitor|in|not|not_eq|or_eq|or|xor_eq|xor)\b',
|
2846
|
-
Operator.Word),
|
2847
|
-
(r'[{}\[\]()]+', Punctuation),
|
2848
|
-
(r'(?:;|\||,|&|\?|!)+', Punctuation),
|
2849
|
-
(r'[$a-zA-Z_]\w*', Name.Other),
|
2850
|
-
(r'0x[0-9a-fA-F]+', Number.Hex),
|
2851
|
-
# Float, Integer, Angle and Duration
|
2852
|
-
(r'(?:[0-9]+(?:(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)?'
|
2853
|
-
r'((?:rad|deg|grad)|(?:ms|s|min|h|d))?)\b', Number.Float),
|
2854
|
-
# handle binary blob in strings
|
2855
|
-
(r'"', String.Double, "string.double"),
|
2856
|
-
(r"'", String.Single, "string.single"),
|
2857
|
-
],
|
2858
|
-
'string.double': [
|
2859
|
-
(r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback),
|
2860
|
-
(r'(\\\\|\\"|[^"])*?"', String.Double, '#pop'),
|
2861
|
-
],
|
2862
|
-
'string.single': [
|
2863
|
-
(r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback),
|
2864
|
-
(r"(\\\\|\\'|[^'])*?'", String.Single, '#pop'),
|
2865
|
-
],
|
2866
|
-
# from http://pygments.org/docs/lexerdevelopment/#changing-states
|
2867
|
-
'comment': [
|
2868
|
-
(r'[^*/]', Comment.Multiline),
|
2869
|
-
(r'/\*', Comment.Multiline, '#push'),
|
2870
|
-
(r'\*/', Comment.Multiline, '#pop'),
|
2871
|
-
(r'[*/]', Comment.Multiline),
|
2872
|
-
]
|
2873
|
-
}
|
2874
|
-
|
2875
|
-
|
2876
|
-
class OpenEdgeLexer(RegexLexer):
|
2877
|
-
"""
|
2878
|
-
Lexer for `OpenEdge ABL (formerly Progress)
|
2879
|
-
<http://web.progress.com/en/openedge/abl.html>`_ source code.
|
2880
|
-
|
2881
|
-
.. versionadded:: 1.5
|
2882
|
-
"""
|
2883
|
-
name = 'OpenEdge ABL'
|
2884
|
-
aliases = ['openedge', 'abl', 'progress']
|
2885
|
-
filenames = ['*.p', '*.cls']
|
2886
|
-
mimetypes = ['text/x-openedge', 'application/x-openedge']
|
2887
|
-
|
2888
|
-
types = (r'(?i)(^|(?<=[^0-9a-z_\-]))(CHARACTER|CHAR|CHARA|CHARAC|CHARACT|CHARACTE|'
|
2889
|
-
r'COM-HANDLE|DATE|DATETIME|DATETIME-TZ|'
|
2890
|
-
r'DECIMAL|DEC|DECI|DECIM|DECIMA|HANDLE|'
|
2891
|
-
r'INT64|INTEGER|INT|INTE|INTEG|INTEGE|'
|
2892
|
-
r'LOGICAL|LONGCHAR|MEMPTR|RAW|RECID|ROWID)\s*($|(?=[^0-9a-z_\-]))')
|
2893
|
-
|
2894
|
-
keywords = (r'(?i)(^|(?<=[^0-9a-z_\-]))(' +
|
2895
|
-
r'|'.join(OPENEDGEKEYWORDS) +
|
2896
|
-
r')\s*($|(?=[^0-9a-z_\-]))')
|
2897
|
-
tokens = {
|
2898
|
-
'root': [
|
2899
|
-
(r'/\*', Comment.Multiline, 'comment'),
|
2900
|
-
(r'\{', Comment.Preproc, 'preprocessor'),
|
2901
|
-
(r'\s*&.*', Comment.Preproc),
|
2902
|
-
(r'0[xX][0-9a-fA-F]+[LlUu]*', Number.Hex),
|
2903
|
-
(r'(?i)(DEFINE|DEF|DEFI|DEFIN)\b', Keyword.Declaration),
|
2904
|
-
(types, Keyword.Type),
|
2905
|
-
(keywords, Name.Builtin),
|
2906
|
-
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
2907
|
-
(r"'(\\\\|\\'|[^'])*'", String.Single),
|
2908
|
-
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
2909
|
-
(r'[0-9]+', Number.Integer),
|
2910
|
-
(r'\s+', Text),
|
2911
|
-
(r'[+*/=-]', Operator),
|
2912
|
-
(r'[.:()]', Punctuation),
|
2913
|
-
(r'.', Name.Variable), # Lazy catch-all
|
2914
|
-
],
|
2915
|
-
'comment': [
|
2916
|
-
(r'[^*/]', Comment.Multiline),
|
2917
|
-
(r'/\*', Comment.Multiline, '#push'),
|
2918
|
-
(r'\*/', Comment.Multiline, '#pop'),
|
2919
|
-
(r'[*/]', Comment.Multiline)
|
2920
|
-
],
|
2921
|
-
'preprocessor': [
|
2922
|
-
(r'[^{}]', Comment.Preproc),
|
2923
|
-
(r'{', Comment.Preproc, '#push'),
|
2924
|
-
(r'}', Comment.Preproc, '#pop'),
|
2925
|
-
],
|
2926
|
-
}
|
2927
|
-
|
2928
|
-
|
2929
|
-
class BroLexer(RegexLexer):
|
2930
|
-
"""
|
2931
|
-
For `Bro <http://bro-ids.org/>`_ scripts.
|
2932
|
-
|
2933
|
-
.. versionadded:: 1.5
|
2934
|
-
"""
|
2935
|
-
name = 'Bro'
|
2936
|
-
aliases = ['bro']
|
2937
|
-
filenames = ['*.bro']
|
2938
|
-
|
2939
|
-
_hex = r'[0-9a-fA-F_]+'
|
2940
|
-
_float = r'((\d*\.?\d+)|(\d+\.?\d*))([eE][-+]?\d+)?'
|
2941
|
-
_h = r'[A-Za-z0-9][-A-Za-z0-9]*'
|
2942
|
-
|
2943
|
-
tokens = {
|
2944
|
-
'root': [
|
2945
|
-
# Whitespace
|
2946
|
-
(r'^@.*?\n', Comment.Preproc),
|
2947
|
-
(r'#.*?\n', Comment.Single),
|
2948
|
-
(r'\n', Text),
|
2949
|
-
(r'\s+', Text),
|
2950
|
-
(r'\\\n', Text),
|
2951
|
-
# Keywords
|
2952
|
-
(r'(add|alarm|break|case|const|continue|delete|do|else|enum|event'
|
2953
|
-
r'|export|for|function|if|global|hook|local|module|next'
|
2954
|
-
r'|of|print|redef|return|schedule|switch|type|when|while)\b', Keyword),
|
2955
|
-
(r'(addr|any|bool|count|counter|double|file|int|interval|net'
|
2956
|
-
r'|pattern|port|record|set|string|subnet|table|time|timer'
|
2957
|
-
r'|vector)\b', Keyword.Type),
|
2958
|
-
(r'(T|F)\b', Keyword.Constant),
|
2959
|
-
(r'(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire'
|
2960
|
-
r'|default|disable_print_hook|raw_output|encrypt|group|log'
|
2961
|
-
r'|mergeable|optional|persistent|priority|redef'
|
2962
|
-
r'|rotate_(?:interval|size)|synchronized)\b', bygroups(Punctuation,
|
2963
|
-
Keyword)),
|
2964
|
-
(r'\s+module\b', Keyword.Namespace),
|
2965
|
-
# Addresses, ports and networks
|
2966
|
-
(r'\d+/(tcp|udp|icmp|unknown)\b', Number),
|
2967
|
-
(r'(\d+\.){3}\d+', Number),
|
2968
|
-
(r'(' + _hex + r'){7}' + _hex, Number),
|
2969
|
-
(r'0x' + _hex + r'(' + _hex + r'|:)*::(' + _hex + r'|:)*', Number),
|
2970
|
-
(r'((\d+|:)(' + _hex + r'|:)*)?::(' + _hex + r'|:)*', Number),
|
2971
|
-
(r'(\d+\.\d+\.|(\d+\.){2}\d+)', Number),
|
2972
|
-
# Hostnames
|
2973
|
-
(_h + r'(\.' + _h + r')+', String),
|
2974
|
-
# Numeric
|
2975
|
-
(_float + r'\s+(day|hr|min|sec|msec|usec)s?\b', Literal.Date),
|
2976
|
-
(r'0[xX]' + _hex, Number.Hex),
|
2977
|
-
(_float, Number.Float),
|
2978
|
-
(r'\d+', Number.Integer),
|
2979
|
-
(r'/', String.Regex, 'regex'),
|
2980
|
-
(r'"', String, 'string'),
|
2981
|
-
# Operators
|
2982
|
-
(r'[!%*/+:<=>?~|-]', Operator),
|
2983
|
-
(r'([-+=&|]{2}|[+=!><-]=)', Operator),
|
2984
|
-
(r'(in|match)\b', Operator.Word),
|
2985
|
-
(r'[{}()\[\]$.,;]', Punctuation),
|
2986
|
-
# Identfier
|
2987
|
-
(r'([_a-zA-Z]\w*)(::)', bygroups(Name, Name.Namespace)),
|
2988
|
-
(r'[a-zA-Z_][a-zA-Z_0-9]*', Name)
|
2989
|
-
],
|
2990
|
-
'string': [
|
2991
|
-
(r'"', String, '#pop'),
|
2992
|
-
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
2993
|
-
(r'[^\\"\n]+', String),
|
2994
|
-
(r'\\\n', String),
|
2995
|
-
(r'\\', String)
|
2996
|
-
],
|
2997
|
-
'regex': [
|
2998
|
-
(r'/', String.Regex, '#pop'),
|
2999
|
-
(r'\\[\\nt/]', String.Regex), # String.Escape is too intense here.
|
3000
|
-
(r'[^\\/\n]+', String.Regex),
|
3001
|
-
(r'\\\n', String.Regex),
|
3002
|
-
(r'\\', String.Regex)
|
3003
|
-
]
|
3004
|
-
}
|
3005
|
-
|
3006
|
-
|
3007
|
-
class CbmBasicV2Lexer(RegexLexer):
|
3008
|
-
"""
|
3009
|
-
For CBM BASIC V2 sources.
|
3010
|
-
|
3011
|
-
.. versionadded:: 1.6
|
3012
|
-
"""
|
3013
|
-
name = 'CBM BASIC V2'
|
3014
|
-
aliases = ['cbmbas']
|
3015
|
-
filenames = ['*.bas']
|
3016
|
-
|
3017
|
-
flags = re.IGNORECASE
|
3018
|
-
|
3019
|
-
tokens = {
|
3020
|
-
'root': [
|
3021
|
-
(r'rem.*\n', Comment.Single),
|
3022
|
-
(r'\s+', Text),
|
3023
|
-
(r'new|run|end|for|to|next|step|go(to|sub)?|on|return|stop|cont'
|
3024
|
-
r'|if|then|input#?|read|wait|load|save|verify|poke|sys|print#?'
|
3025
|
-
r'|list|clr|cmd|open|close|get#?', Keyword.Reserved),
|
3026
|
-
(r'data|restore|dim|let|def|fn', Keyword.Declaration),
|
3027
|
-
(r'tab|spc|sgn|int|abs|usr|fre|pos|sqr|rnd|log|exp|cos|sin|tan|atn'
|
3028
|
-
r'|peek|len|val|asc|(str|chr|left|right|mid)\$', Name.Builtin),
|
3029
|
-
(r'[-+*/^<>=]', Operator),
|
3030
|
-
(r'not|and|or', Operator.Word),
|
3031
|
-
(r'"[^"\n]*.', String),
|
3032
|
-
(r'\d+|[-+]?\d*\.\d*(e[-+]?\d+)?', Number.Float),
|
3033
|
-
(r'[\(\),:;]', Punctuation),
|
3034
|
-
(r'\w+[$%]?', Name),
|
3035
|
-
]
|
3036
|
-
}
|
3037
|
-
|
3038
|
-
def analyse_text(self, text):
|
3039
|
-
# if it starts with a line number, it shouldn't be a "modern" Basic
|
3040
|
-
# like VB.net
|
3041
|
-
if re.match(r'\d+', text):
|
3042
|
-
return True
|
3043
|
-
|
3044
|
-
|
3045
|
-
class MscgenLexer(RegexLexer):
|
3046
|
-
"""
|
3047
|
-
For `Mscgen <http://www.mcternan.me.uk/mscgen/>`_ files.
|
3048
|
-
|
3049
|
-
.. versionadded:: 1.6
|
3050
|
-
"""
|
3051
|
-
name = 'Mscgen'
|
3052
|
-
aliases = ['mscgen', 'msc']
|
3053
|
-
filenames = ['*.msc']
|
3054
|
-
|
3055
|
-
_var = r'(\w+|"(?:\\"|[^"])*")'
|
3056
|
-
|
3057
|
-
tokens = {
|
3058
|
-
'root': [
|
3059
|
-
(r'msc\b', Keyword.Type),
|
3060
|
-
# Options
|
3061
|
-
(r'(hscale|HSCALE|width|WIDTH|wordwraparcs|WORDWRAPARCS'
|
3062
|
-
r'|arcgradient|ARCGRADIENT)\b', Name.Property),
|
3063
|
-
# Operators
|
3064
|
-
(r'(abox|ABOX|rbox|RBOX|box|BOX|note|NOTE)\b', Operator.Word),
|
3065
|
-
(r'(\.|-|\|){3}', Keyword),
|
3066
|
-
(r'(?:-|=|\.|:){2}'
|
3067
|
-
r'|<<=>>|<->|<=>|<<>>|<:>'
|
3068
|
-
r'|->|=>>|>>|=>|:>|-x|-X'
|
3069
|
-
r'|<-|<<=|<<|<=|<:|x-|X-|=', Operator),
|
3070
|
-
# Names
|
3071
|
-
(r'\*', Name.Builtin),
|
3072
|
-
(_var, Name.Variable),
|
3073
|
-
# Other
|
3074
|
-
(r'\[', Punctuation, 'attrs'),
|
3075
|
-
(r'\{|\}|,|;', Punctuation),
|
3076
|
-
include('comments')
|
3077
|
-
],
|
3078
|
-
'attrs': [
|
3079
|
-
(r'\]', Punctuation, '#pop'),
|
3080
|
-
(_var + r'(\s*)(=)(\s*)' + _var,
|
3081
|
-
bygroups(Name.Attribute, Text.Whitespace, Operator, Text.Whitespace,
|
3082
|
-
String)),
|
3083
|
-
(r',', Punctuation),
|
3084
|
-
include('comments')
|
3085
|
-
],
|
3086
|
-
'comments': [
|
3087
|
-
(r'(?://|#).*?\n', Comment.Single),
|
3088
|
-
(r'/\*(?:.|\n)*?\*/', Comment.Multiline),
|
3089
|
-
(r'[ \t\r\n]+', Text.Whitespace)
|
3090
|
-
]
|
3091
|
-
}
|
3092
|
-
|
3093
|
-
|
3094
|
-
def _rx_indent(level):
|
3095
|
-
# Kconfig *always* interprets a tab as 8 spaces, so this is the default.
|
3096
|
-
# Edit this if you are in an environment where KconfigLexer gets expanded
|
3097
|
-
# input (tabs expanded to spaces) and the expansion tab width is != 8,
|
3098
|
-
# e.g. in connection with Trac (trac.ini, [mimeviewer], tab_width).
|
3099
|
-
# Value range here is 2 <= {tab_width} <= 8.
|
3100
|
-
tab_width = 8
|
3101
|
-
# Regex matching a given indentation {level}, assuming that indentation is
|
3102
|
-
# a multiple of {tab_width}. In other cases there might be problems.
|
3103
|
-
return r'(?:\t| {1,%s}\t| {%s}){%s}.*\n' % (tab_width-1, tab_width, level)
|
3104
|
-
|
3105
|
-
|
3106
|
-
class KconfigLexer(RegexLexer):
|
3107
|
-
"""
|
3108
|
-
For Linux-style Kconfig files.
|
3109
|
-
|
3110
|
-
.. versionadded:: 1.6
|
3111
|
-
"""
|
3112
|
-
|
3113
|
-
name = 'Kconfig'
|
3114
|
-
aliases = ['kconfig', 'menuconfig', 'linux-config', 'kernel-config']
|
3115
|
-
# Adjust this if new kconfig file names appear in your environment
|
3116
|
-
filenames = ['Kconfig', '*Config.in*', 'external.in*',
|
3117
|
-
'standard-modules.in']
|
3118
|
-
mimetypes = ['text/x-kconfig']
|
3119
|
-
# No re.MULTILINE, indentation-aware help text needs line-by-line handling
|
3120
|
-
flags = 0
|
3121
|
-
|
3122
|
-
def call_indent(level):
|
3123
|
-
# If indentation >= {level} is detected, enter state 'indent{level}'
|
3124
|
-
return (_rx_indent(level), String.Doc, 'indent%s' % level)
|
3125
|
-
|
3126
|
-
def do_indent(level):
|
3127
|
-
# Print paragraphs of indentation level >= {level} as String.Doc,
|
3128
|
-
# ignoring blank lines. Then return to 'root' state.
|
3129
|
-
return [
|
3130
|
-
(_rx_indent(level), String.Doc),
|
3131
|
-
(r'\s*\n', Text),
|
3132
|
-
default('#pop:2')
|
3133
|
-
]
|
3134
|
-
|
3135
|
-
tokens = {
|
3136
|
-
'root': [
|
3137
|
-
(r'\s+', Text),
|
3138
|
-
(r'#.*?\n', Comment.Single),
|
3139
|
-
(r'(mainmenu|config|menuconfig|choice|endchoice|comment|menu|'
|
3140
|
-
r'endmenu|visible if|if|endif|source|prompt|select|depends on|'
|
3141
|
-
r'default|range|option)\b', Keyword),
|
3142
|
-
(r'(---help---|help)[\t ]*\n', Keyword, 'help'),
|
3143
|
-
(r'(bool|tristate|string|hex|int|defconfig_list|modules|env)\b',
|
3144
|
-
Name.Builtin),
|
3145
|
-
(r'[!=&|]', Operator),
|
3146
|
-
(r'[()]', Punctuation),
|
3147
|
-
(r'[0-9]+', Number.Integer),
|
3148
|
-
(r"'(''|[^'])*'", String.Single),
|
3149
|
-
(r'"(""|[^"])*"', String.Double),
|
3150
|
-
(r'\S+', Text),
|
3151
|
-
],
|
3152
|
-
# Help text is indented, multi-line and ends when a lower indentation
|
3153
|
-
# level is detected.
|
3154
|
-
'help': [
|
3155
|
-
# Skip blank lines after help token, if any
|
3156
|
-
(r'\s*\n', Text),
|
3157
|
-
# Determine the first help line's indentation level heuristically(!).
|
3158
|
-
# Attention: this is not perfect, but works for 99% of "normal"
|
3159
|
-
# indentation schemes up to a max. indentation level of 7.
|
3160
|
-
call_indent(7),
|
3161
|
-
call_indent(6),
|
3162
|
-
call_indent(5),
|
3163
|
-
call_indent(4),
|
3164
|
-
call_indent(3),
|
3165
|
-
call_indent(2),
|
3166
|
-
call_indent(1),
|
3167
|
-
('', Text, '#pop'), # for incomplete help sections without text
|
3168
|
-
],
|
3169
|
-
# Handle text for indentation levels 7 to 1
|
3170
|
-
'indent7': do_indent(7),
|
3171
|
-
'indent6': do_indent(6),
|
3172
|
-
'indent5': do_indent(5),
|
3173
|
-
'indent4': do_indent(4),
|
3174
|
-
'indent3': do_indent(3),
|
3175
|
-
'indent2': do_indent(2),
|
3176
|
-
'indent1': do_indent(1),
|
3177
|
-
}
|
3178
|
-
|
3179
|
-
|
3180
|
-
class VGLLexer(RegexLexer):
|
3181
|
-
"""
|
3182
|
-
For `SampleManager VGL <http://www.thermoscientific.com/samplemanager>`_
|
3183
|
-
source code.
|
3184
|
-
|
3185
|
-
.. versionadded:: 1.6
|
3186
|
-
"""
|
3187
|
-
name = 'VGL'
|
3188
|
-
aliases = ['vgl']
|
3189
|
-
filenames = ['*.rpf']
|
3190
|
-
|
3191
|
-
flags = re.MULTILINE | re.DOTALL | re.IGNORECASE
|
3192
|
-
|
3193
|
-
tokens = {
|
3194
|
-
'root': [
|
3195
|
-
(r'\{[^\}]*\}', Comment.Multiline),
|
3196
|
-
(r'declare', Keyword.Constant),
|
3197
|
-
(r'(if|then|else|endif|while|do|endwhile|and|or|prompt|object'
|
3198
|
-
r'|create|on|line|with|global|routine|value|endroutine|constant'
|
3199
|
-
r'|global|set|join|library|compile_option|file|exists|create|copy'
|
3200
|
-
r'|delete|enable|windows|name|notprotected)(?! *[=<>.,()])',
|
3201
|
-
Keyword),
|
3202
|
-
(r'(true|false|null|empty|error|locked)', Keyword.Constant),
|
3203
|
-
(r'[~\^\*\#!%&\[\]\(\)<>\|+=:;,./?-]', Operator),
|
3204
|
-
(r'"[^"]*"', String),
|
3205
|
-
(r'(\.)([a-z_\$][\w\$]*)', bygroups(Operator, Name.Attribute)),
|
3206
|
-
(r'[0-9][0-9]*(\.[0-9]+(e[+\-]?[0-9]+)?)?', Number),
|
3207
|
-
(r'[a-z_\$][\w\$]*', Name),
|
3208
|
-
(r'[\r\n]+', Text),
|
3209
|
-
(r'\s+', Text)
|
3210
|
-
]
|
3211
|
-
}
|
3212
|
-
|
3213
|
-
|
3214
|
-
class SourcePawnLexer(RegexLexer):
|
3215
|
-
"""
|
3216
|
-
For SourcePawn source code with preprocessor directives.
|
3217
|
-
|
3218
|
-
.. versionadded:: 1.6
|
3219
|
-
"""
|
3220
|
-
name = 'SourcePawn'
|
3221
|
-
aliases = ['sp']
|
3222
|
-
filenames = ['*.sp']
|
3223
|
-
mimetypes = ['text/x-sourcepawn']
|
3224
|
-
|
3225
|
-
#: optional Comment or Whitespace
|
3226
|
-
_ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
|
3227
|
-
|
3228
|
-
tokens = {
|
3229
|
-
'root': [
|
3230
|
-
# preprocessor directives: without whitespace
|
3231
|
-
('^#if\s+0', Comment.Preproc, 'if0'),
|
3232
|
-
('^#', Comment.Preproc, 'macro'),
|
3233
|
-
# or with whitespace
|
3234
|
-
('^' + _ws + r'#if\s+0', Comment.Preproc, 'if0'),
|
3235
|
-
('^' + _ws + '#', Comment.Preproc, 'macro'),
|
3236
|
-
(r'\n', Text),
|
3237
|
-
(r'\s+', Text),
|
3238
|
-
(r'\\\n', Text), # line continuation
|
3239
|
-
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
3240
|
-
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
|
3241
|
-
(r'[{}]', Punctuation),
|
3242
|
-
(r'L?"', String, 'string'),
|
3243
|
-
(r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
|
3244
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
|
3245
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
3246
|
-
(r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
|
3247
|
-
(r'0[0-7]+[LlUu]*', Number.Oct),
|
3248
|
-
(r'\d+[LlUu]*', Number.Integer),
|
3249
|
-
(r'\*/', Error),
|
3250
|
-
(r'[~!%^&*+=|?:<>/-]', Operator),
|
3251
|
-
(r'[()\[\],.;]', Punctuation),
|
3252
|
-
(r'(case|const|continue|native|'
|
3253
|
-
r'default|else|enum|for|if|new|operator|'
|
3254
|
-
r'public|return|sizeof|static|decl|struct|switch)\b', Keyword),
|
3255
|
-
(r'(bool|Float)\b', Keyword.Type),
|
3256
|
-
(r'(true|false)\b', Keyword.Constant),
|
3257
|
-
('[a-zA-Z_]\w*', Name),
|
3258
|
-
],
|
3259
|
-
'string': [
|
3260
|
-
(r'"', String, '#pop'),
|
3261
|
-
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
3262
|
-
(r'[^\\"\n]+', String), # all other characters
|
3263
|
-
(r'\\\n', String), # line continuation
|
3264
|
-
(r'\\', String), # stray backslash
|
3265
|
-
],
|
3266
|
-
'macro': [
|
3267
|
-
(r'[^/\n]+', Comment.Preproc),
|
3268
|
-
(r'/\*(.|\n)*?\*/', Comment.Multiline),
|
3269
|
-
(r'//.*?\n', Comment.Single, '#pop'),
|
3270
|
-
(r'/', Comment.Preproc),
|
3271
|
-
(r'(?<=\\)\n', Comment.Preproc),
|
3272
|
-
(r'\n', Comment.Preproc, '#pop'),
|
3273
|
-
],
|
3274
|
-
'if0': [
|
3275
|
-
(r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
|
3276
|
-
(r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
|
3277
|
-
(r'.*?\n', Comment),
|
3278
|
-
]
|
3279
|
-
}
|
3280
|
-
|
3281
|
-
SM_TYPES = set(['Action', 'bool', 'Float', 'Plugin', 'String', 'any',
|
3282
|
-
'AdminFlag', 'OverrideType', 'OverrideRule', 'ImmunityType',
|
3283
|
-
'GroupId', 'AdminId', 'AdmAccessMode', 'AdminCachePart',
|
3284
|
-
'CookieAccess', 'CookieMenu', 'CookieMenuAction', 'NetFlow',
|
3285
|
-
'ConVarBounds', 'QueryCookie', 'ReplySource',
|
3286
|
-
'ConVarQueryResult', 'ConVarQueryFinished', 'Function',
|
3287
|
-
'Action', 'Identity', 'PluginStatus', 'PluginInfo', 'DBResult',
|
3288
|
-
'DBBindType', 'DBPriority', 'PropType', 'PropFieldType',
|
3289
|
-
'MoveType', 'RenderMode', 'RenderFx', 'EventHookMode',
|
3290
|
-
'EventHook', 'FileType', 'FileTimeMode', 'PathType',
|
3291
|
-
'ParamType', 'ExecType', 'DialogType', 'Handle', 'KvDataTypes',
|
3292
|
-
'NominateResult', 'MapChange', 'MenuStyle', 'MenuAction',
|
3293
|
-
'MenuSource', 'RegexError', 'SDKCallType', 'SDKLibrary',
|
3294
|
-
'SDKFuncConfSource', 'SDKType', 'SDKPassMethod', 'RayType',
|
3295
|
-
'TraceEntityFilter', 'ListenOverride', 'SortOrder', 'SortType',
|
3296
|
-
'SortFunc2D', 'APLRes', 'FeatureType', 'FeatureStatus',
|
3297
|
-
'SMCResult', 'SMCError', 'TFClassType', 'TFTeam', 'TFCond',
|
3298
|
-
'TFResourceType', 'Timer', 'TopMenuAction', 'TopMenuObjectType',
|
3299
|
-
'TopMenuPosition', 'TopMenuObject', 'UserMsg'])
|
3300
|
-
|
3301
|
-
def __init__(self, **options):
|
3302
|
-
self.smhighlighting = get_bool_opt(options,
|
3303
|
-
'sourcemod', True)
|
3304
|
-
|
3305
|
-
self._functions = set()
|
3306
|
-
if self.smhighlighting:
|
3307
|
-
from pygments.lexers._sourcemodbuiltins import FUNCTIONS
|
3308
|
-
self._functions.update(FUNCTIONS)
|
3309
|
-
RegexLexer.__init__(self, **options)
|
3310
|
-
|
3311
|
-
def get_tokens_unprocessed(self, text):
|
3312
|
-
for index, token, value in \
|
3313
|
-
RegexLexer.get_tokens_unprocessed(self, text):
|
3314
|
-
if token is Name:
|
3315
|
-
if self.smhighlighting:
|
3316
|
-
if value in self.SM_TYPES:
|
3317
|
-
token = Keyword.Type
|
3318
|
-
elif value in self._functions:
|
3319
|
-
token = Name.Builtin
|
3320
|
-
yield index, token, value
|
3321
|
-
|
3322
|
-
|
3323
|
-
class PuppetLexer(RegexLexer):
|
3324
|
-
"""
|
3325
|
-
For `Puppet <http://puppetlabs.com/>`__ configuration DSL.
|
3326
|
-
|
3327
|
-
.. versionadded:: 1.6
|
3328
|
-
"""
|
3329
|
-
name = 'Puppet'
|
3330
|
-
aliases = ['puppet']
|
3331
|
-
filenames = ['*.pp']
|
3332
|
-
|
3333
|
-
tokens = {
|
3334
|
-
'root': [
|
3335
|
-
include('comments'),
|
3336
|
-
include('keywords'),
|
3337
|
-
include('names'),
|
3338
|
-
include('numbers'),
|
3339
|
-
include('operators'),
|
3340
|
-
include('strings'),
|
3341
|
-
|
3342
|
-
(r'[]{}:(),;[]', Punctuation),
|
3343
|
-
(r'[^\S\n]+', Text),
|
3344
|
-
],
|
3345
|
-
|
3346
|
-
'comments': [
|
3347
|
-
(r'\s*#.*$', Comment),
|
3348
|
-
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
|
3349
|
-
],
|
3350
|
-
|
3351
|
-
'operators': [
|
3352
|
-
(r'(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)', Operator),
|
3353
|
-
(r'(in|and|or|not)\b', Operator.Word),
|
3354
|
-
],
|
3355
|
-
|
3356
|
-
'names': [
|
3357
|
-
('[a-zA-Z_]\w*', Name.Attribute),
|
3358
|
-
(r'(\$\S+)(\[)(\S+)(\])', bygroups(Name.Variable, Punctuation,
|
3359
|
-
String, Punctuation)),
|
3360
|
-
(r'\$\S+', Name.Variable),
|
3361
|
-
],
|
3362
|
-
|
3363
|
-
'numbers': [
|
3364
|
-
# Copypasta from the Python lexer
|
3365
|
-
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
|
3366
|
-
(r'\d+[eE][+-]?[0-9]+j?', Number.Float),
|
3367
|
-
(r'0[0-7]+j?', Number.Oct),
|
3368
|
-
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
3369
|
-
(r'\d+L', Number.Integer.Long),
|
3370
|
-
(r'\d+j?', Number.Integer)
|
3371
|
-
],
|
3372
|
-
|
3373
|
-
'keywords': [
|
3374
|
-
# Left out 'group' and 'require'
|
3375
|
-
# Since they're often used as attributes
|
3376
|
-
(r'(?i)(absent|alert|alias|audit|augeas|before|case|check|class|'
|
3377
|
-
r'computer|configured|contained|create_resources|crit|cron|debug|'
|
3378
|
-
r'default|define|defined|directory|else|elsif|emerg|err|exec|'
|
3379
|
-
r'extlookup|fail|false|file|filebucket|fqdn_rand|generate|host|if|'
|
3380
|
-
r'import|include|info|inherits|inline_template|installed|'
|
3381
|
-
r'interface|k5login|latest|link|loglevel|macauthorization|'
|
3382
|
-
r'mailalias|maillist|mcx|md5|mount|mounted|nagios_command|'
|
3383
|
-
r'nagios_contact|nagios_contactgroup|nagios_host|'
|
3384
|
-
r'nagios_hostdependency|nagios_hostescalation|nagios_hostextinfo|'
|
3385
|
-
r'nagios_hostgroup|nagios_service|nagios_servicedependency|'
|
3386
|
-
r'nagios_serviceescalation|nagios_serviceextinfo|'
|
3387
|
-
r'nagios_servicegroup|nagios_timeperiod|node|noop|notice|notify|'
|
3388
|
-
r'package|present|purged|realize|regsubst|resources|role|router|'
|
3389
|
-
r'running|schedule|scheduled_task|search|selboolean|selmodule|'
|
3390
|
-
r'service|sha1|shellquote|split|sprintf|ssh_authorized_key|sshkey|'
|
3391
|
-
r'stage|stopped|subscribe|tag|tagged|template|tidy|true|undef|'
|
3392
|
-
r'unmounted|user|versioncmp|vlan|warning|yumrepo|zfs|zone|'
|
3393
|
-
r'zpool)\b', Keyword),
|
3394
|
-
],
|
3395
|
-
|
3396
|
-
'strings': [
|
3397
|
-
(r'"([^"])*"', String),
|
3398
|
-
(r"'(\\'|[^'])*'", String),
|
3399
|
-
],
|
3400
|
-
|
3401
|
-
}
|
3402
|
-
|
3403
|
-
|
3404
|
-
class NSISLexer(RegexLexer):
|
3405
|
-
"""
|
3406
|
-
For `NSIS <http://nsis.sourceforge.net/>`_ scripts.
|
3407
|
-
|
3408
|
-
.. versionadded:: 1.6
|
3409
|
-
"""
|
3410
|
-
name = 'NSIS'
|
3411
|
-
aliases = ['nsis', 'nsi', 'nsh']
|
3412
|
-
filenames = ['*.nsi', '*.nsh']
|
3413
|
-
mimetypes = ['text/x-nsis']
|
3414
|
-
|
3415
|
-
flags = re.IGNORECASE
|
3416
|
-
|
3417
|
-
tokens = {
|
3418
|
-
'root': [
|
3419
|
-
(r'[;\#].*\n', Comment),
|
3420
|
-
(r"'.*?'", String.Single),
|
3421
|
-
(r'"', String.Double, 'str_double'),
|
3422
|
-
(r'`', String.Backtick, 'str_backtick'),
|
3423
|
-
include('macro'),
|
3424
|
-
include('interpol'),
|
3425
|
-
include('basic'),
|
3426
|
-
(r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
|
3427
|
-
(r'/[a-z_]\w*', Name.Attribute),
|
3428
|
-
('.', Text),
|
3429
|
-
],
|
3430
|
-
'basic': [
|
3431
|
-
(r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
|
3432
|
-
bygroups(Text, Keyword, Text, Name.Function)),
|
3433
|
-
(r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b',
|
3434
|
-
bygroups(Keyword.Namespace, Punctuation, Name.Function)),
|
3435
|
-
(r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)),
|
3436
|
-
(r'(\b[ULS]|\B)([\!\<\>=]?=|\<\>?|\>)\B', Operator),
|
3437
|
-
(r'[|+-]', Operator),
|
3438
|
-
(r'\\', Punctuation),
|
3439
|
-
(r'\b(Abort|Add(?:BrandingImage|Size)|'
|
3440
|
-
r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|'
|
3441
|
-
r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|'
|
3442
|
-
r'(?:Sub)?Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|'
|
3443
|
-
r'ComponentText|CopyFiles|CRCCheck|'
|
3444
|
-
r'Create(?:Directory|Font|Shortcut)|Delete(?:INI(?:Sec|Str)|'
|
3445
|
-
r'Reg(?:Key|Value))?|DetailPrint|DetailsButtonText|'
|
3446
|
-
r'Dir(?:Show|Text|Var|Verify)|(?:Disabled|Enabled)Bitmap|'
|
3447
|
-
r'EnableWindow|EnumReg(?:Key|Value)|Exch|Exec(?:Shell|Wait)?|'
|
3448
|
-
r'ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|'
|
3449
|
-
r'Read(?:Byte)?|Seek|Write(?:Byte)?)?|'
|
3450
|
-
r'Find(?:Close|First|Next|Window)|FlushINI|Function(?:End)?|'
|
3451
|
-
r'Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|'
|
3452
|
-
r'ErrorLevel|FileTime(?:Local)?|FullPathName|FunctionAddress|'
|
3453
|
-
r'InstDirError|LabelAddress|TempFileName)|'
|
3454
|
-
r'Goto|HideWindow|Icon|'
|
3455
|
-
r'If(?:Abort|Errors|FileExists|RebootFlag|Silent)|'
|
3456
|
-
r'InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|'
|
3457
|
-
r'Inst(?:ProgressFlags|Type(?:[GS]etText)?)|Int(?:CmpU?|Fmt|Op)|'
|
3458
|
-
r'IsWindow|LangString(?:UP)?|'
|
3459
|
-
r'License(?:BkColor|Data|ForceSelection|LangString|Text)|'
|
3460
|
-
r'LoadLanguageFile|LockWindow|Log(?:Set|Text)|MessageBox|'
|
3461
|
-
r'MiscButtonText|Name|Nop|OutFile|(?:Uninst)?Page(?:Ex(?:End)?)?|'
|
3462
|
-
r'PluginDir|Pop|Push|Quit|Read(?:(?:Env|INI|Reg)Str|RegDWORD)|'
|
3463
|
-
r'Reboot|(?:Un)?RegDLL|Rename|RequestExecutionLevel|ReserveFile|'
|
3464
|
-
r'Return|RMDir|SearchPath|Section(?:Divider|End|'
|
3465
|
-
r'(?:(?:Get|Set)(?:Flags|InstTypes|Size|Text))|Group(?:End)?|In)?|'
|
3466
|
-
r'SendMessage|Set(?:AutoClose|BrandingImage|Compress(?:ionLevel|'
|
3467
|
-
r'or(?:DictSize)?)?|CtlColors|CurInstType|DatablockOptimize|'
|
3468
|
-
r'DateSave|Details(?:Print|View)|Error(?:s|Level)|FileAttributes|'
|
3469
|
-
r'Font|OutPath|Overwrite|PluginUnload|RebootFlag|ShellVarContext|'
|
3470
|
-
r'Silent|StaticBkColor)|'
|
3471
|
-
r'Show(?:(?:I|Uni)nstDetails|Window)|Silent(?:Un)?Install|Sleep|'
|
3472
|
-
r'SpaceTexts|Str(?:CmpS?|Cpy|Len)|SubSection(?:End)?|'
|
3473
|
-
r'Uninstall(?:ButtonText|(?:Sub)?Caption|EXEName|Icon|Text)|'
|
3474
|
-
r'UninstPage|Var|VI(?:AddVersionKey|ProductVersion)|WindowIcon|'
|
3475
|
-
r'Write(?:INIStr|Reg(:?Bin|DWORD|(?:Expand)?Str)|Uninstaller)|'
|
3476
|
-
r'XPStyle)\b', Keyword),
|
3477
|
-
(r'\b(CUR|END|(?:FILE_ATTRIBUTE_)?'
|
3478
|
-
r'(?:ARCHIVE|HIDDEN|NORMAL|OFFLINE|READONLY|SYSTEM|TEMPORARY)|'
|
3479
|
-
r'HK(CC|CR|CU|DD|LM|PD|U)|'
|
3480
|
-
r'HKEY_(?:CLASSES_ROOT|CURRENT_(?:CONFIG|USER)|DYN_DATA|'
|
3481
|
-
r'LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|'
|
3482
|
-
r'ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|'
|
3483
|
-
r'MB_(?:ABORTRETRYIGNORE|DEFBUTTON[1-4]|'
|
3484
|
-
r'ICON(?:EXCLAMATION|INFORMATION|QUESTION|STOP)|'
|
3485
|
-
r'OK(?:CANCEL)?|RETRYCANCEL|RIGHT|SETFOREGROUND|TOPMOST|USERICON|'
|
3486
|
-
r'YESNO(?:CANCEL)?)|SET|SHCTX|'
|
3487
|
-
r'SW_(?:HIDE|SHOW(?:MAXIMIZED|MINIMIZED|NORMAL))|'
|
3488
|
-
r'admin|all|auto|both|bottom|bzip2|checkbox|colored|current|false|'
|
3489
|
-
r'force|hide|highest|if(?:diff|newer)|lastused|leave|left|'
|
3490
|
-
r'listonly|lzma|nevershow|none|normal|off|on|pop|push|'
|
3491
|
-
r'radiobuttons|right|show|silent|silentlog|smooth|textonly|top|'
|
3492
|
-
r'true|try|user|zlib)\b', Name.Constant),
|
3493
|
-
],
|
3494
|
-
'macro': [
|
3495
|
-
(r'\!(addincludedir(?:dir)?|addplugindir|appendfile|cd|define|'
|
3496
|
-
r'delfilefile|echo(?:message)?|else|endif|error|execute|'
|
3497
|
-
r'if(?:macro)?n?(?:def)?|include|insertmacro|macro(?:end)?|packhdr|'
|
3498
|
-
r'search(?:parse|replace)|system|tempfilesymbol|undef|verbose|'
|
3499
|
-
r'warning)\b', Comment.Preproc),
|
3500
|
-
],
|
3501
|
-
'interpol': [
|
3502
|
-
(r'\$(R?[0-9])', Name.Builtin.Pseudo), # registers
|
3503
|
-
(r'\$(ADMINTOOLS|APPDATA|CDBURN_AREA|COOKIES|COMMONFILES(?:32|64)|'
|
3504
|
-
r'DESKTOP|DOCUMENTS|EXE(?:DIR|FILE|PATH)|FAVORITES|FONTS|HISTORY|'
|
3505
|
-
r'HWNDPARENT|INTERNET_CACHE|LOCALAPPDATA|MUSIC|NETHOOD|PICTURES|'
|
3506
|
-
r'PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES(?:32|64)|QUICKLAUNCH|'
|
3507
|
-
r'RECENT|RESOURCES(?:_LOCALIZED)?|SENDTO|SM(?:PROGRAMS|STARTUP)|'
|
3508
|
-
r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})',
|
3509
|
-
Name.Builtin),
|
3510
|
-
(r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global),
|
3511
|
-
(r'\$[a-z_]\w*', Name.Variable),
|
3512
|
-
],
|
3513
|
-
'str_double': [
|
3514
|
-
(r'"', String, '#pop'),
|
3515
|
-
(r'\$(\\[nrt"]|\$)', String.Escape),
|
3516
|
-
include('interpol'),
|
3517
|
-
(r'.', String.Double),
|
3518
|
-
],
|
3519
|
-
'str_backtick': [
|
3520
|
-
(r'`', String, '#pop'),
|
3521
|
-
(r'\$(\\[nrt"]|\$)', String.Escape),
|
3522
|
-
include('interpol'),
|
3523
|
-
(r'.', String.Double),
|
3524
|
-
],
|
3525
|
-
}
|
3526
|
-
|
3527
|
-
|
3528
|
-
class RPMSpecLexer(RegexLexer):
|
3529
|
-
"""
|
3530
|
-
For RPM ``.spec`` files.
|
3531
|
-
|
3532
|
-
.. versionadded:: 1.6
|
3533
|
-
"""
|
3534
|
-
|
3535
|
-
name = 'RPMSpec'
|
3536
|
-
aliases = ['spec']
|
3537
|
-
filenames = ['*.spec']
|
3538
|
-
mimetypes = ['text/x-rpm-spec']
|
3539
|
-
|
3540
|
-
_directives = ('(?:package|prep|build|install|clean|check|pre[a-z]*|'
|
3541
|
-
'post[a-z]*|trigger[a-z]*|files)')
|
3542
|
-
|
3543
|
-
tokens = {
|
3544
|
-
'root': [
|
3545
|
-
(r'#.*\n', Comment),
|
3546
|
-
include('basic'),
|
3547
|
-
],
|
3548
|
-
'description': [
|
3549
|
-
(r'^(%' + _directives + ')(.*)$',
|
3550
|
-
bygroups(Name.Decorator, Text), '#pop'),
|
3551
|
-
(r'\n', Text),
|
3552
|
-
(r'.', Text),
|
3553
|
-
],
|
3554
|
-
'changelog': [
|
3555
|
-
(r'\*.*\n', Generic.Subheading),
|
3556
|
-
(r'^(%' + _directives + ')(.*)$',
|
3557
|
-
bygroups(Name.Decorator, Text), '#pop'),
|
3558
|
-
(r'\n', Text),
|
3559
|
-
(r'.', Text),
|
3560
|
-
],
|
3561
|
-
'string': [
|
3562
|
-
(r'"', String.Double, '#pop'),
|
3563
|
-
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
3564
|
-
include('interpol'),
|
3565
|
-
(r'.', String.Double),
|
3566
|
-
],
|
3567
|
-
'basic': [
|
3568
|
-
include('macro'),
|
3569
|
-
(r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|'
|
3570
|
-
r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|'
|
3571
|
-
r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Suggests|Provides|Conflicts|'
|
3572
|
-
r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$',
|
3573
|
-
bygroups(Generic.Heading, Punctuation, using(this))),
|
3574
|
-
(r'^%description', Name.Decorator, 'description'),
|
3575
|
-
(r'^%changelog', Name.Decorator, 'changelog'),
|
3576
|
-
(r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text)),
|
3577
|
-
(r'%(attr|defattr|dir|doc(?:dir)?|setup|config(?:ure)?|'
|
3578
|
-
r'make(?:install)|ghost|patch[0-9]+|find_lang|exclude|verify)',
|
3579
|
-
Keyword),
|
3580
|
-
include('interpol'),
|
3581
|
-
(r"'.*?'", String.Single),
|
3582
|
-
(r'"', String.Double, 'string'),
|
3583
|
-
(r'.', Text),
|
3584
|
-
],
|
3585
|
-
'macro': [
|
3586
|
-
(r'%define.*\n', Comment.Preproc),
|
3587
|
-
(r'%\{\!\?.*%define.*\}', Comment.Preproc),
|
3588
|
-
(r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$',
|
3589
|
-
bygroups(Comment.Preproc, Text)),
|
3590
|
-
],
|
3591
|
-
'interpol': [
|
3592
|
-
(r'%\{?__[a-z_]+\}?', Name.Function),
|
3593
|
-
(r'%\{?_([a-z_]+dir|[a-z_]+path|prefix)\}?', Keyword.Pseudo),
|
3594
|
-
(r'%\{\?\w+\}', Name.Variable),
|
3595
|
-
(r'\$\{?RPM_[A-Z0-9_]+\}?', Name.Variable.Global),
|
3596
|
-
(r'%\{[a-zA-Z]\w+\}', Keyword.Constant),
|
3597
|
-
]
|
3598
|
-
}
|
3599
|
-
|
3600
|
-
|
3601
|
-
class AutoItLexer(RegexLexer):
|
3602
|
-
"""
|
3603
|
-
For `AutoIt <http://www.autoitscript.com/site/autoit/>`_ files.
|
3604
|
-
|
3605
|
-
AutoIt is a freeware BASIC-like scripting language
|
3606
|
-
designed for automating the Windows GUI and general scripting
|
3607
|
-
|
3608
|
-
.. versionadded:: 1.6
|
3609
|
-
"""
|
3610
|
-
name = 'AutoIt'
|
3611
|
-
aliases = ['autoit']
|
3612
|
-
filenames = ['*.au3']
|
3613
|
-
mimetypes = ['text/x-autoit']
|
3614
|
-
|
3615
|
-
# Keywords, functions, macros from au3.keywords.properties
|
3616
|
-
# which can be found in AutoIt installed directory, e.g.
|
3617
|
-
# c:\Program Files (x86)\AutoIt3\SciTE\au3.keywords.properties
|
3618
|
-
|
3619
|
-
keywords = """\
|
3620
|
-
#include-once #include #endregion #forcedef #forceref #region
|
3621
|
-
and byref case continueloop dim do else elseif endfunc endif
|
3622
|
-
endselect exit exitloop for func global
|
3623
|
-
if local next not or return select step
|
3624
|
-
then to until wend while exit""".split()
|
3625
|
-
|
3626
|
-
functions = """\
|
3627
|
-
abs acos adlibregister adlibunregister asc ascw asin assign atan
|
3628
|
-
autoitsetoption autoitwingettitle autoitwinsettitle beep binary binarylen
|
3629
|
-
binarymid binarytostring bitand bitnot bitor bitrotate bitshift bitxor
|
3630
|
-
blockinput break call cdtray ceiling chr chrw clipget clipput consoleread
|
3631
|
-
consolewrite consolewriteerror controlclick controlcommand controldisable
|
3632
|
-
controlenable controlfocus controlgetfocus controlgethandle controlgetpos
|
3633
|
-
controlgettext controlhide controllistview controlmove controlsend
|
3634
|
-
controlsettext controlshow controltreeview cos dec dircopy dircreate
|
3635
|
-
dirgetsize dirmove dirremove dllcall dllcalladdress dllcallbackfree
|
3636
|
-
dllcallbackgetptr dllcallbackregister dllclose dllopen dllstructcreate
|
3637
|
-
dllstructgetdata dllstructgetptr dllstructgetsize dllstructsetdata
|
3638
|
-
drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype
|
3639
|
-
drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree
|
3640
|
-
drivespacetotal drivestatus envget envset envupdate eval execute exp
|
3641
|
-
filechangedir fileclose filecopy filecreatentfslink filecreateshortcut
|
3642
|
-
filedelete fileexists filefindfirstfile filefindnextfile fileflush
|
3643
|
-
filegetattrib filegetencoding filegetlongname filegetpos filegetshortcut
|
3644
|
-
filegetshortname filegetsize filegettime filegetversion fileinstall filemove
|
3645
|
-
fileopen fileopendialog fileread filereadline filerecycle filerecycleempty
|
3646
|
-
filesavedialog fileselectfolder filesetattrib filesetpos filesettime
|
3647
|
-
filewrite filewriteline floor ftpsetproxy guicreate guictrlcreateavi
|
3648
|
-
guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo
|
3649
|
-
guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy
|
3650
|
-
guictrlcreateedit guictrlcreategraphic guictrlcreategroup guictrlcreateicon
|
3651
|
-
guictrlcreateinput guictrlcreatelabel guictrlcreatelist
|
3652
|
-
guictrlcreatelistview guictrlcreatelistviewitem guictrlcreatemenu
|
3653
|
-
guictrlcreatemenuitem guictrlcreatemonthcal guictrlcreateobj
|
3654
|
-
guictrlcreatepic guictrlcreateprogress guictrlcreateradio
|
3655
|
-
guictrlcreateslider guictrlcreatetab guictrlcreatetabitem
|
3656
|
-
guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown
|
3657
|
-
guictrldelete guictrlgethandle guictrlgetstate guictrlread guictrlrecvmsg
|
3658
|
-
guictrlregisterlistviewsort guictrlsendmsg guictrlsendtodummy
|
3659
|
-
guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata
|
3660
|
-
guictrlsetdefbkcolor guictrlsetdefcolor guictrlsetfont guictrlsetgraphic
|
3661
|
-
guictrlsetimage guictrlsetlimit guictrlsetonevent guictrlsetpos
|
3662
|
-
guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete
|
3663
|
-
guigetcursorinfo guigetmsg guigetstyle guiregistermsg guisetaccelerators
|
3664
|
-
guisetbkcolor guisetcoord guisetcursor guisetfont guisethelp guiseticon
|
3665
|
-
guisetonevent guisetstate guisetstyle guistartgroup guiswitch hex hotkeyset
|
3666
|
-
httpsetproxy httpsetuseragent hwnd inetclose inetget inetgetinfo inetgetsize
|
3667
|
-
inetread inidelete iniread inireadsection inireadsectionnames
|
3668
|
-
inirenamesection iniwrite iniwritesection inputbox int isadmin isarray
|
3669
|
-
isbinary isbool isdeclared isdllstruct isfloat ishwnd isint iskeyword
|
3670
|
-
isnumber isobj isptr isstring log memgetstats mod mouseclick mouseclickdrag
|
3671
|
-
mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox
|
3672
|
-
number objcreate objcreateinterface objevent objevent objget objname
|
3673
|
-
onautoitexitregister onautoitexitunregister opt ping pixelchecksum
|
3674
|
-
pixelgetcolor pixelsearch pluginclose pluginopen processclose processexists
|
3675
|
-
processgetstats processlist processsetpriority processwait processwaitclose
|
3676
|
-
progressoff progresson progressset ptr random regdelete regenumkey
|
3677
|
-
regenumval regread regwrite round run runas runaswait runwait send
|
3678
|
-
sendkeepactive seterror setextended shellexecute shellexecutewait shutdown
|
3679
|
-
sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton
|
3680
|
-
sqrt srandom statusbargettext stderrread stdinwrite stdioclose stdoutread
|
3681
|
-
string stringaddcr stringcompare stringformat stringfromasciiarray
|
3682
|
-
stringinstr stringisalnum stringisalpha stringisascii stringisdigit
|
3683
|
-
stringisfloat stringisint stringislower stringisspace stringisupper
|
3684
|
-
stringisxdigit stringleft stringlen stringlower stringmid stringregexp
|
3685
|
-
stringregexpreplace stringreplace stringright stringsplit stringstripcr
|
3686
|
-
stringstripws stringtoasciiarray stringtobinary stringtrimleft
|
3687
|
-
stringtrimright stringupper tan tcpaccept tcpclosesocket tcpconnect
|
3688
|
-
tcplisten tcpnametoip tcprecv tcpsend tcpshutdown tcpstartup timerdiff
|
3689
|
-
timerinit tooltip traycreateitem traycreatemenu traygetmsg trayitemdelete
|
3690
|
-
trayitemgethandle trayitemgetstate trayitemgettext trayitemsetonevent
|
3691
|
-
trayitemsetstate trayitemsettext traysetclick trayseticon traysetonevent
|
3692
|
-
traysetpauseicon traysetstate traysettooltip traytip ubound udpbind
|
3693
|
-
udpclosesocket udpopen udprecv udpsend udpshutdown udpstartup vargettype
|
3694
|
-
winactivate winactive winclose winexists winflash wingetcaretpos
|
3695
|
-
wingetclasslist wingetclientsize wingethandle wingetpos wingetprocess
|
3696
|
-
wingetstate wingettext wingettitle winkill winlist winmenuselectitem
|
3697
|
-
winminimizeall winminimizeallundo winmove winsetontop winsetstate
|
3698
|
-
winsettitle winsettrans winwait winwaitactive winwaitclose
|
3699
|
-
winwaitnotactive""".split()
|
3700
|
-
|
3701
|
-
macros = """\
|
3702
|
-
@appdatacommondir @appdatadir @autoitexe @autoitpid @autoitversion
|
3703
|
-
@autoitx64 @com_eventobj @commonfilesdir @compiled @computername @comspec
|
3704
|
-
@cpuarch @cr @crlf @desktopcommondir @desktopdepth @desktopdir
|
3705
|
-
@desktopheight @desktoprefresh @desktopwidth @documentscommondir @error
|
3706
|
-
@exitcode @exitmethod @extended @favoritescommondir @favoritesdir
|
3707
|
-
@gui_ctrlhandle @gui_ctrlid @gui_dragfile @gui_dragid @gui_dropid
|
3708
|
-
@gui_winhandle @homedrive @homepath @homeshare @hotkeypressed @hour
|
3709
|
-
@ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @kblayout @lf
|
3710
|
-
@logondnsdomain @logondomain @logonserver @mday @min @mon @msec @muilang
|
3711
|
-
@mydocumentsdir @numparams @osarch @osbuild @oslang @osservicepack @ostype
|
3712
|
-
@osversion @programfilesdir @programscommondir @programsdir @scriptdir
|
3713
|
-
@scriptfullpath @scriptlinenumber @scriptname @sec @startmenucommondir
|
3714
|
-
@startmenudir @startupcommondir @startupdir @sw_disable @sw_enable @sw_hide
|
3715
|
-
@sw_lock @sw_maximize @sw_minimize @sw_restore @sw_show @sw_showdefault
|
3716
|
-
@sw_showmaximized @sw_showminimized @sw_showminnoactive @sw_showna
|
3717
|
-
@sw_shownoactivate @sw_shownormal @sw_unlock @systemdir @tab @tempdir
|
3718
|
-
@tray_id @trayiconflashing @trayiconvisible @username @userprofiledir @wday
|
3719
|
-
@windowsdir @workingdir @yday @year""".split()
|
3720
|
-
|
3721
|
-
tokens = {
|
3722
|
-
'root': [
|
3723
|
-
(r';.*\n', Comment.Single),
|
3724
|
-
(r'(#comments-start|#cs).*?(#comments-end|#ce)', Comment.Multiline),
|
3725
|
-
(r'[\[\]{}(),;]', Punctuation),
|
3726
|
-
(r'(and|or|not)\b', Operator.Word),
|
3727
|
-
(r'[\$|@][a-zA-Z_]\w*', Name.Variable),
|
3728
|
-
(r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
|
3729
|
-
include('commands'),
|
3730
|
-
include('labels'),
|
3731
|
-
include('builtInFunctions'),
|
3732
|
-
include('builtInMarcros'),
|
3733
|
-
(r'"', String, combined('stringescape', 'dqs')),
|
3734
|
-
include('numbers'),
|
3735
|
-
(r'[a-zA-Z_#@$][\w#@$]*', Name),
|
3736
|
-
(r'\\|\'', Text),
|
3737
|
-
(r'\`([\,\%\`abfnrtv\-\+;])', String.Escape),
|
3738
|
-
(r'_\n', Text), # Line continuation
|
3739
|
-
include('garbage'),
|
3740
|
-
],
|
3741
|
-
'commands': [
|
3742
|
-
(r'(?i)(\s*)(%s)\b' % '|'.join(keywords),
|
3743
|
-
bygroups(Text, Name.Builtin)),
|
3744
|
-
],
|
3745
|
-
'builtInFunctions': [
|
3746
|
-
(r'(?i)(%s)\b' % '|'.join(functions),
|
3747
|
-
Name.Function),
|
3748
|
-
],
|
3749
|
-
'builtInMarcros': [
|
3750
|
-
(r'(?i)(%s)\b' % '|'.join(macros),
|
3751
|
-
Name.Variable.Global),
|
3752
|
-
],
|
3753
|
-
'labels': [
|
3754
|
-
# sendkeys
|
3755
|
-
(r'(^\s*)({\S+?})', bygroups(Text, Name.Label)),
|
3756
|
-
],
|
3757
|
-
'numbers': [
|
3758
|
-
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
3759
|
-
(r'\d+[eE][+-]?[0-9]+', Number.Float),
|
3760
|
-
(r'0\d+', Number.Oct),
|
3761
|
-
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
3762
|
-
(r'\d+L', Number.Integer.Long),
|
3763
|
-
(r'\d+', Number.Integer)
|
3764
|
-
],
|
3765
|
-
'stringescape': [
|
3766
|
-
(r'\"\"|\`([\,\%\`abfnrtv])', String.Escape),
|
3767
|
-
],
|
3768
|
-
'strings': [
|
3769
|
-
(r'[^"\n]+', String),
|
3770
|
-
],
|
3771
|
-
'dqs': [
|
3772
|
-
(r'"', String, '#pop'),
|
3773
|
-
include('strings')
|
3774
|
-
],
|
3775
|
-
'garbage': [
|
3776
|
-
(r'[^\S\n]', Text),
|
3777
|
-
],
|
3778
|
-
}
|
3779
|
-
|
3780
|
-
|
3781
|
-
class RexxLexer(RegexLexer):
|
3782
|
-
"""
|
3783
|
-
`Rexx <http://www.rexxinfo.org/>`_ is a scripting language available for
|
3784
|
-
a wide range of different platforms with its roots found on mainframe
|
3785
|
-
systems. It is popular for I/O- and data based tasks and can act as glue
|
3786
|
-
language to bind different applications together.
|
3787
|
-
|
3788
|
-
.. versionadded:: 2.0
|
3789
|
-
"""
|
3790
|
-
name = 'Rexx'
|
3791
|
-
aliases = ['rexx', 'arexx']
|
3792
|
-
filenames = ['*.rexx', '*.rex', '*.rx', '*.arexx']
|
3793
|
-
mimetypes = ['text/x-rexx']
|
3794
|
-
flags = re.IGNORECASE
|
3795
|
-
|
3796
|
-
tokens = {
|
3797
|
-
'root': [
|
3798
|
-
(r'\s', Whitespace),
|
3799
|
-
(r'/\*', Comment.Multiline, 'comment'),
|
3800
|
-
(r'"', String, 'string_double'),
|
3801
|
-
(r"'", String, 'string_single'),
|
3802
|
-
(r'[0-9]+(\.[0-9]+)?(e[+-]?[0-9])?', Number),
|
3803
|
-
(r'([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b',
|
3804
|
-
bygroups(Name.Function, Whitespace, Operator, Whitespace,
|
3805
|
-
Keyword.Declaration)),
|
3806
|
-
(r'([a-z_]\w*)(\s*)(:)',
|
3807
|
-
bygroups(Name.Label, Whitespace, Operator)),
|
3808
|
-
include('function'),
|
3809
|
-
include('keyword'),
|
3810
|
-
include('operator'),
|
3811
|
-
(r'[a-z_]\w*', Text),
|
3812
|
-
],
|
3813
|
-
'function': [
|
3814
|
-
(r'(abbrev|abs|address|arg|b2x|bitand|bitor|bitxor|c2d|c2x|'
|
3815
|
-
r'center|charin|charout|chars|compare|condition|copies|d2c|'
|
3816
|
-
r'd2x|datatype|date|delstr|delword|digits|errortext|form|'
|
3817
|
-
r'format|fuzz|insert|lastpos|left|length|linein|lineout|lines|'
|
3818
|
-
r'max|min|overlay|pos|queued|random|reverse|right|sign|'
|
3819
|
-
r'sourceline|space|stream|strip|substr|subword|symbol|time|'
|
3820
|
-
r'trace|translate|trunc|value|verify|word|wordindex|'
|
3821
|
-
r'wordlength|wordpos|words|x2b|x2c|x2d|xrange)(\s*)(\()',
|
3822
|
-
bygroups(Name.Builtin, Whitespace, Operator)),
|
3823
|
-
],
|
3824
|
-
'keyword': [
|
3825
|
-
(r'(address|arg|by|call|do|drop|else|end|exit|for|forever|if|'
|
3826
|
-
r'interpret|iterate|leave|nop|numeric|off|on|options|parse|'
|
3827
|
-
r'pull|push|queue|return|say|select|signal|to|then|trace|until|'
|
3828
|
-
r'while)\b', Keyword.Reserved),
|
3829
|
-
],
|
3830
|
-
'operator': [
|
3831
|
-
(r'(-|//|/|\(|\)|\*\*|\*|\\<<|\\<|\\==|\\=|\\>>|\\>|\\|\|\||\||'
|
3832
|
-
r'&&|&|%|\+|<<=|<<|<=|<>|<|==|=|><|>=|>>=|>>|>|¬<<|¬<|¬==|¬=|'
|
3833
|
-
r'¬>>|¬>|¬|\.|,)', Operator),
|
3834
|
-
],
|
3835
|
-
'string_double': [
|
3836
|
-
(r'[^"\n]+', String),
|
3837
|
-
(r'""', String),
|
3838
|
-
(r'"', String, '#pop'),
|
3839
|
-
(r'\n', Text, '#pop'), # Stray linefeed also terminates strings.
|
3840
|
-
],
|
3841
|
-
'string_single': [
|
3842
|
-
(r'[^\'\n]', String),
|
3843
|
-
(r'\'\'', String),
|
3844
|
-
(r'\'', String, '#pop'),
|
3845
|
-
(r'\n', Text, '#pop'), # Stray linefeed also terminates strings.
|
3846
|
-
],
|
3847
|
-
'comment': [
|
3848
|
-
(r'[^*]+', Comment.Multiline),
|
3849
|
-
(r'\*/', Comment.Multiline, '#pop'),
|
3850
|
-
(r'\*', Comment.Multiline),
|
3851
|
-
]
|
3852
|
-
}
|
3853
|
-
|
3854
|
-
_c = lambda s: re.compile(s, re.MULTILINE)
|
3855
|
-
_ADDRESS_COMMAND_PATTERN = _c(r'^\s*address\s+command\b')
|
3856
|
-
_ADDRESS_PATTERN = _c(r'^\s*address\s+')
|
3857
|
-
_DO_WHILE_PATTERN = _c(r'^\s*do\s+while\b')
|
3858
|
-
_IF_THEN_DO_PATTERN = _c(r'^\s*if\b.+\bthen\s+do\s*$')
|
3859
|
-
_PROCEDURE_PATTERN = _c(r'^\s*([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b')
|
3860
|
-
_ELSE_DO_PATTERN = _c(r'\belse\s+do\s*$')
|
3861
|
-
_PARSE_ARG_PATTERN = _c(r'^\s*parse\s+(upper\s+)?(arg|value)\b')
|
3862
|
-
PATTERNS_AND_WEIGHTS = (
|
3863
|
-
(_ADDRESS_COMMAND_PATTERN, 0.2),
|
3864
|
-
(_ADDRESS_PATTERN, 0.05),
|
3865
|
-
(_DO_WHILE_PATTERN, 0.1),
|
3866
|
-
(_ELSE_DO_PATTERN, 0.1),
|
3867
|
-
(_IF_THEN_DO_PATTERN, 0.1),
|
3868
|
-
(_PROCEDURE_PATTERN, 0.5),
|
3869
|
-
(_PARSE_ARG_PATTERN, 0.2),
|
3870
|
-
)
|
3871
|
-
|
3872
|
-
def analyse_text(text):
|
3873
|
-
"""
|
3874
|
-
Check for inital comment and patterns that distinguish Rexx from other
|
3875
|
-
C-like languages.
|
3876
|
-
"""
|
3877
|
-
if re.search(r'/\*\**\s*rexx', text, re.IGNORECASE):
|
3878
|
-
# Header matches MVS Rexx requirements, this is certainly a Rexx
|
3879
|
-
# script.
|
3880
|
-
return 1.0
|
3881
|
-
elif text.startswith('/*'):
|
3882
|
-
# Header matches general Rexx requirements; the source code might
|
3883
|
-
# still be any language using C comments such as C++, C# or Java.
|
3884
|
-
lowerText = text.lower()
|
3885
|
-
result = sum(weight
|
3886
|
-
for (pattern, weight) in RexxLexer.PATTERNS_AND_WEIGHTS
|
3887
|
-
if pattern.search(lowerText)) + 0.01
|
3888
|
-
return min(result, 1.0)
|
3889
|
-
|
3890
|
-
|
3891
|
-
class APLLexer(RegexLexer):
|
3892
|
-
"""
|
3893
|
-
A simple APL lexer.
|
3894
|
-
|
3895
|
-
.. versionadded:: 2.0
|
3896
|
-
"""
|
3897
|
-
name = 'APL'
|
3898
|
-
aliases = ['apl']
|
3899
|
-
filenames = ['*.apl']
|
3900
|
-
|
3901
|
-
tokens = {
|
3902
|
-
'root': [
|
3903
|
-
# Whitespace
|
3904
|
-
# ==========
|
3905
|
-
(r'\s+', Text),
|
3906
|
-
#
|
3907
|
-
# Comment
|
3908
|
-
# =======
|
3909
|
-
# '⍝' is traditional; '#' is supported by GNU APL and NGN (but not Dyalog)
|
3910
|
-
(u'[⍝#].*$', Comment.Single),
|
3911
|
-
#
|
3912
|
-
# Strings
|
3913
|
-
# =======
|
3914
|
-
(r'\'((\'\')|[^\'])*\'', String.Single),
|
3915
|
-
(r'"(("")|[^"])*"', String.Double), # supported by NGN APL
|
3916
|
-
#
|
3917
|
-
# Punctuation
|
3918
|
-
# ===========
|
3919
|
-
# This token type is used for diamond and parenthesis
|
3920
|
-
# but not for bracket and ; (see below)
|
3921
|
-
(u'[⋄◇()]', Punctuation),
|
3922
|
-
#
|
3923
|
-
# Array indexing
|
3924
|
-
# ==============
|
3925
|
-
# Since this token type is very important in APL, it is not included in
|
3926
|
-
# the punctuation token type but rather in the following one
|
3927
|
-
(r'[\[\];]', String.Regex),
|
3928
|
-
#
|
3929
|
-
# Distinguished names
|
3930
|
-
# ===================
|
3931
|
-
# following IBM APL2 standard
|
3932
|
-
(u'⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Function),
|
3933
|
-
#
|
3934
|
-
# Labels
|
3935
|
-
# ======
|
3936
|
-
# following IBM APL2 standard
|
3937
|
-
# (u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*:', Name.Label),
|
3938
|
-
#
|
3939
|
-
# Variables
|
3940
|
-
# =========
|
3941
|
-
# following IBM APL2 standard
|
3942
|
-
(u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Variable),
|
3943
|
-
#
|
3944
|
-
# Numbers
|
3945
|
-
# =======
|
3946
|
-
(u'¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)'
|
3947
|
-
u'([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?',
|
3948
|
-
Number),
|
3949
|
-
#
|
3950
|
-
# Operators
|
3951
|
-
# ==========
|
3952
|
-
(u'[\.\\\/⌿⍀¨⍣⍨⍠⍤∘]', Name.Attribute), # closest token type
|
3953
|
-
(u'[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]',
|
3954
|
-
Operator),
|
3955
|
-
#
|
3956
|
-
# Constant
|
3957
|
-
# ========
|
3958
|
-
(u'⍬', Name.Constant),
|
3959
|
-
#
|
3960
|
-
# Quad symbol
|
3961
|
-
# ===========
|
3962
|
-
(u'[⎕⍞]', Name.Variable.Global),
|
3963
|
-
#
|
3964
|
-
# Arrows left/right
|
3965
|
-
# =================
|
3966
|
-
(u'[←→]', Keyword.Declaration),
|
3967
|
-
#
|
3968
|
-
# D-Fn
|
3969
|
-
# ====
|
3970
|
-
(u'[⍺⍵⍶⍹∇:]', Name.Builtin.Pseudo),
|
3971
|
-
(r'[{}]', Keyword.Type),
|
3972
|
-
],
|
3973
|
-
}
|
3974
|
-
|
3975
|
-
class AmbientTalkLexer(RegexLexer):
|
3976
|
-
"""
|
3977
|
-
Lexer for `AmbientTalk <https://code.google.com/p/ambienttalk>`_ source code.
|
3978
|
-
|
3979
|
-
.. versionadded:: 2.0
|
3980
|
-
"""
|
3981
|
-
name = 'AmbientTalk'
|
3982
|
-
filenames = ['*.at']
|
3983
|
-
aliases = ['at', 'ambienttalk', 'ambienttalk/2']
|
3984
|
-
mimetypes = ['text/x-ambienttalk']
|
3985
|
-
|
3986
|
-
flags = re.MULTILINE | re.DOTALL
|
3987
|
-
|
3988
|
-
builtin = ['if:', 'then:', 'else:', 'when:', 'whenever:', 'discovered:',
|
3989
|
-
'disconnected:', 'reconnected:', 'takenOffline:', 'becomes:',
|
3990
|
-
'export:', 'as:', 'object:', 'actor:', 'mirror:', 'taggedAs:',
|
3991
|
-
'mirroredBy:', 'is:']
|
3992
|
-
tokens = {
|
3993
|
-
'root' : [
|
3994
|
-
(r'\s+', Text),
|
3995
|
-
(r'//.*?\n', Comment.Single),
|
3996
|
-
(r'/\*.*?\*/', Comment.Multiline),
|
3997
|
-
(r'(def|deftype|import|alias|exclude)\b', Keyword),
|
3998
|
-
(r"(%s)" % "|".join(builtin), Name.Builtin),
|
3999
|
-
(r'(true|false|nil)\b', Keyword.Constant),
|
4000
|
-
(r'(~|lobby|jlobby|/)\.', Keyword.Constant, 'namespace'),
|
4001
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
4002
|
-
(r'\|', Punctuation, 'arglist'),
|
4003
|
-
(r'<:|[\^\*!%&<>+=,./?-]|:=', Operator),
|
4004
|
-
(r"`[a-zA-Z_]\w*", String.Symbol),
|
4005
|
-
(r"[a-zA-Z_]\w*:", Name.Function),
|
4006
|
-
(r"[\{\}()\[\];`]", Punctuation),
|
4007
|
-
(r'(self|super)\b', Name.Variable.Instance),
|
4008
|
-
(r"[a-zA-Z_]\w*", Name.Variable),
|
4009
|
-
(r"@[a-zA-Z_]\w*", Name.Class),
|
4010
|
-
(r"@\[", Name.Class, 'annotations'),
|
4011
|
-
include('numbers'),
|
4012
|
-
],
|
4013
|
-
'numbers' : [
|
4014
|
-
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
4015
|
-
(r'\d+', Number.Integer)
|
4016
|
-
],
|
4017
|
-
'namespace': [
|
4018
|
-
(r'[a-zA-Z_]\w*\.', Name.Namespace),
|
4019
|
-
(r'[a-zA-Z_]\w*:', Name.Function , '#pop'),
|
4020
|
-
(r'[a-zA-Z_]\w*(?!\.)', Name.Function , '#pop')
|
4021
|
-
],
|
4022
|
-
'annotations' : [
|
4023
|
-
(r"(.*?)\]", Name.Class, '#pop')
|
4024
|
-
],
|
4025
|
-
'arglist' : [
|
4026
|
-
(r'\|', Punctuation, '#pop'),
|
4027
|
-
(r'\s*(,)\s*', Punctuation),
|
4028
|
-
(r'[a-zA-Z_]\w*', Name.Variable),
|
4029
|
-
],
|
4030
|
-
}
|
4031
|
-
|
4032
|
-
|
4033
|
-
class PawnLexer(RegexLexer):
|
4034
|
-
"""
|
4035
|
-
For Pawn source code
|
4036
|
-
"""
|
4037
|
-
|
4038
|
-
name = 'Pawn'
|
4039
|
-
aliases = ['pawn']
|
4040
|
-
filenames = ['*.p', '*.pwn', '*.inc']
|
4041
|
-
mimetypes = ['text/x-pawn']
|
4042
|
-
|
4043
|
-
#: optional Comment or Whitespace
|
4044
|
-
_ws = r'(?:\s|//.*?\n|/[*][\w\W]*?[*]/)+'
|
4045
|
-
|
4046
|
-
tokens = {
|
4047
|
-
'root': [
|
4048
|
-
# preprocessor directives: without whitespace
|
4049
|
-
('^#if\s+0', Comment.Preproc, 'if0'),
|
4050
|
-
('^#', Comment.Preproc, 'macro'),
|
4051
|
-
# or with whitespace
|
4052
|
-
('^' + _ws + r'#if\s+0', Comment.Preproc, 'if0'),
|
4053
|
-
('^' + _ws + '#', Comment.Preproc, 'macro'),
|
4054
|
-
(r'\n', Text),
|
4055
|
-
(r'\s+', Text),
|
4056
|
-
(r'\\\n', Text), # line continuation
|
4057
|
-
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
4058
|
-
(r'/(\\\n)?\*[\w\W]*?\*(\\\n)?/', Comment.Multiline),
|
4059
|
-
(r'[{}]', Punctuation),
|
4060
|
-
(r'L?"', String, 'string'),
|
4061
|
-
(r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
|
4062
|
-
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
|
4063
|
-
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
4064
|
-
(r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
|
4065
|
-
(r'0[0-7]+[LlUu]*', Number.Oct),
|
4066
|
-
(r'\d+[LlUu]*', Number.Integer),
|
4067
|
-
(r'\*/', Error),
|
4068
|
-
(r'[~!%^&*+=|?:<>/-]', Operator),
|
4069
|
-
(r'[()\[\],.;]', Punctuation),
|
4070
|
-
(r'(switch|case|default|const|new|static|char|continue|break|'
|
4071
|
-
r'if|else|for|while|do|operator|enum|'
|
4072
|
-
r'public|return|sizeof|tagof|state|goto)\b', Keyword),
|
4073
|
-
(r'(bool|Float)\b', Keyword.Type),
|
4074
|
-
(r'(true|false)\b', Keyword.Constant),
|
4075
|
-
('[a-zA-Z_]\w*', Name),
|
4076
|
-
],
|
4077
|
-
'string': [
|
4078
|
-
(r'"', String, '#pop'),
|
4079
|
-
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
4080
|
-
(r'[^\\"\n]+', String), # all other characters
|
4081
|
-
(r'\\\n', String), # line continuation
|
4082
|
-
(r'\\', String), # stray backslash
|
4083
|
-
],
|
4084
|
-
'macro': [
|
4085
|
-
(r'[^/\n]+', Comment.Preproc),
|
4086
|
-
(r'/\*(.|\n)*?\*/', Comment.Multiline),
|
4087
|
-
(r'//.*?\n', Comment.Single, '#pop'),
|
4088
|
-
(r'/', Comment.Preproc),
|
4089
|
-
(r'(?<=\\)\n', Comment.Preproc),
|
4090
|
-
(r'\n', Comment.Preproc, '#pop'),
|
4091
|
-
],
|
4092
|
-
'if0': [
|
4093
|
-
(r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
|
4094
|
-
(r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
|
4095
|
-
(r'.*?\n', Comment),
|
4096
|
-
]
|
4097
|
-
}
|
4098
|
-
|
4099
|
-
|
4100
|
-
class VCTreeStatusLexer(RegexLexer):
|
4101
|
-
"""
|
4102
|
-
For colorizing output of version control status commans, like "hg
|
4103
|
-
status" or "svn status".
|
4104
|
-
|
4105
|
-
.. versionadded:: 2.0
|
4106
|
-
"""
|
4107
|
-
name = 'VCTreeStatus'
|
4108
|
-
aliases = ['vctreestatus']
|
4109
|
-
filenames = []
|
4110
|
-
mimetypes = []
|
4111
|
-
|
4112
|
-
tokens = {
|
4113
|
-
'root' : [
|
4114
|
-
(r'^A \+ C\s+', Generic.Error),
|
4115
|
-
(r'^A\s+\+?\s+', String),
|
4116
|
-
(r'^M\s+', Generic.Inserted),
|
4117
|
-
(r'^C\s+', Generic.Error),
|
4118
|
-
(r'^D\s+', Generic.Deleted),
|
4119
|
-
(r'^[\?!]\s+', Comment.Preproc),
|
4120
|
-
(r' >\s+.*\n', Comment.Preproc),
|
4121
|
-
(r'.*\n', Text)
|
4122
|
-
]
|
4123
|
-
}
|
4124
|
-
|
4125
|
-
|
4126
|
-
class RslLexer(RegexLexer):
|
4127
|
-
"""
|
4128
|
-
`RSL <http://en.wikipedia.org/wiki/RAISE>`_ is the formal specification
|
4129
|
-
language used in RAISE (Rigorous Approach to Industrial Software Engineering)
|
4130
|
-
method.
|
4131
|
-
|
4132
|
-
.. versionadded:: 2.0
|
4133
|
-
"""
|
4134
|
-
name = 'RSL'
|
4135
|
-
aliases = ['rsl']
|
4136
|
-
filenames = ['*.rsl']
|
4137
|
-
mimetypes = ['text/rsl']
|
4138
|
-
|
4139
|
-
flags = re.MULTILINE | re.DOTALL
|
4140
|
-
|
4141
|
-
tokens = {
|
4142
|
-
'root':[
|
4143
|
-
(r'\b(Bool|Char|Int|Nat|Real|Text|Unit|abs|all|always|any|as|'
|
4144
|
-
r'axiom|card|case|channel|chaos|class|devt_relation|dom|elems|'
|
4145
|
-
r'else|elif|end|exists|extend|false|for|hd|hide|if|in|is|inds|'
|
4146
|
-
r'initialise|int|inter|isin|len|let|local|ltl_assertion|object|'
|
4147
|
-
r'of|out|post|pre|read|real|rng|scheme|skip|stop|swap|then|'
|
4148
|
-
r'thoery|test_case|tl|transition_system|true|type|union|until|'
|
4149
|
-
r'use|value|variable|while|with|write|~isin|-inflist|-infset|'
|
4150
|
-
r'-list|-set)\b', Keyword),
|
4151
|
-
(r'(variable|value)\b', Keyword.Declaration),
|
4152
|
-
(r'--.*?\n', Comment),
|
4153
|
-
(r'<:.*?:>', Comment),
|
4154
|
-
(r'\{!.*?!\}', Comment),
|
4155
|
-
(r'/\*.*?\*/', Comment),
|
4156
|
-
(r'^[ \t]*([\w]+)[ \t]*:[^:]', Name.Function),
|
4157
|
-
(r'(^[ \t]*)([\w]+)([ \t]*\([\w\s,]*\)[ \t]*)(is|as)',
|
4158
|
-
bygroups(Text, Name.Function, Text, Keyword)),
|
4159
|
-
(r'\b[A-Z]\w*\b',Keyword.Type),
|
4160
|
-
(r'(true|false)\b', Keyword.Constant),
|
4161
|
-
(r'".*"',String),
|
4162
|
-
(r'\'.\'',String.Char),
|
4163
|
-
(r'(><|->|-m->|/\\|<=|<<=|<\.|\|\||\|\^\||-~->|-~m->|\\/|>=|>>|'
|
4164
|
-
r'\.>|\+\+|-\\|<->|=>|:-|~=|\*\*|<<|>>=|\+>|!!|\|=\||#)',
|
4165
|
-
Operator),
|
4166
|
-
(r'[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
4167
|
-
(r'0x[0-9a-f]+', Number.Hex),
|
4168
|
-
(r'[0-9]+', Number.Integer),
|
4169
|
-
(r'.', Text),
|
4170
|
-
],
|
4171
|
-
}
|
4172
|
-
|
4173
|
-
def analyse_text(text):
|
4174
|
-
"""
|
4175
|
-
Check for the most common text in the beginning of a RSL file.
|
4176
|
-
"""
|
4177
|
-
if re.search(r'scheme\s*.*?=\s*class\s*type', text, re.I) is not None:
|
4178
|
-
return 1.0
|
4179
|
-
else:
|
4180
|
-
return 0.01
|
4181
|
-
|
4182
|
-
|
4183
|
-
class PanLexer(RegexLexer):
|
4184
|
-
"""
|
4185
|
-
Lexer for `pan <http://github.com/quattor/pan/>`_ source files.
|
4186
|
-
|
4187
|
-
Based on tcsh lexer.
|
4188
|
-
|
4189
|
-
.. versionadded:: 2.0
|
4190
|
-
"""
|
4191
|
-
|
4192
|
-
name = 'Pan'
|
4193
|
-
aliases = ['pan']
|
4194
|
-
filenames = ['*.pan']
|
4195
|
-
|
4196
|
-
tokens = {
|
4197
|
-
'root': [
|
4198
|
-
include('basic'),
|
4199
|
-
(r'\(', Keyword, 'paren'),
|
4200
|
-
(r'{', Keyword, 'curly'),
|
4201
|
-
include('data'),
|
4202
|
-
],
|
4203
|
-
'basic': [
|
4204
|
-
(r'\b(if|for|with|else|type|bind|while|valid|final|prefix|unique|'
|
4205
|
-
r'object|foreach|include|template|function|variable|structure|'
|
4206
|
-
r'extensible|declaration)\s*\b',
|
4207
|
-
Keyword),
|
4208
|
-
(r'\b(file_contents|format|index|length|match|matches|replace|'
|
4209
|
-
r'splice|split|substr|to_lowercase|to_uppercase|debug|error|'
|
4210
|
-
r'traceback|deprecated|base64_decode|base64_encode|digest|escape|'
|
4211
|
-
r'unescape|append|create|first|nlist|key|length|list|merge|next|'
|
4212
|
-
r'prepend|splice|is_boolean|is_defined|is_double|is_list|is_long|'
|
4213
|
-
r'is_nlist|is_null|is_number|is_property|is_resource|is_string|'
|
4214
|
-
r'to_boolean|to_double|to_long|to_string|clone|delete|exists|'
|
4215
|
-
r'path_exists|if_exists|return|value)\s*\b',
|
4216
|
-
Name.Builtin),
|
4217
|
-
(r'#.*', Comment),
|
4218
|
-
(r'\\[\w\W]', String.Escape),
|
4219
|
-
(r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
|
4220
|
-
(r'[\[\]{}()=]+', Operator),
|
4221
|
-
(r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
|
4222
|
-
(r';', Punctuation),
|
4223
|
-
],
|
4224
|
-
'data': [
|
4225
|
-
(r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
|
4226
|
-
(r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
|
4227
|
-
(r'\s+', Text),
|
4228
|
-
(r'[^=\s\[\]{}()$"\'`\\;#]+', Text),
|
4229
|
-
(r'\d+(?= |\Z)', Number),
|
4230
|
-
],
|
4231
|
-
'curly': [
|
4232
|
-
(r'}', Keyword, '#pop'),
|
4233
|
-
(r':-', Keyword),
|
4234
|
-
(r'\w+', Name.Variable),
|
4235
|
-
(r'[^}:"\'`$]+', Punctuation),
|
4236
|
-
(r':', Punctuation),
|
4237
|
-
include('root'),
|
4238
|
-
],
|
4239
|
-
'paren': [
|
4240
|
-
(r'\)', Keyword, '#pop'),
|
4241
|
-
include('root'),
|
4242
|
-
],
|
4243
|
-
}
|
4244
|
-
|
4245
|
-
class RedLexer(RegexLexer):
|
4246
|
-
"""
|
4247
|
-
A `Red-language <http://www.red-lang.org/>`_ lexer.
|
4248
|
-
|
4249
|
-
.. versionadded:: 2.0
|
4250
|
-
"""
|
4251
|
-
name = 'Red'
|
4252
|
-
aliases = ['red', 'red/system']
|
4253
|
-
filenames = ['*.red', '*.reds']
|
4254
|
-
mimetypes = ['text/x-red', 'text/x-red-system']
|
4255
|
-
|
4256
|
-
flags = re.IGNORECASE | re.MULTILINE
|
4257
|
-
|
4258
|
-
escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
|
4259
|
-
|
4260
|
-
def word_callback(lexer, match):
|
4261
|
-
word = match.group()
|
4262
|
-
|
4263
|
-
if re.match(".*:$", word):
|
4264
|
-
yield match.start(), Generic.Subheading, word
|
4265
|
-
elif re.match(
|
4266
|
-
r'(if|unless|either|any|all|while|until|loop|repeat|'
|
4267
|
-
r'foreach|forall|func|function|does|has|switch|'
|
4268
|
-
r'case|reduce|compose|get|set|print|prin|equal\?|'
|
4269
|
-
r'not-equal\?|strict-equal\?|lesser\?|greater\?|lesser-or-equal\?|'
|
4270
|
-
r'greater-or-equal\?|same\?|not|type\?|stats|'
|
4271
|
-
r'bind|union|replace|charset|routine)$', word):
|
4272
|
-
yield match.start(), Name.Builtin, word
|
4273
|
-
elif re.match(
|
4274
|
-
r'(make|random|reflect|to|form|mold|absolute|add|divide|multiply|negate|'
|
4275
|
-
r'power|remainder|round|subtract|even\?|odd\?|and~|complement|or~|xor~|'
|
4276
|
-
r'append|at|back|change|clear|copy|find|head|head\?|index\?|insert|'
|
4277
|
-
r'length\?|next|pick|poke|remove|reverse|select|sort|skip|swap|tail|tail\?|'
|
4278
|
-
r'take|trim|create|close|delete|modify|open|open\?|query|read|rename|'
|
4279
|
-
r'update|write)$', word):
|
4280
|
-
yield match.start(), Name.Function, word
|
4281
|
-
elif re.match(
|
4282
|
-
r'(yes|on|no|off|true|false|tab|cr|lf|newline|escape|slash|sp|space|null|'
|
4283
|
-
r'none|crlf|dot|null-byte)$', word):
|
4284
|
-
yield match.start(), Name.Builtin.Pseudo, word
|
4285
|
-
elif re.match(
|
4286
|
-
r'(#system-global|#include|#enum|#define|#either|#if|#import|#export|'
|
4287
|
-
r'#switch|#default|#get-definition)$', word):
|
4288
|
-
yield match.start(), Keyword.Namespace, word
|
4289
|
-
elif re.match(
|
4290
|
-
r'(system|halt|quit|quit-return|do|load|q|recycle|call|run|ask|parse|'
|
4291
|
-
r'raise-error|return|exit|break|alias|push|pop|probe|\?\?|spec-of|body-of|'
|
4292
|
-
r'quote|forever)$', word):
|
4293
|
-
yield match.start(), Name.Exception, word
|
4294
|
-
elif re.match(
|
4295
|
-
r'(action\?|block\?|char\?|datatype\?|file\?|function\?|get-path\?|zero\?|'
|
4296
|
-
r'get-word\?|integer\?|issue\?|lit-path\?|lit-word\?|logic\?|native\?|'
|
4297
|
-
r'op\?|paren\?|path\?|refinement\?|set-path\?|set-word\?|string\?|unset\?|'
|
4298
|
-
r'any-struct\?|none\?|word\?|any-series\?)$', word):
|
4299
|
-
yield match.start(), Keyword, word
|
4300
|
-
elif re.match(r'(JNICALL|stdcall|cdecl|infix)$', word):
|
4301
|
-
yield match.start(), Keyword.Namespace, word
|
4302
|
-
elif re.match("to-.*", word):
|
4303
|
-
yield match.start(), Keyword, word
|
4304
|
-
elif re.match('(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|===|<>|<|>|<=|>=|<<|>>|<<<|>>>|%|-\*\*)$', word):
|
4305
|
-
yield match.start(), Operator, word
|
4306
|
-
elif re.match(".*\!$", word):
|
4307
|
-
yield match.start(), Keyword.Type, word
|
4308
|
-
elif re.match("'.*", word):
|
4309
|
-
yield match.start(), Name.Variable.Instance, word # lit-word
|
4310
|
-
elif re.match("#.*", word):
|
4311
|
-
yield match.start(), Name.Label, word # issue
|
4312
|
-
elif re.match("%.*", word):
|
4313
|
-
yield match.start(), Name.Decorator, word # file
|
4314
|
-
elif re.match(":.*", word):
|
4315
|
-
yield match.start(), Generic.Subheading, word # get-word
|
4316
|
-
else:
|
4317
|
-
yield match.start(), Name.Variable, word
|
4318
|
-
|
4319
|
-
tokens = {
|
4320
|
-
'root': [
|
4321
|
-
(r'[^R]+', Comment),
|
4322
|
-
(r'Red/System\s+\[', Generic.Strong, 'script'),
|
4323
|
-
(r'Red\s+\[', Generic.Strong, 'script'),
|
4324
|
-
(r'R', Comment)
|
4325
|
-
],
|
4326
|
-
'script': [
|
4327
|
-
(r'\s+', Text),
|
4328
|
-
(r'#"', String.Char, 'char'),
|
4329
|
-
(r'#{[0-9a-f\s]*}', Number.Hex),
|
4330
|
-
(r'2#{', Number.Hex, 'bin2'),
|
4331
|
-
(r'64#{[0-9a-z+/=\s]*}', Number.Hex),
|
4332
|
-
(r'([0-9a-f]+)(h)((\s)|(?=[\[\]{}""\(\)]))',
|
4333
|
-
bygroups(Number.Hex, Name.Variable, Whitespace)),
|
4334
|
-
(r'"', String, 'string'),
|
4335
|
-
(r'{', String, 'string2'),
|
4336
|
-
(r';#+.*\n', Comment.Special),
|
4337
|
-
(r';\*+.*\n', Comment.Preproc),
|
4338
|
-
(r';.*\n', Comment),
|
4339
|
-
(r'%"', Name.Decorator, 'stringFile'),
|
4340
|
-
(r'%[^(\^{^")\s\[\]]+', Name.Decorator),
|
4341
|
-
(r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
|
4342
|
-
(r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
|
4343
|
-
(r'\d+[\-\/][0-9a-z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?'
|
4344
|
-
r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
|
4345
|
-
(r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
|
4346
|
-
(r'\d+[xX]\d+', Keyword.Constant), # pair
|
4347
|
-
(r'[+-]?\d+(\'\d+)?([\.,]\d*)?[eE][+-]?\d+', Number.Float),
|
4348
|
-
(r'[+-]?\d+(\'\d+)?[\.,]\d*', Number.Float),
|
4349
|
-
(r'[+-]?\d+(\'\d+)?', Number),
|
4350
|
-
(r'[\[\]\(\)]', Generic.Strong),
|
4351
|
-
(r'[a-z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url
|
4352
|
-
(r'mailto:[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # url
|
4353
|
-
(r'[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # email
|
4354
|
-
(r'comment\s"', Comment, 'commentString1'),
|
4355
|
-
(r'comment\s{', Comment, 'commentString2'),
|
4356
|
-
(r'comment\s\[', Comment, 'commentBlock'),
|
4357
|
-
(r'comment\s[^(\s{\"\[]+', Comment),
|
4358
|
-
(r'/[^(\^{^")\s/[\]]*', Name.Attribute),
|
4359
|
-
(r'([^(\^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
|
4360
|
-
(r'<[\w:.-]*>', Name.Tag),
|
4361
|
-
(r'<[^(<>\s")]+', Name.Tag, 'tag'),
|
4362
|
-
(r'([^(\^{^")\s]+)', Text),
|
4363
|
-
],
|
4364
|
-
'string': [
|
4365
|
-
(r'[^(\^")]+', String),
|
4366
|
-
(escape_re, String.Escape),
|
4367
|
-
(r'[\(|\)]+', String),
|
4368
|
-
(r'\^.', String.Escape),
|
4369
|
-
(r'"', String, '#pop'),
|
4370
|
-
],
|
4371
|
-
'string2': [
|
4372
|
-
(r'[^(\^{^})]+', String),
|
4373
|
-
(escape_re, String.Escape),
|
4374
|
-
(r'[\(|\)]+', String),
|
4375
|
-
(r'\^.', String.Escape),
|
4376
|
-
(r'{', String, '#push'),
|
4377
|
-
(r'}', String, '#pop'),
|
4378
|
-
],
|
4379
|
-
'stringFile': [
|
4380
|
-
(r'[^(\^")]+', Name.Decorator),
|
4381
|
-
(escape_re, Name.Decorator),
|
4382
|
-
(r'\^.', Name.Decorator),
|
4383
|
-
(r'"', Name.Decorator, '#pop'),
|
4384
|
-
],
|
4385
|
-
'char': [
|
4386
|
-
(escape_re + '"', String.Char, '#pop'),
|
4387
|
-
(r'\^."', String.Char, '#pop'),
|
4388
|
-
(r'."', String.Char, '#pop'),
|
4389
|
-
],
|
4390
|
-
'tag': [
|
4391
|
-
(escape_re, Name.Tag),
|
4392
|
-
(r'"', Name.Tag, 'tagString'),
|
4393
|
-
(r'[^(<>\r\n")]+', Name.Tag),
|
4394
|
-
(r'>', Name.Tag, '#pop'),
|
4395
|
-
],
|
4396
|
-
'tagString': [
|
4397
|
-
(r'[^(\^")]+', Name.Tag),
|
4398
|
-
(escape_re, Name.Tag),
|
4399
|
-
(r'[\(|\)]+', Name.Tag),
|
4400
|
-
(r'\^.', Name.Tag),
|
4401
|
-
(r'"', Name.Tag, '#pop'),
|
4402
|
-
],
|
4403
|
-
'tuple': [
|
4404
|
-
(r'(\d+\.)+', Keyword.Constant),
|
4405
|
-
(r'\d+', Keyword.Constant, '#pop'),
|
4406
|
-
],
|
4407
|
-
'bin2': [
|
4408
|
-
(r'\s+', Number.Hex),
|
4409
|
-
(r'([0-1]\s*){8}', Number.Hex),
|
4410
|
-
(r'}', Number.Hex, '#pop'),
|
4411
|
-
],
|
4412
|
-
'commentString1': [
|
4413
|
-
(r'[^(\^")]+', Comment),
|
4414
|
-
(escape_re, Comment),
|
4415
|
-
(r'[\(|\)]+', Comment),
|
4416
|
-
(r'\^.', Comment),
|
4417
|
-
(r'"', Comment, '#pop'),
|
4418
|
-
],
|
4419
|
-
'commentString2': [
|
4420
|
-
(r'[^(\^{^})]+', Comment),
|
4421
|
-
(escape_re, Comment),
|
4422
|
-
(r'[\(|\)]+', Comment),
|
4423
|
-
(r'\^.', Comment),
|
4424
|
-
(r'{', Comment, '#push'),
|
4425
|
-
(r'}', Comment, '#pop'),
|
4426
|
-
],
|
4427
|
-
'commentBlock': [
|
4428
|
-
(r'\[', Comment, '#push'),
|
4429
|
-
(r'\]', Comment, '#pop'),
|
4430
|
-
(r'"', Comment, "commentString1"),
|
4431
|
-
(r'{', Comment, "commentString2"),
|
4432
|
-
(r'[^(\[\]\"{)]+', Comment),
|
4433
|
-
],
|
4434
|
-
}
|
4435
|
-
|
4436
|
-
|
4437
|
-
class AlloyLexer(RegexLexer):
|
4438
|
-
"""
|
4439
|
-
For `Alloy <http://alloy.mit.edu>`_ source code.
|
4440
|
-
"""
|
4441
|
-
|
4442
|
-
name = 'Alloy'
|
4443
|
-
aliases = ['alloy']
|
4444
|
-
filenames = ['*.als']
|
4445
|
-
mimetypes = ['text/x-alloy']
|
4446
|
-
|
4447
|
-
flags = re.MULTILINE | re.DOTALL
|
4448
|
-
|
4449
|
-
iden_rex = r'[a-zA-Z_][a-zA-Z0-9_\']*'
|
4450
|
-
text_tuple = (r'[^\S\n]+', Text)
|
4451
|
-
|
4452
|
-
tokens = {
|
4453
|
-
'sig': [
|
4454
|
-
(r'(extends)\b', Keyword, '#pop'),
|
4455
|
-
(iden_rex, Name),
|
4456
|
-
text_tuple,
|
4457
|
-
(r',', Punctuation),
|
4458
|
-
(r'\{', Operator, '#pop'),
|
4459
|
-
],
|
4460
|
-
'module': [
|
4461
|
-
text_tuple,
|
4462
|
-
(iden_rex, Name, '#pop'),
|
4463
|
-
],
|
4464
|
-
'fun': [
|
4465
|
-
text_tuple,
|
4466
|
-
(r'\{', Operator, '#pop'),
|
4467
|
-
(iden_rex, Name, '#pop'),
|
4468
|
-
],
|
4469
|
-
'root': [
|
4470
|
-
(r'--.*?$', Comment.Single),
|
4471
|
-
(r'//.*?$', Comment.Single),
|
4472
|
-
(r'/\*.*?\*/', Comment.Multiline),
|
4473
|
-
text_tuple,
|
4474
|
-
(r'(module|open)(\s+)', bygroups(Keyword.Namespace, Text),
|
4475
|
-
'module'),
|
4476
|
-
(r'(sig|enum)(\s+)', bygroups(Keyword.Declaration, Text), 'sig'),
|
4477
|
-
(r'(iden|univ|none)\b', Keyword.Constant),
|
4478
|
-
(r'(int|Int)\b', Keyword.Type),
|
4479
|
-
(r'(this|abstract|extends|set|seq|one|lone|let)\b', Keyword),
|
4480
|
-
(r'(all|some|no|sum|disj|when|else)\b', Keyword),
|
4481
|
-
(r'(run|check|for|but|exactly|expect|as)\b', Keyword),
|
4482
|
-
(r'(and|or|implies|iff|in)\b', Operator.Word),
|
4483
|
-
(r'(fun|pred|fact|assert)(\s+)', bygroups(Keyword, Text), 'fun'),
|
4484
|
-
(r'!|#|&&|\+\+|<<|>>|>=|<=>|<=|\.|->', Operator),
|
4485
|
-
(r'[-+/*%=<>&!^|~\{\}\[\]\(\)\.]', Operator),
|
4486
|
-
(iden_rex, Name),
|
4487
|
-
(r'[:,]', Punctuation),
|
4488
|
-
(r'[0-9]+', Number.Integer),
|
4489
|
-
(r'"(\\\\|\\"|[^"])*"', String),
|
4490
|
-
(r'\n', Text),
|
4491
|
-
]
|
4492
|
-
}
|
14
|
+
TcshLexer
|
15
|
+
from pygments.lexers.robotframework import RobotFrameworkLexer
|
16
|
+
from pygments.lexers.testing import GherkinLexer
|
17
|
+
from pygments.lexers.esoteric import BrainfuckLexer, BefungeLexer, RedcodeLexer
|
18
|
+
from pygments.lexers.prolog import LogtalkLexer
|
19
|
+
from pygments.lexers.snobol import SnobolLexer
|
20
|
+
from pygments.lexers.rebol import RebolLexer
|
21
|
+
from pygments.lexers.configs import KconfigLexer, Cfengine3Lexer
|
22
|
+
from pygments.lexers.modeling import ModelicaLexer
|
23
|
+
from pygments.lexers.scripting import AppleScriptLexer, MOOCodeLexer, \
|
24
|
+
HybrisLexer
|
25
|
+
from pygments.lexers.graphics import PostScriptLexer, GnuplotLexer, \
|
26
|
+
AsymptoteLexer, PovrayLexer
|
27
|
+
from pygments.lexers.business import ABAPLexer, OpenEdgeLexer, \
|
28
|
+
GoodDataCLLexer, MaqlLexer
|
29
|
+
from pygments.lexers.automation import AutoItLexer, AutohotkeyLexer
|
30
|
+
from pygments.lexers.dsls import ProtoBufLexer, BroLexer, PuppetLexer, \
|
31
|
+
MscgenLexer, VGLLexer
|
32
|
+
from pygments.lexers.basic import CbmBasicV2Lexer
|
33
|
+
from pygments.lexers.pawn import SourcePawnLexer, PawnLexer
|
34
|
+
from pygments.lexers.ecl import ECLLexer
|
35
|
+
from pygments.lexers.urbi import UrbiscriptLexer
|
36
|
+
from pygments.lexers.smalltalk import SmalltalkLexer, NewspeakLexer
|
37
|
+
from pygments.lexers.installers import NSISLexer, RPMSpecLexer
|
38
|
+
from pygments.lexers.textedit import AwkLexer
|
39
|
+
from pygments.lexers.smv import NuSMVLexer
|
40
|
+
|
41
|
+
__all__ = []
|