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
@@ -3,2284 +3,19 @@
|
|
3
3
|
pygments.lexers.math
|
4
4
|
~~~~~~~~~~~~~~~~~~~~
|
5
5
|
|
6
|
-
|
6
|
+
Just export lexers that were 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
|
-
from
|
12
|
+
from pygments.lexers.python import NumPyLexer
|
13
|
+
from pygments.lexers.matlab import MatlabLexer, MatlabSessionLexer, \
|
14
|
+
OctaveLexer, ScilabLexer
|
15
|
+
from pygments.lexers.julia import JuliaLexer, JuliaConsoleLexer
|
16
|
+
from pygments.lexers.r import RConsoleLexer, SLexer, RdLexer
|
17
|
+
from pygments.lexers.modeling import BugsLexer, JagsLexer, StanLexer
|
18
|
+
from pygments.lexers.idl import IDLLexer
|
19
|
+
from pygments.lexers.algebra import MuPADLexer
|
13
20
|
|
14
|
-
|
15
|
-
|
16
|
-
from pygments.util import shebang_matches
|
17
|
-
from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
|
18
|
-
combined, do_insertions
|
19
|
-
from pygments.token import Comment, String, Punctuation, Keyword, Name, \
|
20
|
-
Operator, Number, Text, Generic
|
21
|
-
|
22
|
-
from pygments.lexers.agile import PythonLexer
|
23
|
-
from pygments.lexers import _scilab_builtins
|
24
|
-
from pygments.lexers import _stan_builtins
|
25
|
-
|
26
|
-
__all__ = ['JuliaLexer', 'JuliaConsoleLexer', 'MuPADLexer', 'MatlabLexer',
|
27
|
-
'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer', 'NumPyLexer',
|
28
|
-
'RConsoleLexer', 'SLexer', 'JagsLexer', 'BugsLexer', 'StanLexer',
|
29
|
-
'IDLLexer', 'RdLexer', 'IgorLexer', 'MathematicaLexer', 'GAPLexer']
|
30
|
-
|
31
|
-
|
32
|
-
class JuliaLexer(RegexLexer):
|
33
|
-
"""
|
34
|
-
For `Julia <http://julialang.org/>`_ source code.
|
35
|
-
|
36
|
-
.. versionadded:: 1.6
|
37
|
-
"""
|
38
|
-
name = 'Julia'
|
39
|
-
aliases = ['julia','jl']
|
40
|
-
filenames = ['*.jl']
|
41
|
-
mimetypes = ['text/x-julia','application/x-julia']
|
42
|
-
|
43
|
-
builtins = [
|
44
|
-
'exit','whos','edit','load','is','isa','isequal','typeof','tuple',
|
45
|
-
'ntuple','uid','hash','finalizer','convert','promote','subtype',
|
46
|
-
'typemin','typemax','realmin','realmax','sizeof','eps','promote_type',
|
47
|
-
'method_exists','applicable','invoke','dlopen','dlsym','system',
|
48
|
-
'error','throw','assert','new','Inf','Nan','pi','im',
|
49
|
-
]
|
50
|
-
|
51
|
-
tokens = {
|
52
|
-
'root': [
|
53
|
-
(r'\n', Text),
|
54
|
-
(r'[^\S\n]+', Text),
|
55
|
-
(r'#.*$', Comment),
|
56
|
-
(r'[]{}:(),;[@]', Punctuation),
|
57
|
-
(r'\\\n', Text),
|
58
|
-
(r'\\', Text),
|
59
|
-
|
60
|
-
# keywords
|
61
|
-
(r'(begin|while|for|in|return|break|continue|'
|
62
|
-
r'macro|quote|let|if|elseif|else|try|catch|end|'
|
63
|
-
r'bitstype|ccall|do|using|module|import|export|'
|
64
|
-
r'importall|baremodule|immutable)\b', Keyword),
|
65
|
-
(r'(local|global|const)\b', Keyword.Declaration),
|
66
|
-
(r'(Bool|Int|Int8|Int16|Int32|Int64|Uint|Uint8|Uint16|Uint32|Uint64'
|
67
|
-
r'|Float32|Float64|Complex64|Complex128|Any|Nothing|None)\b',
|
68
|
-
Keyword.Type),
|
69
|
-
|
70
|
-
# functions
|
71
|
-
(r'(function)((?:\s|\\\s)+)',
|
72
|
-
bygroups(Keyword,Name.Function), 'funcname'),
|
73
|
-
|
74
|
-
# types
|
75
|
-
(r'(type|typealias|abstract)((?:\s|\\\s)+)',
|
76
|
-
bygroups(Keyword,Name.Class), 'typename'),
|
77
|
-
|
78
|
-
# operators
|
79
|
-
(r'==|!=|<=|>=|->|&&|\|\||::|<:|[-~+/*%=<>&^|.?!$]', Operator),
|
80
|
-
(r'\.\*|\.\^|\.\\|\.\/|\\', Operator),
|
81
|
-
|
82
|
-
# builtins
|
83
|
-
('(' + '|'.join(builtins) + r')\b', Name.Builtin),
|
84
|
-
|
85
|
-
# backticks
|
86
|
-
(r'`(?s).*?`', String.Backtick),
|
87
|
-
|
88
|
-
# chars
|
89
|
-
(r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|"
|
90
|
-
r"\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char),
|
91
|
-
|
92
|
-
# try to match trailing transpose
|
93
|
-
(r'(?<=[.\w\)\]])\'+', Operator),
|
94
|
-
|
95
|
-
# strings
|
96
|
-
(r'(?:[IL])"', String, 'string'),
|
97
|
-
(r'[E]?"', String, combined('stringescape', 'string')),
|
98
|
-
|
99
|
-
# names
|
100
|
-
(r'@[\w.]+', Name.Decorator),
|
101
|
-
(r'[a-zA-Z_]\w*', Name),
|
102
|
-
|
103
|
-
# numbers
|
104
|
-
(r'(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?', Number.Float),
|
105
|
-
(r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
|
106
|
-
(r'\d+(_\d+)+[eEf][+-]?[0-9]+', Number.Float),
|
107
|
-
(r'\d+[eEf][+-]?[0-9]+', Number.Float),
|
108
|
-
(r'0b[01]+(_[01]+)+', Number.Bin),
|
109
|
-
(r'0b[01]+', Number.Bin),
|
110
|
-
(r'0o[0-7]+(_[0-7]+)+', Number.Oct),
|
111
|
-
(r'0o[0-7]+', Number.Oct),
|
112
|
-
(r'0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+', Number.Hex),
|
113
|
-
(r'0x[a-fA-F0-9]+', Number.Hex),
|
114
|
-
(r'\d+(_\d+)+', Number.Integer),
|
115
|
-
(r'\d+', Number.Integer)
|
116
|
-
],
|
117
|
-
|
118
|
-
'funcname': [
|
119
|
-
('[a-zA-Z_]\w*', Name.Function, '#pop'),
|
120
|
-
('\([^\s\w{]{1,2}\)', Operator, '#pop'),
|
121
|
-
('[^\s\w{]{1,2}', Operator, '#pop'),
|
122
|
-
],
|
123
|
-
|
124
|
-
'typename': [
|
125
|
-
('[a-zA-Z_]\w*', Name.Class, '#pop')
|
126
|
-
],
|
127
|
-
|
128
|
-
'stringescape': [
|
129
|
-
(r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
|
130
|
-
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
131
|
-
],
|
132
|
-
|
133
|
-
'string': [
|
134
|
-
(r'"', String, '#pop'),
|
135
|
-
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
136
|
-
(r'\$(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?',
|
137
|
-
String.Interpol),
|
138
|
-
(r'[^\\"$]+', String),
|
139
|
-
# quotes, dollar signs, and backslashes must be parsed one at a time
|
140
|
-
(r'["\\]', String),
|
141
|
-
# unhandled string formatting sign
|
142
|
-
(r'\$', String)
|
143
|
-
],
|
144
|
-
}
|
145
|
-
|
146
|
-
def analyse_text(text):
|
147
|
-
return shebang_matches(text, r'julia')
|
148
|
-
|
149
|
-
|
150
|
-
line_re = re.compile('.*?\n')
|
151
|
-
|
152
|
-
class JuliaConsoleLexer(Lexer):
|
153
|
-
"""
|
154
|
-
For Julia console sessions. Modeled after MatlabSessionLexer.
|
155
|
-
|
156
|
-
.. versionadded:: 1.6
|
157
|
-
"""
|
158
|
-
name = 'Julia console'
|
159
|
-
aliases = ['jlcon']
|
160
|
-
|
161
|
-
def get_tokens_unprocessed(self, text):
|
162
|
-
jllexer = JuliaLexer(**self.options)
|
163
|
-
|
164
|
-
curcode = ''
|
165
|
-
insertions = []
|
166
|
-
|
167
|
-
for match in line_re.finditer(text):
|
168
|
-
line = match.group()
|
169
|
-
|
170
|
-
if line.startswith('julia>'):
|
171
|
-
insertions.append((len(curcode),
|
172
|
-
[(0, Generic.Prompt, line[:6])]))
|
173
|
-
curcode += line[6:]
|
174
|
-
|
175
|
-
elif line.startswith(' '):
|
176
|
-
|
177
|
-
idx = len(curcode)
|
178
|
-
|
179
|
-
# without is showing error on same line as before...?
|
180
|
-
line = "\n" + line
|
181
|
-
token = (0, Generic.Traceback, line)
|
182
|
-
insertions.append((idx, [token]))
|
183
|
-
|
184
|
-
else:
|
185
|
-
if curcode:
|
186
|
-
for item in do_insertions(
|
187
|
-
insertions, jllexer.get_tokens_unprocessed(curcode)):
|
188
|
-
yield item
|
189
|
-
curcode = ''
|
190
|
-
insertions = []
|
191
|
-
|
192
|
-
yield match.start(), Generic.Output, line
|
193
|
-
|
194
|
-
if curcode: # or item:
|
195
|
-
for item in do_insertions(
|
196
|
-
insertions, jllexer.get_tokens_unprocessed(curcode)):
|
197
|
-
yield item
|
198
|
-
|
199
|
-
|
200
|
-
class MuPADLexer(RegexLexer):
|
201
|
-
"""
|
202
|
-
A `MuPAD <http://www.mupad.com>`_ lexer.
|
203
|
-
Contributed by Christopher Creutzig <christopher@creutzig.de>.
|
204
|
-
|
205
|
-
.. versionadded:: 0.8
|
206
|
-
"""
|
207
|
-
name = 'MuPAD'
|
208
|
-
aliases = ['mupad']
|
209
|
-
filenames = ['*.mu']
|
210
|
-
|
211
|
-
tokens = {
|
212
|
-
'root' : [
|
213
|
-
(r'//.*?$', Comment.Single),
|
214
|
-
(r'/\*', Comment.Multiline, 'comment'),
|
215
|
-
(r'"(?:[^"\\]|\\.)*"', String),
|
216
|
-
(r'\(|\)|\[|\]|\{|\}', Punctuation),
|
217
|
-
(r'''(?x)\b(?:
|
218
|
-
next|break|end|
|
219
|
-
axiom|end_axiom|category|end_category|domain|end_domain|inherits|
|
220
|
-
if|%if|then|elif|else|end_if|
|
221
|
-
case|of|do|otherwise|end_case|
|
222
|
-
while|end_while|
|
223
|
-
repeat|until|end_repeat|
|
224
|
-
for|from|to|downto|step|end_for|
|
225
|
-
proc|local|option|save|begin|end_proc|
|
226
|
-
delete|frame
|
227
|
-
)\b''', Keyword),
|
228
|
-
(r'''(?x)\b(?:
|
229
|
-
DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR|
|
230
|
-
DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT|
|
231
|
-
DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC|
|
232
|
-
DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR
|
233
|
-
)\b''', Name.Class),
|
234
|
-
(r'''(?x)\b(?:
|
235
|
-
PI|EULER|E|CATALAN|
|
236
|
-
NIL|FAIL|undefined|infinity|
|
237
|
-
TRUE|FALSE|UNKNOWN
|
238
|
-
)\b''',
|
239
|
-
Name.Constant),
|
240
|
-
(r'\b(?:dom|procname)\b', Name.Builtin.Pseudo),
|
241
|
-
(r'\.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=', Operator),
|
242
|
-
(r'''(?x)\b(?:
|
243
|
-
and|or|not|xor|
|
244
|
-
assuming|
|
245
|
-
div|mod|
|
246
|
-
union|minus|intersect|in|subset
|
247
|
-
)\b''',
|
248
|
-
Operator.Word),
|
249
|
-
(r'\b(?:I|RDN_INF|RD_NINF|RD_NAN)\b', Number),
|
250
|
-
#(r'\b(?:adt|linalg|newDomain|hold)\b', Name.Builtin),
|
251
|
-
(r'''(?x)
|
252
|
-
((?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)
|
253
|
-
(?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*)(\s*)([(])''',
|
254
|
-
bygroups(Name.Function, Text, Punctuation)),
|
255
|
-
(r'''(?x)
|
256
|
-
(?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)
|
257
|
-
(?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*''', Name.Variable),
|
258
|
-
(r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
|
259
|
-
(r'\.[0-9]+(?:e[0-9]+)?', Number),
|
260
|
-
(r'.', Text)
|
261
|
-
],
|
262
|
-
'comment' : [
|
263
|
-
(r'[^*/]', Comment.Multiline),
|
264
|
-
(r'/\*', Comment.Multiline, '#push'),
|
265
|
-
(r'\*/', Comment.Multiline, '#pop'),
|
266
|
-
(r'[*/]', Comment.Multiline)
|
267
|
-
]
|
268
|
-
}
|
269
|
-
|
270
|
-
|
271
|
-
class MatlabLexer(RegexLexer):
|
272
|
-
"""
|
273
|
-
For Matlab source code.
|
274
|
-
|
275
|
-
.. versionadded:: 0.10
|
276
|
-
"""
|
277
|
-
name = 'Matlab'
|
278
|
-
aliases = ['matlab']
|
279
|
-
filenames = ['*.m']
|
280
|
-
mimetypes = ['text/matlab']
|
281
|
-
|
282
|
-
#
|
283
|
-
# These lists are generated automatically.
|
284
|
-
# Run the following in bash shell:
|
285
|
-
#
|
286
|
-
# for f in elfun specfun elmat; do
|
287
|
-
# echo -n "$f = "
|
288
|
-
# matlab -nojvm -r "help $f;exit;" | perl -ne \
|
289
|
-
# 'push(@c,$1) if /^ (\w+)\s+-/; END {print q{["}.join(q{","},@c).qq{"]\n};}'
|
290
|
-
# done
|
291
|
-
#
|
292
|
-
# elfun: Elementary math functions
|
293
|
-
# specfun: Special Math functions
|
294
|
-
# elmat: Elementary matrices and matrix manipulation
|
295
|
-
#
|
296
|
-
# taken from Matlab version 7.4.0.336 (R2007a)
|
297
|
-
#
|
298
|
-
elfun = ["sin","sind","sinh","asin","asind","asinh","cos","cosd","cosh",
|
299
|
-
"acos","acosd","acosh","tan","tand","tanh","atan","atand","atan2",
|
300
|
-
"atanh","sec","secd","sech","asec","asecd","asech","csc","cscd",
|
301
|
-
"csch","acsc","acscd","acsch","cot","cotd","coth","acot","acotd",
|
302
|
-
"acoth","hypot","exp","expm1","log","log1p","log10","log2","pow2",
|
303
|
-
"realpow","reallog","realsqrt","sqrt","nthroot","nextpow2","abs",
|
304
|
-
"angle","complex","conj","imag","real","unwrap","isreal","cplxpair",
|
305
|
-
"fix","floor","ceil","round","mod","rem","sign"]
|
306
|
-
specfun = ["airy","besselj","bessely","besselh","besseli","besselk","beta",
|
307
|
-
"betainc","betaln","ellipj","ellipke","erf","erfc","erfcx",
|
308
|
-
"erfinv","expint","gamma","gammainc","gammaln","psi","legendre",
|
309
|
-
"cross","dot","factor","isprime","primes","gcd","lcm","rat",
|
310
|
-
"rats","perms","nchoosek","factorial","cart2sph","cart2pol",
|
311
|
-
"pol2cart","sph2cart","hsv2rgb","rgb2hsv"]
|
312
|
-
elmat = ["zeros","ones","eye","repmat","rand","randn","linspace","logspace",
|
313
|
-
"freqspace","meshgrid","accumarray","size","length","ndims","numel",
|
314
|
-
"disp","isempty","isequal","isequalwithequalnans","cat","reshape",
|
315
|
-
"diag","blkdiag","tril","triu","fliplr","flipud","flipdim","rot90",
|
316
|
-
"find","end","sub2ind","ind2sub","bsxfun","ndgrid","permute",
|
317
|
-
"ipermute","shiftdim","circshift","squeeze","isscalar","isvector",
|
318
|
-
"ans","eps","realmax","realmin","pi","i","inf","nan","isnan",
|
319
|
-
"isinf","isfinite","j","why","compan","gallery","hadamard","hankel",
|
320
|
-
"hilb","invhilb","magic","pascal","rosser","toeplitz","vander",
|
321
|
-
"wilkinson"]
|
322
|
-
|
323
|
-
tokens = {
|
324
|
-
'root': [
|
325
|
-
# line starting with '!' is sent as a system command. not sure what
|
326
|
-
# label to use...
|
327
|
-
(r'^!.*', String.Other),
|
328
|
-
(r'%\{\s*\n', Comment.Multiline, 'blockcomment'),
|
329
|
-
(r'%.*$', Comment),
|
330
|
-
(r'^\s*function', Keyword, 'deffunc'),
|
331
|
-
|
332
|
-
# from 'iskeyword' on version 7.11 (R2010):
|
333
|
-
(r'(break|case|catch|classdef|continue|else|elseif|end|enumerated|'
|
334
|
-
r'events|for|function|global|if|methods|otherwise|parfor|'
|
335
|
-
r'persistent|properties|return|spmd|switch|try|while)\b', Keyword),
|
336
|
-
|
337
|
-
("(" + "|".join(elfun+specfun+elmat) + r')\b', Name.Builtin),
|
338
|
-
|
339
|
-
# line continuation with following comment:
|
340
|
-
(r'\.\.\..*$', Comment),
|
341
|
-
|
342
|
-
# operators:
|
343
|
-
(r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
|
344
|
-
# operators requiring escape for re:
|
345
|
-
(r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
|
346
|
-
|
347
|
-
# punctuation:
|
348
|
-
(r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation),
|
349
|
-
(r'=|:|;', Punctuation),
|
350
|
-
|
351
|
-
# quote can be transpose, instead of string:
|
352
|
-
# (not great, but handles common cases...)
|
353
|
-
(r'(?<=[\w\)\].])\'+', Operator),
|
354
|
-
|
355
|
-
(r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
|
356
|
-
(r'\d+[eEf][+-]?[0-9]+', Number.Float),
|
357
|
-
(r'\d+', Number.Integer),
|
358
|
-
|
359
|
-
(r'(?<![\w\)\].])\'', String, 'string'),
|
360
|
-
('[a-zA-Z_]\w*', Name),
|
361
|
-
(r'.', Text),
|
362
|
-
],
|
363
|
-
'string': [
|
364
|
-
(r'[^\']*\'', String, '#pop')
|
365
|
-
],
|
366
|
-
'blockcomment': [
|
367
|
-
(r'^\s*%\}', Comment.Multiline, '#pop'),
|
368
|
-
(r'^.*\n', Comment.Multiline),
|
369
|
-
(r'.', Comment.Multiline),
|
370
|
-
],
|
371
|
-
'deffunc': [
|
372
|
-
(r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
|
373
|
-
bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
|
374
|
-
Text.Whitespace, Name.Function, Punctuation, Text,
|
375
|
-
Punctuation, Text.Whitespace), '#pop'),
|
376
|
-
],
|
377
|
-
}
|
378
|
-
|
379
|
-
def analyse_text(text):
|
380
|
-
if re.match('^\s*%', text, re.M): # comment
|
381
|
-
return 0.2
|
382
|
-
elif re.match('^!\w+', text, re.M): # system cmd
|
383
|
-
return 0.2
|
384
|
-
|
385
|
-
|
386
|
-
line_re = re.compile('.*?\n')
|
387
|
-
|
388
|
-
class MatlabSessionLexer(Lexer):
|
389
|
-
"""
|
390
|
-
For Matlab sessions. Modeled after PythonConsoleLexer.
|
391
|
-
Contributed by Ken Schutte <kschutte@csail.mit.edu>.
|
392
|
-
|
393
|
-
.. versionadded:: 0.10
|
394
|
-
"""
|
395
|
-
name = 'Matlab session'
|
396
|
-
aliases = ['matlabsession']
|
397
|
-
|
398
|
-
def get_tokens_unprocessed(self, text):
|
399
|
-
mlexer = MatlabLexer(**self.options)
|
400
|
-
|
401
|
-
curcode = ''
|
402
|
-
insertions = []
|
403
|
-
|
404
|
-
for match in line_re.finditer(text):
|
405
|
-
line = match.group()
|
406
|
-
|
407
|
-
if line.startswith('>> '):
|
408
|
-
insertions.append((len(curcode),
|
409
|
-
[(0, Generic.Prompt, line[:3])]))
|
410
|
-
curcode += line[3:]
|
411
|
-
|
412
|
-
elif line.startswith('>>'):
|
413
|
-
insertions.append((len(curcode),
|
414
|
-
[(0, Generic.Prompt, line[:2])]))
|
415
|
-
curcode += line[2:]
|
416
|
-
|
417
|
-
elif line.startswith('???'):
|
418
|
-
|
419
|
-
idx = len(curcode)
|
420
|
-
|
421
|
-
# without is showing error on same line as before...?
|
422
|
-
#line = "\n" + line
|
423
|
-
token = (0, Generic.Traceback, line)
|
424
|
-
insertions.append((idx, [token]))
|
425
|
-
|
426
|
-
else:
|
427
|
-
if curcode:
|
428
|
-
for item in do_insertions(
|
429
|
-
insertions, mlexer.get_tokens_unprocessed(curcode)):
|
430
|
-
yield item
|
431
|
-
curcode = ''
|
432
|
-
insertions = []
|
433
|
-
|
434
|
-
yield match.start(), Generic.Output, line
|
435
|
-
|
436
|
-
print(insertions)
|
437
|
-
if curcode: # or item:
|
438
|
-
for item in do_insertions(
|
439
|
-
insertions, mlexer.get_tokens_unprocessed(curcode)):
|
440
|
-
yield item
|
441
|
-
|
442
|
-
|
443
|
-
class OctaveLexer(RegexLexer):
|
444
|
-
"""
|
445
|
-
For GNU Octave source code.
|
446
|
-
|
447
|
-
.. versionadded:: 1.5
|
448
|
-
"""
|
449
|
-
name = 'Octave'
|
450
|
-
aliases = ['octave']
|
451
|
-
filenames = ['*.m']
|
452
|
-
mimetypes = ['text/octave']
|
453
|
-
|
454
|
-
# These lists are generated automatically.
|
455
|
-
# Run the following in bash shell:
|
456
|
-
#
|
457
|
-
# First dump all of the Octave manual into a plain text file:
|
458
|
-
#
|
459
|
-
# $ info octave --subnodes -o octave-manual
|
460
|
-
#
|
461
|
-
# Now grep through it:
|
462
|
-
|
463
|
-
# for i in \
|
464
|
-
# "Built-in Function" "Command" "Function File" \
|
465
|
-
# "Loadable Function" "Mapping Function";
|
466
|
-
# do
|
467
|
-
# perl -e '@name = qw('"$i"');
|
468
|
-
# print lc($name[0]),"_kw = [\n"';
|
469
|
-
#
|
470
|
-
# perl -n -e 'print "\"$1\",\n" if /-- '"$i"': .* (\w*) \(/;' \
|
471
|
-
# octave-manual | sort | uniq ;
|
472
|
-
# echo "]" ;
|
473
|
-
# echo;
|
474
|
-
# done
|
475
|
-
|
476
|
-
# taken from Octave Mercurial changeset 8cc154f45e37 (30-jan-2011)
|
477
|
-
|
478
|
-
builtin_kw = [ "addlistener", "addpath", "addproperty", "all",
|
479
|
-
"and", "any", "argnames", "argv", "assignin",
|
480
|
-
"atexit", "autoload",
|
481
|
-
"available_graphics_toolkits", "beep_on_error",
|
482
|
-
"bitand", "bitmax", "bitor", "bitshift", "bitxor",
|
483
|
-
"cat", "cell", "cellstr", "char", "class", "clc",
|
484
|
-
"columns", "command_line_path",
|
485
|
-
"completion_append_char", "completion_matches",
|
486
|
-
"complex", "confirm_recursive_rmdir", "cputime",
|
487
|
-
"crash_dumps_octave_core", "ctranspose", "cumprod",
|
488
|
-
"cumsum", "debug_on_error", "debug_on_interrupt",
|
489
|
-
"debug_on_warning", "default_save_options",
|
490
|
-
"dellistener", "diag", "diff", "disp",
|
491
|
-
"doc_cache_file", "do_string_escapes", "double",
|
492
|
-
"drawnow", "e", "echo_executing_commands", "eps",
|
493
|
-
"eq", "errno", "errno_list", "error", "eval",
|
494
|
-
"evalin", "exec", "exist", "exit", "eye", "false",
|
495
|
-
"fclear", "fclose", "fcntl", "fdisp", "feof",
|
496
|
-
"ferror", "feval", "fflush", "fgetl", "fgets",
|
497
|
-
"fieldnames", "file_in_loadpath", "file_in_path",
|
498
|
-
"filemarker", "filesep", "find_dir_in_path",
|
499
|
-
"fixed_point_format", "fnmatch", "fopen", "fork",
|
500
|
-
"formula", "fprintf", "fputs", "fread", "freport",
|
501
|
-
"frewind", "fscanf", "fseek", "fskipl", "ftell",
|
502
|
-
"functions", "fwrite", "ge", "genpath", "get",
|
503
|
-
"getegid", "getenv", "geteuid", "getgid",
|
504
|
-
"getpgrp", "getpid", "getppid", "getuid", "glob",
|
505
|
-
"gt", "gui_mode", "history_control",
|
506
|
-
"history_file", "history_size",
|
507
|
-
"history_timestamp_format_string", "home",
|
508
|
-
"horzcat", "hypot", "ifelse",
|
509
|
-
"ignore_function_time_stamp", "inferiorto",
|
510
|
-
"info_file", "info_program", "inline", "input",
|
511
|
-
"intmax", "intmin", "ipermute",
|
512
|
-
"is_absolute_filename", "isargout", "isbool",
|
513
|
-
"iscell", "iscellstr", "ischar", "iscomplex",
|
514
|
-
"isempty", "isfield", "isfloat", "isglobal",
|
515
|
-
"ishandle", "isieee", "isindex", "isinteger",
|
516
|
-
"islogical", "ismatrix", "ismethod", "isnull",
|
517
|
-
"isnumeric", "isobject", "isreal",
|
518
|
-
"is_rooted_relative_filename", "issorted",
|
519
|
-
"isstruct", "isvarname", "kbhit", "keyboard",
|
520
|
-
"kill", "lasterr", "lasterror", "lastwarn",
|
521
|
-
"ldivide", "le", "length", "link", "linspace",
|
522
|
-
"logical", "lstat", "lt", "make_absolute_filename",
|
523
|
-
"makeinfo_program", "max_recursion_depth", "merge",
|
524
|
-
"methods", "mfilename", "minus", "mislocked",
|
525
|
-
"mkdir", "mkfifo", "mkstemp", "mldivide", "mlock",
|
526
|
-
"mouse_wheel_zoom", "mpower", "mrdivide", "mtimes",
|
527
|
-
"munlock", "nargin", "nargout",
|
528
|
-
"native_float_format", "ndims", "ne", "nfields",
|
529
|
-
"nnz", "norm", "not", "numel", "nzmax",
|
530
|
-
"octave_config_info", "octave_core_file_limit",
|
531
|
-
"octave_core_file_name",
|
532
|
-
"octave_core_file_options", "ones", "or",
|
533
|
-
"output_max_field_width", "output_precision",
|
534
|
-
"page_output_immediately", "page_screen_output",
|
535
|
-
"path", "pathsep", "pause", "pclose", "permute",
|
536
|
-
"pi", "pipe", "plus", "popen", "power",
|
537
|
-
"print_empty_dimensions", "printf",
|
538
|
-
"print_struct_array_contents", "prod",
|
539
|
-
"program_invocation_name", "program_name",
|
540
|
-
"putenv", "puts", "pwd", "quit", "rats", "rdivide",
|
541
|
-
"readdir", "readlink", "read_readline_init_file",
|
542
|
-
"realmax", "realmin", "rehash", "rename",
|
543
|
-
"repelems", "re_read_readline_init_file", "reset",
|
544
|
-
"reshape", "resize", "restoredefaultpath",
|
545
|
-
"rethrow", "rmdir", "rmfield", "rmpath", "rows",
|
546
|
-
"save_header_format_string", "save_precision",
|
547
|
-
"saving_history", "scanf", "set", "setenv",
|
548
|
-
"shell_cmd", "sighup_dumps_octave_core",
|
549
|
-
"sigterm_dumps_octave_core", "silent_functions",
|
550
|
-
"single", "size", "size_equal", "sizemax",
|
551
|
-
"sizeof", "sleep", "source", "sparse_auto_mutate",
|
552
|
-
"split_long_rows", "sprintf", "squeeze", "sscanf",
|
553
|
-
"stat", "stderr", "stdin", "stdout", "strcmp",
|
554
|
-
"strcmpi", "string_fill_char", "strncmp",
|
555
|
-
"strncmpi", "struct", "struct_levels_to_print",
|
556
|
-
"strvcat", "subsasgn", "subsref", "sum", "sumsq",
|
557
|
-
"superiorto", "suppress_verbose_help_message",
|
558
|
-
"symlink", "system", "tic", "tilde_expand",
|
559
|
-
"times", "tmpfile", "tmpnam", "toc", "toupper",
|
560
|
-
"transpose", "true", "typeinfo", "umask", "uminus",
|
561
|
-
"uname", "undo_string_escapes", "unlink", "uplus",
|
562
|
-
"upper", "usage", "usleep", "vec", "vectorize",
|
563
|
-
"vertcat", "waitpid", "warning", "warranty",
|
564
|
-
"whos_line_format", "yes_or_no", "zeros",
|
565
|
-
"inf", "Inf", "nan", "NaN"]
|
566
|
-
|
567
|
-
command_kw = [ "close", "load", "who", "whos", ]
|
568
|
-
|
569
|
-
function_kw = [ "accumarray", "accumdim", "acosd", "acotd",
|
570
|
-
"acscd", "addtodate", "allchild", "ancestor",
|
571
|
-
"anova", "arch_fit", "arch_rnd", "arch_test",
|
572
|
-
"area", "arma_rnd", "arrayfun", "ascii", "asctime",
|
573
|
-
"asecd", "asind", "assert", "atand",
|
574
|
-
"autoreg_matrix", "autumn", "axes", "axis", "bar",
|
575
|
-
"barh", "bartlett", "bartlett_test", "beep",
|
576
|
-
"betacdf", "betainv", "betapdf", "betarnd",
|
577
|
-
"bicgstab", "bicubic", "binary", "binocdf",
|
578
|
-
"binoinv", "binopdf", "binornd", "bitcmp",
|
579
|
-
"bitget", "bitset", "blackman", "blanks",
|
580
|
-
"blkdiag", "bone", "box", "brighten", "calendar",
|
581
|
-
"cast", "cauchy_cdf", "cauchy_inv", "cauchy_pdf",
|
582
|
-
"cauchy_rnd", "caxis", "celldisp", "center", "cgs",
|
583
|
-
"chisquare_test_homogeneity",
|
584
|
-
"chisquare_test_independence", "circshift", "cla",
|
585
|
-
"clabel", "clf", "clock", "cloglog", "closereq",
|
586
|
-
"colon", "colorbar", "colormap", "colperm",
|
587
|
-
"comet", "common_size", "commutation_matrix",
|
588
|
-
"compan", "compare_versions", "compass",
|
589
|
-
"computer", "cond", "condest", "contour",
|
590
|
-
"contourc", "contourf", "contrast", "conv",
|
591
|
-
"convhull", "cool", "copper", "copyfile", "cor",
|
592
|
-
"corrcoef", "cor_test", "cosd", "cotd", "cov",
|
593
|
-
"cplxpair", "cross", "cscd", "cstrcat", "csvread",
|
594
|
-
"csvwrite", "ctime", "cumtrapz", "curl", "cut",
|
595
|
-
"cylinder", "date", "datenum", "datestr",
|
596
|
-
"datetick", "datevec", "dblquad", "deal",
|
597
|
-
"deblank", "deconv", "delaunay", "delaunayn",
|
598
|
-
"delete", "demo", "detrend", "diffpara", "diffuse",
|
599
|
-
"dir", "discrete_cdf", "discrete_inv",
|
600
|
-
"discrete_pdf", "discrete_rnd", "display",
|
601
|
-
"divergence", "dlmwrite", "dos", "dsearch",
|
602
|
-
"dsearchn", "duplication_matrix", "durbinlevinson",
|
603
|
-
"ellipsoid", "empirical_cdf", "empirical_inv",
|
604
|
-
"empirical_pdf", "empirical_rnd", "eomday",
|
605
|
-
"errorbar", "etime", "etreeplot", "example",
|
606
|
-
"expcdf", "expinv", "expm", "exppdf", "exprnd",
|
607
|
-
"ezcontour", "ezcontourf", "ezmesh", "ezmeshc",
|
608
|
-
"ezplot", "ezpolar", "ezsurf", "ezsurfc", "factor",
|
609
|
-
"factorial", "fail", "fcdf", "feather", "fftconv",
|
610
|
-
"fftfilt", "fftshift", "figure", "fileattrib",
|
611
|
-
"fileparts", "fill", "findall", "findobj",
|
612
|
-
"findstr", "finv", "flag", "flipdim", "fliplr",
|
613
|
-
"flipud", "fpdf", "fplot", "fractdiff", "freqz",
|
614
|
-
"freqz_plot", "frnd", "fsolve",
|
615
|
-
"f_test_regression", "ftp", "fullfile", "fzero",
|
616
|
-
"gamcdf", "gaminv", "gampdf", "gamrnd", "gca",
|
617
|
-
"gcbf", "gcbo", "gcf", "genvarname", "geocdf",
|
618
|
-
"geoinv", "geopdf", "geornd", "getfield", "ginput",
|
619
|
-
"glpk", "gls", "gplot", "gradient",
|
620
|
-
"graphics_toolkit", "gray", "grid", "griddata",
|
621
|
-
"griddatan", "gtext", "gunzip", "gzip", "hadamard",
|
622
|
-
"hamming", "hankel", "hanning", "hggroup",
|
623
|
-
"hidden", "hilb", "hist", "histc", "hold", "hot",
|
624
|
-
"hotelling_test", "housh", "hsv", "hurst",
|
625
|
-
"hygecdf", "hygeinv", "hygepdf", "hygernd",
|
626
|
-
"idivide", "ifftshift", "image", "imagesc",
|
627
|
-
"imfinfo", "imread", "imshow", "imwrite", "index",
|
628
|
-
"info", "inpolygon", "inputname", "interpft",
|
629
|
-
"interpn", "intersect", "invhilb", "iqr", "isa",
|
630
|
-
"isdefinite", "isdir", "is_duplicate_entry",
|
631
|
-
"isequal", "isequalwithequalnans", "isfigure",
|
632
|
-
"ishermitian", "ishghandle", "is_leap_year",
|
633
|
-
"isletter", "ismac", "ismember", "ispc", "isprime",
|
634
|
-
"isprop", "isscalar", "issquare", "isstrprop",
|
635
|
-
"issymmetric", "isunix", "is_valid_file_id",
|
636
|
-
"isvector", "jet", "kendall",
|
637
|
-
"kolmogorov_smirnov_cdf",
|
638
|
-
"kolmogorov_smirnov_test", "kruskal_wallis_test",
|
639
|
-
"krylov", "kurtosis", "laplace_cdf", "laplace_inv",
|
640
|
-
"laplace_pdf", "laplace_rnd", "legend", "legendre",
|
641
|
-
"license", "line", "linkprop", "list_primes",
|
642
|
-
"loadaudio", "loadobj", "logistic_cdf",
|
643
|
-
"logistic_inv", "logistic_pdf", "logistic_rnd",
|
644
|
-
"logit", "loglog", "loglogerr", "logm", "logncdf",
|
645
|
-
"logninv", "lognpdf", "lognrnd", "logspace",
|
646
|
-
"lookfor", "ls_command", "lsqnonneg", "magic",
|
647
|
-
"mahalanobis", "manova", "matlabroot",
|
648
|
-
"mcnemar_test", "mean", "meansq", "median", "menu",
|
649
|
-
"mesh", "meshc", "meshgrid", "meshz", "mexext",
|
650
|
-
"mget", "mkpp", "mode", "moment", "movefile",
|
651
|
-
"mpoles", "mput", "namelengthmax", "nargchk",
|
652
|
-
"nargoutchk", "nbincdf", "nbininv", "nbinpdf",
|
653
|
-
"nbinrnd", "nchoosek", "ndgrid", "newplot", "news",
|
654
|
-
"nonzeros", "normcdf", "normest", "norminv",
|
655
|
-
"normpdf", "normrnd", "now", "nthroot", "null",
|
656
|
-
"ocean", "ols", "onenormest", "optimget",
|
657
|
-
"optimset", "orderfields", "orient", "orth",
|
658
|
-
"pack", "pareto", "parseparams", "pascal", "patch",
|
659
|
-
"pathdef", "pcg", "pchip", "pcolor", "pcr",
|
660
|
-
"peaks", "periodogram", "perl", "perms", "pie",
|
661
|
-
"pink", "planerot", "playaudio", "plot",
|
662
|
-
"plotmatrix", "plotyy", "poisscdf", "poissinv",
|
663
|
-
"poisspdf", "poissrnd", "polar", "poly",
|
664
|
-
"polyaffine", "polyarea", "polyderiv", "polyfit",
|
665
|
-
"polygcd", "polyint", "polyout", "polyreduce",
|
666
|
-
"polyval", "polyvalm", "postpad", "powerset",
|
667
|
-
"ppder", "ppint", "ppjumps", "ppplot", "ppval",
|
668
|
-
"pqpnonneg", "prepad", "primes", "print",
|
669
|
-
"print_usage", "prism", "probit", "qp", "qqplot",
|
670
|
-
"quadcc", "quadgk", "quadl", "quadv", "quiver",
|
671
|
-
"qzhess", "rainbow", "randi", "range", "rank",
|
672
|
-
"ranks", "rat", "reallog", "realpow", "realsqrt",
|
673
|
-
"record", "rectangle_lw", "rectangle_sw",
|
674
|
-
"rectint", "refresh", "refreshdata",
|
675
|
-
"regexptranslate", "repmat", "residue", "ribbon",
|
676
|
-
"rindex", "roots", "rose", "rosser", "rotdim",
|
677
|
-
"rref", "run", "run_count", "rundemos", "run_test",
|
678
|
-
"runtests", "saveas", "saveaudio", "saveobj",
|
679
|
-
"savepath", "scatter", "secd", "semilogx",
|
680
|
-
"semilogxerr", "semilogy", "semilogyerr",
|
681
|
-
"setaudio", "setdiff", "setfield", "setxor",
|
682
|
-
"shading", "shift", "shiftdim", "sign_test",
|
683
|
-
"sinc", "sind", "sinetone", "sinewave", "skewness",
|
684
|
-
"slice", "sombrero", "sortrows", "spaugment",
|
685
|
-
"spconvert", "spdiags", "spearman", "spectral_adf",
|
686
|
-
"spectral_xdf", "specular", "speed", "spencer",
|
687
|
-
"speye", "spfun", "sphere", "spinmap", "spline",
|
688
|
-
"spones", "sprand", "sprandn", "sprandsym",
|
689
|
-
"spring", "spstats", "spy", "sqp", "stairs",
|
690
|
-
"statistics", "std", "stdnormal_cdf",
|
691
|
-
"stdnormal_inv", "stdnormal_pdf", "stdnormal_rnd",
|
692
|
-
"stem", "stft", "strcat", "strchr", "strjust",
|
693
|
-
"strmatch", "strread", "strsplit", "strtok",
|
694
|
-
"strtrim", "strtrunc", "structfun", "studentize",
|
695
|
-
"subplot", "subsindex", "subspace", "substr",
|
696
|
-
"substruct", "summer", "surf", "surface", "surfc",
|
697
|
-
"surfl", "surfnorm", "svds", "swapbytes",
|
698
|
-
"sylvester_matrix", "symvar", "synthesis", "table",
|
699
|
-
"tand", "tar", "tcdf", "tempdir", "tempname",
|
700
|
-
"test", "text", "textread", "textscan", "tinv",
|
701
|
-
"title", "toeplitz", "tpdf", "trace", "trapz",
|
702
|
-
"treelayout", "treeplot", "triangle_lw",
|
703
|
-
"triangle_sw", "tril", "trimesh", "triplequad",
|
704
|
-
"triplot", "trisurf", "triu", "trnd", "tsearchn",
|
705
|
-
"t_test", "t_test_regression", "type", "unidcdf",
|
706
|
-
"unidinv", "unidpdf", "unidrnd", "unifcdf",
|
707
|
-
"unifinv", "unifpdf", "unifrnd", "union", "unique",
|
708
|
-
"unix", "unmkpp", "unpack", "untabify", "untar",
|
709
|
-
"unwrap", "unzip", "u_test", "validatestring",
|
710
|
-
"vander", "var", "var_test", "vech", "ver",
|
711
|
-
"version", "view", "voronoi", "voronoin",
|
712
|
-
"waitforbuttonpress", "wavread", "wavwrite",
|
713
|
-
"wblcdf", "wblinv", "wblpdf", "wblrnd", "weekday",
|
714
|
-
"welch_test", "what", "white", "whitebg",
|
715
|
-
"wienrnd", "wilcoxon_test", "wilkinson", "winter",
|
716
|
-
"xlabel", "xlim", "ylabel", "yulewalker", "zip",
|
717
|
-
"zlabel", "z_test", ]
|
718
|
-
|
719
|
-
loadable_kw = [ "airy", "amd", "balance", "besselh", "besseli",
|
720
|
-
"besselj", "besselk", "bessely", "bitpack",
|
721
|
-
"bsxfun", "builtin", "ccolamd", "cellfun",
|
722
|
-
"cellslices", "chol", "choldelete", "cholinsert",
|
723
|
-
"cholinv", "cholshift", "cholupdate", "colamd",
|
724
|
-
"colloc", "convhulln", "convn", "csymamd",
|
725
|
-
"cummax", "cummin", "daspk", "daspk_options",
|
726
|
-
"dasrt", "dasrt_options", "dassl", "dassl_options",
|
727
|
-
"dbclear", "dbdown", "dbstack", "dbstatus",
|
728
|
-
"dbstop", "dbtype", "dbup", "dbwhere", "det",
|
729
|
-
"dlmread", "dmperm", "dot", "eig", "eigs",
|
730
|
-
"endgrent", "endpwent", "etree", "fft", "fftn",
|
731
|
-
"fftw", "filter", "find", "full", "gcd",
|
732
|
-
"getgrent", "getgrgid", "getgrnam", "getpwent",
|
733
|
-
"getpwnam", "getpwuid", "getrusage", "givens",
|
734
|
-
"gmtime", "gnuplot_binary", "hess", "ifft",
|
735
|
-
"ifftn", "inv", "isdebugmode", "issparse", "kron",
|
736
|
-
"localtime", "lookup", "lsode", "lsode_options",
|
737
|
-
"lu", "luinc", "luupdate", "matrix_type", "max",
|
738
|
-
"min", "mktime", "pinv", "qr", "qrdelete",
|
739
|
-
"qrinsert", "qrshift", "qrupdate", "quad",
|
740
|
-
"quad_options", "qz", "rand", "rande", "randg",
|
741
|
-
"randn", "randp", "randperm", "rcond", "regexp",
|
742
|
-
"regexpi", "regexprep", "schur", "setgrent",
|
743
|
-
"setpwent", "sort", "spalloc", "sparse", "spparms",
|
744
|
-
"sprank", "sqrtm", "strfind", "strftime",
|
745
|
-
"strptime", "strrep", "svd", "svd_driver", "syl",
|
746
|
-
"symamd", "symbfact", "symrcm", "time", "tsearch",
|
747
|
-
"typecast", "urlread", "urlwrite", ]
|
748
|
-
|
749
|
-
mapping_kw = [ "abs", "acos", "acosh", "acot", "acoth", "acsc",
|
750
|
-
"acsch", "angle", "arg", "asec", "asech", "asin",
|
751
|
-
"asinh", "atan", "atanh", "beta", "betainc",
|
752
|
-
"betaln", "bincoeff", "cbrt", "ceil", "conj", "cos",
|
753
|
-
"cosh", "cot", "coth", "csc", "csch", "erf", "erfc",
|
754
|
-
"erfcx", "erfinv", "exp", "finite", "fix", "floor",
|
755
|
-
"fmod", "gamma", "gammainc", "gammaln", "imag",
|
756
|
-
"isalnum", "isalpha", "isascii", "iscntrl",
|
757
|
-
"isdigit", "isfinite", "isgraph", "isinf",
|
758
|
-
"islower", "isna", "isnan", "isprint", "ispunct",
|
759
|
-
"isspace", "isupper", "isxdigit", "lcm", "lgamma",
|
760
|
-
"log", "lower", "mod", "real", "rem", "round",
|
761
|
-
"roundb", "sec", "sech", "sign", "sin", "sinh",
|
762
|
-
"sqrt", "tan", "tanh", "toascii", "tolower", "xor",
|
763
|
-
]
|
764
|
-
|
765
|
-
builtin_consts = [ "EDITOR", "EXEC_PATH", "I", "IMAGE_PATH", "NA",
|
766
|
-
"OCTAVE_HOME", "OCTAVE_VERSION", "PAGER",
|
767
|
-
"PAGER_FLAGS", "SEEK_CUR", "SEEK_END", "SEEK_SET",
|
768
|
-
"SIG", "S_ISBLK", "S_ISCHR", "S_ISDIR", "S_ISFIFO",
|
769
|
-
"S_ISLNK", "S_ISREG", "S_ISSOCK", "WCONTINUE",
|
770
|
-
"WCOREDUMP", "WEXITSTATUS", "WIFCONTINUED",
|
771
|
-
"WIFEXITED", "WIFSIGNALED", "WIFSTOPPED", "WNOHANG",
|
772
|
-
"WSTOPSIG", "WTERMSIG", "WUNTRACED", ]
|
773
|
-
|
774
|
-
tokens = {
|
775
|
-
'root': [
|
776
|
-
#We should look into multiline comments
|
777
|
-
(r'[%#].*$', Comment),
|
778
|
-
(r'^\s*function', Keyword, 'deffunc'),
|
779
|
-
|
780
|
-
# from 'iskeyword' on hg changeset 8cc154f45e37
|
781
|
-
(r'(__FILE__|__LINE__|break|case|catch|classdef|continue|do|else|'
|
782
|
-
r'elseif|end|end_try_catch|end_unwind_protect|endclassdef|'
|
783
|
-
r'endevents|endfor|endfunction|endif|endmethods|endproperties|'
|
784
|
-
r'endswitch|endwhile|events|for|function|get|global|if|methods|'
|
785
|
-
r'otherwise|persistent|properties|return|set|static|switch|try|'
|
786
|
-
r'until|unwind_protect|unwind_protect_cleanup|while)\b', Keyword),
|
787
|
-
|
788
|
-
("(" + "|".join( builtin_kw + command_kw
|
789
|
-
+ function_kw + loadable_kw
|
790
|
-
+ mapping_kw) + r')\b', Name.Builtin),
|
791
|
-
|
792
|
-
("(" + "|".join(builtin_consts) + r')\b', Name.Constant),
|
793
|
-
|
794
|
-
# operators in Octave but not Matlab:
|
795
|
-
(r'-=|!=|!|/=|--', Operator),
|
796
|
-
# operators:
|
797
|
-
(r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
|
798
|
-
# operators in Octave but not Matlab requiring escape for re:
|
799
|
-
(r'\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*',Operator),
|
800
|
-
# operators requiring escape for re:
|
801
|
-
(r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
|
802
|
-
|
803
|
-
|
804
|
-
# punctuation:
|
805
|
-
(r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation),
|
806
|
-
(r'=|:|;', Punctuation),
|
807
|
-
|
808
|
-
(r'"[^"]*"', String),
|
809
|
-
|
810
|
-
(r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
|
811
|
-
(r'\d+[eEf][+-]?[0-9]+', Number.Float),
|
812
|
-
(r'\d+', Number.Integer),
|
813
|
-
|
814
|
-
# quote can be transpose, instead of string:
|
815
|
-
# (not great, but handles common cases...)
|
816
|
-
(r'(?<=[\w\)\].])\'+', Operator),
|
817
|
-
(r'(?<![\w\)\].])\'', String, 'string'),
|
818
|
-
|
819
|
-
('[a-zA-Z_]\w*', Name),
|
820
|
-
(r'.', Text),
|
821
|
-
],
|
822
|
-
'string': [
|
823
|
-
(r"[^']*'", String, '#pop'),
|
824
|
-
],
|
825
|
-
'deffunc': [
|
826
|
-
(r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
|
827
|
-
bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
|
828
|
-
Text.Whitespace, Name.Function, Punctuation, Text,
|
829
|
-
Punctuation, Text.Whitespace), '#pop'),
|
830
|
-
],
|
831
|
-
}
|
832
|
-
|
833
|
-
|
834
|
-
class ScilabLexer(RegexLexer):
|
835
|
-
"""
|
836
|
-
For Scilab source code.
|
837
|
-
|
838
|
-
.. versionadded:: 1.5
|
839
|
-
"""
|
840
|
-
name = 'Scilab'
|
841
|
-
aliases = ['scilab']
|
842
|
-
filenames = ['*.sci', '*.sce', '*.tst']
|
843
|
-
mimetypes = ['text/scilab']
|
844
|
-
|
845
|
-
tokens = {
|
846
|
-
'root': [
|
847
|
-
(r'//.*?$', Comment.Single),
|
848
|
-
(r'^\s*function', Keyword, 'deffunc'),
|
849
|
-
|
850
|
-
(r'(__FILE__|__LINE__|break|case|catch|classdef|continue|do|else|'
|
851
|
-
r'elseif|end|end_try_catch|end_unwind_protect|endclassdef|'
|
852
|
-
r'endevents|endfor|endfunction|endif|endmethods|endproperties|'
|
853
|
-
r'endswitch|endwhile|events|for|function|get|global|if|methods|'
|
854
|
-
r'otherwise|persistent|properties|return|set|static|switch|try|'
|
855
|
-
r'until|unwind_protect|unwind_protect_cleanup|while)\b', Keyword),
|
856
|
-
|
857
|
-
("(" + "|".join(_scilab_builtins.functions_kw +
|
858
|
-
_scilab_builtins.commands_kw +
|
859
|
-
_scilab_builtins.macros_kw
|
860
|
-
) + r')\b', Name.Builtin),
|
861
|
-
|
862
|
-
(r'(%s)\b' % "|".join(map(re.escape, _scilab_builtins.builtin_consts)),
|
863
|
-
Name.Constant),
|
864
|
-
|
865
|
-
# operators:
|
866
|
-
(r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
|
867
|
-
# operators requiring escape for re:
|
868
|
-
(r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
|
869
|
-
|
870
|
-
# punctuation:
|
871
|
-
(r'[\[\](){}@.,=:;]', Punctuation),
|
872
|
-
|
873
|
-
(r'"[^"]*"', String),
|
874
|
-
|
875
|
-
# quote can be transpose, instead of string:
|
876
|
-
# (not great, but handles common cases...)
|
877
|
-
(r'(?<=[\w\)\].])\'+', Operator),
|
878
|
-
(r'(?<![\w\)\].])\'', String, 'string'),
|
879
|
-
|
880
|
-
(r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
|
881
|
-
(r'\d+[eEf][+-]?[0-9]+', Number.Float),
|
882
|
-
(r'\d+', Number.Integer),
|
883
|
-
|
884
|
-
('[a-zA-Z_]\w*', Name),
|
885
|
-
(r'.', Text),
|
886
|
-
],
|
887
|
-
'string': [
|
888
|
-
(r"[^']*'", String, '#pop'),
|
889
|
-
(r'.', String, '#pop'),
|
890
|
-
],
|
891
|
-
'deffunc': [
|
892
|
-
(r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
|
893
|
-
bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
|
894
|
-
Text.Whitespace, Name.Function, Punctuation, Text,
|
895
|
-
Punctuation, Text.Whitespace), '#pop'),
|
896
|
-
],
|
897
|
-
}
|
898
|
-
|
899
|
-
|
900
|
-
class NumPyLexer(PythonLexer):
|
901
|
-
"""
|
902
|
-
A Python lexer recognizing Numerical Python builtins.
|
903
|
-
|
904
|
-
.. versionadded:: 0.10
|
905
|
-
"""
|
906
|
-
|
907
|
-
name = 'NumPy'
|
908
|
-
aliases = ['numpy']
|
909
|
-
|
910
|
-
# override the mimetypes to not inherit them from python
|
911
|
-
mimetypes = []
|
912
|
-
filenames = []
|
913
|
-
|
914
|
-
EXTRA_KEYWORDS = set([
|
915
|
-
'abs', 'absolute', 'accumulate', 'add', 'alen', 'all', 'allclose',
|
916
|
-
'alltrue', 'alterdot', 'amax', 'amin', 'angle', 'any', 'append',
|
917
|
-
'apply_along_axis', 'apply_over_axes', 'arange', 'arccos', 'arccosh',
|
918
|
-
'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'argmax', 'argmin',
|
919
|
-
'argsort', 'argwhere', 'around', 'array', 'array2string', 'array_equal',
|
920
|
-
'array_equiv', 'array_repr', 'array_split', 'array_str', 'arrayrange',
|
921
|
-
'asanyarray', 'asarray', 'asarray_chkfinite', 'ascontiguousarray',
|
922
|
-
'asfarray', 'asfortranarray', 'asmatrix', 'asscalar', 'astype',
|
923
|
-
'atleast_1d', 'atleast_2d', 'atleast_3d', 'average', 'bartlett',
|
924
|
-
'base_repr', 'beta', 'binary_repr', 'bincount', 'binomial',
|
925
|
-
'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blackman',
|
926
|
-
'bmat', 'broadcast', 'byte_bounds', 'bytes', 'byteswap', 'c_',
|
927
|
-
'can_cast', 'ceil', 'choose', 'clip', 'column_stack', 'common_type',
|
928
|
-
'compare_chararrays', 'compress', 'concatenate', 'conj', 'conjugate',
|
929
|
-
'convolve', 'copy', 'corrcoef', 'correlate', 'cos', 'cosh', 'cov',
|
930
|
-
'cross', 'cumprod', 'cumproduct', 'cumsum', 'delete', 'deprecate',
|
931
|
-
'diag', 'diagflat', 'diagonal', 'diff', 'digitize', 'disp', 'divide',
|
932
|
-
'dot', 'dsplit', 'dstack', 'dtype', 'dump', 'dumps', 'ediff1d', 'empty',
|
933
|
-
'empty_like', 'equal', 'exp', 'expand_dims', 'expm1', 'extract', 'eye',
|
934
|
-
'fabs', 'fastCopyAndTranspose', 'fft', 'fftfreq', 'fftshift', 'fill',
|
935
|
-
'finfo', 'fix', 'flat', 'flatnonzero', 'flatten', 'fliplr', 'flipud',
|
936
|
-
'floor', 'floor_divide', 'fmod', 'frexp', 'fromarrays', 'frombuffer',
|
937
|
-
'fromfile', 'fromfunction', 'fromiter', 'frompyfunc', 'fromstring',
|
938
|
-
'generic', 'get_array_wrap', 'get_include', 'get_numarray_include',
|
939
|
-
'get_numpy_include', 'get_printoptions', 'getbuffer', 'getbufsize',
|
940
|
-
'geterr', 'geterrcall', 'geterrobj', 'getfield', 'gradient', 'greater',
|
941
|
-
'greater_equal', 'gumbel', 'hamming', 'hanning', 'histogram',
|
942
|
-
'histogram2d', 'histogramdd', 'hsplit', 'hstack', 'hypot', 'i0',
|
943
|
-
'identity', 'ifft', 'imag', 'index_exp', 'indices', 'inf', 'info',
|
944
|
-
'inner', 'insert', 'int_asbuffer', 'interp', 'intersect1d',
|
945
|
-
'intersect1d_nu', 'inv', 'invert', 'iscomplex', 'iscomplexobj',
|
946
|
-
'isfinite', 'isfortran', 'isinf', 'isnan', 'isneginf', 'isposinf',
|
947
|
-
'isreal', 'isrealobj', 'isscalar', 'issctype', 'issubclass_',
|
948
|
-
'issubdtype', 'issubsctype', 'item', 'itemset', 'iterable', 'ix_',
|
949
|
-
'kaiser', 'kron', 'ldexp', 'left_shift', 'less', 'less_equal', 'lexsort',
|
950
|
-
'linspace', 'load', 'loads', 'loadtxt', 'log', 'log10', 'log1p', 'log2',
|
951
|
-
'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'logspace',
|
952
|
-
'lstsq', 'mat', 'matrix', 'max', 'maximum', 'maximum_sctype',
|
953
|
-
'may_share_memory', 'mean', 'median', 'meshgrid', 'mgrid', 'min',
|
954
|
-
'minimum', 'mintypecode', 'mod', 'modf', 'msort', 'multiply', 'nan',
|
955
|
-
'nan_to_num', 'nanargmax', 'nanargmin', 'nanmax', 'nanmin', 'nansum',
|
956
|
-
'ndenumerate', 'ndim', 'ndindex', 'negative', 'newaxis', 'newbuffer',
|
957
|
-
'newbyteorder', 'nonzero', 'not_equal', 'obj2sctype', 'ogrid', 'ones',
|
958
|
-
'ones_like', 'outer', 'permutation', 'piecewise', 'pinv', 'pkgload',
|
959
|
-
'place', 'poisson', 'poly', 'poly1d', 'polyadd', 'polyder', 'polydiv',
|
960
|
-
'polyfit', 'polyint', 'polymul', 'polysub', 'polyval', 'power', 'prod',
|
961
|
-
'product', 'ptp', 'put', 'putmask', 'r_', 'randint', 'random_integers',
|
962
|
-
'random_sample', 'ranf', 'rank', 'ravel', 'real', 'real_if_close',
|
963
|
-
'recarray', 'reciprocal', 'reduce', 'remainder', 'repeat', 'require',
|
964
|
-
'reshape', 'resize', 'restoredot', 'right_shift', 'rint', 'roll',
|
965
|
-
'rollaxis', 'roots', 'rot90', 'round', 'round_', 'row_stack', 's_',
|
966
|
-
'sample', 'savetxt', 'sctype2char', 'searchsorted', 'seed', 'select',
|
967
|
-
'set_numeric_ops', 'set_printoptions', 'set_string_function',
|
968
|
-
'setbufsize', 'setdiff1d', 'seterr', 'seterrcall', 'seterrobj',
|
969
|
-
'setfield', 'setflags', 'setmember1d', 'setxor1d', 'shape',
|
970
|
-
'show_config', 'shuffle', 'sign', 'signbit', 'sin', 'sinc', 'sinh',
|
971
|
-
'size', 'slice', 'solve', 'sometrue', 'sort', 'sort_complex', 'source',
|
972
|
-
'split', 'sqrt', 'square', 'squeeze', 'standard_normal', 'std',
|
973
|
-
'subtract', 'sum', 'svd', 'swapaxes', 'take', 'tan', 'tanh', 'tensordot',
|
974
|
-
'test', 'tile', 'tofile', 'tolist', 'tostring', 'trace', 'transpose',
|
975
|
-
'trapz', 'tri', 'tril', 'trim_zeros', 'triu', 'true_divide', 'typeDict',
|
976
|
-
'typename', 'uniform', 'union1d', 'unique', 'unique1d', 'unravel_index',
|
977
|
-
'unwrap', 'vander', 'var', 'vdot', 'vectorize', 'view', 'vonmises',
|
978
|
-
'vsplit', 'vstack', 'weibull', 'where', 'who', 'zeros', 'zeros_like'
|
979
|
-
])
|
980
|
-
|
981
|
-
def get_tokens_unprocessed(self, text):
|
982
|
-
for index, token, value in \
|
983
|
-
PythonLexer.get_tokens_unprocessed(self, text):
|
984
|
-
if token is Name and value in self.EXTRA_KEYWORDS:
|
985
|
-
yield index, Keyword.Pseudo, value
|
986
|
-
else:
|
987
|
-
yield index, token, value
|
988
|
-
|
989
|
-
def analyse_text(text):
|
990
|
-
return (shebang_matches(text, r'pythonw?(2(\.\d)?)?') or
|
991
|
-
'import ' in text[:1000]) \
|
992
|
-
and ('import numpy' in text or 'from numpy import' in text)
|
993
|
-
|
994
|
-
|
995
|
-
class RConsoleLexer(Lexer):
|
996
|
-
"""
|
997
|
-
For R console transcripts or R CMD BATCH output files.
|
998
|
-
"""
|
999
|
-
|
1000
|
-
name = 'RConsole'
|
1001
|
-
aliases = ['rconsole', 'rout']
|
1002
|
-
filenames = ['*.Rout']
|
1003
|
-
|
1004
|
-
def get_tokens_unprocessed(self, text):
|
1005
|
-
slexer = SLexer(**self.options)
|
1006
|
-
|
1007
|
-
current_code_block = ''
|
1008
|
-
insertions = []
|
1009
|
-
|
1010
|
-
for match in line_re.finditer(text):
|
1011
|
-
line = match.group()
|
1012
|
-
if line.startswith('>') or line.startswith('+'):
|
1013
|
-
# Colorize the prompt as such,
|
1014
|
-
# then put rest of line into current_code_block
|
1015
|
-
insertions.append((len(current_code_block),
|
1016
|
-
[(0, Generic.Prompt, line[:2])]))
|
1017
|
-
current_code_block += line[2:]
|
1018
|
-
else:
|
1019
|
-
# We have reached a non-prompt line!
|
1020
|
-
# If we have stored prompt lines, need to process them first.
|
1021
|
-
if current_code_block:
|
1022
|
-
# Weave together the prompts and highlight code.
|
1023
|
-
for item in do_insertions(insertions,
|
1024
|
-
slexer.get_tokens_unprocessed(current_code_block)):
|
1025
|
-
yield item
|
1026
|
-
# Reset vars for next code block.
|
1027
|
-
current_code_block = ''
|
1028
|
-
insertions = []
|
1029
|
-
# Now process the actual line itself, this is output from R.
|
1030
|
-
yield match.start(), Generic.Output, line
|
1031
|
-
|
1032
|
-
# If we happen to end on a code block with nothing after it, need to
|
1033
|
-
# process the last code block. This is neither elegant nor DRY so
|
1034
|
-
# should be changed.
|
1035
|
-
if current_code_block:
|
1036
|
-
for item in do_insertions(insertions,
|
1037
|
-
slexer.get_tokens_unprocessed(current_code_block)):
|
1038
|
-
yield item
|
1039
|
-
|
1040
|
-
|
1041
|
-
class SLexer(RegexLexer):
|
1042
|
-
"""
|
1043
|
-
For S, S-plus, and R source code.
|
1044
|
-
|
1045
|
-
.. versionadded:: 0.10
|
1046
|
-
"""
|
1047
|
-
|
1048
|
-
name = 'S'
|
1049
|
-
aliases = ['splus', 's', 'r']
|
1050
|
-
filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron']
|
1051
|
-
mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r',
|
1052
|
-
'text/x-R', 'text/x-r-history', 'text/x-r-profile']
|
1053
|
-
|
1054
|
-
builtins_base = [
|
1055
|
-
'Arg', 'Conj', 'Cstack_info', 'Encoding', 'FALSE',
|
1056
|
-
'Filter', 'Find', 'I', 'ISOdate', 'ISOdatetime', 'Im', 'Inf',
|
1057
|
-
'La\.svd', 'Map', 'Math\.Date', 'Math\.POSIXt', 'Math\.data\.frame',
|
1058
|
-
'Math\.difftime', 'Math\.factor', 'Mod', 'NA_character_',
|
1059
|
-
'NA_complex_', 'NA_real_', 'NCOL', 'NROW', 'NULLNA_integer_', 'NaN',
|
1060
|
-
'Negate', 'NextMethod', 'Ops\.Date', 'Ops\.POSIXt', 'Ops\.data\.frame',
|
1061
|
-
'Ops\.difftime', 'Ops\.factor', 'Ops\.numeric_version', 'Ops\.ordered',
|
1062
|
-
'Position', 'R\.Version', 'R\.home', 'R\.version', 'R\.version\.string',
|
1063
|
-
'RNGkind', 'RNGversion', 'R_system_version', 'Re', 'Recall',
|
1064
|
-
'Reduce', 'Summary\.Date', 'Summary\.POSIXct', 'Summary\.POSIXlt',
|
1065
|
-
'Summary\.data\.frame', 'Summary\.difftime', 'Summary\.factor',
|
1066
|
-
'Summary\.numeric_version', 'Summary\.ordered', 'Sys\.Date',
|
1067
|
-
'Sys\.chmod', 'Sys\.getenv', 'Sys\.getlocale', 'Sys\.getpid',
|
1068
|
-
'Sys\.glob', 'Sys\.info', 'Sys\.localeconv', 'Sys\.readlink',
|
1069
|
-
'Sys\.setFileTime', 'Sys\.setenv', 'Sys\.setlocale', 'Sys\.sleep',
|
1070
|
-
'Sys\.time', 'Sys\.timezone', 'Sys\.umask', 'Sys\.unsetenv',
|
1071
|
-
'Sys\.which', 'TRUE', 'UseMethod', 'Vectorize', 'abbreviate', 'abs',
|
1072
|
-
'acos', 'acosh', 'addNA', 'addTaskCallback', 'agrep', 'alist',
|
1073
|
-
'all', 'all\.equal', 'all\.equal\.POSIXct', 'all\.equal\.character',
|
1074
|
-
'all\.equal\.default', 'all\.equal\.factor', 'all\.equal\.formula',
|
1075
|
-
'all\.equal\.language', 'all\.equal\.list', 'all\.equal\.numeric',
|
1076
|
-
'all\.equal\.raw', 'all\.names', 'all\.vars', 'any', 'anyDuplicated',
|
1077
|
-
'anyDuplicated\.array', 'anyDuplicated\.data\.frame',
|
1078
|
-
'anyDuplicated\.default', 'anyDuplicated\.matrix', 'aperm',
|
1079
|
-
'aperm\.default', 'aperm\.table', 'append', 'apply', 'args',
|
1080
|
-
'arrayInd', 'as\.Date', 'as\.Date\.POSIXct', 'as\.Date\.POSIXlt',
|
1081
|
-
'as\.Date\.character', 'as\.Date\.date', 'as\.Date\.dates',
|
1082
|
-
'as\.Date\.default', 'as\.Date\.factor', 'as\.Date\.numeric',
|
1083
|
-
'as\.POSIXct', 'as\.POSIXct\.Date', 'as\.POSIXct\.POSIXlt',
|
1084
|
-
'as\.POSIXct\.date', 'as\.POSIXct\.dates', 'as\.POSIXct\.default',
|
1085
|
-
'as\.POSIXct\.numeric', 'as\.POSIXlt', 'as\.POSIXlt\.Date',
|
1086
|
-
'as\.POSIXlt\.POSIXct', 'as\.POSIXlt\.character', 'as\.POSIXlt\.date',
|
1087
|
-
'as\.POSIXlt\.dates', 'as\.POSIXlt\.default', 'as\.POSIXlt\.factor',
|
1088
|
-
'as\.POSIXlt\.numeric', 'as\.array', 'as\.array\.default', 'as\.call',
|
1089
|
-
'as\.character', 'as\.character\.Date', 'as\.character\.POSIXt',
|
1090
|
-
'as\.character\.condition', 'as\.character\.default',
|
1091
|
-
'as\.character\.error', 'as\.character\.factor', 'as\.character\.hexmode',
|
1092
|
-
'as\.character\.numeric_version', 'as\.character\.octmode',
|
1093
|
-
'as\.character\.srcref', 'as\.complex', 'as\.data\.frame',
|
1094
|
-
'as\.data\.frame\.AsIs', 'as\.data\.frame\.Date', 'as\.data\.frame\.POSIXct',
|
1095
|
-
'as\.data\.frame\.POSIXlt', 'as\.data\.frame\.array',
|
1096
|
-
'as\.data\.frame\.character', 'as\.data\.frame\.complex',
|
1097
|
-
'as\.data\.frame\.data\.frame', 'as\.data\.frame\.default',
|
1098
|
-
'as\.data\.frame\.difftime', 'as\.data\.frame\.factor',
|
1099
|
-
'as\.data\.frame\.integer', 'as\.data\.frame\.list',
|
1100
|
-
'as\.data\.frame\.logical', 'as\.data\.frame\.matrix',
|
1101
|
-
'as\.data\.frame\.model\.matrix', 'as\.data\.frame\.numeric',
|
1102
|
-
'as\.data\.frame\.numeric_version', 'as\.data\.frame\.ordered',
|
1103
|
-
'as\.data\.frame\.raw', 'as\.data\.frame\.table', 'as\.data\.frame\.ts',
|
1104
|
-
'as\.data\.frame\.vector', 'as\.difftime', 'as\.double',
|
1105
|
-
'as\.double\.POSIXlt', 'as\.double\.difftime', 'as\.environment',
|
1106
|
-
'as\.expression', 'as\.expression\.default', 'as\.factor',
|
1107
|
-
'as\.function', 'as\.function\.default', 'as\.hexmode', 'as\.integer',
|
1108
|
-
'as\.list', 'as\.list\.Date', 'as\.list\.POSIXct', 'as\.list\.data\.frame',
|
1109
|
-
'as\.list\.default', 'as\.list\.environment', 'as\.list\.factor',
|
1110
|
-
'as\.list\.function', 'as\.list\.numeric_version', 'as\.logical',
|
1111
|
-
'as\.logical\.factor', 'as\.matrix', 'as\.matrix\.POSIXlt',
|
1112
|
-
'as\.matrix\.data\.frame', 'as\.matrix\.default', 'as\.matrix\.noquote',
|
1113
|
-
'as\.name', 'as\.null', 'as\.null\.default', 'as\.numeric',
|
1114
|
-
'as\.numeric_version', 'as\.octmode', 'as\.ordered',
|
1115
|
-
'as\.package_version', 'as\.pairlist', 'as\.qr', 'as\.raw', 'as\.single',
|
1116
|
-
'as\.single\.default', 'as\.symbol', 'as\.table', 'as\.table\.default',
|
1117
|
-
'as\.vector', 'as\.vector\.factor', 'asNamespace', 'asS3', 'asS4',
|
1118
|
-
'asin', 'asinh', 'assign', 'atan', 'atan2', 'atanh',
|
1119
|
-
'attachNamespace', 'attr', 'attr\.all\.equal', 'attributes',
|
1120
|
-
'autoload', 'autoloader', 'backsolve', 'baseenv', 'basename',
|
1121
|
-
'besselI', 'besselJ', 'besselK', 'besselY', 'beta',
|
1122
|
-
'bindingIsActive', 'bindingIsLocked', 'bindtextdomain', 'bitwAnd',
|
1123
|
-
'bitwNot', 'bitwOr', 'bitwShiftL', 'bitwShiftR', 'bitwXor', 'body',
|
1124
|
-
'bquote', 'browser', 'browserCondition', 'browserSetDebug',
|
1125
|
-
'browserText', 'builtins', 'by', 'by\.data\.frame', 'by\.default',
|
1126
|
-
'bzfile', 'c\.Date', 'c\.POSIXct', 'c\.POSIXlt', 'c\.noquote',
|
1127
|
-
'c\.numeric_version', 'call', 'callCC', 'capabilities', 'casefold',
|
1128
|
-
'cat', 'category', 'cbind', 'cbind\.data\.frame', 'ceiling',
|
1129
|
-
'char\.expand', 'charToRaw', 'charmatch', 'chartr', 'check_tzones',
|
1130
|
-
'chol', 'chol\.default', 'chol2inv', 'choose', 'class',
|
1131
|
-
'clearPushBack', 'close', 'close\.connection', 'close\.srcfile',
|
1132
|
-
'close\.srcfilealias', 'closeAllConnections', 'col', 'colMeans',
|
1133
|
-
'colSums', 'colnames', 'commandArgs', 'comment', 'computeRestarts',
|
1134
|
-
'conditionCall', 'conditionCall\.condition', 'conditionMessage',
|
1135
|
-
'conditionMessage\.condition', 'conflicts', 'contributors', 'cos',
|
1136
|
-
'cosh', 'crossprod', 'cummax', 'cummin', 'cumprod', 'cumsum', 'cut',
|
1137
|
-
'cut\.Date', 'cut\.POSIXt', 'cut\.default', 'dQuote', 'data\.class',
|
1138
|
-
'data\.matrix', 'date', 'debug', 'debugonce',
|
1139
|
-
'default\.stringsAsFactors', 'delayedAssign', 'deparse', 'det',
|
1140
|
-
'determinant', 'determinant\.matrix', 'dget', 'diag', 'diff',
|
1141
|
-
'diff\.Date', 'diff\.POSIXt', 'diff\.default', 'difftime', 'digamma',
|
1142
|
-
'dim', 'dim\.data\.frame', 'dimnames', 'dimnames\.data\.frame', 'dir',
|
1143
|
-
'dir\.create', 'dirname', 'do\.call', 'dput', 'drop', 'droplevels',
|
1144
|
-
'droplevels\.data\.frame', 'droplevels\.factor', 'dump', 'duplicated',
|
1145
|
-
'duplicated\.POSIXlt', 'duplicated\.array', 'duplicated\.data\.frame',
|
1146
|
-
'duplicated\.default', 'duplicated\.matrix',
|
1147
|
-
'duplicated\.numeric_version', 'dyn\.load', 'dyn\.unload', 'eapply',
|
1148
|
-
'eigen', 'else', 'emptyenv', 'enc2native', 'enc2utf8',
|
1149
|
-
'encodeString', 'enquote', 'env\.profile', 'environment',
|
1150
|
-
'environmentIsLocked', 'environmentName', 'eval', 'eval\.parent',
|
1151
|
-
'evalq', 'exists', 'exp', 'expand\.grid', 'expm1', 'expression',
|
1152
|
-
'factor', 'factorial', 'fifo', 'file', 'file\.access', 'file\.append',
|
1153
|
-
'file\.choose', 'file\.copy', 'file\.create', 'file\.exists',
|
1154
|
-
'file\.info', 'file\.link', 'file\.path', 'file\.remove', 'file\.rename',
|
1155
|
-
'file\.show', 'file\.symlink', 'find\.package', 'findInterval',
|
1156
|
-
'findPackageEnv', 'findRestart', 'floor', 'flush',
|
1157
|
-
'flush\.connection', 'force', 'formals', 'format',
|
1158
|
-
'format\.AsIs', 'format\.Date', 'format\.POSIXct', 'format\.POSIXlt',
|
1159
|
-
'format\.data\.frame', 'format\.default', 'format\.difftime',
|
1160
|
-
'format\.factor', 'format\.hexmode', 'format\.info',
|
1161
|
-
'format\.libraryIQR', 'format\.numeric_version', 'format\.octmode',
|
1162
|
-
'format\.packageInfo', 'format\.pval', 'format\.summaryDefault',
|
1163
|
-
'formatC', 'formatDL', 'forwardsolve', 'gamma', 'gc', 'gc\.time',
|
1164
|
-
'gcinfo', 'gctorture', 'gctorture2', 'get', 'getAllConnections',
|
1165
|
-
'getCallingDLL', 'getCallingDLLe', 'getConnection',
|
1166
|
-
'getDLLRegisteredRoutines', 'getDLLRegisteredRoutines\.DLLInfo',
|
1167
|
-
'getDLLRegisteredRoutines\.character', 'getElement',
|
1168
|
-
'getExportedValue', 'getHook', 'getLoadedDLLs', 'getNamespace',
|
1169
|
-
'getNamespaceExports', 'getNamespaceImports', 'getNamespaceInfo',
|
1170
|
-
'getNamespaceName', 'getNamespaceUsers', 'getNamespaceVersion',
|
1171
|
-
'getNativeSymbolInfo', 'getOption', 'getRversion', 'getSrcLines',
|
1172
|
-
'getTaskCallbackNames', 'geterrmessage', 'gettext', 'gettextf',
|
1173
|
-
'getwd', 'gl', 'globalenv', 'gregexpr', 'grep', 'grepRaw', 'grepl',
|
1174
|
-
'gsub', 'gzcon', 'gzfile', 'head', 'iconv', 'iconvlist',
|
1175
|
-
'icuSetCollate', 'identical', 'identity', 'ifelse', 'importIntoEnv',
|
1176
|
-
'in', 'inherits', 'intToBits', 'intToUtf8', 'interaction', 'interactive',
|
1177
|
-
'intersect', 'inverse\.rle', 'invisible', 'invokeRestart',
|
1178
|
-
'invokeRestartInteractively', 'is\.R', 'is\.array', 'is\.atomic',
|
1179
|
-
'is\.call', 'is\.character', 'is\.complex', 'is\.data\.frame',
|
1180
|
-
'is\.double', 'is\.element', 'is\.environment', 'is\.expression',
|
1181
|
-
'is\.factor', 'is\.finite', 'is\.function', 'is\.infinite',
|
1182
|
-
'is\.integer', 'is\.language', 'is\.list', 'is\.loaded', 'is\.logical',
|
1183
|
-
'is\.matrix', 'is\.na', 'is\.na\.POSIXlt', 'is\.na\.data\.frame',
|
1184
|
-
'is\.na\.numeric_version', 'is\.name', 'is\.nan', 'is\.null',
|
1185
|
-
'is\.numeric', 'is\.numeric\.Date', 'is\.numeric\.POSIXt',
|
1186
|
-
'is\.numeric\.difftime', 'is\.numeric_version', 'is\.object',
|
1187
|
-
'is\.ordered', 'is\.package_version', 'is\.pairlist', 'is\.primitive',
|
1188
|
-
'is\.qr', 'is\.raw', 'is\.recursive', 'is\.single', 'is\.symbol',
|
1189
|
-
'is\.table', 'is\.unsorted', 'is\.vector', 'isBaseNamespace',
|
1190
|
-
'isIncomplete', 'isNamespace', 'isOpen', 'isRestart', 'isS4',
|
1191
|
-
'isSeekable', 'isSymmetric', 'isSymmetric\.matrix', 'isTRUE',
|
1192
|
-
'isatty', 'isdebugged', 'jitter', 'julian', 'julian\.Date',
|
1193
|
-
'julian\.POSIXt', 'kappa', 'kappa\.default', 'kappa\.lm', 'kappa\.qr',
|
1194
|
-
'kronecker', 'l10n_info', 'labels', 'labels\.default', 'lapply',
|
1195
|
-
'lazyLoad', 'lazyLoadDBexec', 'lazyLoadDBfetch', 'lbeta', 'lchoose',
|
1196
|
-
'length', 'length\.POSIXlt', 'letters', 'levels', 'levels\.default',
|
1197
|
-
'lfactorial', 'lgamma', 'library\.dynam', 'library\.dynam\.unload',
|
1198
|
-
'licence', 'license', 'list\.dirs', 'list\.files', 'list2env', 'load',
|
1199
|
-
'loadNamespace', 'loadedNamespaces', 'loadingNamespaceInfo',
|
1200
|
-
'local', 'lockBinding', 'lockEnvironment', 'log', 'log10', 'log1p',
|
1201
|
-
'log2', 'logb', 'lower\.tri', 'ls', 'make\.names', 'make\.unique',
|
1202
|
-
'makeActiveBinding', 'mapply', 'margin\.table', 'mat\.or\.vec',
|
1203
|
-
'match', 'match\.arg', 'match\.call', 'match\.fun', 'max', 'max\.col',
|
1204
|
-
'mean', 'mean\.Date', 'mean\.POSIXct', 'mean\.POSIXlt', 'mean\.default',
|
1205
|
-
'mean\.difftime', 'mem\.limits', 'memCompress', 'memDecompress',
|
1206
|
-
'memory\.profile', 'merge', 'merge\.data\.frame', 'merge\.default',
|
1207
|
-
'message', 'mget', 'min', 'missing', 'mode', 'month\.abb',
|
1208
|
-
'month\.name', 'months', 'months\.Date', 'months\.POSIXt',
|
1209
|
-
'months\.abb', 'months\.nameletters', 'names', 'names\.POSIXlt',
|
1210
|
-
'namespaceExport', 'namespaceImport', 'namespaceImportClasses',
|
1211
|
-
'namespaceImportFrom', 'namespaceImportMethods', 'nargs', 'nchar',
|
1212
|
-
'ncol', 'new\.env', 'ngettext', 'nlevels', 'noquote', 'norm',
|
1213
|
-
'normalizePath', 'nrow', 'numeric_version', 'nzchar', 'objects',
|
1214
|
-
'oldClass', 'on\.exit', 'open', 'open\.connection', 'open\.srcfile',
|
1215
|
-
'open\.srcfilealias', 'open\.srcfilecopy', 'options', 'order',
|
1216
|
-
'ordered', 'outer', 'packBits', 'packageEvent',
|
1217
|
-
'packageHasNamespace', 'packageStartupMessage', 'package_version',
|
1218
|
-
'pairlist', 'parent\.env', 'parent\.frame', 'parse',
|
1219
|
-
'parseNamespaceFile', 'paste', 'paste0', 'path\.expand',
|
1220
|
-
'path\.package', 'pipe', 'pmatch', 'pmax', 'pmax\.int', 'pmin',
|
1221
|
-
'pmin\.int', 'polyroot', 'pos\.to\.env', 'pretty', 'pretty\.default',
|
1222
|
-
'prettyNum', 'print', 'print\.AsIs', 'print\.DLLInfo',
|
1223
|
-
'print\.DLLInfoList', 'print\.DLLRegisteredRoutines', 'print\.Date',
|
1224
|
-
'print\.NativeRoutineList', 'print\.POSIXct', 'print\.POSIXlt',
|
1225
|
-
'print\.by', 'print\.condition', 'print\.connection',
|
1226
|
-
'print\.data\.frame', 'print\.default', 'print\.difftime',
|
1227
|
-
'print\.factor', 'print\.function', 'print\.hexmode',
|
1228
|
-
'print\.libraryIQR', 'print\.listof', 'print\.noquote',
|
1229
|
-
'print\.numeric_version', 'print\.octmode', 'print\.packageInfo',
|
1230
|
-
'print\.proc_time', 'print\.restart', 'print\.rle',
|
1231
|
-
'print\.simple\.list', 'print\.srcfile', 'print\.srcref',
|
1232
|
-
'print\.summary\.table', 'print\.summaryDefault', 'print\.table',
|
1233
|
-
'print\.warnings', 'prmatrix', 'proc\.time', 'prod', 'prop\.table',
|
1234
|
-
'provideDimnames', 'psigamma', 'pushBack', 'pushBackLength', 'q',
|
1235
|
-
'qr', 'qr\.Q', 'qr\.R', 'qr\.X', 'qr\.coef', 'qr\.default', 'qr\.fitted',
|
1236
|
-
'qr\.qty', 'qr\.qy', 'qr\.resid', 'qr\.solve', 'quarters',
|
1237
|
-
'quarters\.Date', 'quarters\.POSIXt', 'quit', 'quote', 'range',
|
1238
|
-
'range\.default', 'rank', 'rapply', 'raw', 'rawConnection',
|
1239
|
-
'rawConnectionValue', 'rawShift', 'rawToBits', 'rawToChar', 'rbind',
|
1240
|
-
'rbind\.data\.frame', 'rcond', 'read\.dcf', 'readBin', 'readChar',
|
1241
|
-
'readLines', 'readRDS', 'readRenviron', 'readline', 'reg\.finalizer',
|
1242
|
-
'regexec', 'regexpr', 'registerS3method', 'registerS3methods',
|
1243
|
-
'regmatches', 'remove', 'removeTaskCallback', 'rep', 'rep\.Date',
|
1244
|
-
'rep\.POSIXct', 'rep\.POSIXlt', 'rep\.factor', 'rep\.int',
|
1245
|
-
'rep\.numeric_version', 'rep_len', 'replace', 'replicate',
|
1246
|
-
'requireNamespace', 'restartDescription', 'restartFormals',
|
1247
|
-
'retracemem', 'rev', 'rev\.default', 'rle', 'rm', 'round',
|
1248
|
-
'round\.Date', 'round\.POSIXt', 'row', 'row\.names',
|
1249
|
-
'row\.names\.data\.frame', 'row\.names\.default', 'rowMeans', 'rowSums',
|
1250
|
-
'rownames', 'rowsum', 'rowsum\.data\.frame', 'rowsum\.default',
|
1251
|
-
'sQuote', 'sample', 'sample\.int', 'sapply', 'save', 'save\.image',
|
1252
|
-
'saveRDS', 'scale', 'scale\.default', 'scan', 'search',
|
1253
|
-
'searchpaths', 'seek', 'seek\.connection', 'seq', 'seq\.Date',
|
1254
|
-
'seq\.POSIXt', 'seq\.default', 'seq\.int', 'seq_along', 'seq_len',
|
1255
|
-
'sequence', 'serialize', 'set\.seed', 'setHook', 'setNamespaceInfo',
|
1256
|
-
'setSessionTimeLimit', 'setTimeLimit', 'setdiff', 'setequal',
|
1257
|
-
'setwd', 'shQuote', 'showConnections', 'sign', 'signalCondition',
|
1258
|
-
'signif', 'simpleCondition', 'simpleError', 'simpleMessage',
|
1259
|
-
'simpleWarning', 'simplify2array', 'sin', 'single',
|
1260
|
-
'sinh', 'sink', 'sink\.number', 'slice\.index', 'socketConnection',
|
1261
|
-
'socketSelect', 'solve', 'solve\.default', 'solve\.qr', 'sort',
|
1262
|
-
'sort\.POSIXlt', 'sort\.default', 'sort\.int', 'sort\.list', 'split',
|
1263
|
-
'split\.Date', 'split\.POSIXct', 'split\.data\.frame', 'split\.default',
|
1264
|
-
'sprintf', 'sqrt', 'srcfile', 'srcfilealias', 'srcfilecopy',
|
1265
|
-
'srcref', 'standardGeneric', 'stderr', 'stdin', 'stdout', 'stop',
|
1266
|
-
'stopifnot', 'storage\.mode', 'strftime', 'strptime', 'strsplit',
|
1267
|
-
'strtoi', 'strtrim', 'structure', 'strwrap', 'sub', 'subset',
|
1268
|
-
'subset\.data\.frame', 'subset\.default', 'subset\.matrix',
|
1269
|
-
'substitute', 'substr', 'substring', 'sum', 'summary',
|
1270
|
-
'summary\.Date', 'summary\.POSIXct', 'summary\.POSIXlt',
|
1271
|
-
'summary\.connection', 'summary\.data\.frame', 'summary\.default',
|
1272
|
-
'summary\.factor', 'summary\.matrix', 'summary\.proc_time',
|
1273
|
-
'summary\.srcfile', 'summary\.srcref', 'summary\.table',
|
1274
|
-
'suppressMessages', 'suppressPackageStartupMessages',
|
1275
|
-
'suppressWarnings', 'svd', 'sweep', 'sys\.call', 'sys\.calls',
|
1276
|
-
'sys\.frame', 'sys\.frames', 'sys\.function', 'sys\.load\.image',
|
1277
|
-
'sys\.nframe', 'sys\.on\.exit', 'sys\.parent', 'sys\.parents',
|
1278
|
-
'sys\.save\.image', 'sys\.source', 'sys\.status', 'system',
|
1279
|
-
'system\.file', 'system\.time', 'system2', 't', 't\.data\.frame',
|
1280
|
-
't\.default', 'table', 'tabulate', 'tail', 'tan', 'tanh', 'tapply',
|
1281
|
-
'taskCallbackManager', 'tcrossprod', 'tempdir', 'tempfile',
|
1282
|
-
'testPlatformEquivalence', 'textConnection', 'textConnectionValue',
|
1283
|
-
'toString', 'toString\.default', 'tolower', 'topenv', 'toupper',
|
1284
|
-
'trace', 'traceback', 'tracemem', 'tracingState', 'transform',
|
1285
|
-
'transform\.data\.frame', 'transform\.default', 'trigamma', 'trunc',
|
1286
|
-
'trunc\.Date', 'trunc\.POSIXt', 'truncate', 'truncate\.connection',
|
1287
|
-
'try', 'tryCatch', 'typeof', 'unclass', 'undebug', 'union',
|
1288
|
-
'unique', 'unique\.POSIXlt', 'unique\.array', 'unique\.data\.frame',
|
1289
|
-
'unique\.default', 'unique\.matrix', 'unique\.numeric_version',
|
1290
|
-
'units', 'units\.difftime', 'unix\.time', 'unlink', 'unlist',
|
1291
|
-
'unloadNamespace', 'unlockBinding', 'unname', 'unserialize',
|
1292
|
-
'unsplit', 'untrace', 'untracemem', 'unz', 'upper\.tri', 'url',
|
1293
|
-
'utf8ToInt', 'vapply', 'version', 'warning', 'warnings', 'weekdays',
|
1294
|
-
'weekdays\.Date', 'weekdays\.POSIXt', 'which', 'which\.max',
|
1295
|
-
'which\.min', 'with', 'with\.default', 'withCallingHandlers',
|
1296
|
-
'withRestarts', 'withVisible', 'within', 'within\.data\.frame',
|
1297
|
-
'within\.list', 'write', 'write\.dcf', 'writeBin', 'writeChar',
|
1298
|
-
'writeLines', 'xor', 'xor\.hexmode', 'xor\.octmode',
|
1299
|
-
'xpdrows\.data\.frame', 'xtfrm', 'xtfrm\.AsIs', 'xtfrm\.Date',
|
1300
|
-
'xtfrm\.POSIXct', 'xtfrm\.POSIXlt', 'xtfrm\.Surv', 'xtfrm\.default',
|
1301
|
-
'xtfrm\.difftime', 'xtfrm\.factor', 'xtfrm\.numeric_version', 'xzfile',
|
1302
|
-
'zapsmall'
|
1303
|
-
]
|
1304
|
-
|
1305
|
-
tokens = {
|
1306
|
-
'comments': [
|
1307
|
-
(r'#.*$', Comment.Single),
|
1308
|
-
],
|
1309
|
-
'valid_name': [
|
1310
|
-
(r'[a-zA-Z][0-9a-zA-Z\._]*', Text),
|
1311
|
-
# can begin with ., but not if that is followed by a digit
|
1312
|
-
(r'\.[a-zA-Z_][0-9a-zA-Z\._]*', Text),
|
1313
|
-
],
|
1314
|
-
'punctuation': [
|
1315
|
-
(r'\[{1,2}|\]{1,2}|\(|\)|;|,', Punctuation),
|
1316
|
-
],
|
1317
|
-
'keywords': [
|
1318
|
-
(r'(' + r'|'.join(builtins_base) + r')'
|
1319
|
-
r'(?![\w\. =])',
|
1320
|
-
Keyword.Pseudo),
|
1321
|
-
(r'(if|else|for|while|repeat|in|next|break|return|switch|function)'
|
1322
|
-
r'(?![\w\.])',
|
1323
|
-
Keyword.Reserved),
|
1324
|
-
(r'(array|category|character|complex|double|function|integer|list|'
|
1325
|
-
r'logical|matrix|numeric|vector|data.frame|c)'
|
1326
|
-
r'(?![\w\.])',
|
1327
|
-
Keyword.Type),
|
1328
|
-
(r'(library|require|attach|detach|source)'
|
1329
|
-
r'(?![\w\.])',
|
1330
|
-
Keyword.Namespace)
|
1331
|
-
],
|
1332
|
-
'operators': [
|
1333
|
-
(r'<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?', Operator),
|
1334
|
-
(r'\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}', Operator)
|
1335
|
-
],
|
1336
|
-
'builtin_symbols': [
|
1337
|
-
(r'(NULL|NA(_(integer|real|complex|character)_)?|'
|
1338
|
-
r'letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))'
|
1339
|
-
r'(?![0-9a-zA-Z\._])',
|
1340
|
-
Keyword.Constant),
|
1341
|
-
(r'(T|F)\b', Name.Builtin.Pseudo),
|
1342
|
-
],
|
1343
|
-
'numbers': [
|
1344
|
-
# hex number
|
1345
|
-
(r'0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?', Number.Hex),
|
1346
|
-
# decimal number
|
1347
|
-
(r'[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?',
|
1348
|
-
Number),
|
1349
|
-
],
|
1350
|
-
'statements': [
|
1351
|
-
include('comments'),
|
1352
|
-
# whitespaces
|
1353
|
-
(r'\s+', Text),
|
1354
|
-
(r'`.*?`', String.Backtick),
|
1355
|
-
(r'\'', String, 'string_squote'),
|
1356
|
-
(r'\"', String, 'string_dquote'),
|
1357
|
-
include('builtin_symbols'),
|
1358
|
-
include('numbers'),
|
1359
|
-
include('keywords'),
|
1360
|
-
include('punctuation'),
|
1361
|
-
include('operators'),
|
1362
|
-
include('valid_name'),
|
1363
|
-
],
|
1364
|
-
'root': [
|
1365
|
-
include('statements'),
|
1366
|
-
# blocks:
|
1367
|
-
(r'\{|\}', Punctuation),
|
1368
|
-
#(r'\{', Punctuation, 'block'),
|
1369
|
-
(r'.', Text),
|
1370
|
-
],
|
1371
|
-
#'block': [
|
1372
|
-
# include('statements'),
|
1373
|
-
# ('\{', Punctuation, '#push'),
|
1374
|
-
# ('\}', Punctuation, '#pop')
|
1375
|
-
#],
|
1376
|
-
'string_squote': [
|
1377
|
-
(r'([^\'\\]|\\.)*\'', String, '#pop'),
|
1378
|
-
],
|
1379
|
-
'string_dquote': [
|
1380
|
-
(r'([^"\\]|\\.)*"', String, '#pop'),
|
1381
|
-
],
|
1382
|
-
}
|
1383
|
-
|
1384
|
-
def analyse_text(text):
|
1385
|
-
if re.search(r'[a-z0-9_\])\s]<-(?!-)', text):
|
1386
|
-
return 0.11
|
1387
|
-
|
1388
|
-
|
1389
|
-
class BugsLexer(RegexLexer):
|
1390
|
-
"""
|
1391
|
-
Pygments Lexer for `OpenBugs <http://www.openbugs.info/w/>`_ and WinBugs
|
1392
|
-
models.
|
1393
|
-
|
1394
|
-
.. versionadded:: 1.6
|
1395
|
-
"""
|
1396
|
-
|
1397
|
-
name = 'BUGS'
|
1398
|
-
aliases = ['bugs', 'winbugs', 'openbugs']
|
1399
|
-
filenames = ['*.bug']
|
1400
|
-
|
1401
|
-
_FUNCTIONS = [
|
1402
|
-
# Scalar functions
|
1403
|
-
'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
|
1404
|
-
'cloglog', 'cos', 'cosh', 'cumulative', 'cut', 'density', 'deviance',
|
1405
|
-
'equals', 'expr', 'gammap', 'ilogit', 'icloglog', 'integral', 'log',
|
1406
|
-
'logfact', 'loggam', 'logit', 'max', 'min', 'phi', 'post.p.value',
|
1407
|
-
'pow', 'prior.p.value', 'probit', 'replicate.post', 'replicate.prior',
|
1408
|
-
'round', 'sin', 'sinh', 'solution', 'sqrt', 'step', 'tan', 'tanh',
|
1409
|
-
'trunc',
|
1410
|
-
# Vector functions
|
1411
|
-
'inprod', 'interp.lin', 'inverse', 'logdet', 'mean', 'eigen.vals',
|
1412
|
-
'ode', 'prod', 'p.valueM', 'rank', 'ranked', 'replicate.postM',
|
1413
|
-
'sd', 'sort', 'sum',
|
1414
|
-
## Special
|
1415
|
-
'D', 'I', 'F', 'T', 'C']
|
1416
|
-
""" OpenBUGS built-in functions
|
1417
|
-
|
1418
|
-
From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAII
|
1419
|
-
|
1420
|
-
This also includes
|
1421
|
-
|
1422
|
-
- T, C, I : Truncation and censoring.
|
1423
|
-
``T`` and ``C`` are in OpenBUGS. ``I`` in WinBUGS.
|
1424
|
-
- D : ODE
|
1425
|
-
- F : Functional http://www.openbugs.info/Examples/Functionals.html
|
1426
|
-
|
1427
|
-
"""
|
1428
|
-
|
1429
|
-
_DISTRIBUTIONS = ['dbern', 'dbin', 'dcat', 'dnegbin', 'dpois',
|
1430
|
-
'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
|
1431
|
-
'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
|
1432
|
-
'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
|
1433
|
-
'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
|
1434
|
-
'dmt', 'dwish']
|
1435
|
-
""" OpenBUGS built-in distributions
|
1436
|
-
|
1437
|
-
Functions from
|
1438
|
-
http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI
|
1439
|
-
"""
|
1440
|
-
|
1441
|
-
|
1442
|
-
tokens = {
|
1443
|
-
'whitespace' : [
|
1444
|
-
(r"\s+", Text),
|
1445
|
-
],
|
1446
|
-
'comments' : [
|
1447
|
-
# Comments
|
1448
|
-
(r'#.*$', Comment.Single),
|
1449
|
-
],
|
1450
|
-
'root': [
|
1451
|
-
# Comments
|
1452
|
-
include('comments'),
|
1453
|
-
include('whitespace'),
|
1454
|
-
# Block start
|
1455
|
-
(r'(model)(\s+)({)',
|
1456
|
-
bygroups(Keyword.Namespace, Text, Punctuation)),
|
1457
|
-
# Reserved Words
|
1458
|
-
(r'(for|in)(?![0-9a-zA-Z\._])', Keyword.Reserved),
|
1459
|
-
# Built-in Functions
|
1460
|
-
(r'(%s)(?=\s*\()'
|
1461
|
-
% r'|'.join(_FUNCTIONS + _DISTRIBUTIONS),
|
1462
|
-
Name.Builtin),
|
1463
|
-
# Regular variable names
|
1464
|
-
(r'[A-Za-z][\w.]*', Name),
|
1465
|
-
# Number Literals
|
1466
|
-
(r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
|
1467
|
-
# Punctuation
|
1468
|
-
(r'\[|\]|\(|\)|:|,|;', Punctuation),
|
1469
|
-
# Assignment operators
|
1470
|
-
# SLexer makes these tokens Operators.
|
1471
|
-
(r'<-|~', Operator),
|
1472
|
-
# Infix and prefix operators
|
1473
|
-
(r'\+|-|\*|/', Operator),
|
1474
|
-
# Block
|
1475
|
-
(r'[{}]', Punctuation),
|
1476
|
-
]
|
1477
|
-
}
|
1478
|
-
|
1479
|
-
def analyse_text(text):
|
1480
|
-
if re.search(r"^\s*model\s*{", text, re.M):
|
1481
|
-
return 0.7
|
1482
|
-
else:
|
1483
|
-
return 0.0
|
1484
|
-
|
1485
|
-
class JagsLexer(RegexLexer):
|
1486
|
-
"""
|
1487
|
-
Pygments Lexer for JAGS.
|
1488
|
-
|
1489
|
-
.. versionadded:: 1.6
|
1490
|
-
"""
|
1491
|
-
|
1492
|
-
name = 'JAGS'
|
1493
|
-
aliases = ['jags']
|
1494
|
-
filenames = ['*.jag', '*.bug']
|
1495
|
-
|
1496
|
-
## JAGS
|
1497
|
-
_FUNCTIONS = [
|
1498
|
-
'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
|
1499
|
-
'cos', 'cosh', 'cloglog',
|
1500
|
-
'equals', 'exp', 'icloglog', 'ifelse', 'ilogit', 'log', 'logfact',
|
1501
|
-
'loggam', 'logit', 'phi', 'pow', 'probit', 'round', 'sin', 'sinh',
|
1502
|
-
'sqrt', 'step', 'tan', 'tanh', 'trunc', 'inprod', 'interp.lin',
|
1503
|
-
'logdet', 'max', 'mean', 'min', 'prod', 'sum', 'sd', 'inverse',
|
1504
|
-
'rank', 'sort', 't', 'acos', 'acosh', 'asin', 'asinh', 'atan',
|
1505
|
-
# Truncation/Censoring (should I include)
|
1506
|
-
'T', 'I']
|
1507
|
-
# Distributions with density, probability and quartile functions
|
1508
|
-
_DISTRIBUTIONS = ['[dpq]%s' % x for x in
|
1509
|
-
['bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp',
|
1510
|
-
'df', 'gamma', 'gen.gamma', 'logis', 'lnorm',
|
1511
|
-
'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib']]
|
1512
|
-
# Other distributions without density and probability
|
1513
|
-
_OTHER_DISTRIBUTIONS = [
|
1514
|
-
'dt', 'dunif', 'dbetabin', 'dbern', 'dbin', 'dcat', 'dhyper',
|
1515
|
-
'ddirch', 'dmnorm', 'dwish', 'dmt', 'dmulti', 'dbinom', 'dchisq',
|
1516
|
-
'dnbinom', 'dweibull', 'ddirich']
|
1517
|
-
|
1518
|
-
tokens = {
|
1519
|
-
'whitespace' : [
|
1520
|
-
(r"\s+", Text),
|
1521
|
-
],
|
1522
|
-
'names' : [
|
1523
|
-
# Regular variable names
|
1524
|
-
(r'[a-zA-Z][\w.]*\b', Name),
|
1525
|
-
],
|
1526
|
-
'comments' : [
|
1527
|
-
# do not use stateful comments
|
1528
|
-
(r'(?s)/\*.*?\*/', Comment.Multiline),
|
1529
|
-
# Comments
|
1530
|
-
(r'#.*$', Comment.Single),
|
1531
|
-
],
|
1532
|
-
'root': [
|
1533
|
-
# Comments
|
1534
|
-
include('comments'),
|
1535
|
-
include('whitespace'),
|
1536
|
-
# Block start
|
1537
|
-
(r'(model|data)(\s+)({)',
|
1538
|
-
bygroups(Keyword.Namespace, Text, Punctuation)),
|
1539
|
-
(r'var(?![0-9a-zA-Z\._])', Keyword.Declaration),
|
1540
|
-
# Reserved Words
|
1541
|
-
(r'(for|in)(?![0-9a-zA-Z\._])', Keyword.Reserved),
|
1542
|
-
# Builtins
|
1543
|
-
# Need to use lookahead because . is a valid char
|
1544
|
-
(r'(%s)(?=\s*\()' % r'|'.join(_FUNCTIONS
|
1545
|
-
+ _DISTRIBUTIONS
|
1546
|
-
+ _OTHER_DISTRIBUTIONS),
|
1547
|
-
Name.Builtin),
|
1548
|
-
# Names
|
1549
|
-
include('names'),
|
1550
|
-
# Number Literals
|
1551
|
-
(r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
|
1552
|
-
(r'\[|\]|\(|\)|:|,|;', Punctuation),
|
1553
|
-
# Assignment operators
|
1554
|
-
(r'<-|~', Operator),
|
1555
|
-
# # JAGS includes many more than OpenBUGS
|
1556
|
-
(r'\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%', Operator),
|
1557
|
-
(r'[{}]', Punctuation),
|
1558
|
-
]
|
1559
|
-
}
|
1560
|
-
|
1561
|
-
def analyse_text(text):
|
1562
|
-
if re.search(r'^\s*model\s*\{', text, re.M):
|
1563
|
-
if re.search(r'^\s*data\s*\{', text, re.M):
|
1564
|
-
return 0.9
|
1565
|
-
elif re.search(r'^\s*var', text, re.M):
|
1566
|
-
return 0.9
|
1567
|
-
else:
|
1568
|
-
return 0.3
|
1569
|
-
else:
|
1570
|
-
return 0
|
1571
|
-
|
1572
|
-
class StanLexer(RegexLexer):
|
1573
|
-
"""Pygments Lexer for Stan models.
|
1574
|
-
|
1575
|
-
The Stan modeling language is specified in the *Stan Modeling Language User's Guide and Reference Manual, v2.2.0*,
|
1576
|
-
`pdf <https://github.com/stan-dev/stan/releases/download/v2.2.0/stan-reference-2.2.0.pdf>`__.
|
1577
|
-
|
1578
|
-
.. versionadded:: 1.6
|
1579
|
-
"""
|
1580
|
-
|
1581
|
-
name = 'Stan'
|
1582
|
-
aliases = ['stan']
|
1583
|
-
filenames = ['*.stan']
|
1584
|
-
|
1585
|
-
tokens = {
|
1586
|
-
'whitespace' : [
|
1587
|
-
(r"\s+", Text),
|
1588
|
-
],
|
1589
|
-
'comments' : [
|
1590
|
-
(r'(?s)/\*.*?\*/', Comment.Multiline),
|
1591
|
-
# Comments
|
1592
|
-
(r'(//|#).*$', Comment.Single),
|
1593
|
-
],
|
1594
|
-
'root': [
|
1595
|
-
# Stan is more restrictive on strings than this regex
|
1596
|
-
(r'"[^"]*"', String),
|
1597
|
-
# Comments
|
1598
|
-
include('comments'),
|
1599
|
-
# block start
|
1600
|
-
include('whitespace'),
|
1601
|
-
# Block start
|
1602
|
-
(r'(%s)(\s*)({)' %
|
1603
|
-
r'|'.join(('data', r'transformed\s+?data',
|
1604
|
-
'parameters', r'transformed\s+parameters',
|
1605
|
-
'model', r'generated\s+quantities')),
|
1606
|
-
bygroups(Keyword.Namespace, Text, Punctuation)),
|
1607
|
-
# Reserved Words
|
1608
|
-
(r'(%s)\b' % r'|'.join(_stan_builtins.KEYWORDS), Keyword),
|
1609
|
-
# Truncation
|
1610
|
-
(r'T(?=\s*\[)', Keyword),
|
1611
|
-
# Data types
|
1612
|
-
(r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type),
|
1613
|
-
# Punctuation
|
1614
|
-
(r"[;:,\[\]()]", Punctuation),
|
1615
|
-
# Builtin
|
1616
|
-
(r'(%s)(?=\s*\()'
|
1617
|
-
% r'|'.join(_stan_builtins.FUNCTIONS
|
1618
|
-
+ _stan_builtins.DISTRIBUTIONS),
|
1619
|
-
Name.Builtin),
|
1620
|
-
# Special names ending in __, like lp__
|
1621
|
-
(r'[A-Za-z]\w*__\b', Name.Builtin.Pseudo),
|
1622
|
-
(r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved),
|
1623
|
-
# Regular variable names
|
1624
|
-
(r'[A-Za-z]\w*\b', Name),
|
1625
|
-
# Real Literals
|
1626
|
-
(r'-?[0-9]+(\.[0-9]+)?[eE]-?[0-9]+', Number.Float),
|
1627
|
-
(r'-?[0-9]*\.[0-9]*', Number.Float),
|
1628
|
-
# Integer Literals
|
1629
|
-
(r'-?[0-9]+', Number.Integer),
|
1630
|
-
# Assignment operators
|
1631
|
-
# SLexer makes these tokens Operators.
|
1632
|
-
(r'<-|~', Operator),
|
1633
|
-
# Infix and prefix operators (and = )
|
1634
|
-
(r"\+|-|\.?\*|\.?/|\\|'|==?|!=?|<=?|>=?|\|\||&&", Operator),
|
1635
|
-
# Block delimiters
|
1636
|
-
(r'[{}]', Punctuation),
|
1637
|
-
]
|
1638
|
-
}
|
1639
|
-
|
1640
|
-
def analyse_text(text):
|
1641
|
-
if re.search(r'^\s*parameters\s*\{', text, re.M):
|
1642
|
-
return 1.0
|
1643
|
-
else:
|
1644
|
-
return 0.0
|
1645
|
-
|
1646
|
-
|
1647
|
-
class IDLLexer(RegexLexer):
|
1648
|
-
"""
|
1649
|
-
Pygments Lexer for IDL (Interactive Data Language).
|
1650
|
-
|
1651
|
-
.. versionadded:: 1.6
|
1652
|
-
"""
|
1653
|
-
name = 'IDL'
|
1654
|
-
aliases = ['idl']
|
1655
|
-
filenames = ['*.pro']
|
1656
|
-
mimetypes = ['text/idl']
|
1657
|
-
|
1658
|
-
flags = re.IGNORECASE | re.MULTILINE
|
1659
|
-
|
1660
|
-
_RESERVED = ['and', 'begin', 'break', 'case', 'common', 'compile_opt',
|
1661
|
-
'continue', 'do', 'else', 'end', 'endcase', 'elseelse',
|
1662
|
-
'endfor', 'endforeach', 'endif', 'endrep', 'endswitch',
|
1663
|
-
'endwhile', 'eq', 'for', 'foreach', 'forward_function',
|
1664
|
-
'function', 'ge', 'goto', 'gt', 'if', 'inherits', 'le',
|
1665
|
-
'lt', 'mod', 'ne', 'not', 'of', 'on_ioerror', 'or', 'pro',
|
1666
|
-
'repeat', 'switch', 'then', 'until', 'while', 'xor']
|
1667
|
-
"""Reserved words from: http://www.exelisvis.com/docs/reswords.html"""
|
1668
|
-
|
1669
|
-
_BUILTIN_LIB = ['abs', 'acos', 'adapt_hist_equal', 'alog', 'alog10',
|
1670
|
-
'amoeba', 'annotate', 'app_user_dir', 'app_user_dir_query',
|
1671
|
-
'arg_present', 'array_equal', 'array_indices', 'arrow',
|
1672
|
-
'ascii_template', 'asin', 'assoc', 'atan', 'axis',
|
1673
|
-
'a_correlate', 'bandpass_filter', 'bandreject_filter',
|
1674
|
-
'barplot', 'bar_plot', 'beseli', 'beselj', 'beselk',
|
1675
|
-
'besely', 'beta', 'bilinear', 'binary_template', 'bindgen',
|
1676
|
-
'binomial', 'bin_date', 'bit_ffs', 'bit_population',
|
1677
|
-
'blas_axpy', 'blk_con', 'box_cursor', 'breakpoint',
|
1678
|
-
'broyden', 'butterworth', 'bytarr', 'byte', 'byteorder',
|
1679
|
-
'bytscl', 'caldat', 'calendar', 'call_external',
|
1680
|
-
'call_function', 'call_method', 'call_procedure', 'canny',
|
1681
|
-
'catch', 'cd', 'cdf_\w*', 'ceil', 'chebyshev',
|
1682
|
-
'check_math',
|
1683
|
-
'chisqr_cvf', 'chisqr_pdf', 'choldc', 'cholsol', 'cindgen',
|
1684
|
-
'cir_3pnt', 'close', 'cluster', 'cluster_tree', 'clust_wts',
|
1685
|
-
'cmyk_convert', 'colorbar', 'colorize_sample',
|
1686
|
-
'colormap_applicable', 'colormap_gradient',
|
1687
|
-
'colormap_rotation', 'colortable', 'color_convert',
|
1688
|
-
'color_exchange', 'color_quan', 'color_range_map', 'comfit',
|
1689
|
-
'command_line_args', 'complex', 'complexarr', 'complexround',
|
1690
|
-
'compute_mesh_normals', 'cond', 'congrid', 'conj',
|
1691
|
-
'constrained_min', 'contour', 'convert_coord', 'convol',
|
1692
|
-
'convol_fft', 'coord2to3', 'copy_lun', 'correlate', 'cos',
|
1693
|
-
'cosh', 'cpu', 'cramer', 'create_cursor', 'create_struct',
|
1694
|
-
'create_view', 'crossp', 'crvlength', 'cti_test',
|
1695
|
-
'ct_luminance', 'cursor', 'curvefit', 'cvttobm', 'cv_coord',
|
1696
|
-
'cw_animate', 'cw_animate_getp', 'cw_animate_load',
|
1697
|
-
'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index',
|
1698
|
-
'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel',
|
1699
|
-
'cw_form', 'cw_fslider', 'cw_light_editor',
|
1700
|
-
'cw_light_editor_get', 'cw_light_editor_set', 'cw_orient',
|
1701
|
-
'cw_palette_editor', 'cw_palette_editor_get',
|
1702
|
-
'cw_palette_editor_set', 'cw_pdmenu', 'cw_rgbslider',
|
1703
|
-
'cw_tmpl', 'cw_zoom', 'c_correlate', 'dblarr', 'db_exists',
|
1704
|
-
'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key',
|
1705
|
-
'define_msgblk', 'define_msgblk_from_file', 'defroi',
|
1706
|
-
'defsysv', 'delvar', 'dendrogram', 'dendro_plot', 'deriv',
|
1707
|
-
'derivsig', 'determ', 'device', 'dfpmin', 'diag_matrix',
|
1708
|
-
'dialog_dbconnect', 'dialog_message', 'dialog_pickfile',
|
1709
|
-
'dialog_printersetup', 'dialog_printjob',
|
1710
|
-
'dialog_read_image', 'dialog_write_image', 'digital_filter',
|
1711
|
-
'dilate', 'dindgen', 'dissolve', 'dist', 'distance_measure',
|
1712
|
-
'dlm_load', 'dlm_register', 'doc_library', 'double',
|
1713
|
-
'draw_roi', 'edge_dog', 'efont', 'eigenql', 'eigenvec',
|
1714
|
-
'ellipse', 'elmhes', 'emboss', 'empty', 'enable_sysrtn',
|
1715
|
-
'eof', 'eos_\w*', 'erase', 'erf', 'erfc', 'erfcx',
|
1716
|
-
'erode', 'errorplot', 'errplot', 'estimator_filter',
|
1717
|
-
'execute', 'exit', 'exp', 'expand', 'expand_path', 'expint',
|
1718
|
-
'extrac', 'extract_slice', 'factorial', 'fft', 'filepath',
|
1719
|
-
'file_basename', 'file_chmod', 'file_copy', 'file_delete',
|
1720
|
-
'file_dirname', 'file_expand_path', 'file_info',
|
1721
|
-
'file_lines', 'file_link', 'file_mkdir', 'file_move',
|
1722
|
-
'file_poll_input', 'file_readlink', 'file_same',
|
1723
|
-
'file_search', 'file_test', 'file_which', 'findgen',
|
1724
|
-
'finite', 'fix', 'flick', 'float', 'floor', 'flow3',
|
1725
|
-
'fltarr', 'flush', 'format_axis_values', 'free_lun',
|
1726
|
-
'fstat', 'fulstr', 'funct', 'fv_test', 'fx_root',
|
1727
|
-
'fz_roots', 'f_cvf', 'f_pdf', 'gamma', 'gamma_ct',
|
1728
|
-
'gauss2dfit', 'gaussfit', 'gaussian_function', 'gaussint',
|
1729
|
-
'gauss_cvf', 'gauss_pdf', 'gauss_smooth', 'getenv',
|
1730
|
-
'getwindows', 'get_drive_list', 'get_dxf_objects',
|
1731
|
-
'get_kbrd', 'get_login_info', 'get_lun', 'get_screen_size',
|
1732
|
-
'greg2jul', 'grib_\w*', 'grid3', 'griddata',
|
1733
|
-
'grid_input', 'grid_tps', 'gs_iter',
|
1734
|
-
'h5[adfgirst]_\w*', 'h5_browser', 'h5_close',
|
1735
|
-
'h5_create', 'h5_get_libversion', 'h5_open', 'h5_parse',
|
1736
|
-
'hanning', 'hash', 'hdf_\w*', 'heap_free',
|
1737
|
-
'heap_gc', 'heap_nosave', 'heap_refcount', 'heap_save',
|
1738
|
-
'help', 'hilbert', 'histogram', 'hist_2d', 'hist_equal',
|
1739
|
-
'hls', 'hough', 'hqr', 'hsv', 'h_eq_ct', 'h_eq_int',
|
1740
|
-
'i18n_multibytetoutf8', 'i18n_multibytetowidechar',
|
1741
|
-
'i18n_utf8tomultibyte', 'i18n_widechartomultibyte',
|
1742
|
-
'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity',
|
1743
|
-
'idlexbr_assistant', 'idlitsys_createtool', 'idl_base64',
|
1744
|
-
'idl_validname', 'iellipse', 'igamma', 'igetcurrent',
|
1745
|
-
'igetdata', 'igetid', 'igetproperty', 'iimage', 'image',
|
1746
|
-
'image_cont', 'image_statistics', 'imaginary', 'imap',
|
1747
|
-
'indgen', 'intarr', 'interpol', 'interpolate',
|
1748
|
-
'interval_volume', 'int_2d', 'int_3d', 'int_tabulated',
|
1749
|
-
'invert', 'ioctl', 'iopen', 'iplot', 'ipolygon',
|
1750
|
-
'ipolyline', 'iputdata', 'iregister', 'ireset', 'iresolve',
|
1751
|
-
'irotate', 'ir_filter', 'isa', 'isave', 'iscale',
|
1752
|
-
'isetcurrent', 'isetproperty', 'ishft', 'isocontour',
|
1753
|
-
'isosurface', 'isurface', 'itext', 'itranslate', 'ivector',
|
1754
|
-
'ivolume', 'izoom', 'i_beta', 'journal', 'json_parse',
|
1755
|
-
'json_serialize', 'jul2greg', 'julday', 'keyword_set',
|
1756
|
-
'krig2d', 'kurtosis', 'kw_test', 'l64indgen', 'label_date',
|
1757
|
-
'label_region', 'ladfit', 'laguerre', 'laplacian',
|
1758
|
-
'la_choldc', 'la_cholmprove', 'la_cholsol', 'la_determ',
|
1759
|
-
'la_eigenproblem', 'la_eigenql', 'la_eigenvec', 'la_elmhes',
|
1760
|
-
'la_gm_linear_model', 'la_hqr', 'la_invert',
|
1761
|
-
'la_least_squares', 'la_least_square_equality',
|
1762
|
-
'la_linear_equation', 'la_ludc', 'la_lumprove', 'la_lusol',
|
1763
|
-
'la_svd', 'la_tridc', 'la_trimprove', 'la_triql',
|
1764
|
-
'la_trired', 'la_trisol', 'least_squares_filter', 'leefilt',
|
1765
|
-
'legend', 'legendre', 'linbcg', 'lindgen', 'linfit',
|
1766
|
-
'linkimage', 'list', 'll_arc_distance', 'lmfit', 'lmgr',
|
1767
|
-
'lngamma', 'lnp_test', 'loadct', 'locale_get',
|
1768
|
-
'logical_and', 'logical_or', 'logical_true', 'lon64arr',
|
1769
|
-
'lonarr', 'long', 'long64', 'lsode', 'ludc', 'lumprove',
|
1770
|
-
'lusol', 'lu_complex', 'machar', 'make_array', 'make_dll',
|
1771
|
-
'make_rt', 'map', 'mapcontinents', 'mapgrid', 'map_2points',
|
1772
|
-
'map_continents', 'map_grid', 'map_image', 'map_patch',
|
1773
|
-
'map_proj_forward', 'map_proj_image', 'map_proj_info',
|
1774
|
-
'map_proj_init', 'map_proj_inverse', 'map_set',
|
1775
|
-
'matrix_multiply', 'matrix_power', 'max', 'md_test',
|
1776
|
-
'mean', 'meanabsdev', 'mean_filter', 'median', 'memory',
|
1777
|
-
'mesh_clip', 'mesh_decimate', 'mesh_issolid', 'mesh_merge',
|
1778
|
-
'mesh_numtriangles', 'mesh_obj', 'mesh_smooth',
|
1779
|
-
'mesh_surfacearea', 'mesh_validate', 'mesh_volume',
|
1780
|
-
'message', 'min', 'min_curve_surf', 'mk_html_help',
|
1781
|
-
'modifyct', 'moment', 'morph_close', 'morph_distance',
|
1782
|
-
'morph_gradient', 'morph_hitormiss', 'morph_open',
|
1783
|
-
'morph_thin', 'morph_tophat', 'multi', 'm_correlate',
|
1784
|
-
'ncdf_\w*', 'newton', 'noise_hurl', 'noise_pick',
|
1785
|
-
'noise_scatter', 'noise_slur', 'norm', 'n_elements',
|
1786
|
-
'n_params', 'n_tags', 'objarr', 'obj_class', 'obj_destroy',
|
1787
|
-
'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid',
|
1788
|
-
'online_help', 'on_error', 'open', 'oplot', 'oploterr',
|
1789
|
-
'parse_url', 'particle_trace', 'path_cache', 'path_sep',
|
1790
|
-
'pcomp', 'plot', 'plot3d', 'ploterr', 'plots', 'plot_3dbox',
|
1791
|
-
'plot_field', 'pnt_line', 'point_lun', 'polarplot',
|
1792
|
-
'polar_contour', 'polar_surface', 'poly', 'polyfill',
|
1793
|
-
'polyfillv', 'polygon', 'polyline', 'polyshade', 'polywarp',
|
1794
|
-
'poly_2d', 'poly_area', 'poly_fit', 'popd', 'powell',
|
1795
|
-
'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes',
|
1796
|
-
'print', 'printd', 'product', 'profile', 'profiler',
|
1797
|
-
'profiles', 'project_vol', 'psafm', 'pseudo',
|
1798
|
-
'ps_show_fonts', 'ptrarr', 'ptr_free', 'ptr_new',
|
1799
|
-
'ptr_valid', 'pushd', 'p_correlate', 'qgrid3', 'qhull',
|
1800
|
-
'qromb', 'qromo', 'qsimp', 'query_ascii', 'query_bmp',
|
1801
|
-
'query_csv', 'query_dicom', 'query_gif', 'query_image',
|
1802
|
-
'query_jpeg', 'query_jpeg2000', 'query_mrsid', 'query_pict',
|
1803
|
-
'query_png', 'query_ppm', 'query_srf', 'query_tiff',
|
1804
|
-
'query_wav', 'radon', 'randomn', 'randomu', 'ranks',
|
1805
|
-
'rdpix', 'read', 'reads', 'readu', 'read_ascii',
|
1806
|
-
'read_binary', 'read_bmp', 'read_csv', 'read_dicom',
|
1807
|
-
'read_gif', 'read_image', 'read_interfile', 'read_jpeg',
|
1808
|
-
'read_jpeg2000', 'read_mrsid', 'read_pict', 'read_png',
|
1809
|
-
'read_ppm', 'read_spr', 'read_srf', 'read_sylk',
|
1810
|
-
'read_tiff', 'read_wav', 'read_wave', 'read_x11_bitmap',
|
1811
|
-
'read_xwd', 'real_part', 'rebin', 'recall_commands',
|
1812
|
-
'recon3', 'reduce_colors', 'reform', 'region_grow',
|
1813
|
-
'register_cursor', 'regress', 'replicate',
|
1814
|
-
'replicate_inplace', 'resolve_all', 'resolve_routine',
|
1815
|
-
'restore', 'retall', 'return', 'reverse', 'rk4', 'roberts',
|
1816
|
-
'rot', 'rotate', 'round', 'routine_filepath',
|
1817
|
-
'routine_info', 'rs_test', 'r_correlate', 'r_test',
|
1818
|
-
'save', 'savgol', 'scale3', 'scale3d', 'scope_level',
|
1819
|
-
'scope_traceback', 'scope_varfetch', 'scope_varname',
|
1820
|
-
'search2d', 'search3d', 'sem_create', 'sem_delete',
|
1821
|
-
'sem_lock', 'sem_release', 'setenv', 'set_plot',
|
1822
|
-
'set_shading', 'sfit', 'shade_surf', 'shade_surf_irr',
|
1823
|
-
'shade_volume', 'shift', 'shift_diff', 'shmdebug', 'shmmap',
|
1824
|
-
'shmunmap', 'shmvar', 'show3', 'showfont', 'simplex', 'sin',
|
1825
|
-
'sindgen', 'sinh', 'size', 'skewness', 'skip_lun',
|
1826
|
-
'slicer3', 'slide_image', 'smooth', 'sobel', 'socket',
|
1827
|
-
'sort', 'spawn', 'spher_harm', 'sph_4pnt', 'sph_scat',
|
1828
|
-
'spline', 'spline_p', 'spl_init', 'spl_interp', 'sprsab',
|
1829
|
-
'sprsax', 'sprsin', 'sprstp', 'sqrt', 'standardize',
|
1830
|
-
'stddev', 'stop', 'strarr', 'strcmp', 'strcompress',
|
1831
|
-
'streamline', 'stregex', 'stretch', 'string', 'strjoin',
|
1832
|
-
'strlen', 'strlowcase', 'strmatch', 'strmessage', 'strmid',
|
1833
|
-
'strpos', 'strput', 'strsplit', 'strtrim', 'struct_assign',
|
1834
|
-
'struct_hide', 'strupcase', 'surface', 'surfr', 'svdc',
|
1835
|
-
'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace',
|
1836
|
-
'symbol', 'systime', 's_test', 't3d', 'tag_names', 'tan',
|
1837
|
-
'tanh', 'tek_color', 'temporary', 'tetra_clip',
|
1838
|
-
'tetra_surface', 'tetra_volume', 'text', 'thin', 'threed',
|
1839
|
-
'timegen', 'time_test2', 'tm_test', 'total', 'trace',
|
1840
|
-
'transpose', 'triangulate', 'trigrid', 'triql', 'trired',
|
1841
|
-
'trisol', 'tri_surf', 'truncate_lun', 'ts_coef', 'ts_diff',
|
1842
|
-
'ts_fcast', 'ts_smooth', 'tv', 'tvcrs', 'tvlct', 'tvrd',
|
1843
|
-
'tvscl', 'typename', 't_cvt', 't_pdf', 'uindgen', 'uint',
|
1844
|
-
'uintarr', 'ul64indgen', 'ulindgen', 'ulon64arr', 'ulonarr',
|
1845
|
-
'ulong', 'ulong64', 'uniq', 'unsharp_mask', 'usersym',
|
1846
|
-
'value_locate', 'variance', 'vector', 'vector_field', 'vel',
|
1847
|
-
'velovect', 'vert_t3d', 'voigt', 'voronoi', 'voxel_proj',
|
1848
|
-
'wait', 'warp_tri', 'watershed', 'wdelete', 'wf_draw',
|
1849
|
-
'where', 'widget_base', 'widget_button', 'widget_combobox',
|
1850
|
-
'widget_control', 'widget_displaycontextmen', 'widget_draw',
|
1851
|
-
'widget_droplist', 'widget_event', 'widget_info',
|
1852
|
-
'widget_label', 'widget_list', 'widget_propertysheet',
|
1853
|
-
'widget_slider', 'widget_tab', 'widget_table',
|
1854
|
-
'widget_text', 'widget_tree', 'widget_tree_move',
|
1855
|
-
'widget_window', 'wiener_filter', 'window', 'writeu',
|
1856
|
-
'write_bmp', 'write_csv', 'write_gif', 'write_image',
|
1857
|
-
'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict',
|
1858
|
-
'write_png', 'write_ppm', 'write_spr', 'write_srf',
|
1859
|
-
'write_sylk', 'write_tiff', 'write_wav', 'write_wave',
|
1860
|
-
'wset', 'wshow', 'wtn', 'wv_applet', 'wv_cwt',
|
1861
|
-
'wv_cw_wavelet', 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet',
|
1862
|
-
'wv_fn_daubechies', 'wv_fn_gaussian', 'wv_fn_haar',
|
1863
|
-
'wv_fn_morlet', 'wv_fn_paul', 'wv_fn_symlet',
|
1864
|
-
'wv_import_data', 'wv_import_wavelet', 'wv_plot3d_wps',
|
1865
|
-
'wv_plot_multires', 'wv_pwt', 'wv_tool_denoise',
|
1866
|
-
'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont',
|
1867
|
-
'xinteranimate', 'xloadct', 'xmanager', 'xmng_tmpl',
|
1868
|
-
'xmtool', 'xobjview', 'xobjview_rotate',
|
1869
|
-
'xobjview_write_image', 'xpalette', 'xpcolor', 'xplot3d',
|
1870
|
-
'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit',
|
1871
|
-
'xvolume', 'xvolume_rotate', 'xvolume_write_image',
|
1872
|
-
'xyouts', 'zoom', 'zoom_24']
|
1873
|
-
"""Functions from: http://www.exelisvis.com/docs/routines-1.html"""
|
1874
|
-
|
1875
|
-
tokens = {
|
1876
|
-
'root': [
|
1877
|
-
(r'^\s*;.*?\n', Comment.Singleline),
|
1878
|
-
(r'\b(' + '|'.join(_RESERVED) + r')\b', Keyword),
|
1879
|
-
(r'\b(' + '|'.join(_BUILTIN_LIB) + r')\b', Name.Builtin),
|
1880
|
-
(r'\+=|-=|\^=|\*=|/=|#=|##=|<=|>=|=', Operator),
|
1881
|
-
(r'\+\+|--|->|\+|-|##|#|\*|/|<|>|&&|\^|~|\|\|\?|:', Operator),
|
1882
|
-
(r'\b(mod=|lt=|le=|eq=|ne=|ge=|gt=|not=|and=|or=|xor=)', Operator),
|
1883
|
-
(r'\b(mod|lt|le|eq|ne|ge|gt|not|and|or|xor)\b', Operator),
|
1884
|
-
(r'\b[0-9](L|B|S|UL|ULL|LL)?\b', Number),
|
1885
|
-
(r'.', Text),
|
1886
|
-
]
|
1887
|
-
}
|
1888
|
-
|
1889
|
-
|
1890
|
-
class RdLexer(RegexLexer):
|
1891
|
-
"""
|
1892
|
-
Pygments Lexer for R documentation (Rd) files
|
1893
|
-
|
1894
|
-
This is a very minimal implementation, highlighting little more
|
1895
|
-
than the macros. A description of Rd syntax is found in `Writing R
|
1896
|
-
Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
|
1897
|
-
and `Parsing Rd files <developer.r-project.org/parseRd.pdf>`_.
|
1898
|
-
|
1899
|
-
.. versionadded:: 1.6
|
1900
|
-
"""
|
1901
|
-
name = 'Rd'
|
1902
|
-
aliases = ['rd']
|
1903
|
-
filenames = ['*.Rd']
|
1904
|
-
mimetypes = ['text/x-r-doc']
|
1905
|
-
|
1906
|
-
# To account for verbatim / LaTeX-like / and R-like areas
|
1907
|
-
# would require parsing.
|
1908
|
-
tokens = {
|
1909
|
-
'root' : [
|
1910
|
-
# catch escaped brackets and percent sign
|
1911
|
-
(r'\\[\\{}%]', String.Escape),
|
1912
|
-
# comments
|
1913
|
-
(r'%.*$', Comment),
|
1914
|
-
# special macros with no arguments
|
1915
|
-
(r'\\(?:cr|l?dots|R|tab)\b', Keyword.Constant),
|
1916
|
-
# macros
|
1917
|
-
(r'\\[a-zA-Z]+\b', Keyword),
|
1918
|
-
# special preprocessor macros
|
1919
|
-
(r'^\s*#(?:ifn?def|endif).*\b', Comment.Preproc),
|
1920
|
-
# non-escaped brackets
|
1921
|
-
(r'[{}]', Name.Builtin),
|
1922
|
-
# everything else
|
1923
|
-
(r'[^\\%\n{}]+', Text),
|
1924
|
-
(r'.', Text),
|
1925
|
-
]
|
1926
|
-
}
|
1927
|
-
|
1928
|
-
|
1929
|
-
class IgorLexer(RegexLexer):
|
1930
|
-
"""
|
1931
|
-
Pygments Lexer for Igor Pro procedure files (.ipf).
|
1932
|
-
See http://www.wavemetrics.com/ and http://www.igorexchange.com/.
|
1933
|
-
|
1934
|
-
.. versionadded:: 2.0
|
1935
|
-
"""
|
1936
|
-
|
1937
|
-
name = 'Igor'
|
1938
|
-
aliases = ['igor', 'igorpro']
|
1939
|
-
filenames = ['*.ipf']
|
1940
|
-
mimetypes = ['text/ipf']
|
1941
|
-
|
1942
|
-
flags = re.IGNORECASE | re.MULTILINE
|
1943
|
-
|
1944
|
-
flowControl = [
|
1945
|
-
'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'strswitch', 'switch',
|
1946
|
-
'case', 'default', 'endswitch', 'do', 'while', 'try', 'catch', 'endtry',
|
1947
|
-
'break', 'continue', 'return',
|
1948
|
-
]
|
1949
|
-
types = [
|
1950
|
-
'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE',
|
1951
|
-
'STRUCT', 'dfref'
|
1952
|
-
]
|
1953
|
-
keywords = [
|
1954
|
-
'override', 'ThreadSafe', 'static', 'FuncFit', 'Proc', 'Picture',
|
1955
|
-
'Prompt', 'DoPrompt', 'macro', 'window', 'graph', 'function', 'end',
|
1956
|
-
'Structure', 'EndStructure', 'EndMacro', 'Menu', 'SubMenu', 'Prompt',
|
1957
|
-
'DoPrompt',
|
1958
|
-
]
|
1959
|
-
operations = [
|
1960
|
-
'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio',
|
1961
|
-
'AddMovieFrame', 'APMath', 'Append', 'AppendImage',
|
1962
|
-
'AppendLayoutObject', 'AppendMatrixContour', 'AppendText',
|
1963
|
-
'AppendToGraph', 'AppendToLayout', 'AppendToTable', 'AppendXYZContour',
|
1964
|
-
'AutoPositionWindow', 'BackgroundInfo', 'Beep', 'BoundingBall',
|
1965
|
-
'BrowseURL', 'BuildMenu', 'Button', 'cd', 'Chart', 'CheckBox',
|
1966
|
-
'CheckDisplayed', 'ChooseColor', 'Close', 'CloseMovie', 'CloseProc',
|
1967
|
-
'ColorScale', 'ColorTab2Wave', 'Concatenate', 'ControlBar',
|
1968
|
-
'ControlInfo', 'ControlUpdate', 'ConvexHull', 'Convolve', 'CopyFile',
|
1969
|
-
'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'Cross',
|
1970
|
-
'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor',
|
1971
|
-
'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions',
|
1972
|
-
'DefaultFont', 'DefaultGuiControls', 'DefaultGuiFont', 'DefineGuide',
|
1973
|
-
'DelayUpdate', 'DeleteFile', 'DeleteFolder', 'DeletePoints',
|
1974
|
-
'Differentiate', 'dir', 'Display', 'DisplayHelpTopic',
|
1975
|
-
'DisplayProcedure', 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow',
|
1976
|
-
'DoXOPIdle', 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine',
|
1977
|
-
'DrawOval', 'DrawPICT', 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText',
|
1978
|
-
'DSPDetrend', 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder',
|
1979
|
-
'DWT', 'EdgeStats', 'Edit', 'ErrorBars', 'Execute', 'ExecuteScriptText',
|
1980
|
-
'ExperimentModified', 'Extract', 'FastGaussTransform', 'FastOp',
|
1981
|
-
'FBinRead', 'FBinWrite', 'FFT', 'FIFO2Wave', 'FIFOStatus', 'FilterFIR',
|
1982
|
-
'FilterIIR', 'FindLevel', 'FindLevels', 'FindPeak', 'FindPointsInPoly',
|
1983
|
-
'FindRoots', 'FindSequence', 'FindValue', 'FPClustering', 'fprintf',
|
1984
|
-
'FReadLine', 'FSetPos', 'FStatus', 'FTPDelete', 'FTPDownload',
|
1985
|
-
'FTPUpload', 'FuncFit', 'FuncFitMD', 'GetAxis', 'GetFileFolderInfo',
|
1986
|
-
'GetLastUserMenuInfo', 'GetMarquee', 'GetSelection', 'GetWindow',
|
1987
|
-
'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', 'GroupBox',
|
1988
|
-
'Hanning', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools',
|
1989
|
-
'HilbertTransform', 'Histogram', 'IFFT', 'ImageAnalyzeParticles',
|
1990
|
-
'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection',
|
1991
|
-
'ImageFileInfo', 'ImageFilter', 'ImageFocus', 'ImageGenerateROIMask',
|
1992
|
-
'ImageHistModification', 'ImageHistogram', 'ImageInterpolate',
|
1993
|
-
'ImageLineProfile', 'ImageLoad', 'ImageMorphology', 'ImageRegistration',
|
1994
|
-
'ImageRemoveBackground', 'ImageRestore', 'ImageRotate', 'ImageSave',
|
1995
|
-
'ImageSeedFill', 'ImageSnake', 'ImageStats', 'ImageThreshold',
|
1996
|
-
'ImageTransform', 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort',
|
1997
|
-
'InsertPoints', 'Integrate', 'IntegrateODE', 'Interp3DPath',
|
1998
|
-
'Interpolate3D', 'KillBackground', 'KillControl', 'KillDataFolder',
|
1999
|
-
'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', 'KillStrings',
|
2000
|
-
'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', 'Layout',
|
2001
|
-
'Legend', 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData',
|
2002
|
-
'LoadPackagePreferences', 'LoadPICT', 'LoadWave', 'Loess',
|
2003
|
-
'LombPeriodogram', 'Make', 'MakeIndex', 'MarkPerfTestTime',
|
2004
|
-
'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', 'MatrixFilter',
|
2005
|
-
'MatrixGaussJ', 'MatrixInverse', 'MatrixLinearSolve',
|
2006
|
-
'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD',
|
2007
|
-
'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve',
|
2008
|
-
'MatrixSVBkSub', 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText',
|
2009
|
-
'Modify', 'ModifyContour', 'ModifyControl', 'ModifyControlList',
|
2010
|
-
'ModifyFreeAxis', 'ModifyGraph', 'ModifyImage', 'ModifyLayout',
|
2011
|
-
'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', 'MoveDataFolder',
|
2012
|
-
'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', 'MoveVariable',
|
2013
|
-
'MoveWave', 'MoveWindow', 'NeuralNetworkRun', 'NeuralNetworkTrain',
|
2014
|
-
'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewImage',
|
2015
|
-
'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath',
|
2016
|
-
'NewWaterfall', 'Note', 'Notebook', 'NotebookAction', 'Open',
|
2017
|
-
'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo',
|
2018
|
-
'PauseForUser', 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction',
|
2019
|
-
'PlaySnd', 'PlaySound', 'PopupContextualMenu', 'PopupMenu',
|
2020
|
-
'Preferences', 'PrimeFactors', 'Print', 'printf', 'PrintGraphs',
|
2021
|
-
'PrintLayout', 'PrintNotebook', 'PrintSettings', 'PrintTable',
|
2022
|
-
'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit',
|
2023
|
-
'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour',
|
2024
|
-
'RemoveFromGraph', 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage',
|
2025
|
-
'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder',
|
2026
|
-
'RenamePath', 'RenamePICT', 'RenameWindow', 'ReorderImages',
|
2027
|
-
'ReorderTraces', 'ReplaceText', 'ReplaceWave', 'Resample',
|
2028
|
-
'ResumeUpdate', 'Reverse', 'Rotate', 'Save', 'SaveData',
|
2029
|
-
'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook',
|
2030
|
-
'SavePackagePreferences', 'SavePICT', 'SaveTableCopy',
|
2031
|
-
'SetActiveSubwindow', 'SetAxis', 'SetBackground', 'SetDashPattern',
|
2032
|
-
'SetDataFolder', 'SetDimLabel', 'SetDrawEnv', 'SetDrawLayer',
|
2033
|
-
'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', 'SetIgorMenuMode',
|
2034
|
-
'SetIgorOption', 'SetMarquee', 'SetProcessSleep', 'SetRandomSeed',
|
2035
|
-
'SetScale', 'SetVariable', 'SetWaveLock', 'SetWindow', 'ShowIgorMenus',
|
2036
|
-
'ShowInfo', 'ShowTools', 'Silent', 'Sleep', 'Slider', 'Smooth',
|
2037
|
-
'SmoothCustom', 'Sort', 'SoundInRecord', 'SoundInSet',
|
2038
|
-
'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart',
|
2039
|
-
'SphericalInterpolate', 'SphericalTriangulate', 'SplitString',
|
2040
|
-
'sprintf', 'sscanf', 'Stack', 'StackWindows',
|
2041
|
-
'StatsAngularDistanceTest', 'StatsANOVA1Test', 'StatsANOVA2NRTest',
|
2042
|
-
'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest',
|
2043
|
-
'StatsCircularCorrelationTest', 'StatsCircularMeans',
|
2044
|
-
'StatsCircularMoments', 'StatsCircularTwoSampleTest',
|
2045
|
-
'StatsCochranTest', 'StatsContingencyTable', 'StatsDIPTest',
|
2046
|
-
'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest',
|
2047
|
-
'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKendallTauTest',
|
2048
|
-
'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest',
|
2049
|
-
'StatsLinearRegression', 'StatsMultiCorrelationTest',
|
2050
|
-
'StatsNPMCTest', 'StatsNPNominalSRTest', 'StatsQuantiles',
|
2051
|
-
'StatsRankCorrelationTest', 'StatsResample', 'StatsSample',
|
2052
|
-
'StatsScheffeTest', 'StatsSignTest', 'StatsSRTest', 'StatsTTest',
|
2053
|
-
'StatsTukeyTest', 'StatsVariancesTest', 'StatsWatsonUSquaredTest',
|
2054
|
-
'StatsWatsonWilliamsTest', 'StatsWheelerWatsonTest',
|
2055
|
-
'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', 'String',
|
2056
|
-
'StructGet', 'StructPut', 'TabControl', 'Tag', 'TextBox', 'Tile',
|
2057
|
-
'TileWindows', 'TitleBox', 'ToCommandLine', 'ToolsGrid',
|
2058
|
-
'Triangulate3d', 'Unwrap', 'ValDisplay', 'Variable', 'WaveMeanStdv',
|
2059
|
-
'WaveStats', 'WaveTransform', 'wfprintf', 'WignerTransform',
|
2060
|
-
'WindowFunction',
|
2061
|
-
]
|
2062
|
-
functions = [
|
2063
|
-
'abs', 'acos', 'acosh', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', 'alog',
|
2064
|
-
'area', 'areaXY', 'asin', 'asinh', 'atan', 'atan2', 'atanh',
|
2065
|
-
'AxisValFromPixel', 'Besseli', 'Besselj', 'Besselk', 'Bessely', 'bessi',
|
2066
|
-
'bessj', 'bessk', 'bessy', 'beta', 'betai', 'BinarySearch',
|
2067
|
-
'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise', 'cabs',
|
2068
|
-
'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', 'chebyshev',
|
2069
|
-
'chebyshevU', 'CheckName', 'cmplx', 'cmpstr', 'conj', 'ContourZ', 'cos',
|
2070
|
-
'cosh', 'cot', 'CountObjects', 'CountObjectsDFR', 'cpowi',
|
2071
|
-
'CreationDate', 'csc', 'DataFolderExists', 'DataFolderRefsEqual',
|
2072
|
-
'DataFolderRefStatus', 'date2secs', 'datetime', 'DateToJulian',
|
2073
|
-
'Dawson', 'DDEExecute', 'DDEInitiate', 'DDEPokeString', 'DDEPokeWave',
|
2074
|
-
'DDERequestWave', 'DDEStatus', 'DDETerminate', 'deltax', 'digamma',
|
2075
|
-
'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', 'erf',
|
2076
|
-
'erfc', 'exists', 'exp', 'expInt', 'expNoise', 'factorial', 'fakedata',
|
2077
|
-
'faverage', 'faverageXY', 'FindDimLabel', 'FindListItem', 'floor',
|
2078
|
-
'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin',
|
2079
|
-
'gamma', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss',
|
2080
|
-
'Gauss1D', 'Gauss2D', 'gcd', 'GetDefaultFontSize',
|
2081
|
-
'GetDefaultFontStyle', 'GetKeyState', 'GetRTError', 'gnoise',
|
2082
|
-
'GrepString', 'hcsr', 'hermite', 'hermiteGauss', 'HyperG0F1',
|
2083
|
-
'HyperG1F1', 'HyperG2F1', 'HyperGNoise', 'HyperGPFQ', 'IgorVersion',
|
2084
|
-
'ilim', 'imag', 'Inf', 'Integrate1D', 'interp', 'Interp2D', 'Interp3D',
|
2085
|
-
'inverseERF', 'inverseERFC', 'ItemsInList', 'jlim', 'Laguerre',
|
2086
|
-
'LaguerreA', 'LaguerreGauss', 'leftx', 'LegendreA', 'limit', 'ln',
|
2087
|
-
'log', 'logNormalNoise', 'lorentzianNoise', 'magsqr', 'MandelbrotPoint',
|
2088
|
-
'MarcumQ', 'MatrixDet', 'MatrixDot', 'MatrixRank', 'MatrixTrace', 'max',
|
2089
|
-
'mean', 'min', 'mod', 'ModDate', 'NaN', 'norm', 'NumberByKey',
|
2090
|
-
'numpnts', 'numtype', 'NumVarOrDefault', 'NVAR_Exists', 'p2rect',
|
2091
|
-
'ParamIsDefault', 'pcsr', 'Pi', 'PixelFromAxisVal', 'pnt2x',
|
2092
|
-
'poissonNoise', 'poly', 'poly2D', 'PolygonArea', 'qcsr', 'r2polar',
|
2093
|
-
'real', 'rightx', 'round', 'sawtooth', 'ScreenResolution', 'sec',
|
2094
|
-
'SelectNumber', 'sign', 'sin', 'sinc', 'sinh', 'SphericalBessJ',
|
2095
|
-
'SphericalBessJD', 'SphericalBessY', 'SphericalBessYD',
|
2096
|
-
'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF',
|
2097
|
-
'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF',
|
2098
|
-
'StatsCauchyCDF', 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF',
|
2099
|
-
'StatsCMSSDCDF', 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF',
|
2100
|
-
'StatsErlangCDF', 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF',
|
2101
|
-
'StatsEValuePDF', 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF',
|
2102
|
-
'StatsFPDF', 'StatsFriedmanCDF', 'StatsGammaCDF', 'StatsGammaPDF',
|
2103
|
-
'StatsGeometricCDF', 'StatsGeometricPDF', 'StatsHyperGCDF',
|
2104
|
-
'StatsHyperGPDF', 'StatsInvBetaCDF', 'StatsInvBinomialCDF',
|
2105
|
-
'StatsInvCauchyCDF', 'StatsInvChiCDF', 'StatsInvCMSSDCDF',
|
2106
|
-
'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF',
|
2107
|
-
'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF',
|
2108
|
-
'StatsInvGeometricCDF', 'StatsInvKuiperCDF', 'StatsInvLogisticCDF',
|
2109
|
-
'StatsInvLogNormalCDF', 'StatsInvMaxwellCDF', 'StatsInvMooreCDF',
|
2110
|
-
'StatsInvNBinomialCDF', 'StatsInvNCChiCDF', 'StatsInvNCFCDF',
|
2111
|
-
'StatsInvNormalCDF', 'StatsInvParetoCDF', 'StatsInvPoissonCDF',
|
2112
|
-
'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF',
|
2113
|
-
'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF',
|
2114
|
-
'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF',
|
2115
|
-
'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF',
|
2116
|
-
'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF',
|
2117
|
-
'StatsLogNormalCDF', 'StatsLogNormalPDF', 'StatsMaxwellCDF',
|
2118
|
-
'StatsMaxwellPDF', 'StatsMedian', 'StatsMooreCDF', 'StatsNBinomialCDF',
|
2119
|
-
'StatsNBinomialPDF', 'StatsNCChiCDF', 'StatsNCChiPDF', 'StatsNCFCDF',
|
2120
|
-
'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', 'StatsNormalCDF',
|
2121
|
-
'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', 'StatsPermute',
|
2122
|
-
'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF',
|
2123
|
-
'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF',
|
2124
|
-
'StatsRayleighCDF', 'StatsRayleighPDF', 'StatsRectangularCDF',
|
2125
|
-
'StatsRectangularPDF', 'StatsRunsCDF', 'StatsSpearmanRhoCDF',
|
2126
|
-
'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF',
|
2127
|
-
'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean',
|
2128
|
-
'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise',
|
2129
|
-
'StatsVonMisesPDF', 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF',
|
2130
|
-
'StatsWeibullPDF', 'StopMSTimer', 'str2num', 'stringCRC', 'stringmatch',
|
2131
|
-
'strlen', 'strsearch', 'StudentA', 'StudentT', 'sum', 'SVAR_Exists',
|
2132
|
-
'TagVal', 'tan', 'tanh', 'ThreadGroupCreate', 'ThreadGroupRelease',
|
2133
|
-
'ThreadGroupWait', 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks',
|
2134
|
-
'trunc', 'Variance', 'vcsr', 'WaveCRC', 'WaveDims', 'WaveExists',
|
2135
|
-
'WaveMax', 'WaveMin', 'WaveRefsEqual', 'WaveType', 'WhichListItem',
|
2136
|
-
'WinType', 'WNoise', 'x', 'x2pnt', 'xcsr', 'y', 'z', 'zcsr', 'ZernikeR',
|
2137
|
-
]
|
2138
|
-
functions += [
|
2139
|
-
'AddListItem', 'AnnotationInfo', 'AnnotationList', 'AxisInfo',
|
2140
|
-
'AxisList', 'CaptureHistory', 'ChildWindowList', 'CleanupName',
|
2141
|
-
'ContourInfo', 'ContourNameList', 'ControlNameList', 'CsrInfo',
|
2142
|
-
'CsrWave', 'CsrXWave', 'CTabList', 'DataFolderDir', 'date',
|
2143
|
-
'DDERequestString', 'FontList', 'FuncRefInfo', 'FunctionInfo',
|
2144
|
-
'FunctionList', 'FunctionPath', 'GetDataFolder', 'GetDefaultFont',
|
2145
|
-
'GetDimLabel', 'GetErrMessage', 'GetFormula',
|
2146
|
-
'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR',
|
2147
|
-
'GetRTErrMessage', 'GetRTStackInfo', 'GetScrapText', 'GetUserData',
|
2148
|
-
'GetWavesDataFolder', 'GrepList', 'GuideInfo', 'GuideNameList', 'Hash',
|
2149
|
-
'IgorInfo', 'ImageInfo', 'ImageNameList', 'IndexedDir', 'IndexedFile',
|
2150
|
-
'JulianToDate', 'LayoutInfo', 'ListMatch', 'LowerStr', 'MacroList',
|
2151
|
-
'NameOfWave', 'note', 'num2char', 'num2istr', 'num2str',
|
2152
|
-
'OperationList', 'PadString', 'ParseFilePath', 'PathList', 'PICTInfo',
|
2153
|
-
'PICTList', 'PossiblyQuoteName', 'ProcedureText', 'RemoveByKey',
|
2154
|
-
'RemoveEnding', 'RemoveFromList', 'RemoveListItem',
|
2155
|
-
'ReplaceNumberByKey', 'ReplaceString', 'ReplaceStringByKey',
|
2156
|
-
'Secs2Date', 'Secs2Time', 'SelectString', 'SortList',
|
2157
|
-
'SpecialCharacterInfo', 'SpecialCharacterList', 'SpecialDirPath',
|
2158
|
-
'StringByKey', 'StringFromList', 'StringList', 'StrVarOrDefault',
|
2159
|
-
'TableInfo', 'TextFile', 'ThreadGroupGetDF', 'time', 'TraceFromPixel',
|
2160
|
-
'TraceInfo', 'TraceNameList', 'UniqueName', 'UnPadString', 'UpperStr',
|
2161
|
-
'VariableList', 'WaveInfo', 'WaveList', 'WaveName', 'WaveUnits',
|
2162
|
-
'WinList', 'WinName', 'WinRecreation', 'XWaveName',
|
2163
|
-
'ContourNameToWaveRef', 'CsrWaveRef', 'CsrXWaveRef',
|
2164
|
-
'ImageNameToWaveRef', 'NewFreeWave', 'TagWaveRef', 'TraceNameToWaveRef',
|
2165
|
-
'WaveRefIndexed', 'XWaveRefFromTrace', 'GetDataFolderDFR',
|
2166
|
-
'GetWavesDataFolderDFR', 'NewFreeDataFolder', 'ThreadGroupGetDFR',
|
2167
|
-
]
|
2168
|
-
|
2169
|
-
tokens = {
|
2170
|
-
'root': [
|
2171
|
-
(r'//.*$', Comment.Single),
|
2172
|
-
(r'"([^"\\]|\\.)*"', String),
|
2173
|
-
# Flow Control.
|
2174
|
-
(r'\b(%s)\b' % '|'.join(flowControl), Keyword),
|
2175
|
-
# Types.
|
2176
|
-
(r'\b(%s)\b' % '|'.join(types), Keyword.Type),
|
2177
|
-
# Keywords.
|
2178
|
-
(r'\b(%s)\b' % '|'.join(keywords), Keyword.Reserved),
|
2179
|
-
# Built-in operations.
|
2180
|
-
(r'\b(%s)\b' % '|'.join(operations), Name.Class),
|
2181
|
-
# Built-in functions.
|
2182
|
-
(r'\b(%s)\b' % '|'.join(functions), Name.Function),
|
2183
|
-
# Compiler directives.
|
2184
|
-
(r'^#(include|pragma|define|ifdef|ifndef|endif)',
|
2185
|
-
Name.Decorator),
|
2186
|
-
(r'[^a-z"/]+$', Text),
|
2187
|
-
(r'.', Text),
|
2188
|
-
],
|
2189
|
-
}
|
2190
|
-
|
2191
|
-
|
2192
|
-
class MathematicaLexer(RegexLexer):
|
2193
|
-
"""
|
2194
|
-
Lexer for `Mathematica <http://www.wolfram.com/mathematica/>`_ source code.
|
2195
|
-
|
2196
|
-
.. versionadded:: 2.0
|
2197
|
-
"""
|
2198
|
-
name = 'Mathematica'
|
2199
|
-
aliases = ['mathematica', 'mma', 'nb']
|
2200
|
-
filenames = ['*.nb', '*.cdf', '*.nbp', '*.ma']
|
2201
|
-
mimetypes = ['application/mathematica',
|
2202
|
-
'application/vnd.wolfram.mathematica',
|
2203
|
-
'application/vnd.wolfram.mathematica.package',
|
2204
|
-
'application/vnd.wolfram.cdf']
|
2205
|
-
|
2206
|
-
# http://reference.wolfram.com/mathematica/guide/Syntax.html
|
2207
|
-
operators = [
|
2208
|
-
";;", "=", "=.", "!=" "==", ":=", "->", ":>", "/.", "+", "-", "*", "/",
|
2209
|
-
"^", "&&", "||", "!", "<>", "|", "/;", "?", "@", "//", "/@", "@@",
|
2210
|
-
"@@@", "~~", "===", "&"]
|
2211
|
-
operators.sort(reverse=True)
|
2212
|
-
|
2213
|
-
punctuation = [",", ";", "(", ")", "[", "]", "{", "}"]
|
2214
|
-
|
2215
|
-
def _multi_escape(entries):
|
2216
|
-
return '(%s)' % ('|'.join(re.escape(entry) for entry in entries))
|
2217
|
-
|
2218
|
-
tokens = {
|
2219
|
-
'root': [
|
2220
|
-
(r'(?s)\(\*.*?\*\)', Comment),
|
2221
|
-
|
2222
|
-
(r'([a-zA-Z]+[A-Za-z0-9]*`)', Name.Namespace),
|
2223
|
-
(r'([A-Za-z0-9]*_+[A-Za-z0-9]*)', Name.Variable),
|
2224
|
-
(r'#\d*', Name.Variable),
|
2225
|
-
(r'([a-zA-Z]+[a-zA-Z0-9]*)', Name),
|
2226
|
-
|
2227
|
-
(r'-?[0-9]+\.[0-9]*', Number.Float),
|
2228
|
-
(r'-?[0-9]*\.[0-9]+', Number.Float),
|
2229
|
-
(r'-?[0-9]+', Number.Integer),
|
2230
|
-
|
2231
|
-
(_multi_escape(operators), Operator),
|
2232
|
-
(_multi_escape(punctuation), Punctuation),
|
2233
|
-
(r'".*?"', String),
|
2234
|
-
(r'\s+', Text.Whitespace),
|
2235
|
-
],
|
2236
|
-
}
|
2237
|
-
|
2238
|
-
class GAPLexer(RegexLexer):
|
2239
|
-
"""
|
2240
|
-
For `GAP <http://www.gap-system.org>`_ source code.
|
2241
|
-
|
2242
|
-
.. versionadded:: 2.0
|
2243
|
-
"""
|
2244
|
-
name = 'GAP'
|
2245
|
-
aliases = ['gap']
|
2246
|
-
filenames = ['*.g', '*.gd', '*.gi', '*.gap']
|
2247
|
-
|
2248
|
-
tokens = {
|
2249
|
-
'root' : [
|
2250
|
-
(r'#.*$', Comment.Single),
|
2251
|
-
(r'"(?:[^"\\]|\\.)*"', String),
|
2252
|
-
(r'\(|\)|\[|\]|\{|\}', Punctuation),
|
2253
|
-
(r'''(?x)\b(?:
|
2254
|
-
if|then|elif|else|fi|
|
2255
|
-
for|while|do|od|
|
2256
|
-
repeat|until|
|
2257
|
-
break|continue|
|
2258
|
-
function|local|return|end|
|
2259
|
-
rec|
|
2260
|
-
quit|QUIT|
|
2261
|
-
IsBound|Unbind|
|
2262
|
-
TryNextMethod|
|
2263
|
-
Info|Assert
|
2264
|
-
)\b''', Keyword),
|
2265
|
-
(r'''(?x)\b(?:
|
2266
|
-
true|false|fail|infinity
|
2267
|
-
)\b''',
|
2268
|
-
Name.Constant),
|
2269
|
-
(r'''(?x)\b(?:
|
2270
|
-
(Declare|Install)([A-Z][A-Za-z]+)|
|
2271
|
-
BindGlobal|BIND_GLOBAL
|
2272
|
-
)\b''',
|
2273
|
-
Name.Builtin),
|
2274
|
-
(r'\.|,|:=|;|=|\+|-|\*|/|\^|>|<', Operator),
|
2275
|
-
(r'''(?x)\b(?:
|
2276
|
-
and|or|not|mod|in
|
2277
|
-
)\b''',
|
2278
|
-
Operator.Word),
|
2279
|
-
(r'''(?x)
|
2280
|
-
(?:[a-zA-Z_0-9]+|`[^`]*`)
|
2281
|
-
(?:::[a-zA-Z_0-9]+|`[^`]*`)*''', Name.Variable),
|
2282
|
-
(r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
|
2283
|
-
(r'\.[0-9]+(?:e[0-9]+)?', Number),
|
2284
|
-
(r'.', Text)
|
2285
|
-
]
|
2286
|
-
}
|
21
|
+
__all__ = []
|