From 23d8e7b3551009a10842d5f1a7ce304686e6e126 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Mon, 13 Jun 2016 16:41:17 +0200 Subject: [PATCH] upgrade pygments to v2.1.3 --- tests/test_dependencies.py | 1 - wakatime/dependencies/c_cpp.py | 47 +- wakatime/dependencies/python.py | 1 + wakatime/dependencies/templates.py | 16 +- wakatime/packages/py2/pygments/console.py | 74 - wakatime/packages/py2/pygments/filter.py | 74 - .../packages/py2/pygments/filters/__init__.py | 350 - wakatime/packages/py2/pygments/formatter.py | 95 - .../py2/pygments/formatters/__init__.py | 118 - .../py2/pygments/formatters/_mapping.py | 76 - .../packages/py2/pygments/formatters/img.py | 560 -- .../packages/py2/pygments/formatters/other.py | 160 - .../packages/py2/pygments/formatters/rtf.py | 147 - .../py2/pygments/formatters/terminal256.py | 223 - .../packages/py2/pygments/lexers/__init__.py | 273 - .../py2/pygments/lexers/_asy_builtins.py | 1645 ---- .../py2/pygments/lexers/_cocoa_builtins.py | 73 - .../py2/pygments/lexers/_lua_builtins.py | 250 - .../py2/pygments/lexers/_mql_builtins.py | 1172 --- .../py2/pygments/lexers/_openedge_builtins.py | 2547 ------- .../pygments/lexers/_sourcemod_builtins.py | 1161 --- .../py2/pygments/lexers/actionscript.py | 240 - .../packages/py2/pygments/lexers/algebra.py | 187 - wakatime/packages/py2/pygments/lexers/apl.py | 101 - wakatime/packages/py2/pygments/lexers/asm.py | 435 -- .../packages/py2/pygments/lexers/basic.py | 500 -- .../packages/py2/pygments/lexers/business.py | 592 -- .../packages/py2/pygments/lexers/c_like.py | 413 - .../packages/py2/pygments/lexers/chapel.py | 98 - .../packages/py2/pygments/lexers/compiled.py | 33 - .../packages/py2/pygments/lexers/console.py | 114 - wakatime/packages/py2/pygments/lexers/css.py | 498 -- wakatime/packages/py2/pygments/lexers/data.py | 530 -- wakatime/packages/py2/pygments/lexers/diff.py | 106 - wakatime/packages/py2/pygments/lexers/dsls.py | 514 -- .../packages/py2/pygments/lexers/eiffel.py | 65 - .../packages/py2/pygments/lexers/esoteric.py | 114 - .../packages/py2/pygments/lexers/factor.py | 344 - .../packages/py2/pygments/lexers/fantom.py | 250 - .../packages/py2/pygments/lexers/felix.py | 273 - wakatime/packages/py2/pygments/lexers/go.py | 101 - .../packages/py2/pygments/lexers/graph.py | 79 - .../packages/py2/pygments/lexers/graphics.py | 553 -- wakatime/packages/py2/pygments/lexers/html.py | 589 -- wakatime/packages/py2/pygments/lexers/idl.py | 262 - .../packages/py2/pygments/lexers/inferno.py | 96 - .../py2/pygments/lexers/installers.py | 322 - .../py2/pygments/lexers/int_fiction.py | 1342 ---- .../py2/pygments/lexers/javascript.py | 1199 --- wakatime/packages/py2/pygments/lexers/lisp.py | 1480 ---- wakatime/packages/py2/pygments/lexers/math.py | 21 - wakatime/packages/py2/pygments/lexers/ml.py | 769 -- .../packages/py2/pygments/lexers/other.py | 40 - .../packages/py2/pygments/lexers/parsers.py | 835 -- wakatime/packages/py2/pygments/lexers/pawn.py | 199 - wakatime/packages/py2/pygments/lexers/php.py | 245 - .../packages/py2/pygments/lexers/python.py | 833 -- wakatime/packages/py2/pygments/lexers/r.py | 453 -- wakatime/packages/py2/pygments/lexers/rdf.py | 99 - .../packages/py2/pygments/lexers/rebol.py | 431 -- .../packages/py2/pygments/lexers/shell.py | 437 -- .../packages/py2/pygments/lexers/smalltalk.py | 195 - .../packages/py2/pygments/lexers/snobol.py | 83 - .../packages/py2/pygments/lexers/special.py | 100 - wakatime/packages/py2/pygments/lexers/tcl.py | 145 - .../packages/py2/pygments/lexers/templates.py | 2174 ------ .../packages/py2/pygments/lexers/testing.py | 131 - wakatime/packages/py2/pygments/lexers/text.py | 25 - .../packages/py2/pygments/lexers/textedit.py | 169 - .../packages/py2/pygments/lexers/textfmts.py | 292 - wakatime/packages/py2/pygments/sphinxext.py | 155 - wakatime/packages/py2/pygments/style.py | 118 - .../packages/py2/pygments/styles/__init__.py | 74 - .../packages/py2/pygments/styles/autumn.py | 65 - wakatime/packages/py2/pygments/styles/bw.py | 49 - .../packages/py2/pygments/styles/default.py | 73 - .../packages/py2/pygments/styles/friendly.py | 72 - .../packages/py2/pygments/styles/monokai.py | 106 - .../py2/pygments/styles/paraiso_dark.py | 125 - .../py2/pygments/styles/paraiso_light.py | 125 - .../packages/py2/pygments/styles/pastie.py | 75 - .../packages/py2/pygments/styles/perldoc.py | 69 - wakatime/packages/py2/pygments/styles/trac.py | 63 - wakatime/packages/py2/pygments/styles/vs.py | 38 - wakatime/packages/py2/pygments/token.py | 198 - wakatime/packages/py2/pygments/unistring.py | 217 - wakatime/packages/py3/pygments/__init__.py | 91 - wakatime/packages/py3/pygments/cmdline.py | 509 -- .../py3/pygments/formatters/bbcode.py | 109 - .../packages/py3/pygments/formatters/html.py | 839 -- .../packages/py3/pygments/formatters/latex.py | 476 -- .../packages/py3/pygments/formatters/svg.py | 153 - wakatime/packages/py3/pygments/lexer.py | 870 --- .../py3/pygments/lexers/_cl_builtins.py | 232 - .../py3/pygments/lexers/_cocoa_builtins.py | 73 - .../py3/pygments/lexers/_lasso_builtins.py | 5182 ------------- .../packages/py3/pygments/lexers/_mapping.py | 413 - .../py3/pygments/lexers/_php_builtins.py | 4755 ------------ .../py3/pygments/lexers/_postgres_builtins.py | 620 -- .../py3/pygments/lexers/_scilab_builtins.py | 3093 -------- .../py3/pygments/lexers/_stan_builtins.py | 498 -- .../py3/pygments/lexers/_vim_builtins.py | 1939 ----- .../packages/py3/pygments/lexers/agile.py | 24 - .../packages/py3/pygments/lexers/ambient.py | 76 - .../py3/pygments/lexers/automation.py | 373 - .../packages/py3/pygments/lexers/c_cpp.py | 233 - .../packages/py3/pygments/lexers/configs.py | 546 -- wakatime/packages/py3/pygments/lexers/d.py | 251 - .../packages/py3/pygments/lexers/dalvik.py | 125 - .../packages/py3/pygments/lexers/dotnet.py | 689 -- .../packages/py3/pygments/lexers/dylan.py | 289 - wakatime/packages/py3/pygments/lexers/ecl.py | 125 - .../packages/py3/pygments/lexers/erlang.py | 511 -- .../packages/py3/pygments/lexers/esoteric.py | 114 - .../packages/py3/pygments/lexers/fortran.py | 161 - .../packages/py3/pygments/lexers/foxpro.py | 428 -- .../py3/pygments/lexers/functional.py | 21 - .../packages/py3/pygments/lexers/haskell.py | 840 -- wakatime/packages/py3/pygments/lexers/haxe.py | 936 --- wakatime/packages/py3/pygments/lexers/hdl.py | 375 - wakatime/packages/py3/pygments/lexers/igor.py | 279 - .../packages/py3/pygments/lexers/iolang.py | 63 - .../packages/py3/pygments/lexers/julia.py | 194 - wakatime/packages/py3/pygments/lexers/jvm.py | 1560 ---- wakatime/packages/py3/pygments/lexers/make.py | 201 - .../packages/py3/pygments/lexers/markup.py | 502 -- .../packages/py3/pygments/lexers/matlab.py | 663 -- .../packages/py3/pygments/lexers/modeling.py | 356 - .../packages/py3/pygments/lexers/nimrod.py | 159 - wakatime/packages/py3/pygments/lexers/nit.py | 64 - wakatime/packages/py3/pygments/lexers/nix.py | 136 - .../packages/py3/pygments/lexers/objective.py | 487 -- wakatime/packages/py3/pygments/lexers/ooc.py | 85 - .../packages/py3/pygments/lexers/pascal.py | 831 -- wakatime/packages/py3/pygments/lexers/perl.py | 614 -- .../packages/py3/pygments/lexers/prolog.py | 306 - wakatime/packages/py3/pygments/lexers/rdf.py | 99 - .../packages/py3/pygments/lexers/resource.py | 84 - .../py3/pygments/lexers/robotframework.py | 560 -- wakatime/packages/py3/pygments/lexers/ruby.py | 518 -- wakatime/packages/py3/pygments/lexers/rust.py | 167 - .../packages/py3/pygments/lexers/scripting.py | 923 --- .../packages/py3/pygments/lexers/shell.py | 437 -- wakatime/packages/py3/pygments/lexers/sql.py | 598 -- .../packages/py3/pygments/lexers/testing.py | 131 - .../packages/py3/pygments/lexers/theorem.py | 466 -- wakatime/packages/py3/pygments/lexers/urbi.py | 133 - wakatime/packages/py3/pygments/lexers/web.py | 24 - .../packages/py3/pygments/lexers/webmisc.py | 920 --- wakatime/packages/py3/pygments/modeline.py | 40 - wakatime/packages/py3/pygments/plugin.py | 74 - wakatime/packages/py3/pygments/regexopt.py | 92 - wakatime/packages/py3/pygments/scanner.py | 104 - .../packages/py3/pygments/styles/borland.py | 51 - .../packages/py3/pygments/styles/colorful.py | 81 - .../packages/py3/pygments/styles/emacs.py | 72 - .../packages/py3/pygments/styles/fruity.py | 42 - wakatime/packages/py3/pygments/styles/igor.py | 29 - .../packages/py3/pygments/styles/manni.py | 75 - .../packages/py3/pygments/styles/murphy.py | 80 - .../packages/py3/pygments/styles/native.py | 65 - wakatime/packages/py3/pygments/styles/rrt.py | 33 - .../packages/py3/pygments/styles/tango.py | 141 - wakatime/packages/py3/pygments/styles/vim.py | 63 - .../packages/py3/pygments/styles/xcode.py | 51 - wakatime/packages/py3/pygments/util.py | 377 - .../packages/{py2 => }/pygments/__init__.py | 17 +- .../packages/{py2 => }/pygments/cmdline.py | 176 +- .../packages/{py3 => }/pygments/console.py | 2 +- .../packages/{py3 => }/pygments/filter.py | 6 +- .../{py3 => }/pygments/filters/__init__.py | 2 +- .../packages/{py3 => }/pygments/formatter.py | 2 +- .../{py3 => }/pygments/formatters/__init__.py | 6 +- .../{py3 => }/pygments/formatters/_mapping.py | 15 +- .../{py2 => }/pygments/formatters/bbcode.py | 2 +- .../{py2 => }/pygments/formatters/html.py | 106 +- .../{py3 => }/pygments/formatters/img.py | 29 +- .../formatters/irc.py} | 87 +- .../{py2 => }/pygments/formatters/latex.py | 34 +- .../{py3 => }/pygments/formatters/other.py | 2 +- .../{py3 => }/pygments/formatters/rtf.py | 2 +- .../{py2 => }/pygments/formatters/svg.py | 2 +- .../{py3 => }/pygments/formatters/terminal.py | 71 +- .../pygments/formatters/terminal256.py | 66 +- wakatime/packages/{py2 => }/pygments/lexer.py | 21 +- .../{py3 => }/pygments/lexers/__init__.py | 4 +- .../pygments/lexers/_asy_builtins.py | 2 +- .../{py2 => }/pygments/lexers/_cl_builtins.py | 2 +- .../pygments/lexers/_cocoa_builtins.py | 72 + .../pygments/lexers/_csound_builtins.py | 1346 ++++ .../pygments/lexers/_lasso_builtins.py | 6778 +++++++++-------- .../pygments/lexers/_lua_builtins.py | 5 +- .../{py2 => }/pygments/lexers/_mapping.py | 84 +- .../pygments/lexers/_mql_builtins.py | 2 +- .../pygments/lexers/_openedge_builtins.py | 2 +- .../pygments/lexers/_php_builtins.py | 5 +- .../pygments/lexers/_postgres_builtins.py | 5 +- .../pygments/lexers/_scilab_builtins.py | 5 +- .../pygments/lexers/_sourcemod_builtins.py | 6 +- .../pygments/lexers/_stan_builtins.py | 54 +- .../pygments/lexers/_vim_builtins.py | 2 +- .../{py3 => }/pygments/lexers/actionscript.py | 2 +- .../{py2 => }/pygments/lexers/agile.py | 2 +- .../{py3 => }/pygments/lexers/algebra.py | 42 +- .../{py2 => }/pygments/lexers/ambient.py | 2 +- .../packages/{py3 => }/pygments/lexers/apl.py | 2 +- .../packages/pygments/lexers/archetype.py | 318 + .../packages/{py3 => }/pygments/lexers/asm.py | 7 +- .../{py2 => }/pygments/lexers/automation.py | 5 +- .../{py3 => }/pygments/lexers/basic.py | 2 +- .../{py3 => }/pygments/lexers/business.py | 4 +- .../{py2 => }/pygments/lexers/c_cpp.py | 57 +- .../{py3 => }/pygments/lexers/c_like.py | 132 +- .../{py3 => }/pygments/lexers/chapel.py | 17 +- .../{py3 => }/pygments/lexers/compiled.py | 2 +- .../{py2 => }/pygments/lexers/configs.py | 293 +- .../{py3 => }/pygments/lexers/console.py | 4 +- wakatime/packages/pygments/lexers/csound.py | 366 + .../packages/{py3 => }/pygments/lexers/css.py | 40 +- .../packages/{py2 => }/pygments/lexers/d.py | 2 +- .../{py2 => }/pygments/lexers/dalvik.py | 2 +- .../{py3 => }/pygments/lexers/data.py | 2 +- .../{py3 => }/pygments/lexers/diff.py | 2 +- .../{py2 => }/pygments/lexers/dotnet.py | 13 +- .../{py3 => }/pygments/lexers/dsls.py | 210 +- .../{py2 => }/pygments/lexers/dylan.py | 2 +- .../packages/{py2 => }/pygments/lexers/ecl.py | 2 +- .../{py3 => }/pygments/lexers/eiffel.py | 2 +- wakatime/packages/pygments/lexers/elm.py | 121 + .../{py2 => }/pygments/lexers/erlang.py | 2 +- wakatime/packages/pygments/lexers/esoteric.py | 219 + wakatime/packages/pygments/lexers/ezhil.py | 68 + .../{py3 => }/pygments/lexers/factor.py | 2 +- .../{py3 => }/pygments/lexers/fantom.py | 2 +- .../{py3 => }/pygments/lexers/felix.py | 2 +- .../{py2 => }/pygments/lexers/fortran.py | 69 +- .../{py2 => }/pygments/lexers/foxpro.py | 2 +- .../{py2 => }/pygments/lexers/functional.py | 4 +- .../packages/{py3 => }/pygments/lexers/go.py | 2 +- .../pygments/lexers/grammar_notation.py | 131 + .../{py3 => }/pygments/lexers/graph.py | 3 +- .../{py3 => }/pygments/lexers/graphics.py | 2 +- .../{py2 => }/pygments/lexers/haskell.py | 2 +- .../{py2 => }/pygments/lexers/haxe.py | 2 +- .../packages/{py2 => }/pygments/lexers/hdl.py | 27 +- wakatime/packages/pygments/lexers/hexdump.py | 97 + .../{py3 => }/pygments/lexers/html.py | 30 +- .../packages/{py3 => }/pygments/lexers/idl.py | 13 +- .../{py2 => }/pygments/lexers/igor.py | 17 +- .../{py3 => }/pygments/lexers/inferno.py | 2 +- .../{py3 => }/pygments/lexers/installers.py | 2 +- .../{py3 => }/pygments/lexers/int_fiction.py | 3 +- .../{py2 => }/pygments/lexers/iolang.py | 2 +- wakatime/packages/pygments/lexers/j.py | 146 + .../{py3 => }/pygments/lexers/javascript.py | 291 +- .../{py2 => }/pygments/lexers/julia.py | 34 +- .../packages/{py2 => }/pygments/lexers/jvm.py | 57 +- .../{py3 => }/pygments/lexers/lisp.py | 897 ++- .../{py2 => }/pygments/lexers/make.py | 3 +- .../{py2 => }/pygments/lexers/markup.py | 2 +- .../{py3 => }/pygments/lexers/math.py | 2 +- .../{py2 => }/pygments/lexers/matlab.py | 2 +- .../packages/{py3 => }/pygments/lexers/ml.py | 2 +- .../{py2 => }/pygments/lexers/modeling.py | 8 +- wakatime/packages/pygments/lexers/modula2.py | 1561 ++++ .../{py2 => }/pygments/lexers/nimrod.py | 2 +- .../packages/{py2 => }/pygments/lexers/nit.py | 2 +- .../packages/{py2 => }/pygments/lexers/nix.py | 2 +- wakatime/packages/pygments/lexers/oberon.py | 105 + .../{py2 => }/pygments/lexers/objective.py | 194 +- .../packages/{py2 => }/pygments/lexers/ooc.py | 2 +- .../{py3 => }/pygments/lexers/other.py | 2 +- wakatime/packages/pygments/lexers/parasail.py | 79 + .../{py3 => }/pygments/lexers/parsers.py | 2 +- .../{py2 => }/pygments/lexers/pascal.py | 211 +- .../{py3 => }/pygments/lexers/pawn.py | 2 +- .../{py2 => }/pygments/lexers/perl.py | 3 +- .../packages/{py3 => }/pygments/lexers/php.py | 2 +- wakatime/packages/pygments/lexers/praat.py | 295 + .../{py2 => }/pygments/lexers/prolog.py | 10 +- .../{py3 => }/pygments/lexers/python.py | 142 +- wakatime/packages/pygments/lexers/qvt.py | 150 + .../packages/{py3 => }/pygments/lexers/r.py | 2 +- wakatime/packages/pygments/lexers/rdf.py | 272 + .../{py3 => }/pygments/lexers/rebol.py | 2 +- .../{py2 => }/pygments/lexers/resource.py | 2 +- wakatime/packages/pygments/lexers/roboconf.py | 82 + .../pygments/lexers/robotframework.py | 32 +- .../{py2 => }/pygments/lexers/ruby.py | 19 +- .../{py2 => }/pygments/lexers/rust.py | 117 +- .../{py2 => }/pygments/lexers/scripting.py | 324 +- wakatime/packages/pygments/lexers/shell.py | 784 ++ .../{py3 => }/pygments/lexers/smalltalk.py | 2 +- .../{py3 => }/pygments/lexers/snobol.py | 2 +- .../{py3 => }/pygments/lexers/special.py | 2 +- .../packages/{py2 => }/pygments/lexers/sql.py | 26 +- .../packages/pygments/lexers/supercollider.py | 90 + .../packages/{py3 => }/pygments/lexers/tcl.py | 2 +- .../{py3 => }/pygments/lexers/templates.py | 30 +- wakatime/packages/pygments/lexers/testing.py | 207 + .../{py3 => }/pygments/lexers/text.py | 2 +- .../{py3 => }/pygments/lexers/textedit.py | 2 +- .../{py3 => }/pygments/lexers/textfmts.py | 11 +- .../{py2 => }/pygments/lexers/theorem.py | 56 +- .../packages/pygments/lexers/trafficscript.py | 54 + .../{py2 => }/pygments/lexers/urbi.py | 2 +- .../packages/{py2 => }/pygments/lexers/web.py | 2 +- .../{py2 => }/pygments/lexers/webmisc.py | 139 +- wakatime/packages/pygments/lexers/x10.py | 69 + .../packages/{py2 => }/pygments/modeline.py | 5 +- .../packages/{py2 => }/pygments/plugin.py | 2 +- .../packages/{py2 => }/pygments/regexopt.py | 2 +- .../packages/{py2 => }/pygments/scanner.py | 2 +- .../packages/{py3 => }/pygments/sphinxext.py | 8 +- wakatime/packages/{py3 => }/pygments/style.py | 4 +- .../{py3 => }/pygments/styles/__init__.py | 5 +- wakatime/packages/pygments/styles/algol.py | 63 + wakatime/packages/pygments/styles/algol_nu.py | 63 + wakatime/packages/pygments/styles/arduino.py | 98 + .../{py3 => }/pygments/styles/autumn.py | 2 +- .../{py2 => }/pygments/styles/borland.py | 2 +- .../packages/{py3 => }/pygments/styles/bw.py | 2 +- .../{py2 => }/pygments/styles/colorful.py | 2 +- .../{py3 => }/pygments/styles/default.py | 2 +- .../{py2 => }/pygments/styles/emacs.py | 2 +- .../{py3 => }/pygments/styles/friendly.py | 2 +- .../{py2 => }/pygments/styles/fruity.py | 2 +- .../{py2 => }/pygments/styles/igor.py | 2 +- wakatime/packages/pygments/styles/lovelace.py | 93 + .../{py2 => }/pygments/styles/manni.py | 2 +- .../{py3 => }/pygments/styles/monokai.py | 2 +- .../{py2 => }/pygments/styles/murphy.py | 2 +- .../{py2 => }/pygments/styles/native.py | 2 +- .../{py3 => }/pygments/styles/paraiso_dark.py | 2 +- .../pygments/styles/paraiso_light.py | 2 +- .../{py3 => }/pygments/styles/pastie.py | 2 +- .../{py3 => }/pygments/styles/perldoc.py | 2 +- .../packages/{py2 => }/pygments/styles/rrt.py | 2 +- .../{py2 => }/pygments/styles/tango.py | 2 +- .../{py3 => }/pygments/styles/trac.py | 2 +- .../packages/{py2 => }/pygments/styles/vim.py | 2 +- .../packages/{py3 => }/pygments/styles/vs.py | 2 +- .../{py2 => }/pygments/styles/xcode.py | 2 +- wakatime/packages/{py3 => }/pygments/token.py | 12 +- .../packages/{py3 => }/pygments/unistring.py | 6 +- wakatime/packages/{py2 => }/pygments/util.py | 30 +- 346 files changed, 13938 insertions(+), 73217 deletions(-) delete mode 100644 wakatime/packages/py2/pygments/console.py delete mode 100644 wakatime/packages/py2/pygments/filter.py delete mode 100644 wakatime/packages/py2/pygments/filters/__init__.py delete mode 100644 wakatime/packages/py2/pygments/formatter.py delete mode 100644 wakatime/packages/py2/pygments/formatters/__init__.py delete mode 100644 wakatime/packages/py2/pygments/formatters/_mapping.py delete mode 100644 wakatime/packages/py2/pygments/formatters/img.py delete mode 100644 wakatime/packages/py2/pygments/formatters/other.py delete mode 100644 wakatime/packages/py2/pygments/formatters/rtf.py delete mode 100644 wakatime/packages/py2/pygments/formatters/terminal256.py delete mode 100644 wakatime/packages/py2/pygments/lexers/__init__.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_asy_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_cocoa_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_lua_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_mql_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_openedge_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/_sourcemod_builtins.py delete mode 100644 wakatime/packages/py2/pygments/lexers/actionscript.py delete mode 100644 wakatime/packages/py2/pygments/lexers/algebra.py delete mode 100644 wakatime/packages/py2/pygments/lexers/apl.py delete mode 100644 wakatime/packages/py2/pygments/lexers/asm.py delete mode 100644 wakatime/packages/py2/pygments/lexers/basic.py delete mode 100644 wakatime/packages/py2/pygments/lexers/business.py delete mode 100644 wakatime/packages/py2/pygments/lexers/c_like.py delete mode 100644 wakatime/packages/py2/pygments/lexers/chapel.py delete mode 100644 wakatime/packages/py2/pygments/lexers/compiled.py delete mode 100644 wakatime/packages/py2/pygments/lexers/console.py delete mode 100644 wakatime/packages/py2/pygments/lexers/css.py delete mode 100644 wakatime/packages/py2/pygments/lexers/data.py delete mode 100644 wakatime/packages/py2/pygments/lexers/diff.py delete mode 100644 wakatime/packages/py2/pygments/lexers/dsls.py delete mode 100644 wakatime/packages/py2/pygments/lexers/eiffel.py delete mode 100644 wakatime/packages/py2/pygments/lexers/esoteric.py delete mode 100644 wakatime/packages/py2/pygments/lexers/factor.py delete mode 100644 wakatime/packages/py2/pygments/lexers/fantom.py delete mode 100644 wakatime/packages/py2/pygments/lexers/felix.py delete mode 100644 wakatime/packages/py2/pygments/lexers/go.py delete mode 100644 wakatime/packages/py2/pygments/lexers/graph.py delete mode 100644 wakatime/packages/py2/pygments/lexers/graphics.py delete mode 100644 wakatime/packages/py2/pygments/lexers/html.py delete mode 100644 wakatime/packages/py2/pygments/lexers/idl.py delete mode 100644 wakatime/packages/py2/pygments/lexers/inferno.py delete mode 100644 wakatime/packages/py2/pygments/lexers/installers.py delete mode 100644 wakatime/packages/py2/pygments/lexers/int_fiction.py delete mode 100644 wakatime/packages/py2/pygments/lexers/javascript.py delete mode 100644 wakatime/packages/py2/pygments/lexers/lisp.py delete mode 100644 wakatime/packages/py2/pygments/lexers/math.py delete mode 100644 wakatime/packages/py2/pygments/lexers/ml.py delete mode 100644 wakatime/packages/py2/pygments/lexers/other.py delete mode 100644 wakatime/packages/py2/pygments/lexers/parsers.py delete mode 100644 wakatime/packages/py2/pygments/lexers/pawn.py delete mode 100644 wakatime/packages/py2/pygments/lexers/php.py delete mode 100644 wakatime/packages/py2/pygments/lexers/python.py delete mode 100644 wakatime/packages/py2/pygments/lexers/r.py delete mode 100644 wakatime/packages/py2/pygments/lexers/rdf.py delete mode 100644 wakatime/packages/py2/pygments/lexers/rebol.py delete mode 100644 wakatime/packages/py2/pygments/lexers/shell.py delete mode 100644 wakatime/packages/py2/pygments/lexers/smalltalk.py delete mode 100644 wakatime/packages/py2/pygments/lexers/snobol.py delete mode 100644 wakatime/packages/py2/pygments/lexers/special.py delete mode 100644 wakatime/packages/py2/pygments/lexers/tcl.py delete mode 100644 wakatime/packages/py2/pygments/lexers/templates.py delete mode 100644 wakatime/packages/py2/pygments/lexers/testing.py delete mode 100644 wakatime/packages/py2/pygments/lexers/text.py delete mode 100644 wakatime/packages/py2/pygments/lexers/textedit.py delete mode 100644 wakatime/packages/py2/pygments/lexers/textfmts.py delete mode 100644 wakatime/packages/py2/pygments/sphinxext.py delete mode 100644 wakatime/packages/py2/pygments/style.py delete mode 100644 wakatime/packages/py2/pygments/styles/__init__.py delete mode 100644 wakatime/packages/py2/pygments/styles/autumn.py delete mode 100644 wakatime/packages/py2/pygments/styles/bw.py delete mode 100644 wakatime/packages/py2/pygments/styles/default.py delete mode 100644 wakatime/packages/py2/pygments/styles/friendly.py delete mode 100644 wakatime/packages/py2/pygments/styles/monokai.py delete mode 100644 wakatime/packages/py2/pygments/styles/paraiso_dark.py delete mode 100644 wakatime/packages/py2/pygments/styles/paraiso_light.py delete mode 100644 wakatime/packages/py2/pygments/styles/pastie.py delete mode 100644 wakatime/packages/py2/pygments/styles/perldoc.py delete mode 100644 wakatime/packages/py2/pygments/styles/trac.py delete mode 100644 wakatime/packages/py2/pygments/styles/vs.py delete mode 100644 wakatime/packages/py2/pygments/token.py delete mode 100644 wakatime/packages/py2/pygments/unistring.py delete mode 100644 wakatime/packages/py3/pygments/__init__.py delete mode 100644 wakatime/packages/py3/pygments/cmdline.py delete mode 100644 wakatime/packages/py3/pygments/formatters/bbcode.py delete mode 100644 wakatime/packages/py3/pygments/formatters/html.py delete mode 100644 wakatime/packages/py3/pygments/formatters/latex.py delete mode 100644 wakatime/packages/py3/pygments/formatters/svg.py delete mode 100644 wakatime/packages/py3/pygments/lexer.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_cl_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_cocoa_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_lasso_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_mapping.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_php_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_postgres_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_scilab_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_stan_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/_vim_builtins.py delete mode 100644 wakatime/packages/py3/pygments/lexers/agile.py delete mode 100644 wakatime/packages/py3/pygments/lexers/ambient.py delete mode 100644 wakatime/packages/py3/pygments/lexers/automation.py delete mode 100644 wakatime/packages/py3/pygments/lexers/c_cpp.py delete mode 100644 wakatime/packages/py3/pygments/lexers/configs.py delete mode 100644 wakatime/packages/py3/pygments/lexers/d.py delete mode 100644 wakatime/packages/py3/pygments/lexers/dalvik.py delete mode 100644 wakatime/packages/py3/pygments/lexers/dotnet.py delete mode 100644 wakatime/packages/py3/pygments/lexers/dylan.py delete mode 100644 wakatime/packages/py3/pygments/lexers/ecl.py delete mode 100644 wakatime/packages/py3/pygments/lexers/erlang.py delete mode 100644 wakatime/packages/py3/pygments/lexers/esoteric.py delete mode 100644 wakatime/packages/py3/pygments/lexers/fortran.py delete mode 100644 wakatime/packages/py3/pygments/lexers/foxpro.py delete mode 100644 wakatime/packages/py3/pygments/lexers/functional.py delete mode 100644 wakatime/packages/py3/pygments/lexers/haskell.py delete mode 100644 wakatime/packages/py3/pygments/lexers/haxe.py delete mode 100644 wakatime/packages/py3/pygments/lexers/hdl.py delete mode 100644 wakatime/packages/py3/pygments/lexers/igor.py delete mode 100644 wakatime/packages/py3/pygments/lexers/iolang.py delete mode 100644 wakatime/packages/py3/pygments/lexers/julia.py delete mode 100644 wakatime/packages/py3/pygments/lexers/jvm.py delete mode 100644 wakatime/packages/py3/pygments/lexers/make.py delete mode 100644 wakatime/packages/py3/pygments/lexers/markup.py delete mode 100644 wakatime/packages/py3/pygments/lexers/matlab.py delete mode 100644 wakatime/packages/py3/pygments/lexers/modeling.py delete mode 100644 wakatime/packages/py3/pygments/lexers/nimrod.py delete mode 100644 wakatime/packages/py3/pygments/lexers/nit.py delete mode 100644 wakatime/packages/py3/pygments/lexers/nix.py delete mode 100644 wakatime/packages/py3/pygments/lexers/objective.py delete mode 100644 wakatime/packages/py3/pygments/lexers/ooc.py delete mode 100644 wakatime/packages/py3/pygments/lexers/pascal.py delete mode 100644 wakatime/packages/py3/pygments/lexers/perl.py delete mode 100644 wakatime/packages/py3/pygments/lexers/prolog.py delete mode 100644 wakatime/packages/py3/pygments/lexers/rdf.py delete mode 100644 wakatime/packages/py3/pygments/lexers/resource.py delete mode 100644 wakatime/packages/py3/pygments/lexers/robotframework.py delete mode 100644 wakatime/packages/py3/pygments/lexers/ruby.py delete mode 100644 wakatime/packages/py3/pygments/lexers/rust.py delete mode 100644 wakatime/packages/py3/pygments/lexers/scripting.py delete mode 100644 wakatime/packages/py3/pygments/lexers/shell.py delete mode 100644 wakatime/packages/py3/pygments/lexers/sql.py delete mode 100644 wakatime/packages/py3/pygments/lexers/testing.py delete mode 100644 wakatime/packages/py3/pygments/lexers/theorem.py delete mode 100644 wakatime/packages/py3/pygments/lexers/urbi.py delete mode 100644 wakatime/packages/py3/pygments/lexers/web.py delete mode 100644 wakatime/packages/py3/pygments/lexers/webmisc.py delete mode 100644 wakatime/packages/py3/pygments/modeline.py delete mode 100644 wakatime/packages/py3/pygments/plugin.py delete mode 100644 wakatime/packages/py3/pygments/regexopt.py delete mode 100644 wakatime/packages/py3/pygments/scanner.py delete mode 100644 wakatime/packages/py3/pygments/styles/borland.py delete mode 100644 wakatime/packages/py3/pygments/styles/colorful.py delete mode 100644 wakatime/packages/py3/pygments/styles/emacs.py delete mode 100644 wakatime/packages/py3/pygments/styles/fruity.py delete mode 100644 wakatime/packages/py3/pygments/styles/igor.py delete mode 100644 wakatime/packages/py3/pygments/styles/manni.py delete mode 100644 wakatime/packages/py3/pygments/styles/murphy.py delete mode 100644 wakatime/packages/py3/pygments/styles/native.py delete mode 100644 wakatime/packages/py3/pygments/styles/rrt.py delete mode 100644 wakatime/packages/py3/pygments/styles/tango.py delete mode 100644 wakatime/packages/py3/pygments/styles/vim.py delete mode 100644 wakatime/packages/py3/pygments/styles/xcode.py delete mode 100644 wakatime/packages/py3/pygments/util.py rename wakatime/packages/{py2 => }/pygments/__init__.py (82%) rename wakatime/packages/{py2 => }/pygments/cmdline.py (81%) rename wakatime/packages/{py3 => }/pygments/console.py (96%) rename wakatime/packages/{py3 => }/pygments/filter.py (92%) rename wakatime/packages/{py3 => }/pygments/filters/__init__.py (99%) rename wakatime/packages/{py3 => }/pygments/formatter.py (97%) rename wakatime/packages/{py3 => }/pygments/formatters/__init__.py (94%) rename wakatime/packages/{py3 => }/pygments/formatters/_mapping.py (83%) mode change 100644 => 100755 rename wakatime/packages/{py2 => }/pygments/formatters/bbcode.py (98%) rename wakatime/packages/{py2 => }/pygments/formatters/html.py (91%) rename wakatime/packages/{py3 => }/pygments/formatters/img.py (96%) rename wakatime/packages/{py2/pygments/formatters/terminal.py => pygments/formatters/irc.py} (69%) rename wakatime/packages/{py2 => }/pygments/formatters/latex.py (95%) rename wakatime/packages/{py3 => }/pygments/formatters/other.py (98%) rename wakatime/packages/{py3 => }/pygments/formatters/rtf.py (98%) rename wakatime/packages/{py2 => }/pygments/formatters/svg.py (98%) rename wakatime/packages/{py3 => }/pygments/formatters/terminal.py (68%) rename wakatime/packages/{py3 => }/pygments/formatters/terminal256.py (78%) rename wakatime/packages/{py2 => }/pygments/lexer.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/__init__.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/_asy_builtins.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/_cl_builtins.py (99%) create mode 100644 wakatime/packages/pygments/lexers/_cocoa_builtins.py create mode 100644 wakatime/packages/pygments/lexers/_csound_builtins.py rename wakatime/packages/{py2 => }/pygments/lexers/_lasso_builtins.py (96%) rename wakatime/packages/{py3 => }/pygments/lexers/_lua_builtins.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/_mapping.py (87%) rename wakatime/packages/{py3 => }/pygments/lexers/_mql_builtins.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/_openedge_builtins.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/_php_builtins.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/_postgres_builtins.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/_scilab_builtins.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/_sourcemod_builtins.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/_stan_builtins.py (90%) rename wakatime/packages/{py2 => }/pygments/lexers/_vim_builtins.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/actionscript.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/agile.py (92%) rename wakatime/packages/{py3 => }/pygments/lexers/algebra.py (83%) rename wakatime/packages/{py2 => }/pygments/lexers/ambient.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/apl.py (97%) create mode 100644 wakatime/packages/pygments/lexers/archetype.py rename wakatime/packages/{py3 => }/pygments/lexers/asm.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/automation.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/basic.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/business.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/c_cpp.py (80%) rename wakatime/packages/{py3 => }/pygments/lexers/c_like.py (68%) rename wakatime/packages/{py3 => }/pygments/lexers/chapel.py (83%) rename wakatime/packages/{py3 => }/pygments/lexers/compiled.py (95%) rename wakatime/packages/{py2 => }/pygments/lexers/configs.py (70%) rename wakatime/packages/{py3 => }/pygments/lexers/console.py (96%) create mode 100644 wakatime/packages/pygments/lexers/csound.py rename wakatime/packages/{py3 => }/pygments/lexers/css.py (96%) rename wakatime/packages/{py2 => }/pygments/lexers/d.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/dalvik.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/data.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/diff.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/dotnet.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/dsls.py (67%) rename wakatime/packages/{py2 => }/pygments/lexers/dylan.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/ecl.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/eiffel.py (97%) create mode 100644 wakatime/packages/pygments/lexers/elm.py rename wakatime/packages/{py2 => }/pygments/lexers/erlang.py (99%) create mode 100644 wakatime/packages/pygments/lexers/esoteric.py create mode 100644 wakatime/packages/pygments/lexers/ezhil.py rename wakatime/packages/{py3 => }/pygments/lexers/factor.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/fantom.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/felix.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/fortran.py (78%) rename wakatime/packages/{py2 => }/pygments/lexers/foxpro.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/functional.py (86%) rename wakatime/packages/{py3 => }/pygments/lexers/go.py (98%) create mode 100644 wakatime/packages/pygments/lexers/grammar_notation.py rename wakatime/packages/{py3 => }/pygments/lexers/graph.py (94%) rename wakatime/packages/{py3 => }/pygments/lexers/graphics.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/haskell.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/haxe.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/hdl.py (95%) create mode 100644 wakatime/packages/pygments/lexers/hexdump.py rename wakatime/packages/{py3 => }/pygments/lexers/html.py (94%) rename wakatime/packages/{py3 => }/pygments/lexers/idl.py (96%) rename wakatime/packages/{py2 => }/pygments/lexers/igor.py (96%) rename wakatime/packages/{py3 => }/pygments/lexers/inferno.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/installers.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/int_fiction.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/iolang.py (96%) create mode 100644 wakatime/packages/pygments/lexers/j.py rename wakatime/packages/{py3 => }/pygments/lexers/javascript.py (81%) rename wakatime/packages/{py2 => }/pygments/lexers/julia.py (84%) rename wakatime/packages/{py2 => }/pygments/lexers/jvm.py (96%) rename wakatime/packages/{py3 => }/pygments/lexers/lisp.py (62%) rename wakatime/packages/{py2 => }/pygments/lexers/make.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/markup.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/math.py (90%) rename wakatime/packages/{py2 => }/pygments/lexers/matlab.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/ml.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/modeling.py (98%) create mode 100644 wakatime/packages/pygments/lexers/modula2.py rename wakatime/packages/{py2 => }/pygments/lexers/nimrod.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/nit.py (97%) rename wakatime/packages/{py2 => }/pygments/lexers/nix.py (98%) create mode 100644 wakatime/packages/pygments/lexers/oberon.py rename wakatime/packages/{py2 => }/pygments/lexers/objective.py (67%) rename wakatime/packages/{py2 => }/pygments/lexers/ooc.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/other.py (96%) create mode 100644 wakatime/packages/pygments/lexers/parasail.py rename wakatime/packages/{py3 => }/pygments/lexers/parsers.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/pascal.py (79%) rename wakatime/packages/{py3 => }/pygments/lexers/pawn.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/perl.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/php.py (99%) create mode 100644 wakatime/packages/pygments/lexers/praat.py rename wakatime/packages/{py2 => }/pygments/lexers/prolog.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/python.py (89%) create mode 100644 wakatime/packages/pygments/lexers/qvt.py rename wakatime/packages/{py3 => }/pygments/lexers/r.py (99%) create mode 100644 wakatime/packages/pygments/lexers/rdf.py rename wakatime/packages/{py3 => }/pygments/lexers/rebol.py (99%) rename wakatime/packages/{py2 => }/pygments/lexers/resource.py (97%) create mode 100644 wakatime/packages/pygments/lexers/roboconf.py rename wakatime/packages/{py2 => }/pygments/lexers/robotframework.py (95%) rename wakatime/packages/{py2 => }/pygments/lexers/ruby.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/rust.py (54%) rename wakatime/packages/{py2 => }/pygments/lexers/scripting.py (80%) create mode 100644 wakatime/packages/pygments/lexers/shell.py rename wakatime/packages/{py3 => }/pygments/lexers/smalltalk.py (99%) rename wakatime/packages/{py3 => }/pygments/lexers/snobol.py (97%) rename wakatime/packages/{py3 => }/pygments/lexers/special.py (97%) rename wakatime/packages/{py2 => }/pygments/lexers/sql.py (96%) create mode 100644 wakatime/packages/pygments/lexers/supercollider.py rename wakatime/packages/{py3 => }/pygments/lexers/tcl.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/templates.py (98%) create mode 100644 wakatime/packages/pygments/lexers/testing.py rename wakatime/packages/{py3 => }/pygments/lexers/text.py (93%) rename wakatime/packages/{py3 => }/pygments/lexers/textedit.py (98%) rename wakatime/packages/{py3 => }/pygments/lexers/textfmts.py (96%) rename wakatime/packages/{py2 => }/pygments/lexers/theorem.py (91%) create mode 100644 wakatime/packages/pygments/lexers/trafficscript.py rename wakatime/packages/{py2 => }/pygments/lexers/urbi.py (98%) rename wakatime/packages/{py2 => }/pygments/lexers/web.py (93%) rename wakatime/packages/{py2 => }/pygments/lexers/webmisc.py (85%) create mode 100644 wakatime/packages/pygments/lexers/x10.py rename wakatime/packages/{py2 => }/pygments/modeline.py (93%) rename wakatime/packages/{py2 => }/pygments/plugin.py (96%) rename wakatime/packages/{py2 => }/pygments/regexopt.py (97%) rename wakatime/packages/{py2 => }/pygments/scanner.py (97%) rename wakatime/packages/{py3 => }/pygments/sphinxext.py (93%) rename wakatime/packages/{py3 => }/pygments/style.py (97%) rename wakatime/packages/{py3 => }/pygments/styles/__init__.py (92%) create mode 100644 wakatime/packages/pygments/styles/algol.py create mode 100644 wakatime/packages/pygments/styles/algol_nu.py create mode 100644 wakatime/packages/pygments/styles/arduino.py rename wakatime/packages/{py3 => }/pygments/styles/autumn.py (97%) rename wakatime/packages/{py2 => }/pygments/styles/borland.py (95%) rename wakatime/packages/{py3 => }/pygments/styles/bw.py (95%) rename wakatime/packages/{py2 => }/pygments/styles/colorful.py (97%) rename wakatime/packages/{py3 => }/pygments/styles/default.py (97%) rename wakatime/packages/{py2 => }/pygments/styles/emacs.py (97%) rename wakatime/packages/{py3 => }/pygments/styles/friendly.py (97%) rename wakatime/packages/{py2 => }/pygments/styles/fruity.py (95%) rename wakatime/packages/{py2 => }/pygments/styles/igor.py (91%) create mode 100644 wakatime/packages/pygments/styles/lovelace.py rename wakatime/packages/{py2 => }/pygments/styles/manni.py (97%) rename wakatime/packages/{py3 => }/pygments/styles/monokai.py (98%) rename wakatime/packages/{py2 => }/pygments/styles/murphy.py (97%) rename wakatime/packages/{py2 => }/pygments/styles/native.py (96%) rename wakatime/packages/{py3 => }/pygments/styles/paraiso_dark.py (98%) rename wakatime/packages/{py3 => }/pygments/styles/paraiso_light.py (98%) rename wakatime/packages/{py3 => }/pygments/styles/pastie.py (97%) rename wakatime/packages/{py3 => }/pygments/styles/perldoc.py (97%) rename wakatime/packages/{py2 => }/pygments/styles/rrt.py (92%) rename wakatime/packages/{py2 => }/pygments/styles/tango.py (99%) rename wakatime/packages/{py3 => }/pygments/styles/trac.py (96%) rename wakatime/packages/{py2 => }/pygments/styles/vim.py (96%) rename wakatime/packages/{py3 => }/pygments/styles/vs.py (94%) rename wakatime/packages/{py2 => }/pygments/styles/xcode.py (95%) rename wakatime/packages/{py3 => }/pygments/token.py (94%) rename wakatime/packages/{py3 => }/pygments/unistring.py (99%) rename wakatime/packages/{py2 => }/pygments/util.py (93%) diff --git a/tests/test_dependencies.py b/tests/test_dependencies.py index e3275f7..df3c476 100644 --- a/tests/test_dependencies.py +++ b/tests/test_dependencies.py @@ -149,7 +149,6 @@ class DependenciesTestCase(utils.TestCase): 'pygments', 'simplejson', 'sqlalchemy', - 'sys', 'unittest', ] diff --git a/wakatime/dependencies/c_cpp.py b/wakatime/dependencies/c_cpp.py index ec62be0..8729743 100644 --- a/wakatime/dependencies/c_cpp.py +++ b/wakatime/dependencies/c_cpp.py @@ -12,34 +12,6 @@ from . import TokenParser -class CppParser(TokenParser): - exclude = [ - r'^stdio\.h$', - r'^stdlib\.h$', - r'^string\.h$', - r'^time\.h$', - ] - - def parse(self): - for index, token, content in self.tokens: - self._process_token(token, content) - return self.dependencies - - def _process_token(self, token, content): - if self.partial(token) == 'Preproc': - self._process_preproc(token, content) - else: - self._process_other(token, content) - - def _process_preproc(self, token, content): - if content.strip().startswith('include ') or content.strip().startswith("include\t"): - content = content.replace('include', '', 1).strip().strip('"').strip('<').strip('>').strip() - self.append(content) - - def _process_other(self, token, content): - pass - - class CParser(TokenParser): exclude = [ r'^stdio\.h$', @@ -47,6 +19,7 @@ class CParser(TokenParser): r'^string\.h$', r'^time\.h$', ] + state = None def parse(self): for index, token, content in self.tokens: @@ -54,15 +27,25 @@ class CParser(TokenParser): return self.dependencies def _process_token(self, token, content): - if self.partial(token) == 'Preproc': + if self.partial(token) == 'Preproc' or self.partial(token) == 'PreprocFile': self._process_preproc(token, content) else: self._process_other(token, content) def _process_preproc(self, token, content): - if content.strip().startswith('include ') or content.strip().startswith("include\t"): - content = content.replace('include', '', 1).strip().strip('"').strip('<').strip('>').strip() - self.append(content) + if self.state == 'include': + if content != '\n' and content != '#': + content = content.strip().strip('"').strip('<').strip('>').strip() + self.append(content, truncate=True, separator='/') + self.state = None + elif content.strip().startswith('include'): + self.state = 'include' + else: + self.state = None def _process_other(self, token, content): pass + + +class CppParser(CParser): + pass diff --git a/wakatime/dependencies/python.py b/wakatime/dependencies/python.py index 65e9e47..97734df 100644 --- a/wakatime/dependencies/python.py +++ b/wakatime/dependencies/python.py @@ -18,6 +18,7 @@ class PythonParser(TokenParser): nonpackage = False exclude = [ r'^os$', + r'^sys$', r'^sys\.', ] diff --git a/wakatime/dependencies/templates.py b/wakatime/dependencies/templates.py index 2ba605e..24f35b2 100644 --- a/wakatime/dependencies/templates.py +++ b/wakatime/dependencies/templates.py @@ -71,6 +71,7 @@ KEYWORDS = [ class HtmlDjangoParser(TokenParser): tags = [] + opening_tag = False getting_attrs = False current_attr = None current_attr_value = None @@ -81,7 +82,9 @@ class HtmlDjangoParser(TokenParser): return self.dependencies def _process_token(self, token, content): - if u(token) == 'Token.Name.Tag': + if u(token) == 'Token.Punctuation': + self._process_punctuation(token, content) + elif u(token) == 'Token.Name.Tag': self._process_tag(token, content) elif u(token) == 'Token.Literal.String': self._process_string(token, content) @@ -92,18 +95,27 @@ class HtmlDjangoParser(TokenParser): def current_tag(self): return None if len(self.tags) == 0 else self.tags[0] - def _process_tag(self, token, content): + def _process_punctuation(self, token, content): if content.startswith(''): + self.opening_tag = False + self.getting_attrs = False + + def _process_tag(self, token, content): + if self.opening_tag: self.tags.insert(0, content.replace('<', '', 1).strip().lower()) self.getting_attrs = True elif content.startswith('>'): + self.opening_tag = False self.getting_attrs = False self.current_attr = None diff --git a/wakatime/packages/py2/pygments/console.py b/wakatime/packages/py2/pygments/console.py deleted file mode 100644 index d93f6a9..0000000 --- a/wakatime/packages/py2/pygments/console.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.console - ~~~~~~~~~~~~~~~~ - - Format colored console output. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -esc = "\x1b[" - -codes = {} -codes[""] = "" -codes["reset"] = esc + "39;49;00m" - -codes["bold"] = esc + "01m" -codes["faint"] = esc + "02m" -codes["standout"] = esc + "03m" -codes["underline"] = esc + "04m" -codes["blink"] = esc + "05m" -codes["overline"] = esc + "06m" - -dark_colors = ["black", "darkred", "darkgreen", "brown", "darkblue", - "purple", "teal", "lightgray"] -light_colors = ["darkgray", "red", "green", "yellow", "blue", - "fuchsia", "turquoise", "white"] - -x = 30 -for d, l in zip(dark_colors, light_colors): - codes[d] = esc + "%im" % x - codes[l] = esc + "%i;01m" % x - x += 1 - -del d, l, x - -codes["darkteal"] = codes["turquoise"] -codes["darkyellow"] = codes["brown"] -codes["fuscia"] = codes["fuchsia"] -codes["white"] = codes["bold"] - - -def reset_color(): - return codes["reset"] - - -def colorize(color_key, text): - return codes[color_key] + text + codes["reset"] - - -def ansiformat(attr, text): - """ - Format ``text`` with a color and/or some attributes:: - - color normal color - *color* bold color - _color_ underlined color - +color+ blinking color - """ - result = [] - if attr[:1] == attr[-1:] == '+': - result.append(codes['blink']) - attr = attr[1:-1] - if attr[:1] == attr[-1:] == '*': - result.append(codes['bold']) - attr = attr[1:-1] - if attr[:1] == attr[-1:] == '_': - result.append(codes['underline']) - attr = attr[1:-1] - result.append(codes[attr]) - result.append(text) - result.append(codes['reset']) - return ''.join(result) diff --git a/wakatime/packages/py2/pygments/filter.py b/wakatime/packages/py2/pygments/filter.py deleted file mode 100644 index 092ef33..0000000 --- a/wakatime/packages/py2/pygments/filter.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.filter - ~~~~~~~~~~~~~~~ - - Module that implements the default filter. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - - -def apply_filters(stream, filters, lexer=None): - """ - Use this method to apply an iterable of filters to - a stream. If lexer is given it's forwarded to the - filter, otherwise the filter receives `None`. - """ - def _apply(filter_, stream): - for token in filter_.filter(lexer, stream): - yield token - for filter_ in filters: - stream = _apply(filter_, stream) - return stream - - -def simplefilter(f): - """ - Decorator that converts a function into a filter:: - - @simplefilter - def lowercase(lexer, stream, options): - for ttype, value in stream: - yield ttype, value.lower() - """ - return type(f.__name__, (FunctionFilter,), { - 'function': f, - '__module__': getattr(f, '__module__'), - '__doc__': f.__doc__ - }) - - -class Filter(object): - """ - Default filter. Subclass this class or use the `simplefilter` - decorator to create own filters. - """ - - def __init__(self, **options): - self.options = options - - def filter(self, lexer, stream): - raise NotImplementedError() - - -class FunctionFilter(Filter): - """ - Abstract class used by `simplefilter` to create simple - function filters on the fly. The `simplefilter` decorator - automatically creates subclasses of this class for - functions passed to it. - """ - function = None - - def __init__(self, **options): - if not hasattr(self, 'function'): - raise TypeError('%r used without bound function' % - self.__class__.__name__) - Filter.__init__(self, **options) - - def filter(self, lexer, stream): - # pylint: disable-msg=E1102 - for ttype, value in self.function(lexer, stream, self.options): - yield ttype, value diff --git a/wakatime/packages/py2/pygments/filters/__init__.py b/wakatime/packages/py2/pygments/filters/__init__.py deleted file mode 100644 index 2685c78..0000000 --- a/wakatime/packages/py2/pygments/filters/__init__.py +++ /dev/null @@ -1,350 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.filters - ~~~~~~~~~~~~~~~~ - - Module containing filter lookup functions and default - filters. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \ - string_to_tokentype -from pygments.filter import Filter -from pygments.util import get_list_opt, get_int_opt, get_bool_opt, \ - get_choice_opt, ClassNotFound, OptionError, text_type, string_types -from pygments.plugin import find_plugin_filters - - -def find_filter_class(filtername): - """Lookup a filter by name. Return None if not found.""" - if filtername in FILTERS: - return FILTERS[filtername] - for name, cls in find_plugin_filters(): - if name == filtername: - return cls - return None - - -def get_filter_by_name(filtername, **options): - """Return an instantiated filter. - - Options are passed to the filter initializer if wanted. - Raise a ClassNotFound if not found. - """ - cls = find_filter_class(filtername) - if cls: - return cls(**options) - else: - raise ClassNotFound('filter %r not found' % filtername) - - -def get_all_filters(): - """Return a generator of all filter names.""" - for name in FILTERS: - yield name - for name, _ in find_plugin_filters(): - yield name - - -def _replace_special(ttype, value, regex, specialttype, - replacefunc=lambda x: x): - last = 0 - for match in regex.finditer(value): - start, end = match.start(), match.end() - if start != last: - yield ttype, value[last:start] - yield specialttype, replacefunc(value[start:end]) - last = end - if last != len(value): - yield ttype, value[last:] - - -class CodeTagFilter(Filter): - """Highlight special code tags in comments and docstrings. - - Options accepted: - - `codetags` : list of strings - A list of strings that are flagged as code tags. The default is to - highlight ``XXX``, ``TODO``, ``BUG`` and ``NOTE``. - """ - - def __init__(self, **options): - Filter.__init__(self, **options) - tags = get_list_opt(options, 'codetags', - ['XXX', 'TODO', 'BUG', 'NOTE']) - self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([ - re.escape(tag) for tag in tags if tag - ])) - - def filter(self, lexer, stream): - regex = self.tag_re - for ttype, value in stream: - if ttype in String.Doc or \ - ttype in Comment and \ - ttype not in Comment.Preproc: - for sttype, svalue in _replace_special(ttype, value, regex, - Comment.Special): - yield sttype, svalue - else: - yield ttype, value - - -class KeywordCaseFilter(Filter): - """Convert keywords to lowercase or uppercase or capitalize them, which - means first letter uppercase, rest lowercase. - - This can be useful e.g. if you highlight Pascal code and want to adapt the - code to your styleguide. - - Options accepted: - - `case` : string - The casing to convert keywords to. Must be one of ``'lower'``, - ``'upper'`` or ``'capitalize'``. The default is ``'lower'``. - """ - - def __init__(self, **options): - Filter.__init__(self, **options) - case = get_choice_opt(options, 'case', - ['lower', 'upper', 'capitalize'], 'lower') - self.convert = getattr(text_type, case) - - def filter(self, lexer, stream): - for ttype, value in stream: - if ttype in Keyword: - yield ttype, self.convert(value) - else: - yield ttype, value - - -class NameHighlightFilter(Filter): - """Highlight a normal Name (and Name.*) token with a different token type. - - Example:: - - filter = NameHighlightFilter( - names=['foo', 'bar', 'baz'], - tokentype=Name.Function, - ) - - This would highlight the names "foo", "bar" and "baz" - as functions. `Name.Function` is the default token type. - - Options accepted: - - `names` : list of strings - A list of names that should be given the different token type. - There is no default. - `tokentype` : TokenType or string - A token type or a string containing a token type name that is - used for highlighting the strings in `names`. The default is - `Name.Function`. - """ - - def __init__(self, **options): - Filter.__init__(self, **options) - self.names = set(get_list_opt(options, 'names', [])) - tokentype = options.get('tokentype') - if tokentype: - self.tokentype = string_to_tokentype(tokentype) - else: - self.tokentype = Name.Function - - def filter(self, lexer, stream): - for ttype, value in stream: - if ttype in Name and value in self.names: - yield self.tokentype, value - else: - yield ttype, value - - -class ErrorToken(Exception): - pass - - -class RaiseOnErrorTokenFilter(Filter): - """Raise an exception when the lexer generates an error token. - - Options accepted: - - `excclass` : Exception class - The exception class to raise. - The default is `pygments.filters.ErrorToken`. - - .. versionadded:: 0.8 - """ - - def __init__(self, **options): - Filter.__init__(self, **options) - self.exception = options.get('excclass', ErrorToken) - try: - # issubclass() will raise TypeError if first argument is not a class - if not issubclass(self.exception, Exception): - raise TypeError - except TypeError: - raise OptionError('excclass option is not an exception class') - - def filter(self, lexer, stream): - for ttype, value in stream: - if ttype is Error: - raise self.exception(value) - yield ttype, value - - -class VisibleWhitespaceFilter(Filter): - """Convert tabs, newlines and/or spaces to visible characters. - - Options accepted: - - `spaces` : string or bool - If this is a one-character string, spaces will be replaces by this string. - If it is another true value, spaces will be replaced by ``·`` (unicode - MIDDLE DOT). If it is a false value, spaces will not be replaced. The - default is ``False``. - `tabs` : string or bool - The same as for `spaces`, but the default replacement character is ``»`` - (unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK). The default value - is ``False``. Note: this will not work if the `tabsize` option for the - lexer is nonzero, as tabs will already have been expanded then. - `tabsize` : int - If tabs are to be replaced by this filter (see the `tabs` option), this - is the total number of characters that a tab should be expanded to. - The default is ``8``. - `newlines` : string or bool - The same as for `spaces`, but the default replacement character is ``¶`` - (unicode PILCROW SIGN). The default value is ``False``. - `wstokentype` : bool - If true, give whitespace the special `Whitespace` token type. This allows - styling the visible whitespace differently (e.g. greyed out), but it can - disrupt background colors. The default is ``True``. - - .. versionadded:: 0.8 - """ - - def __init__(self, **options): - Filter.__init__(self, **options) - for name, default in [('spaces', u'·'), - ('tabs', u'»'), - ('newlines', u'¶')]: - opt = options.get(name, False) - if isinstance(opt, string_types) and len(opt) == 1: - setattr(self, name, opt) - else: - setattr(self, name, (opt and default or '')) - tabsize = get_int_opt(options, 'tabsize', 8) - if self.tabs: - self.tabs += ' ' * (tabsize - 1) - if self.newlines: - self.newlines += '\n' - self.wstt = get_bool_opt(options, 'wstokentype', True) - - def filter(self, lexer, stream): - if self.wstt: - spaces = self.spaces or u' ' - tabs = self.tabs or u'\t' - newlines = self.newlines or u'\n' - regex = re.compile(r'\s') - def replacefunc(wschar): - if wschar == ' ': - return spaces - elif wschar == '\t': - return tabs - elif wschar == '\n': - return newlines - return wschar - - for ttype, value in stream: - for sttype, svalue in _replace_special(ttype, value, regex, - Whitespace, replacefunc): - yield sttype, svalue - else: - spaces, tabs, newlines = self.spaces, self.tabs, self.newlines - # simpler processing - for ttype, value in stream: - if spaces: - value = value.replace(' ', spaces) - if tabs: - value = value.replace('\t', tabs) - if newlines: - value = value.replace('\n', newlines) - yield ttype, value - - -class GobbleFilter(Filter): - """Gobbles source code lines (eats initial characters). - - This filter drops the first ``n`` characters off every line of code. This - may be useful when the source code fed to the lexer is indented by a fixed - amount of space that isn't desired in the output. - - Options accepted: - - `n` : int - The number of characters to gobble. - - .. versionadded:: 1.2 - """ - def __init__(self, **options): - Filter.__init__(self, **options) - self.n = get_int_opt(options, 'n', 0) - - def gobble(self, value, left): - if left < len(value): - return value[left:], 0 - else: - return u'', left - len(value) - - def filter(self, lexer, stream): - n = self.n - left = n # How many characters left to gobble. - for ttype, value in stream: - # Remove ``left`` tokens from first line, ``n`` from all others. - parts = value.split('\n') - (parts[0], left) = self.gobble(parts[0], left) - for i in range(1, len(parts)): - (parts[i], left) = self.gobble(parts[i], n) - value = u'\n'.join(parts) - - if value != '': - yield ttype, value - - -class TokenMergeFilter(Filter): - """Merges consecutive tokens with the same token type in the output - stream of a lexer. - - .. versionadded:: 1.2 - """ - def __init__(self, **options): - Filter.__init__(self, **options) - - def filter(self, lexer, stream): - current_type = None - current_value = None - for ttype, value in stream: - if ttype is current_type: - current_value += value - else: - if current_type is not None: - yield current_type, current_value - current_type = ttype - current_value = value - if current_type is not None: - yield current_type, current_value - - -FILTERS = { - 'codetagify': CodeTagFilter, - 'keywordcase': KeywordCaseFilter, - 'highlight': NameHighlightFilter, - 'raiseonerror': RaiseOnErrorTokenFilter, - 'whitespace': VisibleWhitespaceFilter, - 'gobble': GobbleFilter, - 'tokenmerge': TokenMergeFilter, -} diff --git a/wakatime/packages/py2/pygments/formatter.py b/wakatime/packages/py2/pygments/formatter.py deleted file mode 100644 index 8682138..0000000 --- a/wakatime/packages/py2/pygments/formatter.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatter - ~~~~~~~~~~~~~~~~~~ - - Base formatter class. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import codecs - -from pygments.util import get_bool_opt, string_types -from pygments.styles import get_style_by_name - -__all__ = ['Formatter'] - - -def _lookup_style(style): - if isinstance(style, string_types): - return get_style_by_name(style) - return style - - -class Formatter(object): - """ - Converts a token stream to text. - - Options accepted: - - ``style`` - The style to use, can be a string or a Style subclass - (default: "default"). Not used by e.g. the - TerminalFormatter. - ``full`` - Tells the formatter to output a "full" document, i.e. - a complete self-contained document. This doesn't have - any effect for some formatters (default: false). - ``title`` - If ``full`` is true, the title that should be used to - caption the document (default: ''). - ``encoding`` - If given, must be an encoding name. This will be used to - convert the Unicode token strings to byte strings in the - output. If it is "" or None, Unicode strings will be written - to the output file, which most file-like objects do not - support (default: None). - ``outencoding`` - Overrides ``encoding`` if given. - """ - - #: Name of the formatter - name = None - - #: Shortcuts for the formatter - aliases = [] - - #: fn match rules - filenames = [] - - #: If True, this formatter outputs Unicode strings when no encoding - #: option is given. - unicodeoutput = True - - def __init__(self, **options): - self.style = _lookup_style(options.get('style', 'default')) - self.full = get_bool_opt(options, 'full', False) - self.title = options.get('title', '') - self.encoding = options.get('encoding', None) or None - if self.encoding in ('guess', 'chardet'): - # can happen for e.g. pygmentize -O encoding=guess - self.encoding = 'utf-8' - self.encoding = options.get('outencoding') or self.encoding - self.options = options - - def get_style_defs(self, arg=''): - """ - Return the style definitions for the current style as a string. - - ``arg`` is an additional argument whose meaning depends on the - formatter used. Note that ``arg`` can also be a list or tuple - for some formatters like the html formatter. - """ - return '' - - def format(self, tokensource, outfile): - """ - Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` - tuples and write it into ``outfile``. - """ - if self.encoding: - # wrap the outfile in a StreamWriter - outfile = codecs.lookup(self.encoding)[3](outfile) - return self.format_unencoded(tokensource, outfile) diff --git a/wakatime/packages/py2/pygments/formatters/__init__.py b/wakatime/packages/py2/pygments/formatters/__init__.py deleted file mode 100644 index 45ceaff..0000000 --- a/wakatime/packages/py2/pygments/formatters/__init__.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters - ~~~~~~~~~~~~~~~~~~~ - - Pygments formatters. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re -import sys -import types -import fnmatch -from os.path import basename - -from pygments.formatters._mapping import FORMATTERS -from pygments.plugin import find_plugin_formatters -from pygments.util import ClassNotFound, itervalues - -__all__ = ['get_formatter_by_name', 'get_formatter_for_filename', - 'get_all_formatters'] + list(FORMATTERS) - -_formatter_cache = {} # classes by name -_pattern_cache = {} - - -def _fn_matches(fn, glob): - """Return whether the supplied file name fn matches pattern filename.""" - if glob not in _pattern_cache: - pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob)) - return pattern.match(fn) - return _pattern_cache[glob].match(fn) - - -def _load_formatters(module_name): - """Load a formatter (and all others in the module too).""" - mod = __import__(module_name, None, None, ['__all__']) - for formatter_name in mod.__all__: - cls = getattr(mod, formatter_name) - _formatter_cache[cls.name] = cls - - -def get_all_formatters(): - """Return a generator for all formatter classes.""" - # NB: this returns formatter classes, not info like get_all_lexers(). - for info in itervalues(FORMATTERS): - if info[1] not in _formatter_cache: - _load_formatters(info[0]) - yield _formatter_cache[info[1]] - for _, formatter in find_plugin_formatters(): - yield formatter - - -def find_formatter_class(alias): - """Lookup a formatter by alias. - - Returns None if not found. - """ - for module_name, name, aliases, _, _ in itervalues(FORMATTERS): - if alias in aliases: - if name not in _formatter_cache: - _load_formatters(module_name) - return _formatter_cache[name] - for _, cls in find_plugin_formatters(): - if alias in cls.aliases: - return cls - - -def get_formatter_by_name(_alias, **options): - """Lookup and instantiate a formatter by alias. - - Raises ClassNotFound if not found. - """ - cls = find_formatter_class(_alias) - if cls is None: - raise ClassNotFound("No formatter found for name %r" % _alias) - return cls(**options) - - -def get_formatter_for_filename(fn, **options): - """Lookup and instantiate a formatter by filename pattern. - - Raises ClassNotFound if not found. - """ - fn = basename(fn) - for modname, name, _, filenames, _ in itervalues(FORMATTERS): - for filename in filenames: - if _fn_matches(fn, filename): - if name not in _formatter_cache: - _load_formatters(modname) - return _formatter_cache[name](**options) - for cls in find_plugin_formatters(): - for filename in cls.filenames: - if _fn_matches(fn, filename): - return cls(**options) - raise ClassNotFound("No formatter found for file name %r" % fn) - - -class _automodule(types.ModuleType): - """Automatically import formatters.""" - - def __getattr__(self, name): - info = FORMATTERS.get(name) - if info: - _load_formatters(info[0]) - cls = _formatter_cache[info[1]] - setattr(self, name, cls) - return cls - raise AttributeError(name) - - -oldmod = sys.modules[__name__] -newmod = _automodule(__name__) -newmod.__dict__.update(oldmod.__dict__) -sys.modules[__name__] = newmod -del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types diff --git a/wakatime/packages/py2/pygments/formatters/_mapping.py b/wakatime/packages/py2/pygments/formatters/_mapping.py deleted file mode 100644 index 36ae9dc..0000000 --- a/wakatime/packages/py2/pygments/formatters/_mapping.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters._mapping - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Formatter mapping definitions. This file is generated by itself. Everytime - you change something on a builtin formatter definition, run this script from - the formatters folder to update it. - - Do not alter the FORMATTERS dictionary by hand. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from __future__ import print_function - -FORMATTERS = { - 'BBCodeFormatter': ('pygments.formatters.bbcode', 'BBCode', ('bbcode', 'bb'), (), 'Format tokens with BBcodes. These formatting codes are used by many bulletin boards, so you can highlight your sourcecode with pygments before posting it there.'), - 'BmpImageFormatter': ('pygments.formatters.img', 'img_bmp', ('bmp', 'bitmap'), ('*.bmp',), 'Create a bitmap image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'), - 'GifImageFormatter': ('pygments.formatters.img', 'img_gif', ('gif',), ('*.gif',), 'Create a GIF image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'), - 'HtmlFormatter': ('pygments.formatters.html', 'HTML', ('html',), ('*.html', '*.htm'), "Format tokens as HTML 4 ```` tags within a ``
`` tag, wrapped in a ``
`` tag. The ``
``'s CSS class can be set by the `cssclass` option."), - 'ImageFormatter': ('pygments.formatters.img', 'img', ('img', 'IMG', 'png'), ('*.png',), 'Create a PNG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'), - 'JpgImageFormatter': ('pygments.formatters.img', 'img_jpg', ('jpg', 'jpeg'), ('*.jpg',), 'Create a JPEG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'), - 'LatexFormatter': ('pygments.formatters.latex', 'LaTeX', ('latex', 'tex'), ('*.tex',), 'Format tokens as LaTeX code. This needs the `fancyvrb` and `color` standard packages.'), - 'NullFormatter': ('pygments.formatters.other', 'Text only', ('text', 'null'), ('*.txt',), 'Output the text unchanged without any formatting.'), - 'RawTokenFormatter': ('pygments.formatters.other', 'Raw tokens', ('raw', 'tokens'), ('*.raw',), 'Format tokens as a raw representation for storing token streams.'), - 'RtfFormatter': ('pygments.formatters.rtf', 'RTF', ('rtf',), ('*.rtf',), 'Format tokens as RTF markup. This formatter automatically outputs full RTF documents with color information and other useful stuff. Perfect for Copy and Paste into Microsoft(R) Word(R) documents.'), - 'SvgFormatter': ('pygments.formatters.svg', 'SVG', ('svg',), ('*.svg',), 'Format tokens as an SVG graphics file. This formatter is still experimental. Each line of code is a ```` element with explicit ``x`` and ``y`` coordinates containing ```` elements with the individual token styles.'), - 'Terminal256Formatter': ('pygments.formatters.terminal256', 'Terminal256', ('terminal256', 'console256', '256'), (), 'Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'), - 'TerminalFormatter': ('pygments.formatters.terminal', 'Terminal', ('terminal', 'console'), (), 'Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly.'), - 'TestcaseFormatter': ('pygments.formatters.other', 'Testcase', ('testcase',), (), 'Format tokens as appropriate for a new testcase.') -} - -if __name__ == '__main__': - import sys - import os - - # lookup formatters - found_formatters = [] - imports = [] - sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) - from pygments.util import docstring_headline - - for root, dirs, files in os.walk('.'): - for filename in files: - if filename.endswith('.py') and not filename.startswith('_'): - module_name = 'pygments.formatters%s.%s' % ( - root[1:].replace('/', '.'), filename[:-3]) - print(module_name) - module = __import__(module_name, None, None, ['']) - for formatter_name in module.__all__: - formatter = getattr(module, formatter_name) - found_formatters.append( - '%r: %r' % (formatter_name, - (module_name, - formatter.name, - tuple(formatter.aliases), - tuple(formatter.filenames), - docstring_headline(formatter)))) - # sort them to make the diff minimal - found_formatters.sort() - - # extract useful sourcecode from this file - with open(__file__) as fp: - content = fp.read() - header = content[:content.find('FORMATTERS = {')] - footer = content[content.find("if __name__ == '__main__':"):] - - # write new file - with open(__file__, 'w') as fp: - fp.write(header) - fp.write('FORMATTERS = {\n %s\n}\n\n' % ',\n '.join(found_formatters)) - fp.write(footer) - - print ('=== %d formatters processed.' % len(found_formatters)) diff --git a/wakatime/packages/py2/pygments/formatters/img.py b/wakatime/packages/py2/pygments/formatters/img.py deleted file mode 100644 index db5bee3..0000000 --- a/wakatime/packages/py2/pygments/formatters/img.py +++ /dev/null @@ -1,560 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters.img - ~~~~~~~~~~~~~~~~~~~~~~~ - - Formatter for Pixmap output. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import sys - -from pygments.formatter import Formatter -from pygments.util import get_bool_opt, get_int_opt, get_list_opt, \ - get_choice_opt, xrange - -# Import this carefully -try: - from PIL import Image, ImageDraw, ImageFont - pil_available = True -except ImportError: - pil_available = False - -try: - import _winreg -except ImportError: - try: - import winreg as _winreg - except ImportError: - _winreg = None - -__all__ = ['ImageFormatter', 'GifImageFormatter', 'JpgImageFormatter', - 'BmpImageFormatter'] - - -# For some unknown reason every font calls it something different -STYLES = { - 'NORMAL': ['', 'Roman', 'Book', 'Normal', 'Regular', 'Medium'], - 'ITALIC': ['Oblique', 'Italic'], - 'BOLD': ['Bold'], - 'BOLDITALIC': ['Bold Oblique', 'Bold Italic'], -} - -# A sane default for modern systems -DEFAULT_FONT_NAME_NIX = 'Bitstream Vera Sans Mono' -DEFAULT_FONT_NAME_WIN = 'Courier New' - - -class PilNotAvailable(ImportError): - """When Python imaging library is not available""" - - -class FontNotFound(Exception): - """When there are no usable fonts specified""" - - -class FontManager(object): - """ - Manages a set of fonts: normal, italic, bold, etc... - """ - - def __init__(self, font_name, font_size=14): - self.font_name = font_name - self.font_size = font_size - self.fonts = {} - self.encoding = None - if sys.platform.startswith('win'): - if not font_name: - self.font_name = DEFAULT_FONT_NAME_WIN - self._create_win() - else: - if not font_name: - self.font_name = DEFAULT_FONT_NAME_NIX - self._create_nix() - - def _get_nix_font_path(self, name, style): - try: - from commands import getstatusoutput - except ImportError: - from subprocess import getstatusoutput - exit, out = getstatusoutput('fc-list "%s:style=%s" file' % - (name, style)) - if not exit: - lines = out.splitlines() - if lines: - path = lines[0].strip().strip(':') - return path - - def _create_nix(self): - for name in STYLES['NORMAL']: - path = self._get_nix_font_path(self.font_name, name) - if path is not None: - self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size) - break - else: - raise FontNotFound('No usable fonts named: "%s"' % - self.font_name) - for style in ('ITALIC', 'BOLD', 'BOLDITALIC'): - for stylename in STYLES[style]: - path = self._get_nix_font_path(self.font_name, stylename) - if path is not None: - self.fonts[style] = ImageFont.truetype(path, self.font_size) - break - else: - if style == 'BOLDITALIC': - self.fonts[style] = self.fonts['BOLD'] - else: - self.fonts[style] = self.fonts['NORMAL'] - - def _lookup_win(self, key, basename, styles, fail=False): - for suffix in ('', ' (TrueType)'): - for style in styles: - try: - valname = '%s%s%s' % (basename, style and ' '+style, suffix) - val, _ = _winreg.QueryValueEx(key, valname) - return val - except EnvironmentError: - continue - else: - if fail: - raise FontNotFound('Font %s (%s) not found in registry' % - (basename, styles[0])) - return None - - def _create_win(self): - try: - key = _winreg.OpenKey( - _winreg.HKEY_LOCAL_MACHINE, - r'Software\Microsoft\Windows NT\CurrentVersion\Fonts') - except EnvironmentError: - try: - key = _winreg.OpenKey( - _winreg.HKEY_LOCAL_MACHINE, - r'Software\Microsoft\Windows\CurrentVersion\Fonts') - except EnvironmentError: - raise FontNotFound('Can\'t open Windows font registry key') - try: - path = self._lookup_win(key, self.font_name, STYLES['NORMAL'], True) - self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size) - for style in ('ITALIC', 'BOLD', 'BOLDITALIC'): - path = self._lookup_win(key, self.font_name, STYLES[style]) - if path: - self.fonts[style] = ImageFont.truetype(path, self.font_size) - else: - if style == 'BOLDITALIC': - self.fonts[style] = self.fonts['BOLD'] - else: - self.fonts[style] = self.fonts['NORMAL'] - finally: - _winreg.CloseKey(key) - - def get_char_size(self): - """ - Get the character size. - """ - return self.fonts['NORMAL'].getsize('M') - - def get_font(self, bold, oblique): - """ - Get the font based on bold and italic flags. - """ - if bold and oblique: - return self.fonts['BOLDITALIC'] - elif bold: - return self.fonts['BOLD'] - elif oblique: - return self.fonts['ITALIC'] - else: - return self.fonts['NORMAL'] - - -class ImageFormatter(Formatter): - """ - Create a PNG image from source code. This uses the Python Imaging Library to - generate a pixmap from the source code. - - .. versionadded:: 0.10 - - Additional options accepted: - - `image_format` - An image format to output to that is recognised by PIL, these include: - - * "PNG" (default) - * "JPEG" - * "BMP" - * "GIF" - - `line_pad` - The extra spacing (in pixels) between each line of text. - - Default: 2 - - `font_name` - The font name to be used as the base font from which others, such as - bold and italic fonts will be generated. This really should be a - monospace font to look sane. - - Default: "Bitstream Vera Sans Mono" - - `font_size` - The font size in points to be used. - - Default: 14 - - `image_pad` - The padding, in pixels to be used at each edge of the resulting image. - - Default: 10 - - `line_numbers` - Whether line numbers should be shown: True/False - - Default: True - - `line_number_start` - The line number of the first line. - - Default: 1 - - `line_number_step` - The step used when printing line numbers. - - Default: 1 - - `line_number_bg` - The background colour (in "#123456" format) of the line number bar, or - None to use the style background color. - - Default: "#eed" - - `line_number_fg` - The text color of the line numbers (in "#123456"-like format). - - Default: "#886" - - `line_number_chars` - The number of columns of line numbers allowable in the line number - margin. - - Default: 2 - - `line_number_bold` - Whether line numbers will be bold: True/False - - Default: False - - `line_number_italic` - Whether line numbers will be italicized: True/False - - Default: False - - `line_number_separator` - Whether a line will be drawn between the line number area and the - source code area: True/False - - Default: True - - `line_number_pad` - The horizontal padding (in pixels) between the line number margin, and - the source code area. - - Default: 6 - - `hl_lines` - Specify a list of lines to be highlighted. - - .. versionadded:: 1.2 - - Default: empty list - - `hl_color` - Specify the color for highlighting lines. - - .. versionadded:: 1.2 - - Default: highlight color of the selected style - """ - - # Required by the pygments mapper - name = 'img' - aliases = ['img', 'IMG', 'png'] - filenames = ['*.png'] - - unicodeoutput = False - - default_image_format = 'png' - - def __init__(self, **options): - """ - See the class docstring for explanation of options. - """ - if not pil_available: - raise PilNotAvailable( - 'Python Imaging Library is required for this formatter') - Formatter.__init__(self, **options) - self.encoding = 'latin1' # let pygments.format() do the right thing - # Read the style - self.styles = dict(self.style) - if self.style.background_color is None: - self.background_color = '#fff' - else: - self.background_color = self.style.background_color - # Image options - self.image_format = get_choice_opt( - options, 'image_format', ['png', 'jpeg', 'gif', 'bmp'], - self.default_image_format, normcase=True) - self.image_pad = get_int_opt(options, 'image_pad', 10) - self.line_pad = get_int_opt(options, 'line_pad', 2) - # The fonts - fontsize = get_int_opt(options, 'font_size', 14) - self.fonts = FontManager(options.get('font_name', ''), fontsize) - self.fontw, self.fonth = self.fonts.get_char_size() - # Line number options - self.line_number_fg = options.get('line_number_fg', '#886') - self.line_number_bg = options.get('line_number_bg', '#eed') - self.line_number_chars = get_int_opt(options, - 'line_number_chars', 2) - self.line_number_bold = get_bool_opt(options, - 'line_number_bold', False) - self.line_number_italic = get_bool_opt(options, - 'line_number_italic', False) - self.line_number_pad = get_int_opt(options, 'line_number_pad', 6) - self.line_numbers = get_bool_opt(options, 'line_numbers', True) - self.line_number_separator = get_bool_opt(options, - 'line_number_separator', True) - self.line_number_step = get_int_opt(options, 'line_number_step', 1) - self.line_number_start = get_int_opt(options, 'line_number_start', 1) - if self.line_numbers: - self.line_number_width = (self.fontw * self.line_number_chars + - self.line_number_pad * 2) - else: - self.line_number_width = 0 - self.hl_lines = [] - hl_lines_str = get_list_opt(options, 'hl_lines', []) - for line in hl_lines_str: - try: - self.hl_lines.append(int(line)) - except ValueError: - pass - self.hl_color = options.get('hl_color', - self.style.highlight_color) or '#f90' - self.drawables = [] - - def get_style_defs(self, arg=''): - raise NotImplementedError('The -S option is meaningless for the image ' - 'formatter. Use -O style= instead.') - - def _get_line_height(self): - """ - Get the height of a line. - """ - return self.fonth + self.line_pad - - def _get_line_y(self, lineno): - """ - Get the Y coordinate of a line number. - """ - return lineno * self._get_line_height() + self.image_pad - - def _get_char_width(self): - """ - Get the width of a character. - """ - return self.fontw - - def _get_char_x(self, charno): - """ - Get the X coordinate of a character position. - """ - return charno * self.fontw + self.image_pad + self.line_number_width - - def _get_text_pos(self, charno, lineno): - """ - Get the actual position for a character and line position. - """ - return self._get_char_x(charno), self._get_line_y(lineno) - - def _get_linenumber_pos(self, lineno): - """ - Get the actual position for the start of a line number. - """ - return (self.image_pad, self._get_line_y(lineno)) - - def _get_text_color(self, style): - """ - Get the correct color for the token from the style. - """ - if style['color'] is not None: - fill = '#' + style['color'] - else: - fill = '#000' - return fill - - def _get_style_font(self, style): - """ - Get the correct font for the style. - """ - return self.fonts.get_font(style['bold'], style['italic']) - - def _get_image_size(self, maxcharno, maxlineno): - """ - Get the required image size. - """ - return (self._get_char_x(maxcharno) + self.image_pad, - self._get_line_y(maxlineno + 0) + self.image_pad) - - def _draw_linenumber(self, posno, lineno): - """ - Remember a line number drawable to paint later. - """ - self._draw_text( - self._get_linenumber_pos(posno), - str(lineno).rjust(self.line_number_chars), - font=self.fonts.get_font(self.line_number_bold, - self.line_number_italic), - fill=self.line_number_fg, - ) - - def _draw_text(self, pos, text, font, **kw): - """ - Remember a single drawable tuple to paint later. - """ - self.drawables.append((pos, text, font, kw)) - - def _create_drawables(self, tokensource): - """ - Create drawables for the token content. - """ - lineno = charno = maxcharno = 0 - for ttype, value in tokensource: - while ttype not in self.styles: - ttype = ttype.parent - style = self.styles[ttype] - # TODO: make sure tab expansion happens earlier in the chain. It - # really ought to be done on the input, as to do it right here is - # quite complex. - value = value.expandtabs(4) - lines = value.splitlines(True) - # print lines - for i, line in enumerate(lines): - temp = line.rstrip('\n') - if temp: - self._draw_text( - self._get_text_pos(charno, lineno), - temp, - font = self._get_style_font(style), - fill = self._get_text_color(style) - ) - charno += len(temp) - maxcharno = max(maxcharno, charno) - if line.endswith('\n'): - # add a line for each extra line in the value - charno = 0 - lineno += 1 - self.maxcharno = maxcharno - self.maxlineno = lineno - - def _draw_line_numbers(self): - """ - Create drawables for the line numbers. - """ - if not self.line_numbers: - return - for p in xrange(self.maxlineno): - n = p + self.line_number_start - if (n % self.line_number_step) == 0: - self._draw_linenumber(p, n) - - def _paint_line_number_bg(self, im): - """ - Paint the line number background on the image. - """ - if not self.line_numbers: - return - if self.line_number_fg is None: - return - draw = ImageDraw.Draw(im) - recth = im.size[-1] - rectw = self.image_pad + self.line_number_width - self.line_number_pad - draw.rectangle([(0, 0), (rectw, recth)], - fill=self.line_number_bg) - draw.line([(rectw, 0), (rectw, recth)], fill=self.line_number_fg) - del draw - - def format(self, tokensource, outfile): - """ - Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` - tuples and write it into ``outfile``. - - This implementation calculates where it should draw each token on the - pixmap, then calculates the required pixmap size and draws the items. - """ - self._create_drawables(tokensource) - self._draw_line_numbers() - im = Image.new( - 'RGB', - self._get_image_size(self.maxcharno, self.maxlineno), - self.background_color - ) - self._paint_line_number_bg(im) - draw = ImageDraw.Draw(im) - # Highlight - if self.hl_lines: - x = self.image_pad + self.line_number_width - self.line_number_pad + 1 - recth = self._get_line_height() - rectw = im.size[0] - x - for linenumber in self.hl_lines: - y = self._get_line_y(linenumber - 1) - draw.rectangle([(x, y), (x + rectw, y + recth)], - fill=self.hl_color) - for pos, value, font, kw in self.drawables: - draw.text(pos, value, font=font, **kw) - im.save(outfile, self.image_format.upper()) - - -# Add one formatter per format, so that the "-f gif" option gives the correct result -# when used in pygmentize. - -class GifImageFormatter(ImageFormatter): - """ - Create a GIF image from source code. This uses the Python Imaging Library to - generate a pixmap from the source code. - - .. versionadded:: 1.0 - """ - - name = 'img_gif' - aliases = ['gif'] - filenames = ['*.gif'] - default_image_format = 'gif' - - -class JpgImageFormatter(ImageFormatter): - """ - Create a JPEG image from source code. This uses the Python Imaging Library to - generate a pixmap from the source code. - - .. versionadded:: 1.0 - """ - - name = 'img_jpg' - aliases = ['jpg', 'jpeg'] - filenames = ['*.jpg'] - default_image_format = 'jpeg' - - -class BmpImageFormatter(ImageFormatter): - """ - Create a bitmap image from source code. This uses the Python Imaging Library to - generate a pixmap from the source code. - - .. versionadded:: 1.0 - """ - - name = 'img_bmp' - aliases = ['bmp', 'bitmap'] - filenames = ['*.bmp'] - default_image_format = 'bmp' diff --git a/wakatime/packages/py2/pygments/formatters/other.py b/wakatime/packages/py2/pygments/formatters/other.py deleted file mode 100644 index ea8138c..0000000 --- a/wakatime/packages/py2/pygments/formatters/other.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters.other - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Other formatters: NullFormatter, RawTokenFormatter. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.formatter import Formatter -from pygments.util import OptionError, get_choice_opt -from pygments.token import Token -from pygments.console import colorize - -__all__ = ['NullFormatter', 'RawTokenFormatter', 'TestcaseFormatter'] - - -class NullFormatter(Formatter): - """ - Output the text unchanged without any formatting. - """ - name = 'Text only' - aliases = ['text', 'null'] - filenames = ['*.txt'] - - def format(self, tokensource, outfile): - enc = self.encoding - for ttype, value in tokensource: - if enc: - outfile.write(value.encode(enc)) - else: - outfile.write(value) - - -class RawTokenFormatter(Formatter): - r""" - Format tokens as a raw representation for storing token streams. - - The format is ``tokentyperepr(tokenstring)\n``. The output can later - be converted to a token stream with the `RawTokenLexer`, described in the - :doc:`lexer list `. - - Only two options are accepted: - - `compress` - If set to ``'gz'`` or ``'bz2'``, compress the output with the given - compression algorithm after encoding (default: ``''``). - `error_color` - If set to a color name, highlight error tokens using that color. If - set but with no value, defaults to ``'red'``. - - .. versionadded:: 0.11 - - """ - name = 'Raw tokens' - aliases = ['raw', 'tokens'] - filenames = ['*.raw'] - - unicodeoutput = False - - def __init__(self, **options): - Formatter.__init__(self, **options) - # We ignore self.encoding if it is set, since it gets set for lexer - # and formatter if given with -Oencoding on the command line. - # The RawTokenFormatter outputs only ASCII. Override here. - self.encoding = 'ascii' # let pygments.format() do the right thing - self.compress = get_choice_opt(options, 'compress', - ['', 'none', 'gz', 'bz2'], '') - self.error_color = options.get('error_color', None) - if self.error_color is True: - self.error_color = 'red' - if self.error_color is not None: - try: - colorize(self.error_color, '') - except KeyError: - raise ValueError("Invalid color %r specified" % - self.error_color) - - def format(self, tokensource, outfile): - try: - outfile.write(b'') - except TypeError: - raise TypeError('The raw tokens formatter needs a binary ' - 'output file') - if self.compress == 'gz': - import gzip - outfile = gzip.GzipFile('', 'wb', 9, outfile) - def write(text): - outfile.write(text.encode()) - flush = outfile.flush - elif self.compress == 'bz2': - import bz2 - compressor = bz2.BZ2Compressor(9) - def write(text): - outfile.write(compressor.compress(text.encode())) - def flush(): - outfile.write(compressor.flush()) - outfile.flush() - else: - def write(text): - outfile.write(text.encode()) - flush = outfile.flush - - if self.error_color: - for ttype, value in tokensource: - line = "%s\t%r\n" % (ttype, value) - if ttype is Token.Error: - write(colorize(self.error_color, line)) - else: - write(line) - else: - for ttype, value in tokensource: - write("%s\t%r\n" % (ttype, value)) - flush() - -TESTCASE_BEFORE = u'''\ - def testNeedsName(self): - fragment = %r - tokens = [ -''' -TESTCASE_AFTER = u'''\ - ] - self.assertEqual(tokens, list(self.lexer.get_tokens(fragment))) -''' - - -class TestcaseFormatter(Formatter): - """ - Format tokens as appropriate for a new testcase. - - .. versionadded:: 2.0 - """ - name = 'Testcase' - aliases = ['testcase'] - - def __init__(self, **options): - Formatter.__init__(self, **options) - if self.encoding is not None and self.encoding != 'utf-8': - raise ValueError("Only None and utf-8 are allowed encodings.") - - def format(self, tokensource, outfile): - indentation = ' ' * 12 - rawbuf = [] - outbuf = [] - for ttype, value in tokensource: - rawbuf.append(value) - outbuf.append('%s(%s, %r),\n' % (indentation, ttype, value)) - - before = TESTCASE_BEFORE % (u''.join(rawbuf),) - during = u''.join(outbuf) - after = TESTCASE_AFTER - if self.encoding is None: - outfile.write(before + during + after) - else: - outfile.write(before.encode('utf-8')) - outfile.write(during.encode('utf-8')) - outfile.write(after.encode('utf-8')) - outfile.flush() diff --git a/wakatime/packages/py2/pygments/formatters/rtf.py b/wakatime/packages/py2/pygments/formatters/rtf.py deleted file mode 100644 index 6132127..0000000 --- a/wakatime/packages/py2/pygments/formatters/rtf.py +++ /dev/null @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters.rtf - ~~~~~~~~~~~~~~~~~~~~~~~ - - A formatter that generates RTF files. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.formatter import Formatter -from pygments.util import get_int_opt, _surrogatepair - - -__all__ = ['RtfFormatter'] - - -class RtfFormatter(Formatter): - """ - Format tokens as RTF markup. This formatter automatically outputs full RTF - documents with color information and other useful stuff. Perfect for Copy and - Paste into Microsoft(R) Word(R) documents. - - Please note that ``encoding`` and ``outencoding`` options are ignored. - The RTF format is ASCII natively, but handles unicode characters correctly - thanks to escape sequences. - - .. versionadded:: 0.6 - - Additional options accepted: - - `style` - The style to use, can be a string or a Style subclass (default: - ``'default'``). - - `fontface` - The used font famliy, for example ``Bitstream Vera Sans``. Defaults to - some generic font which is supposed to have fixed width. - - `fontsize` - Size of the font used. Size is specified in half points. The - default is 24 half-points, giving a size 12 font. - - .. versionadded:: 2.0 - """ - name = 'RTF' - aliases = ['rtf'] - filenames = ['*.rtf'] - - def __init__(self, **options): - r""" - Additional options accepted: - - ``fontface`` - Name of the font used. Could for example be ``'Courier New'`` - to further specify the default which is ``'\fmodern'``. The RTF - specification claims that ``\fmodern`` are "Fixed-pitch serif - and sans serif fonts". Hope every RTF implementation thinks - the same about modern... - - """ - Formatter.__init__(self, **options) - self.fontface = options.get('fontface') or '' - self.fontsize = get_int_opt(options, 'fontsize', 0) - - def _escape(self, text): - return text.replace(u'\\', u'\\\\') \ - .replace(u'{', u'\\{') \ - .replace(u'}', u'\\}') - - def _escape_text(self, text): - # empty strings, should give a small performance improvment - if not text: - return u'' - - # escape text - text = self._escape(text) - - buf = [] - for c in text: - cn = ord(c) - if cn < (2**7): - # ASCII character - buf.append(str(c)) - elif (2**7) <= cn < (2**16): - # single unicode escape sequence - buf.append(u'{\\u%d}' % cn) - elif (2**16) <= cn: - # RTF limits unicode to 16 bits. - # Force surrogate pairs - buf.append(u'{\\u%d}{\\u%d}' % _surrogatepair(cn)) - - return u''.join(buf).replace(u'\n', u'\\par\n') - - def format_unencoded(self, tokensource, outfile): - # rtf 1.8 header - outfile.write(u'{\\rtf1\\ansi\\uc0\\deff0' - u'{\\fonttbl{\\f0\\fmodern\\fprq1\\fcharset0%s;}}' - u'{\\colortbl;' % (self.fontface and - u' ' + self._escape(self.fontface) or - u'')) - - # convert colors and save them in a mapping to access them later. - color_mapping = {} - offset = 1 - for _, style in self.style: - for color in style['color'], style['bgcolor'], style['border']: - if color and color not in color_mapping: - color_mapping[color] = offset - outfile.write(u'\\red%d\\green%d\\blue%d;' % ( - int(color[0:2], 16), - int(color[2:4], 16), - int(color[4:6], 16) - )) - offset += 1 - outfile.write(u'}\\f0 ') - if self.fontsize: - outfile.write(u'\\fs%d' % (self.fontsize)) - - # highlight stream - for ttype, value in tokensource: - while not self.style.styles_token(ttype) and ttype.parent: - ttype = ttype.parent - style = self.style.style_for_token(ttype) - buf = [] - if style['bgcolor']: - buf.append(u'\\cb%d' % color_mapping[style['bgcolor']]) - if style['color']: - buf.append(u'\\cf%d' % color_mapping[style['color']]) - if style['bold']: - buf.append(u'\\b') - if style['italic']: - buf.append(u'\\i') - if style['underline']: - buf.append(u'\\ul') - if style['border']: - buf.append(u'\\chbrdr\\chcfpat%d' % - color_mapping[style['border']]) - start = u''.join(buf) - if start: - outfile.write(u'{%s ' % start) - outfile.write(self._escape_text(value)) - if start: - outfile.write(u'}') - - outfile.write(u'}') diff --git a/wakatime/packages/py2/pygments/formatters/terminal256.py b/wakatime/packages/py2/pygments/formatters/terminal256.py deleted file mode 100644 index 3896380..0000000 --- a/wakatime/packages/py2/pygments/formatters/terminal256.py +++ /dev/null @@ -1,223 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.formatters.terminal256 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Formatter for 256-color terminal output with ANSI sequences. - - RGB-to-XTERM color conversion routines adapted from xterm256-conv - tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) - by Wolfgang Frisch. - - Formatter version 1. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -# TODO: -# - Options to map style's bold/underline/italic/border attributes -# to some ANSI attrbutes (something like 'italic=underline') -# - An option to output "style RGB to xterm RGB/index" conversion table -# - An option to indicate that we are running in "reverse background" -# xterm. This means that default colors are white-on-black, not -# black-on-while, so colors like "white background" need to be converted -# to "white background, black foreground", etc... - -import sys - -from pygments.formatter import Formatter - - -__all__ = ['Terminal256Formatter'] - - -class EscapeSequence: - def __init__(self, fg=None, bg=None, bold=False, underline=False): - self.fg = fg - self.bg = bg - self.bold = bold - self.underline = underline - - def escape(self, attrs): - if len(attrs): - return "\x1b[" + ";".join(attrs) + "m" - return "" - - def color_string(self): - attrs = [] - if self.fg is not None: - attrs.extend(("38", "5", "%i" % self.fg)) - if self.bg is not None: - attrs.extend(("48", "5", "%i" % self.bg)) - if self.bold: - attrs.append("01") - if self.underline: - attrs.append("04") - return self.escape(attrs) - - def reset_string(self): - attrs = [] - if self.fg is not None: - attrs.append("39") - if self.bg is not None: - attrs.append("49") - if self.bold or self.underline: - attrs.append("00") - return self.escape(attrs) - - -class Terminal256Formatter(Formatter): - r""" - Format tokens with ANSI color sequences, for output in a 256-color - terminal or console. Like in `TerminalFormatter` color sequences - are terminated at newlines, so that paging the output works correctly. - - The formatter takes colors from a style defined by the `style` option - and converts them to nearest ANSI 256-color escape sequences. Bold and - underline attributes from the style are preserved (and displayed). - - .. versionadded:: 0.9 - - Options accepted: - - `style` - The style to use, can be a string or a Style subclass (default: - ``'default'``). - """ - name = 'Terminal256' - aliases = ['terminal256', 'console256', '256'] - filenames = [] - - def __init__(self, **options): - Formatter.__init__(self, **options) - - self.xterm_colors = [] - self.best_match = {} - self.style_string = {} - - self.usebold = 'nobold' not in options - self.useunderline = 'nounderline' not in options - - self._build_color_table() # build an RGB-to-256 color conversion table - self._setup_styles() # convert selected style's colors to term. colors - - def _build_color_table(self): - # colors 0..15: 16 basic colors - - self.xterm_colors.append((0x00, 0x00, 0x00)) # 0 - self.xterm_colors.append((0xcd, 0x00, 0x00)) # 1 - self.xterm_colors.append((0x00, 0xcd, 0x00)) # 2 - self.xterm_colors.append((0xcd, 0xcd, 0x00)) # 3 - self.xterm_colors.append((0x00, 0x00, 0xee)) # 4 - self.xterm_colors.append((0xcd, 0x00, 0xcd)) # 5 - self.xterm_colors.append((0x00, 0xcd, 0xcd)) # 6 - self.xterm_colors.append((0xe5, 0xe5, 0xe5)) # 7 - self.xterm_colors.append((0x7f, 0x7f, 0x7f)) # 8 - self.xterm_colors.append((0xff, 0x00, 0x00)) # 9 - self.xterm_colors.append((0x00, 0xff, 0x00)) # 10 - self.xterm_colors.append((0xff, 0xff, 0x00)) # 11 - self.xterm_colors.append((0x5c, 0x5c, 0xff)) # 12 - self.xterm_colors.append((0xff, 0x00, 0xff)) # 13 - self.xterm_colors.append((0x00, 0xff, 0xff)) # 14 - self.xterm_colors.append((0xff, 0xff, 0xff)) # 15 - - # colors 16..232: the 6x6x6 color cube - - valuerange = (0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff) - - for i in range(217): - r = valuerange[(i // 36) % 6] - g = valuerange[(i // 6) % 6] - b = valuerange[i % 6] - self.xterm_colors.append((r, g, b)) - - # colors 233..253: grayscale - - for i in range(1, 22): - v = 8 + i * 10 - self.xterm_colors.append((v, v, v)) - - def _closest_color(self, r, g, b): - distance = 257*257*3 # "infinity" (>distance from #000000 to #ffffff) - match = 0 - - for i in range(0, 254): - values = self.xterm_colors[i] - - rd = r - values[0] - gd = g - values[1] - bd = b - values[2] - d = rd*rd + gd*gd + bd*bd - - if d < distance: - match = i - distance = d - return match - - def _color_index(self, color): - index = self.best_match.get(color, None) - if index is None: - try: - rgb = int(str(color), 16) - except ValueError: - rgb = 0 - - r = (rgb >> 16) & 0xff - g = (rgb >> 8) & 0xff - b = rgb & 0xff - index = self._closest_color(r, g, b) - self.best_match[color] = index - return index - - def _setup_styles(self): - for ttype, ndef in self.style: - escape = EscapeSequence() - if ndef['color']: - escape.fg = self._color_index(ndef['color']) - if ndef['bgcolor']: - escape.bg = self._color_index(ndef['bgcolor']) - if self.usebold and ndef['bold']: - escape.bold = True - if self.useunderline and ndef['underline']: - escape.underline = True - self.style_string[str(ttype)] = (escape.color_string(), - escape.reset_string()) - - def format(self, tokensource, outfile): - # hack: if the output is a terminal and has an encoding set, - # use that to avoid unicode encode problems - if not self.encoding and hasattr(outfile, "encoding") and \ - hasattr(outfile, "isatty") and outfile.isatty() and \ - sys.version_info < (3,): - self.encoding = outfile.encoding - return Formatter.format(self, tokensource, outfile) - - def format_unencoded(self, tokensource, outfile): - for ttype, value in tokensource: - not_found = True - while ttype and not_found: - try: - # outfile.write( "<" + str(ttype) + ">" ) - on, off = self.style_string[str(ttype)] - - # Like TerminalFormatter, add "reset colors" escape sequence - # on newline. - spl = value.split('\n') - for line in spl[:-1]: - if line: - outfile.write(on + line + off) - outfile.write('\n') - if spl[-1]: - outfile.write(on + spl[-1] + off) - - not_found = False - # outfile.write( '#' + str(ttype) + '#' ) - - except KeyError: - # ottype = ttype - ttype = ttype[:-1] - # outfile.write( '!' + str(ottype) + '->' + str(ttype) + '!' ) - - if not_found: - outfile.write(value) diff --git a/wakatime/packages/py2/pygments/lexers/__init__.py b/wakatime/packages/py2/pygments/lexers/__init__.py deleted file mode 100644 index 7edb2ac..0000000 --- a/wakatime/packages/py2/pygments/lexers/__init__.py +++ /dev/null @@ -1,273 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers - ~~~~~~~~~~~~~~~ - - Pygments lexers. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re -import sys -import types -import fnmatch -from os.path import basename - -from pygments.lexers._mapping import LEXERS -from pygments.modeline import get_filetype_from_buffer -from pygments.plugin import find_plugin_lexers -from pygments.util import ClassNotFound, itervalues, guess_decode - - -__all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', - 'guess_lexer'] + list(LEXERS) - -_lexer_cache = {} -_pattern_cache = {} - - -def _fn_matches(fn, glob): - """Return whether the supplied file name fn matches pattern filename.""" - if glob not in _pattern_cache: - pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob)) - return pattern.match(fn) - return _pattern_cache[glob].match(fn) - - -def _load_lexers(module_name): - """Load a lexer (and all others in the module too).""" - mod = __import__(module_name, None, None, ['__all__']) - for lexer_name in mod.__all__: - cls = getattr(mod, lexer_name) - _lexer_cache[cls.name] = cls - - -def get_all_lexers(): - """Return a generator of tuples in the form ``(name, aliases, - filenames, mimetypes)`` of all know lexers. - """ - for item in itervalues(LEXERS): - yield item[1:] - for lexer in find_plugin_lexers(): - yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes - - -def find_lexer_class(name): - """Lookup a lexer class by name. - - Return None if not found. - """ - if name in _lexer_cache: - return _lexer_cache[name] - # lookup builtin lexers - for module_name, lname, aliases, _, _ in itervalues(LEXERS): - if name == lname: - _load_lexers(module_name) - return _lexer_cache[name] - # continue with lexers from setuptools entrypoints - for cls in find_plugin_lexers(): - if cls.name == name: - return cls - - -def get_lexer_by_name(_alias, **options): - """Get a lexer by an alias. - - Raises ClassNotFound if not found. - """ - if not _alias: - raise ClassNotFound('no lexer for alias %r found' % _alias) - - # lookup builtin lexers - for module_name, name, aliases, _, _ in itervalues(LEXERS): - if _alias.lower() in aliases: - if name not in _lexer_cache: - _load_lexers(module_name) - return _lexer_cache[name](**options) - # continue with lexers from setuptools entrypoints - for cls in find_plugin_lexers(): - if _alias in cls.aliases: - return cls(**options) - raise ClassNotFound('no lexer for alias %r found' % _alias) - - -def find_lexer_class_for_filename(_fn, code=None): - """Get a lexer for a filename. - - If multiple lexers match the filename pattern, use ``analyse_text()`` to - figure out which one is more appropriate. - - Returns None if not found. - """ - matches = [] - fn = basename(_fn) - for modname, name, _, filenames, _ in itervalues(LEXERS): - for filename in filenames: - if _fn_matches(fn, filename): - if name not in _lexer_cache: - _load_lexers(modname) - matches.append((_lexer_cache[name], filename)) - for cls in find_plugin_lexers(): - for filename in cls.filenames: - if _fn_matches(fn, filename): - matches.append((cls, filename)) - - if sys.version_info > (3,) and isinstance(code, bytes): - # decode it, since all analyse_text functions expect unicode - code = guess_decode(code) - - def get_rating(info): - cls, filename = info - # explicit patterns get a bonus - bonus = '*' not in filename and 0.5 or 0 - # The class _always_ defines analyse_text because it's included in - # the Lexer class. The default implementation returns None which - # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py - # to find lexers which need it overridden. - if code: - return cls.analyse_text(code) + bonus - return cls.priority + bonus - - if matches: - matches.sort(key=get_rating) - # print "Possible lexers, after sort:", matches - return matches[-1][0] - - -def get_lexer_for_filename(_fn, code=None, **options): - """Get a lexer for a filename. - - If multiple lexers match the filename pattern, use ``analyse_text()`` to - figure out which one is more appropriate. - - Raises ClassNotFound if not found. - """ - res = find_lexer_class_for_filename(_fn, code) - if not res: - raise ClassNotFound('no lexer for filename %r found' % _fn) - return res(**options) - - -def get_lexer_for_mimetype(_mime, **options): - """Get a lexer for a mimetype. - - Raises ClassNotFound if not found. - """ - for modname, name, _, _, mimetypes in itervalues(LEXERS): - if _mime in mimetypes: - if name not in _lexer_cache: - _load_lexers(modname) - return _lexer_cache[name](**options) - for cls in find_plugin_lexers(): - if _mime in cls.mimetypes: - return cls(**options) - raise ClassNotFound('no lexer for mimetype %r found' % _mime) - - -def _iter_lexerclasses(plugins=True): - """Return an iterator over all lexer classes.""" - for key in sorted(LEXERS): - module_name, name = LEXERS[key][:2] - if name not in _lexer_cache: - _load_lexers(module_name) - yield _lexer_cache[name] - if plugins: - for lexer in find_plugin_lexers(): - yield lexer - - -def guess_lexer_for_filename(_fn, _text, **options): - """ - Lookup all lexers that handle those filenames primary (``filenames``) - or secondary (``alias_filenames``). Then run a text analysis for those - lexers and choose the best result. - - usage:: - - >>> from pygments.lexers import guess_lexer_for_filename - >>> guess_lexer_for_filename('hello.html', '<%= @foo %>') - - >>> guess_lexer_for_filename('hello.html', '

{{ title|e }}

') - - >>> guess_lexer_for_filename('style.css', 'a { color: }') - - """ - fn = basename(_fn) - primary = {} - matching_lexers = set() - for lexer in _iter_lexerclasses(): - for filename in lexer.filenames: - if _fn_matches(fn, filename): - matching_lexers.add(lexer) - primary[lexer] = True - for filename in lexer.alias_filenames: - if _fn_matches(fn, filename): - matching_lexers.add(lexer) - primary[lexer] = False - if not matching_lexers: - raise ClassNotFound('no lexer for filename %r found' % fn) - if len(matching_lexers) == 1: - return matching_lexers.pop()(**options) - result = [] - for lexer in matching_lexers: - rv = lexer.analyse_text(_text) - if rv == 1.0: - return lexer(**options) - result.append((rv, lexer)) - - def type_sort(t): - # sort by: - # - analyse score - # - is primary filename pattern? - # - priority - # - last resort: class name - return (t[0], primary[t[1]], t[1].priority, t[1].__name__) - result.sort(key=type_sort) - - return result[-1][1](**options) - - -def guess_lexer(_text, **options): - """Guess a lexer by strong distinctions in the text (eg, shebang).""" - - # try to get a vim modeline first - ft = get_filetype_from_buffer(_text) - - if ft is not None: - try: - return get_lexer_by_name(ft, **options) - except ClassNotFound: - pass - - best_lexer = [0.0, None] - for lexer in _iter_lexerclasses(): - rv = lexer.analyse_text(_text) - if rv == 1.0: - return lexer(**options) - if rv > best_lexer[0]: - best_lexer[:] = (rv, lexer) - if not best_lexer[0] or best_lexer[1] is None: - raise ClassNotFound('no lexer matching the text found') - return best_lexer[1](**options) - - -class _automodule(types.ModuleType): - """Automatically import lexers.""" - - def __getattr__(self, name): - info = LEXERS.get(name) - if info: - _load_lexers(info[0]) - cls = _lexer_cache[info[1]] - setattr(self, name, cls) - return cls - raise AttributeError(name) - - -oldmod = sys.modules[__name__] -newmod = _automodule(__name__) -newmod.__dict__.update(oldmod.__dict__) -sys.modules[__name__] = newmod -del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types diff --git a/wakatime/packages/py2/pygments/lexers/_asy_builtins.py b/wakatime/packages/py2/pygments/lexers/_asy_builtins.py deleted file mode 100644 index 2dcd60d..0000000 --- a/wakatime/packages/py2/pygments/lexers/_asy_builtins.py +++ /dev/null @@ -1,1645 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._asy_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This file contains the asy-function names and asy-variable names of - Asymptote. - - Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand. - TODO: perl/python script in Asymptote SVN similar to asy-list.pl but only - for function and variable names. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -ASYFUNCNAME = set(( - 'AND', - 'Arc', - 'ArcArrow', - 'ArcArrows', - 'Arrow', - 'Arrows', - 'Automatic', - 'AvantGarde', - 'BBox', - 'BWRainbow', - 'BWRainbow2', - 'Bar', - 'Bars', - 'BeginArcArrow', - 'BeginArrow', - 'BeginBar', - 'BeginDotMargin', - 'BeginMargin', - 'BeginPenMargin', - 'Blank', - 'Bookman', - 'Bottom', - 'BottomTop', - 'Bounds', - 'Break', - 'Broken', - 'BrokenLog', - 'Ceil', - 'Circle', - 'CircleBarIntervalMarker', - 'Cos', - 'Courier', - 'CrossIntervalMarker', - 'DefaultFormat', - 'DefaultLogFormat', - 'Degrees', - 'Dir', - 'DotMargin', - 'DotMargins', - 'Dotted', - 'Draw', - 'Drawline', - 'Embed', - 'EndArcArrow', - 'EndArrow', - 'EndBar', - 'EndDotMargin', - 'EndMargin', - 'EndPenMargin', - 'Fill', - 'FillDraw', - 'Floor', - 'Format', - 'Full', - 'Gaussian', - 'Gaussrand', - 'Gaussrandpair', - 'Gradient', - 'Grayscale', - 'Helvetica', - 'Hermite', - 'HookHead', - 'InOutTicks', - 'InTicks', - 'J', - 'Label', - 'Landscape', - 'Left', - 'LeftRight', - 'LeftTicks', - 'Legend', - 'Linear', - 'Link', - 'Log', - 'LogFormat', - 'Margin', - 'Margins', - 'Mark', - 'MidArcArrow', - 'MidArrow', - 'NOT', - 'NewCenturySchoolBook', - 'NoBox', - 'NoMargin', - 'NoModifier', - 'NoTicks', - 'NoTicks3', - 'NoZero', - 'NoZeroFormat', - 'None', - 'OR', - 'OmitFormat', - 'OmitTick', - 'OutTicks', - 'Ox', - 'Oy', - 'Palatino', - 'PaletteTicks', - 'Pen', - 'PenMargin', - 'PenMargins', - 'Pentype', - 'Portrait', - 'RadialShade', - 'Rainbow', - 'Range', - 'Relative', - 'Right', - 'RightTicks', - 'Rotate', - 'Round', - 'SQR', - 'Scale', - 'ScaleX', - 'ScaleY', - 'ScaleZ', - 'Seascape', - 'Shift', - 'Sin', - 'Slant', - 'Spline', - 'StickIntervalMarker', - 'Straight', - 'Symbol', - 'Tan', - 'TeXify', - 'Ticks', - 'Ticks3', - 'TildeIntervalMarker', - 'TimesRoman', - 'Top', - 'TrueMargin', - 'UnFill', - 'UpsideDown', - 'Wheel', - 'X', - 'XEquals', - 'XOR', - 'XY', - 'XYEquals', - 'XYZero', - 'XYgrid', - 'XZEquals', - 'XZZero', - 'XZero', - 'XZgrid', - 'Y', - 'YEquals', - 'YXgrid', - 'YZ', - 'YZEquals', - 'YZZero', - 'YZero', - 'YZgrid', - 'Z', - 'ZX', - 'ZXgrid', - 'ZYgrid', - 'ZapfChancery', - 'ZapfDingbats', - '_cputime', - '_draw', - '_eval', - '_image', - '_labelpath', - '_projection', - '_strokepath', - '_texpath', - 'aCos', - 'aSin', - 'aTan', - 'abort', - 'abs', - 'accel', - 'acos', - 'acosh', - 'acot', - 'acsc', - 'add', - 'addArrow', - 'addMargins', - 'addSaveFunction', - 'addnode', - 'addnodes', - 'addpenarc', - 'addpenline', - 'addseg', - 'adjust', - 'alias', - 'align', - 'all', - 'altitude', - 'angabscissa', - 'angle', - 'angpoint', - 'animate', - 'annotate', - 'anticomplementary', - 'antipedal', - 'apply', - 'approximate', - 'arc', - 'arcarrowsize', - 'arccircle', - 'arcdir', - 'arcfromcenter', - 'arcfromfocus', - 'arclength', - 'arcnodesnumber', - 'arcpoint', - 'arcsubtended', - 'arcsubtendedcenter', - 'arctime', - 'arctopath', - 'array', - 'arrow', - 'arrow2', - 'arrowbase', - 'arrowbasepoints', - 'arrowsize', - 'asec', - 'asin', - 'asinh', - 'ask', - 'assert', - 'asy', - 'asycode', - 'asydir', - 'asyfigure', - 'asyfilecode', - 'asyinclude', - 'asywrite', - 'atan', - 'atan2', - 'atanh', - 'atbreakpoint', - 'atexit', - 'atime', - 'attach', - 'attract', - 'atupdate', - 'autoformat', - 'autoscale', - 'autoscale3', - 'axes', - 'axes3', - 'axialshade', - 'axis', - 'axiscoverage', - 'azimuth', - 'babel', - 'background', - 'bangles', - 'bar', - 'barmarksize', - 'barsize', - 'basealign', - 'baseline', - 'bbox', - 'beep', - 'begin', - 'beginclip', - 'begingroup', - 'beginpoint', - 'between', - 'bevel', - 'bezier', - 'bezierP', - 'bezierPP', - 'bezierPPP', - 'bezulate', - 'bibliography', - 'bibliographystyle', - 'binarytree', - 'binarytreeNode', - 'binomial', - 'binput', - 'bins', - 'bisector', - 'bisectorpoint', - 'blend', - 'boutput', - 'box', - 'bqe', - 'breakpoint', - 'breakpoints', - 'brick', - 'buildRestoreDefaults', - 'buildRestoreThunk', - 'buildcycle', - 'bulletcolor', - 'canonical', - 'canonicalcartesiansystem', - 'cartesiansystem', - 'case1', - 'case2', - 'case3', - 'cbrt', - 'cd', - 'ceil', - 'center', - 'centerToFocus', - 'centroid', - 'cevian', - 'change2', - 'changecoordsys', - 'checkSegment', - 'checkconditionlength', - 'checker', - 'checklengths', - 'checkposition', - 'checktriangle', - 'choose', - 'circle', - 'circlebarframe', - 'circlemarkradius', - 'circlenodesnumber', - 'circumcenter', - 'circumcircle', - 'clamped', - 'clear', - 'clip', - 'clipdraw', - 'close', - 'cmyk', - 'code', - 'colatitude', - 'collect', - 'collinear', - 'color', - 'colorless', - 'colors', - 'colorspace', - 'comma', - 'compassmark', - 'complement', - 'complementary', - 'concat', - 'concurrent', - 'cone', - 'conic', - 'conicnodesnumber', - 'conictype', - 'conj', - 'connect', - 'containmentTree', - 'contains', - 'contour', - 'contour3', - 'controlSpecifier', - 'convert', - 'coordinates', - 'coordsys', - 'copy', - 'cos', - 'cosh', - 'cot', - 'countIntersections', - 'cputime', - 'crop', - 'cropcode', - 'cross', - 'crossframe', - 'crosshatch', - 'crossmarksize', - 'csc', - 'cubicroots', - 'curabscissa', - 'curlSpecifier', - 'curpoint', - 'currentarrow', - 'currentexitfunction', - 'currentmomarrow', - 'currentpolarconicroutine', - 'curve', - 'cut', - 'cutafter', - 'cutbefore', - 'cyclic', - 'cylinder', - 'debugger', - 'deconstruct', - 'defaultdir', - 'defaultformat', - 'defaultpen', - 'defined', - 'degenerate', - 'degrees', - 'delete', - 'deletepreamble', - 'determinant', - 'diagonal', - 'diamond', - 'diffdiv', - 'dir', - 'dirSpecifier', - 'dirtime', - 'display', - 'distance', - 'divisors', - 'do_overpaint', - 'dot', - 'dotframe', - 'dotsize', - 'downcase', - 'draw', - 'drawAll', - 'drawDoubleLine', - 'drawFermion', - 'drawGhost', - 'drawGluon', - 'drawMomArrow', - 'drawPhoton', - 'drawScalar', - 'drawVertex', - 'drawVertexBox', - 'drawVertexBoxO', - 'drawVertexBoxX', - 'drawVertexO', - 'drawVertexOX', - 'drawVertexTriangle', - 'drawVertexTriangleO', - 'drawVertexX', - 'drawarrow', - 'drawarrow2', - 'drawline', - 'drawtick', - 'duplicate', - 'elle', - 'ellipse', - 'ellipsenodesnumber', - 'embed', - 'embed3', - 'empty', - 'enclose', - 'end', - 'endScript', - 'endclip', - 'endgroup', - 'endl', - 'endpoint', - 'endpoints', - 'eof', - 'eol', - 'equation', - 'equations', - 'erase', - 'erasestep', - 'erf', - 'erfc', - 'error', - 'errorbar', - 'errorbars', - 'eval', - 'excenter', - 'excircle', - 'exit', - 'exitXasyMode', - 'exitfunction', - 'exp', - 'expfactors', - 'expi', - 'expm1', - 'exradius', - 'extend', - 'extension', - 'extouch', - 'fabs', - 'factorial', - 'fermat', - 'fft', - 'fhorner', - 'figure', - 'file', - 'filecode', - 'fill', - 'filldraw', - 'filloutside', - 'fillrule', - 'filltype', - 'find', - 'finite', - 'finiteDifferenceJacobian', - 'firstcut', - 'firstframe', - 'fit', - 'fit2', - 'fixedscaling', - 'floor', - 'flush', - 'fmdefaults', - 'fmod', - 'focusToCenter', - 'font', - 'fontcommand', - 'fontsize', - 'foot', - 'format', - 'frac', - 'frequency', - 'fromCenter', - 'fromFocus', - 'fspline', - 'functionshade', - 'gamma', - 'generate_random_backtrace', - 'generateticks', - 'gergonne', - 'getc', - 'getint', - 'getpair', - 'getreal', - 'getstring', - 'gettriple', - 'gluon', - 'gouraudshade', - 'graph', - 'graphic', - 'gray', - 'grestore', - 'grid', - 'grid3', - 'gsave', - 'halfbox', - 'hatch', - 'hdiffdiv', - 'hermite', - 'hex', - 'histogram', - 'history', - 'hline', - 'hprojection', - 'hsv', - 'hyperbola', - 'hyperbolanodesnumber', - 'hyperlink', - 'hypot', - 'identity', - 'image', - 'incenter', - 'incentral', - 'incircle', - 'increasing', - 'incrementposition', - 'indexedTransform', - 'indexedfigure', - 'initXasyMode', - 'initdefaults', - 'input', - 'inradius', - 'insert', - 'inside', - 'integrate', - 'interactive', - 'interior', - 'interp', - 'interpolate', - 'intersect', - 'intersection', - 'intersectionpoint', - 'intersectionpoints', - 'intersections', - 'intouch', - 'inverse', - 'inversion', - 'invisible', - 'is3D', - 'isDuplicate', - 'isogonal', - 'isogonalconjugate', - 'isotomic', - 'isotomicconjugate', - 'isparabola', - 'italic', - 'item', - 'key', - 'kurtosis', - 'kurtosisexcess', - 'label', - 'labelaxis', - 'labelmargin', - 'labelpath', - 'labels', - 'labeltick', - 'labelx', - 'labelx3', - 'labely', - 'labely3', - 'labelz', - 'labelz3', - 'lastcut', - 'latex', - 'latitude', - 'latticeshade', - 'layer', - 'layout', - 'ldexp', - 'leastsquares', - 'legend', - 'legenditem', - 'length', - 'lift', - 'light', - 'limits', - 'line', - 'linear', - 'linecap', - 'lineinversion', - 'linejoin', - 'linemargin', - 'lineskip', - 'linetype', - 'linewidth', - 'link', - 'list', - 'lm_enorm', - 'lm_evaluate_default', - 'lm_lmdif', - 'lm_lmpar', - 'lm_minimize', - 'lm_print_default', - 'lm_print_quiet', - 'lm_qrfac', - 'lm_qrsolv', - 'locale', - 'locate', - 'locatefile', - 'location', - 'log', - 'log10', - 'log1p', - 'logaxiscoverage', - 'longitude', - 'lookup', - 'magnetize', - 'makeNode', - 'makedraw', - 'makepen', - 'map', - 'margin', - 'markangle', - 'markangleradius', - 'markanglespace', - 'markarc', - 'marker', - 'markinterval', - 'marknodes', - 'markrightangle', - 'markuniform', - 'mass', - 'masscenter', - 'massformat', - 'math', - 'max', - 'max3', - 'maxbezier', - 'maxbound', - 'maxcoords', - 'maxlength', - 'maxratio', - 'maxtimes', - 'mean', - 'medial', - 'median', - 'midpoint', - 'min', - 'min3', - 'minbezier', - 'minbound', - 'minipage', - 'minratio', - 'mintimes', - 'miterlimit', - 'momArrowPath', - 'momarrowsize', - 'monotonic', - 'multifigure', - 'nativeformat', - 'natural', - 'needshipout', - 'newl', - 'newpage', - 'newslide', - 'newton', - 'newtree', - 'nextframe', - 'nextnormal', - 'nextpage', - 'nib', - 'nodabscissa', - 'none', - 'norm', - 'normalvideo', - 'notaknot', - 'nowarn', - 'numberpage', - 'nurb', - 'object', - 'offset', - 'onpath', - 'opacity', - 'opposite', - 'orientation', - 'orig_circlenodesnumber', - 'orig_circlenodesnumber1', - 'orig_draw', - 'orig_ellipsenodesnumber', - 'orig_ellipsenodesnumber1', - 'orig_hyperbolanodesnumber', - 'orig_parabolanodesnumber', - 'origin', - 'orthic', - 'orthocentercenter', - 'outformat', - 'outline', - 'outprefix', - 'output', - 'overloadedMessage', - 'overwrite', - 'pack', - 'pad', - 'pairs', - 'palette', - 'parabola', - 'parabolanodesnumber', - 'parallel', - 'partialsum', - 'path', - 'path3', - 'pattern', - 'pause', - 'pdf', - 'pedal', - 'periodic', - 'perp', - 'perpendicular', - 'perpendicularmark', - 'phantom', - 'phi1', - 'phi2', - 'phi3', - 'photon', - 'piecewisestraight', - 'point', - 'polar', - 'polarconicroutine', - 'polargraph', - 'polygon', - 'postcontrol', - 'postscript', - 'pow10', - 'ppoint', - 'prc', - 'prc0', - 'precision', - 'precontrol', - 'prepend', - 'print_random_addresses', - 'project', - 'projection', - 'purge', - 'pwhermite', - 'quadrant', - 'quadraticroots', - 'quantize', - 'quarticroots', - 'quotient', - 'radialshade', - 'radians', - 'radicalcenter', - 'radicalline', - 'radius', - 'rand', - 'randompath', - 'rd', - 'readline', - 'realmult', - 'realquarticroots', - 'rectangle', - 'rectangular', - 'rectify', - 'reflect', - 'relabscissa', - 'relative', - 'relativedistance', - 'reldir', - 'relpoint', - 'reltime', - 'remainder', - 'remark', - 'removeDuplicates', - 'rename', - 'replace', - 'report', - 'resetdefaultpen', - 'restore', - 'restoredefaults', - 'reverse', - 'reversevideo', - 'rf', - 'rfind', - 'rgb', - 'rgba', - 'rgbint', - 'rms', - 'rotate', - 'rotateO', - 'rotation', - 'round', - 'roundbox', - 'roundedpath', - 'roundrectangle', - 'samecoordsys', - 'sameside', - 'sample', - 'save', - 'savedefaults', - 'saveline', - 'scale', - 'scale3', - 'scaleO', - 'scaleT', - 'scaleless', - 'scientific', - 'search', - 'searchtree', - 'sec', - 'secondaryX', - 'secondaryY', - 'seconds', - 'section', - 'sector', - 'seek', - 'seekeof', - 'segment', - 'sequence', - 'setpens', - 'sgn', - 'sgnd', - 'sharpangle', - 'sharpdegrees', - 'shift', - 'shiftless', - 'shipout', - 'shipout3', - 'show', - 'side', - 'simeq', - 'simpson', - 'sin', - 'single', - 'sinh', - 'size', - 'size3', - 'skewness', - 'skip', - 'slant', - 'sleep', - 'slope', - 'slopefield', - 'solve', - 'solveBVP', - 'sort', - 'sourceline', - 'sphere', - 'split', - 'sqrt', - 'square', - 'srand', - 'standardizecoordsys', - 'startScript', - 'startTrembling', - 'stdev', - 'step', - 'stickframe', - 'stickmarksize', - 'stickmarkspace', - 'stop', - 'straight', - 'straightness', - 'string', - 'stripdirectory', - 'stripextension', - 'stripfile', - 'strokepath', - 'subdivide', - 'subitem', - 'subpath', - 'substr', - 'sum', - 'surface', - 'symmedial', - 'symmedian', - 'system', - 'tab', - 'tableau', - 'tan', - 'tangent', - 'tangential', - 'tangents', - 'tanh', - 'tell', - 'tensionSpecifier', - 'tensorshade', - 'tex', - 'texcolor', - 'texify', - 'texpath', - 'texpreamble', - 'texreset', - 'texshipout', - 'texsize', - 'textpath', - 'thick', - 'thin', - 'tick', - 'tickMax', - 'tickMax3', - 'tickMin', - 'tickMin3', - 'ticklabelshift', - 'ticklocate', - 'tildeframe', - 'tildemarksize', - 'tile', - 'tiling', - 'time', - 'times', - 'title', - 'titlepage', - 'topbox', - 'transform', - 'transformation', - 'transpose', - 'tremble', - 'trembleFuzz', - 'tremble_circlenodesnumber', - 'tremble_circlenodesnumber1', - 'tremble_draw', - 'tremble_ellipsenodesnumber', - 'tremble_ellipsenodesnumber1', - 'tremble_hyperbolanodesnumber', - 'tremble_marknodes', - 'tremble_markuniform', - 'tremble_parabolanodesnumber', - 'triangle', - 'triangleAbc', - 'triangleabc', - 'triangulate', - 'tricoef', - 'tridiagonal', - 'trilinear', - 'trim', - 'trueMagnetize', - 'truepoint', - 'tube', - 'uncycle', - 'unfill', - 'uniform', - 'unit', - 'unitrand', - 'unitsize', - 'unityroot', - 'unstraighten', - 'upcase', - 'updatefunction', - 'uperiodic', - 'upscale', - 'uptodate', - 'usepackage', - 'usersetting', - 'usetypescript', - 'usleep', - 'value', - 'variance', - 'variancebiased', - 'vbox', - 'vector', - 'vectorfield', - 'verbatim', - 'view', - 'vline', - 'vperiodic', - 'vprojection', - 'warn', - 'warning', - 'windingnumber', - 'write', - 'xaxis', - 'xaxis3', - 'xaxis3At', - 'xaxisAt', - 'xequals', - 'xinput', - 'xlimits', - 'xoutput', - 'xpart', - 'xscale', - 'xscaleO', - 'xtick', - 'xtick3', - 'xtrans', - 'yaxis', - 'yaxis3', - 'yaxis3At', - 'yaxisAt', - 'yequals', - 'ylimits', - 'ypart', - 'yscale', - 'yscaleO', - 'ytick', - 'ytick3', - 'ytrans', - 'zaxis3', - 'zaxis3At', - 'zero', - 'zero3', - 'zlimits', - 'zpart', - 'ztick', - 'ztick3', - 'ztrans' -)) - -ASYVARNAME = set(( - 'AliceBlue', - 'Align', - 'Allow', - 'AntiqueWhite', - 'Apricot', - 'Aqua', - 'Aquamarine', - 'Aspect', - 'Azure', - 'BeginPoint', - 'Beige', - 'Bisque', - 'Bittersweet', - 'Black', - 'BlanchedAlmond', - 'Blue', - 'BlueGreen', - 'BlueViolet', - 'Both', - 'Break', - 'BrickRed', - 'Brown', - 'BurlyWood', - 'BurntOrange', - 'CCW', - 'CW', - 'CadetBlue', - 'CarnationPink', - 'Center', - 'Centered', - 'Cerulean', - 'Chartreuse', - 'Chocolate', - 'Coeff', - 'Coral', - 'CornflowerBlue', - 'Cornsilk', - 'Crimson', - 'Crop', - 'Cyan', - 'Dandelion', - 'DarkBlue', - 'DarkCyan', - 'DarkGoldenrod', - 'DarkGray', - 'DarkGreen', - 'DarkKhaki', - 'DarkMagenta', - 'DarkOliveGreen', - 'DarkOrange', - 'DarkOrchid', - 'DarkRed', - 'DarkSalmon', - 'DarkSeaGreen', - 'DarkSlateBlue', - 'DarkSlateGray', - 'DarkTurquoise', - 'DarkViolet', - 'DeepPink', - 'DeepSkyBlue', - 'DefaultHead', - 'DimGray', - 'DodgerBlue', - 'Dotted', - 'Draw', - 'E', - 'ENE', - 'EPS', - 'ESE', - 'E_Euler', - 'E_PC', - 'E_RK2', - 'E_RK3BS', - 'Emerald', - 'EndPoint', - 'Euler', - 'Fill', - 'FillDraw', - 'FireBrick', - 'FloralWhite', - 'ForestGreen', - 'Fuchsia', - 'Gainsboro', - 'GhostWhite', - 'Gold', - 'Goldenrod', - 'Gray', - 'Green', - 'GreenYellow', - 'Honeydew', - 'HookHead', - 'Horizontal', - 'HotPink', - 'I', - 'IgnoreAspect', - 'IndianRed', - 'Indigo', - 'Ivory', - 'JOIN_IN', - 'JOIN_OUT', - 'JungleGreen', - 'Khaki', - 'LM_DWARF', - 'LM_MACHEP', - 'LM_SQRT_DWARF', - 'LM_SQRT_GIANT', - 'LM_USERTOL', - 'Label', - 'Lavender', - 'LavenderBlush', - 'LawnGreen', - 'LeftJustified', - 'LeftSide', - 'LemonChiffon', - 'LightBlue', - 'LightCoral', - 'LightCyan', - 'LightGoldenrodYellow', - 'LightGreen', - 'LightGrey', - 'LightPink', - 'LightSalmon', - 'LightSeaGreen', - 'LightSkyBlue', - 'LightSlateGray', - 'LightSteelBlue', - 'LightYellow', - 'Lime', - 'LimeGreen', - 'Linear', - 'Linen', - 'Log', - 'Logarithmic', - 'Magenta', - 'Mahogany', - 'Mark', - 'MarkFill', - 'Maroon', - 'Max', - 'MediumAquamarine', - 'MediumBlue', - 'MediumOrchid', - 'MediumPurple', - 'MediumSeaGreen', - 'MediumSlateBlue', - 'MediumSpringGreen', - 'MediumTurquoise', - 'MediumVioletRed', - 'Melon', - 'MidPoint', - 'MidnightBlue', - 'Min', - 'MintCream', - 'MistyRose', - 'Moccasin', - 'Move', - 'MoveQuiet', - 'Mulberry', - 'N', - 'NE', - 'NNE', - 'NNW', - 'NW', - 'NavajoWhite', - 'Navy', - 'NavyBlue', - 'NoAlign', - 'NoCrop', - 'NoFill', - 'NoSide', - 'OldLace', - 'Olive', - 'OliveDrab', - 'OliveGreen', - 'Orange', - 'OrangeRed', - 'Orchid', - 'Ox', - 'Oy', - 'PC', - 'PaleGoldenrod', - 'PaleGreen', - 'PaleTurquoise', - 'PaleVioletRed', - 'PapayaWhip', - 'Peach', - 'PeachPuff', - 'Periwinkle', - 'Peru', - 'PineGreen', - 'Pink', - 'Plum', - 'PowderBlue', - 'ProcessBlue', - 'Purple', - 'RK2', - 'RK3', - 'RK3BS', - 'RK4', - 'RK5', - 'RK5DP', - 'RK5F', - 'RawSienna', - 'Red', - 'RedOrange', - 'RedViolet', - 'Rhodamine', - 'RightJustified', - 'RightSide', - 'RosyBrown', - 'RoyalBlue', - 'RoyalPurple', - 'RubineRed', - 'S', - 'SE', - 'SSE', - 'SSW', - 'SW', - 'SaddleBrown', - 'Salmon', - 'SandyBrown', - 'SeaGreen', - 'Seashell', - 'Sepia', - 'Sienna', - 'Silver', - 'SimpleHead', - 'SkyBlue', - 'SlateBlue', - 'SlateGray', - 'Snow', - 'SpringGreen', - 'SteelBlue', - 'Suppress', - 'SuppressQuiet', - 'Tan', - 'TeXHead', - 'Teal', - 'TealBlue', - 'Thistle', - 'Ticksize', - 'Tomato', - 'Turquoise', - 'UnFill', - 'VERSION', - 'Value', - 'Vertical', - 'Violet', - 'VioletRed', - 'W', - 'WNW', - 'WSW', - 'Wheat', - 'White', - 'WhiteSmoke', - 'WildStrawberry', - 'XYAlign', - 'YAlign', - 'Yellow', - 'YellowGreen', - 'YellowOrange', - 'addpenarc', - 'addpenline', - 'align', - 'allowstepping', - 'angularsystem', - 'animationdelay', - 'appendsuffix', - 'arcarrowangle', - 'arcarrowfactor', - 'arrow2sizelimit', - 'arrowangle', - 'arrowbarb', - 'arrowdir', - 'arrowfactor', - 'arrowhookfactor', - 'arrowlength', - 'arrowsizelimit', - 'arrowtexfactor', - 'authorpen', - 'axis', - 'axiscoverage', - 'axislabelfactor', - 'background', - 'backgroundcolor', - 'backgroundpen', - 'barfactor', - 'barmarksizefactor', - 'basealign', - 'baselinetemplate', - 'beveljoin', - 'bigvertexpen', - 'bigvertexsize', - 'black', - 'blue', - 'bm', - 'bottom', - 'bp', - 'brown', - 'bullet', - 'byfoci', - 'byvertices', - 'camerafactor', - 'chartreuse', - 'circlemarkradiusfactor', - 'circlenodesnumberfactor', - 'circleprecision', - 'circlescale', - 'cm', - 'codefile', - 'codepen', - 'codeskip', - 'colorPen', - 'coloredNodes', - 'coloredSegments', - 'conditionlength', - 'conicnodesfactor', - 'count', - 'cputimeformat', - 'crossmarksizefactor', - 'currentcoordsys', - 'currentlight', - 'currentpatterns', - 'currentpen', - 'currentpicture', - 'currentposition', - 'currentprojection', - 'curvilinearsystem', - 'cuttings', - 'cyan', - 'darkblue', - 'darkbrown', - 'darkcyan', - 'darkgray', - 'darkgreen', - 'darkgrey', - 'darkmagenta', - 'darkolive', - 'darkred', - 'dashdotted', - 'dashed', - 'datepen', - 'dateskip', - 'debuggerlines', - 'debugging', - 'deepblue', - 'deepcyan', - 'deepgray', - 'deepgreen', - 'deepgrey', - 'deepmagenta', - 'deepred', - 'default', - 'defaultControl', - 'defaultS', - 'defaultbackpen', - 'defaultcoordsys', - 'defaultfilename', - 'defaultformat', - 'defaultmassformat', - 'defaultpen', - 'diagnostics', - 'differentlengths', - 'dot', - 'dotfactor', - 'dotframe', - 'dotted', - 'doublelinepen', - 'doublelinespacing', - 'down', - 'duplicateFuzz', - 'ellipsenodesnumberfactor', - 'eps', - 'epsgeo', - 'epsilon', - 'evenodd', - 'extendcap', - 'fermionpen', - 'figureborder', - 'figuremattpen', - 'firstnode', - 'firststep', - 'foregroundcolor', - 'fuchsia', - 'fuzz', - 'gapfactor', - 'ghostpen', - 'gluonamplitude', - 'gluonpen', - 'gluonratio', - 'gray', - 'green', - 'grey', - 'hatchepsilon', - 'havepagenumber', - 'heavyblue', - 'heavycyan', - 'heavygray', - 'heavygreen', - 'heavygrey', - 'heavymagenta', - 'heavyred', - 'hline', - 'hwratio', - 'hyperbolanodesnumberfactor', - 'identity4', - 'ignore', - 'inXasyMode', - 'inch', - 'inches', - 'includegraphicscommand', - 'inf', - 'infinity', - 'institutionpen', - 'intMax', - 'intMin', - 'invert', - 'invisible', - 'itempen', - 'itemskip', - 'itemstep', - 'labelmargin', - 'landscape', - 'lastnode', - 'left', - 'legendhskip', - 'legendlinelength', - 'legendmargin', - 'legendmarkersize', - 'legendmaxrelativewidth', - 'legendvskip', - 'lightblue', - 'lightcyan', - 'lightgray', - 'lightgreen', - 'lightgrey', - 'lightmagenta', - 'lightolive', - 'lightred', - 'lightyellow', - 'linemargin', - 'lm_infmsg', - 'lm_shortmsg', - 'longdashdotted', - 'longdashed', - 'magenta', - 'magneticPoints', - 'magneticRadius', - 'mantissaBits', - 'markangleradius', - 'markangleradiusfactor', - 'markanglespace', - 'markanglespacefactor', - 'mediumblue', - 'mediumcyan', - 'mediumgray', - 'mediumgreen', - 'mediumgrey', - 'mediummagenta', - 'mediumred', - 'mediumyellow', - 'middle', - 'minDistDefault', - 'minblockheight', - 'minblockwidth', - 'mincirclediameter', - 'minipagemargin', - 'minipagewidth', - 'minvertexangle', - 'miterjoin', - 'mm', - 'momarrowfactor', - 'momarrowlength', - 'momarrowmargin', - 'momarrowoffset', - 'momarrowpen', - 'monoPen', - 'morepoints', - 'nCircle', - 'newbulletcolor', - 'ngraph', - 'nil', - 'nmesh', - 'nobasealign', - 'nodeMarginDefault', - 'nodesystem', - 'nomarker', - 'nopoint', - 'noprimary', - 'nullpath', - 'nullpen', - 'numarray', - 'ocgindex', - 'oldbulletcolor', - 'olive', - 'orange', - 'origin', - 'overpaint', - 'page', - 'pageheight', - 'pagemargin', - 'pagenumberalign', - 'pagenumberpen', - 'pagenumberposition', - 'pagewidth', - 'paleblue', - 'palecyan', - 'palegray', - 'palegreen', - 'palegrey', - 'palemagenta', - 'palered', - 'paleyellow', - 'parabolanodesnumberfactor', - 'perpfactor', - 'phi', - 'photonamplitude', - 'photonpen', - 'photonratio', - 'pi', - 'pink', - 'plain', - 'plus', - 'preamblenodes', - 'pt', - 'purple', - 'r3', - 'r4a', - 'r4b', - 'randMax', - 'realDigits', - 'realEpsilon', - 'realMax', - 'realMin', - 'red', - 'relativesystem', - 'reverse', - 'right', - 'roundcap', - 'roundjoin', - 'royalblue', - 'salmon', - 'saveFunctions', - 'scalarpen', - 'sequencereal', - 'settings', - 'shipped', - 'signedtrailingzero', - 'solid', - 'springgreen', - 'sqrtEpsilon', - 'squarecap', - 'squarepen', - 'startposition', - 'stdin', - 'stdout', - 'stepfactor', - 'stepfraction', - 'steppagenumberpen', - 'stepping', - 'stickframe', - 'stickmarksizefactor', - 'stickmarkspacefactor', - 'textpen', - 'ticksize', - 'tildeframe', - 'tildemarksizefactor', - 'tinv', - 'titlealign', - 'titlepagepen', - 'titlepageposition', - 'titlepen', - 'titleskip', - 'top', - 'trailingzero', - 'treeLevelStep', - 'treeMinNodeWidth', - 'treeNodeStep', - 'trembleAngle', - 'trembleFrequency', - 'trembleRandom', - 'tremblingMode', - 'undefined', - 'unitcircle', - 'unitsquare', - 'up', - 'urlpen', - 'urlskip', - 'version', - 'vertexpen', - 'vertexsize', - 'viewportmargin', - 'viewportsize', - 'vline', - 'white', - 'wye', - 'xformStack', - 'yellow', - 'ylabelwidth', - 'zerotickfuzz', - 'zerowinding' -)) diff --git a/wakatime/packages/py2/pygments/lexers/_cocoa_builtins.py b/wakatime/packages/py2/pygments/lexers/_cocoa_builtins.py deleted file mode 100644 index 024bfc0..0000000 --- a/wakatime/packages/py2/pygments/lexers/_cocoa_builtins.py +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._cocoa_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This file defines a set of types used across Cocoa frameworks from Apple. - There is a list of @interfaces, @protocols and some other (structs, unions) - - File may be also used as standalone generator for aboves. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from __future__ import print_function - -COCOA_INTERFACES = set(['UITableViewCell', 'HKCorrelationQuery', 'NSURLSessionDataTask', 'PHFetchOptions', 'NSLinguisticTagger', 'NSStream', 'AVAudioUnitDelay', 'GCMotion', 'SKPhysicsWorld', 'NSString', 'CMAttitude', 'AVAudioEnvironmentDistanceAttenuationParameters', 'HKStatisticsCollection', 'SCNPlane', 'CBPeer', 'JSContext', 'SCNTransaction', 'SCNTorus', 'AVAudioUnitEffect', 'UICollectionReusableView', 'MTLSamplerDescriptor', 'AVAssetReaderSampleReferenceOutput', 'AVMutableCompositionTrack', 'GKLeaderboard', 'NSFetchedResultsController', 'SKRange', 'MKTileOverlayRenderer', 'MIDINetworkSession', 'UIVisualEffectView', 'CIWarpKernel', 'PKObject', 'MKRoute', 'MPVolumeView', 'UIPrintInfo', 'SCNText', 'ADClient', 'UIKeyCommand', 'AVMutableAudioMix', 'GLKEffectPropertyLight', 'WKScriptMessage', 'AVMIDIPlayer', 'PHCollectionListChangeRequest', 'UICollectionViewLayout', 'NSMutableCharacterSet', 'SKPaymentTransaction', 'NEOnDemandRuleConnect', 'NSShadow', 'SCNView', 'NSURLSessionConfiguration', 'MTLVertexAttributeDescriptor', 'CBCharacteristic', 'HKQuantityType', 'CKLocationSortDescriptor', 'NEVPNIKEv2SecurityAssociationParameters', 'CMStepCounter', 'NSNetService', 'AVAssetWriterInputMetadataAdaptor', 'UICollectionView', 'UIViewPrintFormatter', 'SCNLevelOfDetail', 'CAShapeLayer', 'MCPeerID', 'MPRatingCommand', 'WKNavigation', 'NSDictionary', 'NSFileVersion', 'CMGyroData', 'AVAudioUnitDistortion', 'CKFetchRecordsOperation', 'SKPhysicsJointSpring', 'SCNHitTestResult', 'AVAudioTime', 'CIFilter', 'UIView', 'SCNConstraint', 'CAPropertyAnimation', 'MKMapItem', 'MPRemoteCommandCenter', 'UICollectionViewFlowLayoutInvalidationContext', 'UIInputViewController', 'PKPass', 'SCNPhysicsBehavior', 'MTLRenderPassColorAttachmentDescriptor', 'MKPolygonRenderer', 'CKNotification', 'JSValue', 'PHCollectionList', 'CLGeocoder', 'NSByteCountFormatter', 'AVCaptureScreenInput', 'MPFeedbackCommand', 'CAAnimation', 'MKOverlayPathView', 'UIActionSheet', 'UIMotionEffectGroup', 'NSLengthFormatter', 'UIBarItem', 'SKProduct', 'AVAssetExportSession', 'NSKeyedUnarchiver', 'NSMutableSet', 'SCNPyramid', 'PHAssetCollection', 'MKMapView', 'HMHomeManager', 'CATransition', 'MTLCompileOptions', 'UIVibrancyEffect', 'CLCircularRegion', 'MKTileOverlay', 'SCNShape', 'ACAccountCredential', 'SKPhysicsJointLimit', 'MKMapSnapshotter', 'AVMediaSelectionGroup', 'NSIndexSet', 'CBPeripheralManager', 'CKRecordZone', 'AVAudioRecorder', 'NSURL', 'CBCentral', 'NSNumber', 'AVAudioOutputNode', 'MTLVertexAttributeDescriptorArray', 'MKETAResponse', 'SKTransition', 'SSReadingList', 'HKSourceQuery', 'UITableViewRowAction', 'UITableView', 'SCNParticlePropertyController', 'AVCaptureStillImageOutput', 'GCController', 'AVAudioPlayerNode', 'AVAudioSessionPortDescription', 'NSHTTPURLResponse', 'NEOnDemandRuleEvaluateConnection', 'SKEffectNode', 'HKQuantity', 'GCControllerElement', 'AVPlayerItemAccessLogEvent', 'SCNBox', 'NSExtensionContext', 'MKOverlayRenderer', 'SCNPhysicsVehicle', 'NSDecimalNumber', 'EKReminder', 'MKPolylineView', 'CKQuery', 'AVAudioMixerNode', 'GKAchievementDescription', 'EKParticipant', 'NSBlockOperation', 'UIActivityItemProvider', 'CLLocation', 'NSBatchUpdateRequest', 'PHContentEditingOutput', 'PHObjectChangeDetails', 'MPMoviePlayerController', 'AVAudioFormat', 'HMTrigger', 'MTLRenderPassDepthAttachmentDescriptor', 'SCNRenderer', 'GKScore', 'UISplitViewController', 'HKSource', 'NSURLConnection', 'ABUnknownPersonViewController', 'SCNTechnique', 'UIMenuController', 'NSEvent', 'SKTextureAtlas', 'NSKeyedArchiver', 'GKLeaderboardSet', 'NSSimpleCString', 'AVAudioPCMBuffer', 'CBATTRequest', 'GKMatchRequest', 'AVMetadataObject', 'SKProductsRequest', 'UIAlertView', 'NSIncrementalStore', 'MFMailComposeViewController', 'SCNFloor', 'NSSortDescriptor', 'CKFetchNotificationChangesOperation', 'MPMovieAccessLog', 'NSManagedObjectContext', 'AVAudioUnitGenerator', 'WKBackForwardList', 'SKMutableTexture', 'AVCaptureAudioDataOutput', 'ACAccount', 'AVMetadataItem', 'MPRatingCommandEvent', 'AVCaptureDeviceInputSource', 'CLLocationManager', 'MPRemoteCommand', 'AVCaptureSession', 'UIStepper', 'UIRefreshControl', 'NEEvaluateConnectionRule', 'CKModifyRecordsOperation', 'UICollectionViewTransitionLayout', 'CBCentralManager', 'NSPurgeableData', 'SLComposeViewController', 'NSHashTable', 'MKUserTrackingBarButtonItem', 'UILexiconEntry', 'CMMotionActivity', 'SKAction', 'SKShader', 'AVPlayerItemOutput', 'MTLRenderPassAttachmentDescriptor', 'UIDocumentInteractionController', 'UIDynamicItemBehavior', 'NSMutableDictionary', 'UILabel', 'AVCaptureInputPort', 'NSExpression', 'CAInterAppAudioTransportView', 'SKMutablePayment', 'UIImage', 'PHCachingImageManager', 'SCNTransformConstraint', 'UIColor', 'SCNGeometrySource', 'AVCaptureAutoExposureBracketedStillImageSettings', 'UIPopoverBackgroundView', 'UIToolbar', 'NSNotificationCenter', 'AVAssetReaderOutputMetadataAdaptor', 'NSEntityMigrationPolicy', 'NSLocale', 'NSURLSession', 'SCNCamera', 'NSTimeZone', 'UIManagedDocument', 'AVMutableVideoCompositionLayerInstruction', 'AVAssetTrackGroup', 'NSInvocationOperation', 'ALAssetRepresentation', 'AVQueuePlayer', 'HMServiceGroup', 'UIPasteboard', 'PHContentEditingInput', 'NSLayoutManager', 'EKCalendarChooser', 'EKObject', 'CATiledLayer', 'GLKReflectionMapEffect', 'NSManagedObjectID', 'NSEnergyFormatter', 'SLRequest', 'HMCharacteristic', 'AVPlayerLayer', 'MTLRenderPassDescriptor', 'SKPayment', 'NSPointerArray', 'AVAudioMix', 'SCNLight', 'MCAdvertiserAssistant', 'MKMapSnapshotOptions', 'HKCategorySample', 'AVAudioEnvironmentReverbParameters', 'SCNMorpher', 'AVTimedMetadataGroup', 'CBMutableCharacteristic', 'NSFetchRequest', 'UIDevice', 'NSManagedObject', 'NKAssetDownload', 'AVOutputSettingsAssistant', 'SKPhysicsJointPin', 'UITabBar', 'UITextInputMode', 'NSFetchRequestExpression', 'HMActionSet', 'CTSubscriber', 'PHAssetChangeRequest', 'NSPersistentStoreRequest', 'UITabBarController', 'HKQuantitySample', 'AVPlayerItem', 'AVSynchronizedLayer', 'MKDirectionsRequest', 'NSMetadataItem', 'UIPresentationController', 'UINavigationItem', 'PHFetchResultChangeDetails', 'PHImageManager', 'AVCaptureManualExposureBracketedStillImageSettings', 'UIStoryboardPopoverSegue', 'SCNLookAtConstraint', 'UIGravityBehavior', 'UIWindow', 'CBMutableDescriptor', 'NEOnDemandRuleDisconnect', 'UIBezierPath', 'UINavigationController', 'ABPeoplePickerNavigationController', 'EKSource', 'AVAssetWriterInput', 'AVPlayerItemTrack', 'GLKEffectPropertyTexture', 'NSURLResponse', 'SKPaymentQueue', 'NSAssertionHandler', 'MKReverseGeocoder', 'GCControllerAxisInput', 'NSArray', 'NSOrthography', 'NSURLSessionUploadTask', 'NSCharacterSet', 'AVMutableVideoCompositionInstruction', 'AVAssetReaderOutput', 'EAGLContext', 'WKFrameInfo', 'CMPedometer', 'MyClass', 'CKModifyBadgeOperation', 'AVCaptureAudioFileOutput', 'SKEmitterNode', 'NSMachPort', 'AVVideoCompositionCoreAnimationTool', 'PHCollection', 'SCNPhysicsWorld', 'NSURLRequest', 'CMAccelerometerData', 'NSNetServiceBrowser', 'CLFloor', 'AVAsynchronousVideoCompositionRequest', 'SCNGeometry', 'SCNIKConstraint', 'CIKernel', 'CAGradientLayer', 'HKCharacteristicType', 'NSFormatter', 'SCNAction', 'CATransaction', 'CBUUID', 'UIStoryboard', 'MPMediaLibrary', 'UITapGestureRecognizer', 'MPMediaItemArtwork', 'NSURLSessionTask', 'AVAudioUnit', 'MCBrowserViewController', 'NSRelationshipDescription', 'HKSample', 'WKWebView', 'NSMutableAttributedString', 'NSPersistentStoreAsynchronousResult', 'MPNowPlayingInfoCenter', 'MKLocalSearch', 'EAAccessory', 'HKCorrelation', 'CATextLayer', 'NSNotificationQueue', 'UINib', 'GLKTextureLoader', 'HKObjectType', 'NSValue', 'NSMutableIndexSet', 'SKPhysicsContact', 'NSProgress', 'AVPlayerViewController', 'CAScrollLayer', 'GKSavedGame', 'NSTextCheckingResult', 'PHObjectPlaceholder', 'SKConstraint', 'EKEventEditViewController', 'NSEntityDescription', 'NSURLCredentialStorage', 'UIApplication', 'SKDownload', 'SCNNode', 'MKLocalSearchRequest', 'SKScene', 'UISearchDisplayController', 'NEOnDemandRule', 'MTLRenderPassStencilAttachmentDescriptor', 'CAReplicatorLayer', 'UIPrintPageRenderer', 'EKCalendarItem', 'NSUUID', 'EAAccessoryManager', 'NEOnDemandRuleIgnore', 'SKRegion', 'AVAssetResourceLoader', 'EAWiFiUnconfiguredAccessoryBrowser', 'NSUserActivity', 'CTCall', 'UIPrinterPickerController', 'CIVector', 'UINavigationBar', 'UIPanGestureRecognizer', 'MPMediaQuery', 'ABNewPersonViewController', 'CKRecordZoneID', 'HKAnchoredObjectQuery', 'CKFetchRecordZonesOperation', 'UIStoryboardSegue', 'ACAccountType', 'GKSession', 'SKVideoNode', 'PHChange', 'SKReceiptRefreshRequest', 'GCExtendedGamepadSnapshot', 'MPSeekCommandEvent', 'GCExtendedGamepad', 'CAValueFunction', 'SCNCylinder', 'NSNotification', 'NSBatchUpdateResult', 'PKPushCredentials', 'SCNPhysicsSliderJoint', 'AVCaptureDeviceFormat', 'AVPlayerItemErrorLog', 'NSMapTable', 'NSSet', 'CMMotionManager', 'GKVoiceChatService', 'UIPageControl', 'UILexicon', 'MTLArrayType', 'AVAudioUnitReverb', 'MKGeodesicPolyline', 'AVMutableComposition', 'NSLayoutConstraint', 'UIPrinter', 'NSOrderedSet', 'CBAttribute', 'PKPushPayload', 'NSIncrementalStoreNode', 'EKEventStore', 'MPRemoteCommandEvent', 'UISlider', 'UIBlurEffect', 'CKAsset', 'AVCaptureInput', 'AVAudioEngine', 'MTLVertexDescriptor', 'SKPhysicsBody', 'NSOperation', 'UIImageAsset', 'MKMapCamera', 'SKProductsResponse', 'GLKEffectPropertyMaterial', 'AVCaptureDevice', 'CTCallCenter', 'CABTMIDILocalPeripheralViewController', 'NEVPNManager', 'HKQuery', 'SCNPhysicsContact', 'CBMutableService', 'AVSampleBufferDisplayLayer', 'SCNSceneSource', 'SKLightNode', 'CKDiscoveredUserInfo', 'NSMutableArray', 'MTLDepthStencilDescriptor', 'MTLArgument', 'NSMassFormatter', 'CIRectangleFeature', 'PKPushRegistry', 'NEVPNConnection', 'MCNearbyServiceBrowser', 'NSOperationQueue', 'MKPolylineRenderer', 'UICollectionViewLayoutAttributes', 'NSValueTransformer', 'UICollectionViewFlowLayout', 'CIBarcodeFeature', 'MPChangePlaybackRateCommandEvent', 'NSEntityMapping', 'SKTexture', 'NSMergePolicy', 'UITextInputStringTokenizer', 'NSRecursiveLock', 'AVAsset', 'NSUndoManager', 'AVAudioUnitSampler', 'NSItemProvider', 'SKUniform', 'MPMediaPickerController', 'CKOperation', 'MTLRenderPipelineDescriptor', 'EAWiFiUnconfiguredAccessory', 'NSFileCoordinator', 'SKRequest', 'NSFileHandle', 'NSConditionLock', 'UISegmentedControl', 'NSManagedObjectModel', 'UITabBarItem', 'SCNCone', 'MPMediaItem', 'SCNMaterial', 'EKRecurrenceRule', 'UIEvent', 'UITouch', 'UIPrintInteractionController', 'CMDeviceMotion', 'NEVPNProtocol', 'NSCompoundPredicate', 'HKHealthStore', 'MKMultiPoint', 'HKSampleType', 'UIPrintFormatter', 'AVAudioUnitEQFilterParameters', 'SKView', 'NSConstantString', 'UIPopoverController', 'CKDatabase', 'AVMetadataFaceObject', 'UIAccelerometer', 'EKEventViewController', 'CMAltitudeData', 'MTLStencilDescriptor', 'UISwipeGestureRecognizer', 'NSPort', 'MKCircleRenderer', 'AVCompositionTrack', 'NSAsynchronousFetchRequest', 'NSUbiquitousKeyValueStore', 'NSMetadataQueryResultGroup', 'AVAssetResourceLoadingDataRequest', 'UITableViewHeaderFooterView', 'CKNotificationID', 'AVAudioSession', 'HKUnit', 'NSNull', 'NSPersistentStoreResult', 'MKCircleView', 'AVAudioChannelLayout', 'NEVPNProtocolIKEv2', 'WKProcessPool', 'UIAttachmentBehavior', 'CLBeacon', 'NSInputStream', 'NSURLCache', 'GKPlayer', 'NSMappingModel', 'NSHTTPCookie', 'AVMutableVideoComposition', 'PHFetchResult', 'NSAttributeDescription', 'AVPlayer', 'MKAnnotationView', 'UIFontDescriptor', 'NSTimer', 'CBDescriptor', 'MKOverlayView', 'AVAudioUnitTimePitch', 'NSSaveChangesRequest', 'UIReferenceLibraryViewController', 'SKPhysicsJointFixed', 'UILocalizedIndexedCollation', 'UIInterpolatingMotionEffect', 'UIDocumentPickerViewController', 'AVAssetWriter', 'NSBundle', 'SKStoreProductViewController', 'GLKViewController', 'NSMetadataQueryAttributeValueTuple', 'GKTurnBasedMatch', 'AVAudioFile', 'UIActivity', 'NSPipe', 'MKShape', 'NSMergeConflict', 'CIImage', 'HKObject', 'UIRotationGestureRecognizer', 'AVPlayerItemLegibleOutput', 'AVAssetImageGenerator', 'GCControllerButtonInput', 'CKMarkNotificationsReadOperation', 'CKSubscription', 'MPTimedMetadata', 'NKIssue', 'UIScreenMode', 'HMAccessoryBrowser', 'GKTurnBasedEventHandler', 'UIWebView', 'MKPolyline', 'JSVirtualMachine', 'AVAssetReader', 'NSAttributedString', 'GKMatchmakerViewController', 'NSCountedSet', 'UIButton', 'WKNavigationResponse', 'GKLocalPlayer', 'MPMovieErrorLog', 'AVSpeechUtterance', 'HKStatistics', 'UILocalNotification', 'HKBiologicalSexObject', 'AVURLAsset', 'CBPeripheral', 'NSDateComponentsFormatter', 'SKSpriteNode', 'UIAccessibilityElement', 'AVAssetWriterInputGroup', 'HMZone', 'AVAssetReaderAudioMixOutput', 'NSEnumerator', 'UIDocument', 'MKLocalSearchResponse', 'UISimpleTextPrintFormatter', 'PHPhotoLibrary', 'CBService', 'UIDocumentMenuViewController', 'MCSession', 'QLPreviewController', 'CAMediaTimingFunction', 'UITextPosition', 'ASIdentifierManager', 'AVAssetResourceLoadingRequest', 'SLComposeServiceViewController', 'UIPinchGestureRecognizer', 'PHObject', 'NSExtensionItem', 'HKSampleQuery', 'MTLRenderPipelineColorAttachmentDescriptorArray', 'MKRouteStep', 'SCNCapsule', 'NSMetadataQuery', 'AVAssetResourceLoadingContentInformationRequest', 'UITraitCollection', 'CTCarrier', 'NSFileSecurity', 'UIAcceleration', 'UIMotionEffect', 'MTLRenderPipelineReflection', 'CLHeading', 'CLVisit', 'MKDirectionsResponse', 'HMAccessory', 'MTLStructType', 'UITextView', 'CMMagnetometerData', 'UICollisionBehavior', 'UIProgressView', 'CKServerChangeToken', 'UISearchBar', 'MKPlacemark', 'AVCaptureConnection', 'NSPropertyMapping', 'ALAssetsFilter', 'SK3DNode', 'AVPlayerItemErrorLogEvent', 'NSJSONSerialization', 'AVAssetReaderVideoCompositionOutput', 'ABPersonViewController', 'CIDetector', 'GKTurnBasedMatchmakerViewController', 'MPMediaItemCollection', 'SCNSphere', 'NSCondition', 'NSURLCredential', 'MIDINetworkConnection', 'NSFileProviderExtension', 'NSDecimalNumberHandler', 'NSAtomicStoreCacheNode', 'NSAtomicStore', 'EKAlarm', 'CKNotificationInfo', 'AVAudioUnitEQ', 'UIPercentDrivenInteractiveTransition', 'MKPolygon', 'AVAssetTrackSegment', 'MTLVertexAttribute', 'NSExpressionDescription', 'HKStatisticsCollectionQuery', 'NSURLAuthenticationChallenge', 'NSDirectoryEnumerator', 'MKDistanceFormatter', 'UIAlertAction', 'NSPropertyListSerialization', 'GKPeerPickerController', 'UIUserNotificationSettings', 'UITableViewController', 'GKNotificationBanner', 'MKPointAnnotation', 'MTLRenderPassColorAttachmentDescriptorArray', 'NSCache', 'SKPhysicsJoint', 'NSXMLParser', 'UIViewController', 'MFMessageComposeViewController', 'AVAudioInputNode', 'NSDataDetector', 'CABTMIDICentralViewController', 'AVAudioUnitMIDIInstrument', 'AVCaptureVideoPreviewLayer', 'AVAssetWriterInputPassDescription', 'MPChangePlaybackRateCommand', 'NSURLComponents', 'CAMetalLayer', 'UISnapBehavior', 'AVMetadataMachineReadableCodeObject', 'CKDiscoverUserInfosOperation', 'NSTextAttachment', 'NSException', 'UIMenuItem', 'CMMotionActivityManager', 'SCNGeometryElement', 'NCWidgetController', 'CAEmitterLayer', 'MKUserLocation', 'UIImagePickerController', 'CIFeature', 'AVCaptureDeviceInput', 'ALAsset', 'NSURLSessionDownloadTask', 'SCNPhysicsHingeJoint', 'MPMoviePlayerViewController', 'NSMutableOrderedSet', 'SCNMaterialProperty', 'UIFont', 'AVCaptureVideoDataOutput', 'NSCachedURLResponse', 'ALAssetsLibrary', 'NSInvocation', 'UILongPressGestureRecognizer', 'NSTextStorage', 'WKWebViewConfiguration', 'CIFaceFeature', 'MKMapSnapshot', 'GLKEffectPropertyFog', 'AVComposition', 'CKDiscoverAllContactsOperation', 'AVAudioMixInputParameters', 'CAEmitterBehavior', 'PKPassLibrary', 'UIMutableUserNotificationCategory', 'NSLock', 'NEVPNProtocolIPSec', 'ADBannerView', 'UIDocumentPickerExtensionViewController', 'UIActivityIndicatorView', 'AVPlayerMediaSelectionCriteria', 'CALayer', 'UIAccessibilityCustomAction', 'UIBarButtonItem', 'AVAudioSessionRouteDescription', 'CLBeaconRegion', 'HKBloodTypeObject', 'MTLVertexBufferLayoutDescriptorArray', 'CABasicAnimation', 'AVVideoCompositionInstruction', 'AVMutableTimedMetadataGroup', 'EKRecurrenceEnd', 'NSTextContainer', 'TWTweetComposeViewController', 'UIScrollView', 'WKNavigationAction', 'AVPlayerItemMetadataOutput', 'EKRecurrenceDayOfWeek', 'NSNumberFormatter', 'MTLComputePipelineReflection', 'UIScreen', 'CLRegion', 'NSProcessInfo', 'GLKTextureInfo', 'SCNSkinner', 'AVCaptureMetadataOutput', 'SCNAnimationEvent', 'NSTextTab', 'JSManagedValue', 'NSDate', 'UITextChecker', 'WKBackForwardListItem', 'NSData', 'NSParagraphStyle', 'AVMutableMetadataItem', 'EKCalendar', 'NSMutableURLRequest', 'UIVideoEditorController', 'HMTimerTrigger', 'AVAudioUnitVarispeed', 'UIDynamicAnimator', 'AVCompositionTrackSegment', 'GCGamepadSnapshot', 'MPMediaEntity', 'GLKSkyboxEffect', 'UISwitch', 'EKStructuredLocation', 'UIGestureRecognizer', 'NSProxy', 'GLKBaseEffect', 'UIPushBehavior', 'GKScoreChallenge', 'NSCoder', 'MPMediaPlaylist', 'NSDateComponents', 'WKUserScript', 'EKEvent', 'NSDateFormatter', 'NSAsynchronousFetchResult', 'AVAssetWriterInputPixelBufferAdaptor', 'UIVisualEffect', 'UICollectionViewCell', 'UITextField', 'CLPlacemark', 'MPPlayableContentManager', 'AVCaptureOutput', 'HMCharacteristicWriteAction', 'CKModifySubscriptionsOperation', 'NSPropertyDescription', 'GCGamepad', 'UIMarkupTextPrintFormatter', 'SCNTube', 'NSPersistentStoreCoordinator', 'AVAudioEnvironmentNode', 'GKMatchmaker', 'CIContext', 'NSThread', 'SLComposeSheetConfigurationItem', 'SKPhysicsJointSliding', 'NSPredicate', 'GKVoiceChat', 'SKCropNode', 'AVCaptureAudioPreviewOutput', 'NSStringDrawingContext', 'GKGameCenterViewController', 'UIPrintPaper', 'SCNPhysicsBallSocketJoint', 'UICollectionViewLayoutInvalidationContext', 'GLKEffectPropertyTransform', 'AVAudioIONode', 'UIDatePicker', 'MKDirections', 'ALAssetsGroup', 'CKRecordZoneNotification', 'SCNScene', 'MPMovieAccessLogEvent', 'CKFetchSubscriptionsOperation', 'CAEmitterCell', 'AVAudioUnitTimeEffect', 'HMCharacteristicMetadata', 'MKPinAnnotationView', 'UIPickerView', 'UIImageView', 'UIUserNotificationCategory', 'SCNPhysicsVehicleWheel', 'HKCategoryType', 'MPMediaQuerySection', 'GKFriendRequestComposeViewController', 'NSError', 'MTLRenderPipelineColorAttachmentDescriptor', 'SCNPhysicsShape', 'UISearchController', 'SCNPhysicsBody', 'CTSubscriberInfo', 'AVPlayerItemAccessLog', 'MPMediaPropertyPredicate', 'CMLogItem', 'NSAutoreleasePool', 'NSSocketPort', 'AVAssetReaderTrackOutput', 'SKNode', 'UIMutableUserNotificationAction', 'SCNProgram', 'AVSpeechSynthesisVoice', 'CMAltimeter', 'AVCaptureAudioChannel', 'GKTurnBasedExchangeReply', 'AVVideoCompositionLayerInstruction', 'AVSpeechSynthesizer', 'GKChallengeEventHandler', 'AVCaptureFileOutput', 'UIControl', 'SCNPhysicsField', 'CKReference', 'LAContext', 'CKRecordID', 'ADInterstitialAd', 'AVAudioSessionDataSourceDescription', 'AVAudioBuffer', 'CIColorKernel', 'GCControllerDirectionPad', 'NSFileManager', 'AVMutableAudioMixInputParameters', 'UIScreenEdgePanGestureRecognizer', 'CAKeyframeAnimation', 'CKQueryNotification', 'PHAdjustmentData', 'EASession', 'AVAssetResourceRenewalRequest', 'UIInputView', 'NSFileWrapper', 'UIResponder', 'NSPointerFunctions', 'NSHTTPCookieStorage', 'AVMediaSelectionOption', 'NSRunLoop', 'NSFileAccessIntent', 'CAAnimationGroup', 'MKCircle', 'UIAlertController', 'NSMigrationManager', 'NSDateIntervalFormatter', 'UICollectionViewUpdateItem', 'CKDatabaseOperation', 'PHImageRequestOptions', 'SKReachConstraints', 'CKRecord', 'CAInterAppAudioSwitcherView', 'WKWindowFeatures', 'GKInvite', 'NSMutableData', 'PHAssetCollectionChangeRequest', 'NSMutableParagraphStyle', 'UIDynamicBehavior', 'GLKEffectProperty', 'CKFetchRecordChangesOperation', 'SKShapeNode', 'MPMovieErrorLogEvent', 'MKPolygonView', 'MPContentItem', 'HMAction', 'NSScanner', 'GKAchievementChallenge', 'AVAudioPlayer', 'CKContainer', 'AVVideoComposition', 'NKLibrary', 'NSPersistentStore', 'AVCaptureMovieFileOutput', 'HMRoom', 'GKChallenge', 'UITextRange', 'NSURLProtectionSpace', 'ACAccountStore', 'MPSkipIntervalCommand', 'NSComparisonPredicate', 'HMHome', 'PHVideoRequestOptions', 'NSOutputStream', 'MPSkipIntervalCommandEvent', 'PKAddPassesViewController', 'UITextSelectionRect', 'CTTelephonyNetworkInfo', 'AVTextStyleRule', 'NSFetchedPropertyDescription', 'UIPageViewController', 'CATransformLayer', 'UICollectionViewController', 'AVAudioNode', 'MCNearbyServiceAdvertiser', 'NSObject', 'PHAsset', 'GKLeaderboardViewController', 'CKQueryCursor', 'MPMusicPlayerController', 'MKOverlayPathRenderer', 'CMPedometerData', 'HMService', 'SKFieldNode', 'GKAchievement', 'WKUserContentController', 'AVAssetTrack', 'TWRequest', 'SKLabelNode', 'AVCaptureBracketedStillImageSettings', 'MIDINetworkHost', 'MPMediaPredicate', 'AVFrameRateRange', 'MTLTextureDescriptor', 'MTLVertexBufferLayoutDescriptor', 'MPFeedbackCommandEvent', 'UIUserNotificationAction', 'HKStatisticsQuery', 'SCNParticleSystem', 'NSIndexPath', 'AVVideoCompositionRenderContext', 'CADisplayLink', 'HKObserverQuery', 'UIPopoverPresentationController', 'CKQueryOperation', 'CAEAGLLayer', 'NSMutableString', 'NSMessagePort', 'NSURLQueryItem', 'MTLStructMember', 'AVAudioSessionChannelDescription', 'GLKView', 'UIActivityViewController', 'GKAchievementViewController', 'GKTurnBasedParticipant', 'NSURLProtocol', 'NSUserDefaults', 'NSCalendar', 'SKKeyframeSequence', 'AVMetadataItemFilter', 'CKModifyRecordZonesOperation', 'WKPreferences', 'NSMethodSignature', 'NSRegularExpression', 'EAGLSharegroup', 'AVPlayerItemVideoOutput', 'PHContentEditingInputRequestOptions', 'GKMatch', 'CIColor', 'UIDictationPhrase']) -COCOA_PROTOCOLS = set(['SKStoreProductViewControllerDelegate', 'AVVideoCompositionInstruction', 'AVAudioSessionDelegate', 'GKMatchDelegate', 'NSFileManagerDelegate', 'UILayoutSupport', 'NSCopying', 'UIPrintInteractionControllerDelegate', 'QLPreviewControllerDataSource', 'SKProductsRequestDelegate', 'NSTextStorageDelegate', 'MCBrowserViewControllerDelegate', 'MTLComputeCommandEncoder', 'SCNSceneExportDelegate', 'UISearchResultsUpdating', 'MFMailComposeViewControllerDelegate', 'MTLBlitCommandEncoder', 'NSDecimalNumberBehaviors', 'PHContentEditingController', 'NSMutableCopying', 'UIActionSheetDelegate', 'UIViewControllerTransitioningDelegate', 'UIAlertViewDelegate', 'AVAudioPlayerDelegate', 'MKReverseGeocoderDelegate', 'NSCoding', 'UITextInputTokenizer', 'GKFriendRequestComposeViewControllerDelegate', 'UIActivityItemSource', 'NSCacheDelegate', 'UIAdaptivePresentationControllerDelegate', 'GKAchievementViewControllerDelegate', 'UIViewControllerTransitionCoordinator', 'EKEventEditViewDelegate', 'NSURLConnectionDelegate', 'UITableViewDelegate', 'GKPeerPickerControllerDelegate', 'UIGuidedAccessRestrictionDelegate', 'AVSpeechSynthesizerDelegate', 'AVAudio3DMixing', 'AVPlayerItemLegibleOutputPushDelegate', 'ADInterstitialAdDelegate', 'HMAccessoryBrowserDelegate', 'AVAssetResourceLoaderDelegate', 'UITabBarControllerDelegate', 'CKRecordValue', 'SKPaymentTransactionObserver', 'AVCaptureAudioDataOutputSampleBufferDelegate', 'UIInputViewAudioFeedback', 'GKChallengeListener', 'SKSceneDelegate', 'UIPickerViewDelegate', 'UIWebViewDelegate', 'UIApplicationDelegate', 'GKInviteEventListener', 'MPMediaPlayback', 'MyClassJavaScriptMethods', 'AVAsynchronousKeyValueLoading', 'QLPreviewItem', 'SCNBoundingVolume', 'NSPortDelegate', 'UIContentContainer', 'SCNNodeRendererDelegate', 'SKRequestDelegate', 'SKPhysicsContactDelegate', 'HMAccessoryDelegate', 'UIPageViewControllerDataSource', 'SCNSceneRendererDelegate', 'SCNPhysicsContactDelegate', 'MKMapViewDelegate', 'AVPlayerItemOutputPushDelegate', 'UICollectionViewDelegate', 'UIImagePickerControllerDelegate', 'MTLRenderCommandEncoder', 'UIToolbarDelegate', 'WKUIDelegate', 'SCNActionable', 'NSURLConnectionDataDelegate', 'MKOverlay', 'CBCentralManagerDelegate', 'JSExport', 'NSTextLayoutOrientationProvider', 'UIPickerViewDataSource', 'PKPushRegistryDelegate', 'UIViewControllerTransitionCoordinatorContext', 'NSLayoutManagerDelegate', 'MTLLibrary', 'NSFetchedResultsControllerDelegate', 'ABPeoplePickerNavigationControllerDelegate', 'MTLResource', 'NSDiscardableContent', 'UITextFieldDelegate', 'MTLBuffer', 'MTLSamplerState', 'GKGameCenterControllerDelegate', 'MPMediaPickerControllerDelegate', 'UISplitViewControllerDelegate', 'UIAppearance', 'UIPickerViewAccessibilityDelegate', 'UITraitEnvironment', 'UIScrollViewAccessibilityDelegate', 'ADBannerViewDelegate', 'MPPlayableContentDataSource', 'MTLComputePipelineState', 'NSURLSessionDelegate', 'MTLCommandBuffer', 'NSXMLParserDelegate', 'UIViewControllerRestoration', 'UISearchBarDelegate', 'UIBarPositioning', 'CBPeripheralDelegate', 'UISearchDisplayDelegate', 'CAAction', 'PKAddPassesViewControllerDelegate', 'MCNearbyServiceAdvertiserDelegate', 'MTLDepthStencilState', 'GKTurnBasedMatchmakerViewControllerDelegate', 'MPPlayableContentDelegate', 'AVCaptureVideoDataOutputSampleBufferDelegate', 'UIAppearanceContainer', 'UIStateRestoring', 'UITextDocumentProxy', 'MTLDrawable', 'NSURLSessionTaskDelegate', 'NSFilePresenter', 'AVAudioStereoMixing', 'UIViewControllerContextTransitioning', 'UITextInput', 'CBPeripheralManagerDelegate', 'UITextInputDelegate', 'NSFastEnumeration', 'NSURLAuthenticationChallengeSender', 'SCNProgramDelegate', 'AVVideoCompositing', 'SCNAnimatable', 'NSSecureCoding', 'MCAdvertiserAssistantDelegate', 'GKLocalPlayerListener', 'GLKNamedEffect', 'UIPopoverControllerDelegate', 'AVCaptureMetadataOutputObjectsDelegate', 'NSExtensionRequestHandling', 'UITextSelecting', 'UIPrinterPickerControllerDelegate', 'NCWidgetProviding', 'MTLCommandEncoder', 'NSURLProtocolClient', 'MFMessageComposeViewControllerDelegate', 'UIVideoEditorControllerDelegate', 'WKNavigationDelegate', 'GKSavedGameListener', 'UITableViewDataSource', 'MTLFunction', 'EKCalendarChooserDelegate', 'NSUserActivityDelegate', 'UICollisionBehaviorDelegate', 'NSStreamDelegate', 'MCNearbyServiceBrowserDelegate', 'HMHomeDelegate', 'UINavigationControllerDelegate', 'MCSessionDelegate', 'UIDocumentPickerDelegate', 'UIViewControllerInteractiveTransitioning', 'GKTurnBasedEventListener', 'SCNSceneRenderer', 'MTLTexture', 'GLKViewDelegate', 'EAAccessoryDelegate', 'WKScriptMessageHandler', 'PHPhotoLibraryChangeObserver', 'NSKeyedUnarchiverDelegate', 'AVPlayerItemMetadataOutputPushDelegate', 'NSMachPortDelegate', 'SCNShadable', 'UIPopoverBackgroundViewMethods', 'UIDocumentMenuDelegate', 'UIBarPositioningDelegate', 'ABPersonViewControllerDelegate', 'NSNetServiceBrowserDelegate', 'EKEventViewDelegate', 'UIScrollViewDelegate', 'NSURLConnectionDownloadDelegate', 'UIGestureRecognizerDelegate', 'UINavigationBarDelegate', 'AVAudioMixing', 'NSFetchedResultsSectionInfo', 'UIDocumentInteractionControllerDelegate', 'MTLParallelRenderCommandEncoder', 'QLPreviewControllerDelegate', 'UIAccessibilityReadingContent', 'ABUnknownPersonViewControllerDelegate', 'GLKViewControllerDelegate', 'UICollectionViewDelegateFlowLayout', 'UIPopoverPresentationControllerDelegate', 'UIDynamicAnimatorDelegate', 'NSTextAttachmentContainer', 'MKAnnotation', 'UIAccessibilityIdentification', 'UICoordinateSpace', 'ABNewPersonViewControllerDelegate', 'MTLDevice', 'CAMediaTiming', 'AVCaptureFileOutputRecordingDelegate', 'HMHomeManagerDelegate', 'UITextViewDelegate', 'UITabBarDelegate', 'GKLeaderboardViewControllerDelegate', 'UISearchControllerDelegate', 'EAWiFiUnconfiguredAccessoryBrowserDelegate', 'UITextInputTraits', 'MTLRenderPipelineState', 'GKVoiceChatClient', 'UIKeyInput', 'UICollectionViewDataSource', 'SCNTechniqueSupport', 'NSLocking', 'AVCaptureFileOutputDelegate', 'GKChallengeEventHandlerDelegate', 'UIObjectRestoration', 'CIFilterConstructor', 'AVPlayerItemOutputPullDelegate', 'EAGLDrawable', 'AVVideoCompositionValidationHandling', 'UIViewControllerAnimatedTransitioning', 'NSURLSessionDownloadDelegate', 'UIAccelerometerDelegate', 'UIPageViewControllerDelegate', 'MTLCommandQueue', 'UIDataSourceModelAssociation', 'AVAudioRecorderDelegate', 'GKSessionDelegate', 'NSKeyedArchiverDelegate', 'CAMetalDrawable', 'UIDynamicItem', 'CLLocationManagerDelegate', 'NSMetadataQueryDelegate', 'NSNetServiceDelegate', 'GKMatchmakerViewControllerDelegate', 'NSURLSessionDataDelegate']) -COCOA_PRIMITIVES = set(['ROTAHeader', '__CFBundle', 'MortSubtable', 'AudioFilePacketTableInfo', 'CGPDFOperatorTable', 'KerxStateEntry', 'ExtendedTempoEvent', 'CTParagraphStyleSetting', 'OpaqueMIDIPort', '_GLKMatrix3', '_GLKMatrix2', '_GLKMatrix4', 'ExtendedControlEvent', 'CAFAudioDescription', 'OpaqueCMBlockBuffer', 'CGTextDrawingMode', 'EKErrorCode', 'GCAcceleration', 'AudioUnitParameterInfo', '__SCPreferences', '__CTFrame', '__CTLine', 'AudioFile_SMPTE_Time', 'gss_krb5_lucid_context_v1', 'OpaqueJSValue', 'TrakTableEntry', 'AudioFramePacketTranslation', 'CGImageSource', 'OpaqueJSPropertyNameAccumulator', 'JustPCGlyphRepeatAddAction', '__CFBinaryHeap', 'OpaqueMIDIThruConnection', 'opaqueCMBufferQueue', 'OpaqueMusicSequence', 'MortRearrangementSubtable', 'MixerDistanceParams', 'MorxSubtable', 'MIDIObjectPropertyChangeNotification', 'SFNTLookupSegment', 'CGImageMetadataErrors', 'CGPath', 'OpaqueMIDIEndpoint', 'AudioComponentPlugInInterface', 'gss_ctx_id_t_desc_struct', 'sfntFontFeatureSetting', 'OpaqueJSContextGroup', '__SCNetworkConnection', 'AudioUnitParameterValueTranslation', 'CGImageMetadataType', 'CGPattern', 'AudioFileTypeAndFormatID', 'CGContext', 'AUNodeInteraction', 'SFNTLookupTable', 'JustPCDecompositionAction', 'KerxControlPointHeader', 'AudioStreamPacketDescription', 'KernSubtableHeader', '__SecCertificate', 'AUMIDIOutputCallbackStruct', 'MIDIMetaEvent', 'AudioQueueChannelAssignment', 'AnchorPoint', 'JustTable', '__CFNetService', 'CF_BRIDGED_TYPE', 'gss_krb5_lucid_key', 'CGPDFDictionary', 'KerxSubtableHeader', 'CAF_UUID_ChunkHeader', 'gss_krb5_cfx_keydata', 'OpaqueJSClass', 'CGGradient', 'OpaqueMIDISetup', 'JustPostcompTable', '__CTParagraphStyle', 'AudioUnitParameterHistoryInfo', 'OpaqueJSContext', 'CGShading', 'MIDIThruConnectionParams', 'BslnFormat0Part', 'SFNTLookupSingle', '__CFHost', '__SecRandom', '__CTFontDescriptor', '_NSRange', 'sfntDirectory', 'AudioQueueLevelMeterState', 'CAFPositionPeak', 'PropLookupSegment', '__CVOpenGLESTextureCache', 'sfntInstance', '_GLKQuaternion', 'AnkrTable', '__SCNetworkProtocol', 'gss_buffer_desc_struct', 'CAFFileHeader', 'KerxOrderedListHeader', 'CGBlendMode', 'STXEntryOne', 'CAFRegion', 'SFNTLookupTrimmedArrayHeader', 'SCNMatrix4', 'KerxControlPointEntry', 'OpaqueMusicTrack', '_GLKVector4', 'gss_OID_set_desc_struct', 'OpaqueMusicPlayer', '_CFHTTPAuthentication', 'CGAffineTransform', 'CAFMarkerChunk', 'AUHostIdentifier', 'ROTAGlyphEntry', 'BslnTable', 'gss_krb5_lucid_context_version', '_GLKMatrixStack', 'CGImage', 'KernStateEntry', 'SFNTLookupSingleHeader', 'MortLigatureSubtable', 'CAFUMIDChunk', 'SMPTETime', 'CAFDataChunk', 'CGPDFStream', 'AudioFileRegionList', 'STEntryTwo', 'SFNTLookupBinarySearchHeader', 'OpbdTable', '__CTGlyphInfo', 'BslnFormat2Part', 'KerxIndexArrayHeader', 'TrakTable', 'KerxKerningPair', '__CFBitVector', 'KernVersion0SubtableHeader', 'OpaqueAudioComponentInstance', 'AudioChannelLayout', '__CFUUID', 'MIDISysexSendRequest', '__CFNumberFormatter', 'CGImageSourceStatus', 'AudioFileMarkerList', 'AUSamplerBankPresetData', 'CGDataProvider', 'AudioFormatInfo', '__SecIdentity', 'sfntCMapExtendedSubHeader', 'MIDIChannelMessage', 'KernOffsetTable', 'CGColorSpaceModel', 'MFMailComposeErrorCode', 'CGFunction', '__SecTrust', 'AVAudio3DAngularOrientation', 'CGFontPostScriptFormat', 'KernStateHeader', 'AudioUnitCocoaViewInfo', 'CGDataConsumer', 'OpaqueMIDIDevice', 'KernVersion0Header', 'AnchorPointTable', 'CGImageDestination', 'CAFInstrumentChunk', 'AudioUnitMeterClipping', 'MorxChain', '__CTFontCollection', 'STEntryOne', 'STXEntryTwo', 'ExtendedNoteOnEvent', 'CGColorRenderingIntent', 'KerxSimpleArrayHeader', 'MorxTable', '_GLKVector3', '_GLKVector2', 'MortTable', 'CGPDFBox', 'AudioUnitParameterValueFromString', '__CFSocket', 'ALCdevice_struct', 'MIDINoteMessage', 'sfntFeatureHeader', 'CGRect', '__SCNetworkInterface', '__CFTree', 'MusicEventUserData', 'TrakTableData', 'GCQuaternion', 'MortContextualSubtable', '__CTRun', 'AudioUnitFrequencyResponseBin', 'MortChain', 'MorxInsertionSubtable', 'CGImageMetadata', 'gss_auth_identity', 'AudioUnitMIDIControlMapping', 'CAFChunkHeader', 'CGImagePropertyOrientation', 'CGPDFScanner', 'OpaqueMusicEventIterator', 'sfntDescriptorHeader', 'AudioUnitNodeConnection', 'OpaqueMIDIDeviceList', 'ExtendedAudioFormatInfo', 'BslnFormat1Part', 'sfntFontDescriptor', 'KernSimpleArrayHeader', '__CFRunLoopObserver', 'CGPatternTiling', 'MIDINotification', 'MorxLigatureSubtable', 'MessageComposeResult', 'MIDIThruConnectionEndpoint', 'MusicDeviceStdNoteParams', 'opaqueCMSimpleQueue', 'ALCcontext_struct', 'OpaqueAudioQueue', 'PropLookupSingle', 'CGInterpolationQuality', 'CGColor', 'AudioOutputUnitStartAtTimeParams', 'gss_name_t_desc_struct', 'CGFunctionCallbacks', 'CAFPacketTableHeader', 'AudioChannelDescription', 'sfntFeatureName', 'MorxContextualSubtable', 'CVSMPTETime', 'AudioValueRange', 'CGTextEncoding', 'AudioStreamBasicDescription', 'AUNodeRenderCallback', 'AudioPanningInfo', 'KerxOrderedListEntry', '__CFAllocator', 'OpaqueJSPropertyNameArray', '__SCDynamicStore', 'OpaqueMIDIEntity', '__CTRubyAnnotation', 'SCNVector4', 'CFHostClientContext', 'CFNetServiceClientContext', 'AudioUnitPresetMAS_SettingData', 'opaqueCMBufferQueueTriggerToken', 'AudioUnitProperty', 'CAFRegionChunk', 'CGPDFString', '__GLsync', '__CFStringTokenizer', 'JustWidthDeltaEntry', 'sfntVariationAxis', '__CFNetDiagnostic', 'CAFOverviewSample', 'sfntCMapEncoding', 'CGVector', '__SCNetworkService', 'opaqueCMSampleBuffer', 'AUHostVersionIdentifier', 'AudioBalanceFade', 'sfntFontRunFeature', 'KerxCoordinateAction', 'sfntCMapSubHeader', 'CVPlanarPixelBufferInfo', 'AUNumVersion', 'AUSamplerInstrumentData', 'AUPreset', '__CTRunDelegate', 'OpaqueAudioQueueProcessingTap', 'KerxTableHeader', '_NSZone', 'OpaqueExtAudioFile', '__CFRunLoopSource', '__CVMetalTextureCache', 'KerxAnchorPointAction', 'OpaqueJSString', 'AudioQueueParameterEvent', '__CFHTTPMessage', 'OpaqueCMClock', 'ScheduledAudioFileRegion', 'STEntryZero', 'AVAudio3DPoint', 'gss_channel_bindings_struct', 'sfntVariationHeader', 'AUChannelInfo', 'UIOffset', 'GLKEffectPropertyPrv', 'KerxStateHeader', 'CGLineJoin', 'CGPDFDocument', '__CFBag', 'KernOrderedListHeader', '__SCNetworkSet', '__SecKey', 'MIDIObjectAddRemoveNotification', 'AudioUnitParameter', 'JustPCActionSubrecord', 'AudioComponentDescription', 'AudioUnitParameterValueName', 'AudioUnitParameterEvent', 'KerxControlPointAction', 'AudioTimeStamp', 'KernKerningPair', 'gss_buffer_set_desc_struct', 'MortFeatureEntry', 'FontVariation', 'CAFStringID', 'LcarCaretClassEntry', 'AudioUnitParameterStringFromValue', 'ACErrorCode', 'ALMXGlyphEntry', 'LtagTable', '__CTTypesetter', 'AuthorizationOpaqueRef', 'UIEdgeInsets', 'CGPathElement', 'CAFMarker', 'KernTableHeader', 'NoteParamsControlValue', 'SSLContext', 'gss_cred_id_t_desc_struct', 'AudioUnitParameterNameInfo', 'CGDataConsumerCallbacks', 'ALMXHeader', 'CGLineCap', 'MIDIControlTransform', 'CGPDFArray', '__SecPolicy', 'AudioConverterPrimeInfo', '__CTTextTab', '__CFNetServiceMonitor', 'AUInputSamplesInOutputCallbackStruct', '__CTFramesetter', 'CGPDFDataFormat', 'STHeader', 'CVPlanarPixelBufferInfo_YCbCrPlanar', 'MIDIValueMap', 'JustDirectionTable', '__SCBondStatus', 'SFNTLookupSegmentHeader', 'OpaqueCMMemoryPool', 'CGPathDrawingMode', 'CGFont', '__SCNetworkReachability', 'AudioClassDescription', 'CGPoint', 'AVAudio3DVectorOrientation', 'CAFStrings', '__CFNetServiceBrowser', 'opaqueMTAudioProcessingTap', 'sfntNameRecord', 'CGPDFPage', 'CGLayer', 'ComponentInstanceRecord', 'CAFInfoStrings', 'HostCallbackInfo', 'MusicDeviceNoteParams', 'OpaqueVTCompressionSession', 'KernIndexArrayHeader', 'CVPlanarPixelBufferInfo_YCbCrBiPlanar', 'MusicTrackLoopInfo', 'opaqueCMFormatDescription', 'STClassTable', 'sfntDirectoryEntry', 'OpaqueCMTimebase', 'CGDataProviderDirectCallbacks', 'MIDIPacketList', 'CAFOverviewChunk', 'MIDIPacket', 'ScheduledAudioSlice', 'CGDataProviderSequentialCallbacks', 'AudioBuffer', 'MorxRearrangementSubtable', 'CGPatternCallbacks', 'AUDistanceAttenuationData', 'MIDIIOErrorNotification', 'CGPDFContentStream', 'IUnknownVTbl', 'MIDITransform', 'MortInsertionSubtable', 'CABarBeatTime', 'AudioBufferList', '__CVBuffer', 'AURenderCallbackStruct', 'STXEntryZero', 'JustPCDuctilityAction', 'OpaqueAudioQueueTimeline', 'VTDecompressionOutputCallbackRecord', 'OpaqueMIDIClient', '__CFPlugInInstance', 'AudioQueueBuffer', '__CFFileDescriptor', 'AudioUnitConnection', '_GKTurnBasedExchangeStatus', 'LcarCaretTable', 'CVPlanarComponentInfo', 'JustWidthDeltaGroup', 'OpaqueAudioComponent', 'ParameterEvent', '__CVPixelBufferPool', '__CTFont', 'CGColorSpace', 'CGSize', 'AUDependentParameter', 'MIDIDriverInterface', 'gss_krb5_rfc1964_keydata', '__CFDateFormatter', 'LtagStringRange', 'OpaqueVTDecompressionSession', 'gss_iov_buffer_desc_struct', 'AUPresetEvent', 'PropTable', 'KernOrderedListEntry', 'CF_BRIDGED_MUTABLE_TYPE', 'gss_OID_desc_struct', 'AudioUnitPresetMAS_Settings', 'AudioFileMarker', 'JustPCConditionalAddAction', 'BslnFormat3Part', '__CFNotificationCenter', 'MortSwashSubtable', 'AUParameterMIDIMapping', 'SCNVector3', 'OpaqueAudioConverter', 'MIDIRawData', 'sfntNameHeader', '__CFRunLoop', 'MFMailComposeResult', 'CATransform3D', 'OpbdSideValues', 'CAF_SMPTE_Time', '__SecAccessControl', 'JustPCAction', 'OpaqueVTFrameSilo', 'OpaqueVTMultiPassStorage', 'CGPathElementType', 'AudioFormatListItem', 'AudioUnitExternalBuffer', 'AudioFileRegion', 'AudioValueTranslation', 'CGImageMetadataTag', 'CAFPeakChunk', 'AudioBytePacketTranslation', 'sfntCMapHeader', '__CFURLEnumerator', 'STXHeader', 'CGPDFObjectType', 'SFNTLookupArrayHeader']) - - -if __name__ == '__main__': - import os - import re - - FRAMEWORKS_PATH = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/' - frameworks = os.listdir(FRAMEWORKS_PATH) - - all_interfaces = set() - all_protocols = set() - all_primitives = set() - for framework in frameworks: - frameworkHeadersDir = FRAMEWORKS_PATH + framework + '/Headers/' - if not os.path.exists(frameworkHeadersDir): - continue - - headerFilenames = os.listdir(frameworkHeadersDir) - - for f in headerFilenames: - if not f.endswith('.h'): - continue - - headerFilePath = frameworkHeadersDir + f - content = open(headerFilePath).read() - res = re.findall('(?<=@interface )\w+', content) - for r in res: - all_interfaces.add(r) - - res = re.findall('(?<=@protocol )\w+', content) - for r in res: - all_protocols.add(r) - - res = re.findall('(?<=typedef enum )\w+', content) - for r in res: - all_primitives.add(r) - - res = re.findall('(?<=typedef struct )\w+', content) - for r in res: - all_primitives.add(r) - - res = re.findall('(?<=typedef const struct )\w+', content) - for r in res: - all_primitives.add(r) - - - print("ALL interfaces: \n") - print(all_interfaces) - - print("\nALL protocols: \n") - print(all_protocols) - - print("\nALL primitives: \n") - print(all_primitives) diff --git a/wakatime/packages/py2/pygments/lexers/_lua_builtins.py b/wakatime/packages/py2/pygments/lexers/_lua_builtins.py deleted file mode 100644 index 79a8da6..0000000 --- a/wakatime/packages/py2/pygments/lexers/_lua_builtins.py +++ /dev/null @@ -1,250 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._lua_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This file contains the names and modules of lua functions - It is able to re-generate itself, but for adding new functions you - probably have to add some callbacks (see function module_callbacks). - - Do not edit the MODULES dict by hand. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from __future__ import print_function - - -MODULES = {'basic': ('_G', - '_VERSION', - 'assert', - 'collectgarbage', - 'dofile', - 'error', - 'getfenv', - 'getmetatable', - 'ipairs', - 'load', - 'loadfile', - 'loadstring', - 'next', - 'pairs', - 'pcall', - 'print', - 'rawequal', - 'rawget', - 'rawset', - 'select', - 'setfenv', - 'setmetatable', - 'tonumber', - 'tostring', - 'type', - 'unpack', - 'xpcall'), - 'coroutine': ('coroutine.create', - 'coroutine.resume', - 'coroutine.running', - 'coroutine.status', - 'coroutine.wrap', - 'coroutine.yield'), - 'debug': ('debug.debug', - 'debug.getfenv', - 'debug.gethook', - 'debug.getinfo', - 'debug.getlocal', - 'debug.getmetatable', - 'debug.getregistry', - 'debug.getupvalue', - 'debug.setfenv', - 'debug.sethook', - 'debug.setlocal', - 'debug.setmetatable', - 'debug.setupvalue', - 'debug.traceback'), - 'io': ('io.close', - 'io.flush', - 'io.input', - 'io.lines', - 'io.open', - 'io.output', - 'io.popen', - 'io.read', - 'io.tmpfile', - 'io.type', - 'io.write'), - 'math': ('math.abs', - 'math.acos', - 'math.asin', - 'math.atan2', - 'math.atan', - 'math.ceil', - 'math.cosh', - 'math.cos', - 'math.deg', - 'math.exp', - 'math.floor', - 'math.fmod', - 'math.frexp', - 'math.huge', - 'math.ldexp', - 'math.log10', - 'math.log', - 'math.max', - 'math.min', - 'math.modf', - 'math.pi', - 'math.pow', - 'math.rad', - 'math.random', - 'math.randomseed', - 'math.sinh', - 'math.sin', - 'math.sqrt', - 'math.tanh', - 'math.tan'), - 'modules': ('module', - 'require', - 'package.cpath', - 'package.loaded', - 'package.loadlib', - 'package.path', - 'package.preload', - 'package.seeall'), - 'os': ('os.clock', - 'os.date', - 'os.difftime', - 'os.execute', - 'os.exit', - 'os.getenv', - 'os.remove', - 'os.rename', - 'os.setlocale', - 'os.time', - 'os.tmpname'), - 'string': ('string.byte', - 'string.char', - 'string.dump', - 'string.find', - 'string.format', - 'string.gmatch', - 'string.gsub', - 'string.len', - 'string.lower', - 'string.match', - 'string.rep', - 'string.reverse', - 'string.sub', - 'string.upper'), - 'table': ('table.concat', - 'table.insert', - 'table.maxn', - 'table.remove', - 'table.sort')} - -if __name__ == '__main__': - import re - try: - from urllib import urlopen - except ImportError: - from urllib.request import urlopen - import pprint - - # you can't generally find out what module a function belongs to if you - # have only its name. Because of this, here are some callback functions - # that recognize if a gioven function belongs to a specific module - def module_callbacks(): - def is_in_coroutine_module(name): - return name.startswith('coroutine.') - - def is_in_modules_module(name): - if name in ['require', 'module'] or name.startswith('package'): - return True - else: - return False - - def is_in_string_module(name): - return name.startswith('string.') - - def is_in_table_module(name): - return name.startswith('table.') - - def is_in_math_module(name): - return name.startswith('math') - - def is_in_io_module(name): - return name.startswith('io.') - - def is_in_os_module(name): - return name.startswith('os.') - - def is_in_debug_module(name): - return name.startswith('debug.') - - return {'coroutine': is_in_coroutine_module, - 'modules': is_in_modules_module, - 'string': is_in_string_module, - 'table': is_in_table_module, - 'math': is_in_math_module, - 'io': is_in_io_module, - 'os': is_in_os_module, - 'debug': is_in_debug_module} - - - - def get_newest_version(): - f = urlopen('http://www.lua.org/manual/') - r = re.compile(r'^Lua \1') - for line in f: - m = r.match(line) - if m is not None: - return m.groups()[0] - - def get_lua_functions(version): - f = urlopen('http://www.lua.org/manual/%s/' % version) - r = re.compile(r'^\1') - functions = [] - for line in f: - m = r.match(line) - if m is not None: - functions.append(m.groups()[0]) - return functions - - def get_function_module(name): - for mod, cb in module_callbacks().items(): - if cb(name): - return mod - if '.' in name: - return name.split('.')[0] - else: - return 'basic' - - def regenerate(filename, modules): - with open(filename) as fp: - content = fp.read() - - header = content[:content.find('MODULES = {')] - footer = content[content.find("if __name__ == '__main__':"):] - - - with open(filename, 'w') as fp: - fp.write(header) - fp.write('MODULES = %s\n\n' % pprint.pformat(modules)) - fp.write(footer) - - def run(): - version = get_newest_version() - print('> Downloading function index for Lua %s' % version) - functions = get_lua_functions(version) - print('> %d functions found:' % len(functions)) - - modules = {} - for full_function_name in functions: - print('>> %s' % full_function_name) - m = get_function_module(full_function_name) - modules.setdefault(m, []).append(full_function_name) - - regenerate(__file__, modules) - - run() diff --git a/wakatime/packages/py2/pygments/lexers/_mql_builtins.py b/wakatime/packages/py2/pygments/lexers/_mql_builtins.py deleted file mode 100644 index b6a009d..0000000 --- a/wakatime/packages/py2/pygments/lexers/_mql_builtins.py +++ /dev/null @@ -1,1172 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._mql_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Builtins for the MqlLexer. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" -types = ( - 'AccountBalance', - 'AccountCompany', - 'AccountCredit', - 'AccountCurrency', - 'AccountEquity', - 'AccountFreeMarginCheck', - 'AccountFreeMarginMode', - 'AccountFreeMargin', - 'AccountInfoDouble', - 'AccountInfoInteger', - 'AccountInfoString', - 'AccountLeverage', - 'AccountMargin', - 'AccountName', - 'AccountNumber', - 'AccountProfit', - 'AccountServer', - 'AccountStopoutLevel', - 'AccountStopoutMode', - 'Alert', - 'ArrayBsearch', - 'ArrayCompare', - 'ArrayCopyRates', - 'ArrayCopySeries', - 'ArrayCopy', - 'ArrayDimension', - 'ArrayFill', - 'ArrayFree', - 'ArrayGetAsSeries', - 'ArrayInitialize', - 'ArrayIsDynamic', - 'ArrayIsSeries', - 'ArrayMaximum', - 'ArrayMinimum', - 'ArrayRange', - 'ArrayResize', - 'ArraySetAsSeries', - 'ArraySize', - 'ArraySort', - 'CharArrayToString', - 'CharToString', - 'CharToStr', - 'CheckPointer', - 'ColorToARGB', - 'ColorToString', - 'Comment', - 'CopyClose', - 'CopyHigh', - 'CopyLow', - 'CopyOpen', - 'CopyRates', - 'CopyRealVolume', - 'CopySpread', - 'CopyTickVolume', - 'CopyTime', - 'DayOfWeek', - 'DayOfYear', - 'Day', - 'DebugBreak', - 'Digits', - 'DoubleToString', - 'DoubleToStr', - 'EnumToString', - 'EventChartCustom', - 'EventKillTimer', - 'EventSetMillisecondTimer', - 'EventSetTimer', - 'ExpertRemove', - 'FileClose', - 'FileCopy', - 'FileDelete', - 'FileFindClose', - 'FileFindFirst', - 'FileFindNext', - 'FileFlush', - 'FileGetInteger', - 'FileIsEnding', - 'FileIsExist', - 'FileIsLineEnding', - 'FileMove', - 'FileOpenHistory', - 'FileOpen', - 'FileReadArray', - 'FileReadBool', - 'FileReadDatetime', - 'FileReadDouble', - 'FileReadFloat', - 'FileReadInteger', - 'FileReadLong', - 'FileReadNumber', - 'FileReadString', - 'FileReadStruct', - 'FileSeek', - 'FileSize', - 'FileTell', - 'FileWriteArray', - 'FileWriteDouble', - 'FileWriteFloat', - 'FileWriteInteger', - 'FileWriteLong', - 'FileWriteString', - 'FileWriteStruct', - 'FileWrite', - 'FolderClean', - 'FolderCreate', - 'FolderDelete', - 'GetLastError', - 'GetPointer', - 'GetTickCount', - 'GlobalVariableCheck', - 'GlobalVariableDel', - 'GlobalVariableGet', - 'GlobalVariableName', - 'GlobalVariableSetOnCondition', - 'GlobalVariableSet', - 'GlobalVariableTemp', - 'GlobalVariableTime', - 'GlobalVariablesDeleteAll', - 'GlobalVariablesFlush', - 'GlobalVariablesTotal', - 'HideTestIndicators', - 'Hour', - 'IndicatorBuffers', - 'IndicatorCounted', - 'IndicatorDigits', - 'IndicatorSetDouble', - 'IndicatorSetInteger', - 'IndicatorSetString', - 'IndicatorShortName', - 'IntegerToString', - 'IsConnected', - 'IsDemo', - 'IsDllsAllowed', - 'IsExpertEnabled', - 'IsLibrariesAllowed', - 'IsOptimization', - 'IsStopped', - 'IsTesting', - 'IsTradeAllowed', - 'IsTradeContextBusy', - 'IsVisualMode', - 'MQLInfoInteger', - 'MQLInfoString', - 'MarketInfo', - 'MathAbs', - 'MathArccos', - 'MathArcsin', - 'MathArctan', - 'MathCeil', - 'MathCos', - 'MathExp', - 'MathFloor', - 'MathIsValidNumber', - 'MathLog', - 'MathMax', - 'MathMin', - 'MathMod', - 'MathPow', - 'MathRand', - 'MathRound', - 'MathSin', - 'MathSqrt', - 'MathSrand', - 'MathTan', - 'MessageBox', - 'Minute', - 'Month', - 'NormalizeDouble', - 'ObjectCreate', - 'ObjectDelete', - 'ObjectDescription', - 'ObjectFind', - 'ObjectGetDouble', - 'ObjectGetFiboDescription', - 'ObjectGetInteger', - 'ObjectGetShiftByValue', - 'ObjectGetString', - 'ObjectGetTimeByValue', - 'ObjectGetValueByShift', - 'ObjectGetValueByTime', - 'ObjectGet', - 'ObjectMove', - 'ObjectName', - 'ObjectSetDouble', - 'ObjectSetFiboDescription', - 'ObjectSetInteger', - 'ObjectSetString', - 'ObjectSetText', - 'ObjectSet', - 'ObjectType', - 'ObjectsDeleteAll', - 'ObjectsTotal', - 'OrderCloseBy', - 'OrderClosePrice', - 'OrderCloseTime', - 'OrderClose', - 'OrderComment', - 'OrderCommission', - 'OrderDelete', - 'OrderExpiration', - 'OrderLots', - 'OrderMagicNumber', - 'OrderModify', - 'OrderOpenPrice', - 'OrderOpenTime', - 'OrderPrint', - 'OrderProfit', - 'OrderSelect', - 'OrderSend', - 'OrderStopLoss', - 'OrderSwap', - 'OrderSymbol', - 'OrderTakeProfit', - 'OrderTicket', - 'OrderType', - 'OrdersHistoryTotal', - 'OrdersTotal', - 'PeriodSeconds', - 'Period', - 'PlaySound', - 'Point', - 'PrintFormat', - 'Print', - 'RefreshRates', - 'ResetLastError', - 'ResourceCreate', - 'ResourceFree', - 'ResourceReadImage', - 'ResourceSave', - 'Seconds', - 'SendFTP', - 'SendMail', - 'SendNotification', - 'SeriesInfoInteger', - 'SetIndexArrow', - 'SetIndexBuffer', - 'SetIndexDrawBegin', - 'SetIndexEmptyValue', - 'SetIndexLabel', - 'SetIndexShift', - 'SetIndexStyle', - 'SetLevelStyle', - 'SetLevelValue', - 'ShortArrayToString', - 'ShortToString', - 'Sleep', - 'StrToDouble', - 'StrToInteger', - 'StrToTime', - 'StringAdd', - 'StringBufferLen', - 'StringCompare', - 'StringConcatenate', - 'StringFill', - 'StringFind', - 'StringFormat', - 'StringGetCharacter', - 'StringGetChar', - 'StringInit', - 'StringLen', - 'StringReplace', - 'StringSetCharacter', - 'StringSetChar', - 'StringSplit', - 'StringSubstr', - 'StringToCharArray', - 'StringToColor', - 'StringToDouble', - 'StringToInteger', - 'StringToLower', - 'StringToShortArray', - 'StringToTime', - 'StringToUpper', - 'StringTrimLeft', - 'StringTrimRight', - 'StructToTime', - 'SymbolInfoDouble', - 'SymbolInfoInteger', - 'SymbolInfoSessionQuote', - 'SymbolInfoSessionTrade', - 'SymbolInfoString', - 'SymbolInfoTick', - 'SymbolIsSynchronized', - 'SymbolName', - 'SymbolSelect', - 'SymbolsTotal', - 'Symbol', - 'TerminalClose', - 'TerminalCompany', - 'TerminalName', - 'TerminalPath', - 'TesterStatistics', - 'TextGetSize', - 'TextOut', - 'TextSetFont', - 'TimeCurrent', - 'TimeDayOfWeek', - 'TimeDayOfYear', - 'TimeDaylightSavings', - 'TimeDay', - 'TimeGMTOffset', - 'TimeGMT', - 'TimeHour', - 'TimeLocal', - 'TimeMinute', - 'TimeMonth', - 'TimeSeconds', - 'TimeToString', - 'TimeToStruct', - 'TimeToStr', - 'TimeTradeServer', - 'TimeYear', - 'UninitializeReason', - 'WindowBarsPerChart', - 'WindowExpertName', - 'WindowFind', - 'WindowFirstVisibleBar', - 'WindowHandle', - 'WindowIsVisible', - 'WindowOnDropped', - 'WindowPriceMax', - 'WindowPriceMin', - 'WindowPriceOnDropped', - 'WindowRedraw', - 'WindowScreenShot', - 'WindowTimeOnDropped', - 'WindowXOnDropped', - 'WindowYOnDropped', - 'WindowsTotal', - 'Year', - 'ZeroMemory', - 'iAC', - 'iADX', - 'iAD', - 'iAO', - 'iATR', - 'iAlligator', - 'iBWMFI', - 'iBandsOnArray', - 'iBands', - 'iBarShift', - 'iBars', - 'iBearsPower', - 'iBullsPower', - 'iCCIOnArray', - 'iCCI', - 'iClose', - 'iCustom', - 'iDeMarker', - 'iEnvelopesOnArray', - 'iEnvelopes', - 'iForce', - 'iFractals', - 'iGator', - 'iHighest', - 'iHigh', - 'iIchimoku', - 'iLowest', - 'iLow', - 'iMACD', - 'iMAOnArray', - 'iMA', - 'iMFI', - 'iMomentumOnArray', - 'iMomentum', - 'iOBV', - 'iOpen', - 'iOsMA', - 'iRSIOnArray', - 'iRSI', - 'iRVI', - 'iSAR', - 'iStdDevOnArray', - 'iStdDev', - 'iStochastic', - 'iTime', - 'iVolume', - 'iWPR', -) - -constants = ( - 'ACCOUNT_BALANCE', - 'ACCOUNT_COMPANY', - 'ACCOUNT_CREDIT', - 'ACCOUNT_CURRENCY', - 'ACCOUNT_EQUITY', - 'ACCOUNT_FREEMARGIN', - 'ACCOUNT_LEVERAGE', - 'ACCOUNT_LIMIT_ORDERS', - 'ACCOUNT_LOGIN', - 'ACCOUNT_MARGIN', - 'ACCOUNT_MARGIN_LEVEL', - 'ACCOUNT_MARGIN_SO_CALL', - 'ACCOUNT_MARGIN_SO_MODE', - 'ACCOUNT_MARGIN_SO_SO', - 'ACCOUNT_NAME', - 'ACCOUNT_PROFIT', - 'ACCOUNT_SERVER', - 'ACCOUNT_STOPOUT_MODE_MONEY', - 'ACCOUNT_STOPOUT_MODE_PERCENT', - 'ACCOUNT_TRADE_ALLOWED', - 'ACCOUNT_TRADE_EXPERT', - 'ACCOUNT_TRADE_MODE', - 'ACCOUNT_TRADE_MODE_CONTEST', - 'ACCOUNT_TRADE_MODE_DEMO', - 'ACCOUNT_TRADE_MODE_REAL', - 'ALIGN_CENTER', - 'ALIGN_LEFT', - 'ALIGN_RIGHT', - 'ANCHOR_BOTTOM', - 'ANCHOR_CENTER', - 'ANCHOR_LEFT', - 'ANCHOR_LEFT_LOWER', - 'ANCHOR_LEFT_UPPER', - 'ANCHOR_LOWER', - 'ANCHOR_RIGHT', - 'ANCHOR_RIGHT_LOWER', - 'ANCHOR_RIGHT_UPPER', - 'ANCHOR_TOP', - 'ANCHOR_UPPER', - 'BORDER_FLAT', - 'BORDER_RAISED', - 'BORDER_SUNKEN', - 'CHARTEVENT_CHART_CHANGE', - 'CHARTEVENT_CLICK', - 'CHARTEVENT_CUSTOM', - 'CHARTEVENT_CUSTOM_LAST', - 'CHARTEVENT_KEYDOWN', - 'CHARTEVENT_MOUSE_MOVE', - 'CHARTEVENT_OBJECT_CHANGE', - 'CHARTEVENT_OBJECT_CLICK', - 'CHARTEVENT_OBJECT_CREATE', - 'CHARTEVENT_OBJECT_DELETE', - 'CHARTEVENT_OBJECT_DRAG', - 'CHARTEVENT_OBJECT_ENDEDIT', - 'CHARTS_MAX', - 'CHART_AUTOSCROLL', - 'CHART_BARS', - 'CHART_BEGIN', - 'CHART_BRING_TO_TOP', - 'CHART_CANDLES', - 'CHART_COLOR_ASK', - 'CHART_COLOR_BACKGROUND', - 'CHART_COLOR_BID', - 'CHART_COLOR_CANDLE_BEAR', - 'CHART_COLOR_CANDLE_BULL', - 'CHART_COLOR_CHART_DOWN', - 'CHART_COLOR_CHART_LINE', - 'CHART_COLOR_CHART_UP', - 'CHART_COLOR_FOREGROUND', - 'CHART_COLOR_GRID', - 'CHART_COLOR_LAST', - 'CHART_COLOR_STOP_LEVEL', - 'CHART_COLOR_VOLUME', - 'CHART_COMMENT', - 'CHART_CURRENT_POS', - 'CHART_DRAG_TRADE_LEVELS', - 'CHART_END', - 'CHART_EVENT_MOUSE_MOVE', - 'CHART_EVENT_OBJECT_CREATE', - 'CHART_EVENT_OBJECT_DELETE', - 'CHART_FIRST_VISIBLE_BAR', - 'CHART_FIXED_MAX', - 'CHART_FIXED_MIN', - 'CHART_FIXED_POSITION', - 'CHART_FOREGROUND', - 'CHART_HEIGHT_IN_PIXELS', - 'CHART_IS_OBJECT', - 'CHART_LINE', - 'CHART_MODE', - 'CHART_MOUSE_SCROLL', - 'CHART_POINTS_PER_BAR', - 'CHART_PRICE_MAX', - 'CHART_PRICE_MIN', - 'CHART_SCALEFIX', - 'CHART_SCALEFIX_11', - 'CHART_SCALE', - 'CHART_SCALE_PT_PER_BAR', - 'CHART_SHIFT', - 'CHART_SHIFT_SIZE', - 'CHART_SHOW_ASK_LINE', - 'CHART_SHOW_BID_LINE', - 'CHART_SHOW_DATE_SCALE', - 'CHART_SHOW_GRID', - 'CHART_SHOW_LAST_LINE', - 'CHART_SHOW_OBJECT_DESCR', - 'CHART_SHOW_OHLC', - 'CHART_SHOW_PERIOD_SEP', - 'CHART_SHOW_PRICE_SCALE', - 'CHART_SHOW_TRADE_LEVELS', - 'CHART_SHOW_VOLUMES', - 'CHART_VISIBLE_BARS', - 'CHART_VOLUME_HIDE', - 'CHART_VOLUME_REAL', - 'CHART_VOLUME_TICK', - 'CHART_WIDTH_IN_BARS', - 'CHART_WIDTH_IN_PIXELS', - 'CHART_WINDOWS_TOTAL', - 'CHART_WINDOW_HANDLE', - 'CHART_WINDOW_IS_VISIBLE', - 'CHART_WINDOW_YDISTANCE', - 'CHAR_MAX', - 'CHAR_MIN', - 'CLR_NONE', - 'CORNER_LEFT_LOWER', - 'CORNER_LEFT_UPPER', - 'CORNER_RIGHT_LOWER', - 'CORNER_RIGHT_UPPER', - 'CP_ACP', - 'CP_MACCP', - 'CP_OEMCP', - 'CP_SYMBOL', - 'CP_THREAD_ACP', - 'CP_UTF7', - 'CP_UTF8', - 'DBL_DIG', - 'DBL_EPSILON', - 'DBL_MANT_DIG', - 'DBL_MAX', - 'DBL_MAX_10_EXP', - 'DBL_MAX_EXP', - 'DBL_MIN', - 'DBL_MIN_10_EXP', - 'DBL_MIN_EXP', - 'DRAW_ARROW', - 'DRAW_FILLING', - 'DRAW_HISTOGRAM', - 'DRAW_LINE', - 'DRAW_NONE', - 'DRAW_SECTION', - 'DRAW_ZIGZAG', - 'EMPTY', - 'EMPTY_VALUE', - 'ERR_ACCOUNT_DISABLED', - 'ERR_BROKER_BUSY', - 'ERR_COMMON_ERROR', - 'ERR_INVALID_ACCOUNT', - 'ERR_INVALID_PRICE', - 'ERR_INVALID_STOPS', - 'ERR_INVALID_TRADE_PARAMETERS', - 'ERR_INVALID_TRADE_VOLUME', - 'ERR_LONG_POSITIONS_ONLY_ALLOWED', - 'ERR_MALFUNCTIONAL_TRADE', - 'ERR_MARKET_CLOSED', - 'ERR_NOT_ENOUGH_MONEY', - 'ERR_NOT_ENOUGH_RIGHTS', - 'ERR_NO_CONNECTION', - 'ERR_NO_ERROR', - 'ERR_NO_RESULT', - 'ERR_OFF_QUOTES', - 'ERR_OLD_VERSION', - 'ERR_ORDER_LOCKED', - 'ERR_PRICE_CHANGED', - 'ERR_REQUOTE', - 'ERR_SERVER_BUSY', - 'ERR_TOO_FREQUENT_REQUESTS', - 'ERR_TOO_MANY_REQUESTS', - 'ERR_TRADE_CONTEXT_BUSY', - 'ERR_TRADE_DISABLED', - 'ERR_TRADE_EXPIRATION_DENIED', - 'ERR_TRADE_HEDGE_PROHIBITED', - 'ERR_TRADE_MODIFY_DENIED', - 'ERR_TRADE_PROHIBITED_BY_FIFO', - 'ERR_TRADE_TIMEOUT', - 'ERR_TRADE_TOO_MANY_ORDERS', - 'FILE_ACCESS_DATE', - 'FILE_ANSI', - 'FILE_BIN', - 'FILE_COMMON', - 'FILE_CREATE_DATE', - 'FILE_CSV', - 'FILE_END', - 'FILE_EXISTS', - 'FILE_IS_ANSI', - 'FILE_IS_BINARY', - 'FILE_IS_COMMON', - 'FILE_IS_CSV', - 'FILE_IS_READABLE', - 'FILE_IS_TEXT', - 'FILE_IS_WRITABLE', - 'FILE_LINE_END', - 'FILE_MODIFY_DATE', - 'FILE_POSITION', - 'FILE_READ', - 'FILE_REWRITE', - 'FILE_SHARE_READ', - 'FILE_SHARE_WRITE', - 'FILE_SIZE', - 'FILE_TXT', - 'FILE_UNICODE', - 'FILE_WRITE', - 'FLT_DIG', - 'FLT_EPSILON', - 'FLT_MANT_DIG', - 'FLT_MAX', - 'FLT_MAX_10_EXP', - 'FLT_MAX_EXP', - 'FLT_MIN', - 'FLT_MIN_10_EXP', - 'FLT_MIN_EXP', - 'FRIDAY', - 'GANN_DOWN_TREND', - 'GANN_UP_TREND', - 'IDABORT', - 'IDCANCEL', - 'IDCONTINUE', - 'IDIGNORE', - 'IDNO', - 'IDOK', - 'IDRETRY', - 'IDTRYAGAIN', - 'IDYES', - 'INDICATOR_CALCULATIONS', - 'INDICATOR_COLOR_INDEX', - 'INDICATOR_DATA', - 'INDICATOR_DIGITS', - 'INDICATOR_HEIGHT', - 'INDICATOR_LEVELCOLOR', - 'INDICATOR_LEVELSTYLE', - 'INDICATOR_LEVELS', - 'INDICATOR_LEVELTEXT', - 'INDICATOR_LEVELVALUE', - 'INDICATOR_LEVELWIDTH', - 'INDICATOR_MAXIMUM', - 'INDICATOR_MINIMUM', - 'INDICATOR_SHORTNAME', - 'INT_MAX', - 'INT_MIN', - 'INVALID_HANDLE', - 'IS_DEBUG_MODE', - 'IS_PROFILE_MODE', - 'LICENSE_DEMO', - 'LICENSE_FREE', - 'LICENSE_FULL', - 'LICENSE_TIME', - 'LONG_MAX', - 'LONG_MIN', - 'MB_ABORTRETRYIGNORE', - 'MB_CANCELTRYCONTINUE', - 'MB_DEFBUTTON1', - 'MB_DEFBUTTON2', - 'MB_DEFBUTTON3', - 'MB_DEFBUTTON4', - 'MB_ICONASTERISK', - 'MB_ICONERROR', - 'MB_ICONEXCLAMATION', - 'MB_ICONHAND', - 'MB_ICONINFORMATION', - 'MB_ICONQUESTION', - 'MB_ICONSTOP', - 'MB_ICONWARNING', - 'MB_OKCANCEL', - 'MB_OK', - 'MB_RETRYCANCEL', - 'MB_YESNOCANCEL', - 'MB_YESNO', - 'MODE_ASK', - 'MODE_BID', - 'MODE_CHINKOUSPAN', - 'MODE_CLOSE', - 'MODE_DIGITS', - 'MODE_EMA', - 'MODE_EXPIRATION', - 'MODE_FREEZELEVEL', - 'MODE_GATORJAW', - 'MODE_GATORLIPS', - 'MODE_GATORTEETH', - 'MODE_HIGH', - 'MODE_KIJUNSEN', - 'MODE_LOTSIZE', - 'MODE_LOTSTEP', - 'MODE_LOWER', - 'MODE_LOW', - 'MODE_LWMA', - 'MODE_MAIN', - 'MODE_MARGINCALCMODE', - 'MODE_MARGINHEDGED', - 'MODE_MARGININIT', - 'MODE_MARGINMAINTENANCE', - 'MODE_MARGINREQUIRED', - 'MODE_MAXLOT', - 'MODE_MINLOT', - 'MODE_MINUSDI', - 'MODE_OPEN', - 'MODE_PLUSDI', - 'MODE_POINT', - 'MODE_PROFITCALCMODE', - 'MODE_SENKOUSPANA', - 'MODE_SENKOUSPANB', - 'MODE_SIGNAL', - 'MODE_SMA', - 'MODE_SMMA', - 'MODE_SPREAD', - 'MODE_STARTING', - 'MODE_STOPLEVEL', - 'MODE_SWAPLONG', - 'MODE_SWAPSHORT', - 'MODE_SWAPTYPE', - 'MODE_TENKANSEN', - 'MODE_TICKSIZE', - 'MODE_TICKVALUE', - 'MODE_TIME', - 'MODE_TRADEALLOWED', - 'MODE_UPPER', - 'MODE_VOLUME', - 'MONDAY', - 'MQL_DEBUG', - 'MQL_DLLS_ALLOWED', - 'MQL_FRAME_MODE', - 'MQL_LICENSE_TYPE', - 'MQL_OPTIMIZATION', - 'MQL_PROFILER', - 'MQL_PROGRAM_NAME', - 'MQL_PROGRAM_PATH', - 'MQL_PROGRAM_TYPE', - 'MQL_TESTER', - 'MQL_TRADE_ALLOWED', - 'MQL_VISUAL_MODE', - 'M_1_PI', - 'M_2_PI', - 'M_2_SQRTPI', - 'M_E', - 'M_LN2', - 'M_LN10', - 'M_LOG2E', - 'M_LOG10E', - 'M_PI', - 'M_PI_2', - 'M_PI_4', - 'M_SQRT1_2', - 'M_SQRT2', - 'NULL', - 'OBJPROP_ALIGN', - 'OBJPROP_ANCHOR', - 'OBJPROP_ANGLE', - 'OBJPROP_ARROWCODE', - 'OBJPROP_BACK', - 'OBJPROP_BGCOLOR', - 'OBJPROP_BMPFILE', - 'OBJPROP_BORDER_COLOR', - 'OBJPROP_BORDER_TYPE', - 'OBJPROP_CHART_ID', - 'OBJPROP_CHART_SCALE', - 'OBJPROP_COLOR', - 'OBJPROP_CORNER', - 'OBJPROP_CREATETIME', - 'OBJPROP_DATE_SCALE', - 'OBJPROP_DEVIATION', - 'OBJPROP_DRAWLINES', - 'OBJPROP_ELLIPSE', - 'OBJPROP_FIBOLEVELS', - 'OBJPROP_FILL', - 'OBJPROP_FIRSTLEVEL', - 'OBJPROP_FONTSIZE', - 'OBJPROP_FONT', - 'OBJPROP_HIDDEN', - 'OBJPROP_LEVELCOLOR', - 'OBJPROP_LEVELSTYLE', - 'OBJPROP_LEVELS', - 'OBJPROP_LEVELTEXT', - 'OBJPROP_LEVELVALUE', - 'OBJPROP_LEVELWIDTH', - 'OBJPROP_NAME', - 'OBJPROP_PERIOD', - 'OBJPROP_PRICE1', - 'OBJPROP_PRICE2', - 'OBJPROP_PRICE3', - 'OBJPROP_PRICE', - 'OBJPROP_PRICE_SCALE', - 'OBJPROP_RAY', - 'OBJPROP_RAY_RIGHT', - 'OBJPROP_READONLY', - 'OBJPROP_SCALE', - 'OBJPROP_SELECTABLE', - 'OBJPROP_SELECTED', - 'OBJPROP_STATE', - 'OBJPROP_STYLE', - 'OBJPROP_SYMBOL', - 'OBJPROP_TEXT', - 'OBJPROP_TIME1', - 'OBJPROP_TIME2', - 'OBJPROP_TIME3', - 'OBJPROP_TIMEFRAMES', - 'OBJPROP_TIME', - 'OBJPROP_TOOLTIP', - 'OBJPROP_TYPE', - 'OBJPROP_WIDTH', - 'OBJPROP_XDISTANCE', - 'OBJPROP_XOFFSET', - 'OBJPROP_XSIZE', - 'OBJPROP_YDISTANCE', - 'OBJPROP_YOFFSET', - 'OBJPROP_YSIZE', - 'OBJPROP_ZORDER', - 'OBJ_ALL_PERIODS', - 'OBJ_ARROW', - 'OBJ_ARROW_BUY', - 'OBJ_ARROW_CHECK', - 'OBJ_ARROW_DOWN', - 'OBJ_ARROW_LEFT_PRICE', - 'OBJ_ARROW_RIGHT_PRICE', - 'OBJ_ARROW_SELL', - 'OBJ_ARROW_STOP', - 'OBJ_ARROW_THUMB_DOWN', - 'OBJ_ARROW_THUMB_UP', - 'OBJ_ARROW_UP', - 'OBJ_BITMAP', - 'OBJ_BITMAP_LABEL', - 'OBJ_BUTTON', - 'OBJ_CHANNEL', - 'OBJ_CYCLES', - 'OBJ_EDIT', - 'OBJ_ELLIPSE', - 'OBJ_EVENT', - 'OBJ_EXPANSION', - 'OBJ_FIBOARC', - 'OBJ_FIBOCHANNEL', - 'OBJ_FIBOFAN', - 'OBJ_FIBOTIMES', - 'OBJ_FIBO', - 'OBJ_GANNFAN', - 'OBJ_GANNGRID', - 'OBJ_GANNLINE', - 'OBJ_HLINE', - 'OBJ_LABEL', - 'OBJ_NO_PERIODS', - 'OBJ_PERIOD_D1', - 'OBJ_PERIOD_H1', - 'OBJ_PERIOD_H4', - 'OBJ_PERIOD_M1', - 'OBJ_PERIOD_M5', - 'OBJ_PERIOD_M15', - 'OBJ_PERIOD_M30', - 'OBJ_PERIOD_MN1', - 'OBJ_PERIOD_W1', - 'OBJ_PITCHFORK', - 'OBJ_RECTANGLE', - 'OBJ_RECTANGLE_LABEL', - 'OBJ_REGRESSION', - 'OBJ_STDDEVCHANNEL', - 'OBJ_TEXT', - 'OBJ_TRENDBYANGLE', - 'OBJ_TREND', - 'OBJ_TRIANGLE', - 'OBJ_VLINE', - 'OP_BUYLIMIT', - 'OP_BUYSTOP', - 'OP_BUY', - 'OP_SELLLIMIT', - 'OP_SELLSTOP', - 'OP_SELL', - 'PERIOD_CURRENT', - 'PERIOD_D1', - 'PERIOD_H1', - 'PERIOD_H2', - 'PERIOD_H3', - 'PERIOD_H4', - 'PERIOD_H6', - 'PERIOD_H8', - 'PERIOD_H12', - 'PERIOD_M1', - 'PERIOD_M2', - 'PERIOD_M3', - 'PERIOD_M4', - 'PERIOD_M5', - 'PERIOD_M6', - 'PERIOD_M10', - 'PERIOD_M12', - 'PERIOD_M15', - 'PERIOD_M20', - 'PERIOD_M30', - 'PERIOD_MN1', - 'PERIOD_W1', - 'POINTER_AUTOMATIC', - 'POINTER_DYNAMIC', - 'POINTER_INVALID' - 'PRICE_CLOSE', - 'PRICE_HIGH', - 'PRICE_LOW', - 'PRICE_MEDIAN', - 'PRICE_OPEN', - 'PRICE_TYPICAL', - 'PRICE_WEIGHTED', - 'PROGRAM_EXPERT', - 'PROGRAM_INDICATOR', - 'PROGRAM_SCRIPT', - 'REASON_ACCOUNT', - 'REASON_CHARTCHANGE', - 'REASON_CHARTCLOSE', - 'REASON_CLOSE', - 'REASON_INITFAILED', - 'REASON_PARAMETERS', - 'REASON_PROGRAM' - 'REASON_RECOMPILE', - 'REASON_REMOVE', - 'REASON_TEMPLATE', - 'SATURDAY', - 'SEEK_CUR', - 'SEEK_END', - 'SEEK_SET', - 'SERIES_BARS_COUNT', - 'SERIES_FIRSTDATE', - 'SERIES_LASTBAR_DATE', - 'SERIES_SERVER_FIRSTDATE', - 'SERIES_SYNCHRONIZED', - 'SERIES_TERMINAL_FIRSTDATE', - 'SHORT_MAX', - 'SHORT_MIN', - 'STAT_BALANCEDD_PERCENT', - 'STAT_BALANCEMIN', - 'STAT_BALANCE_DDREL_PERCENT', - 'STAT_BALANCE_DD', - 'STAT_BALANCE_DD_RELATIVE', - 'STAT_CONLOSSMAX', - 'STAT_CONLOSSMAX_TRADES', - 'STAT_CONPROFITMAX', - 'STAT_CONPROFITMAX_TRADES', - 'STAT_CUSTOM_ONTESTER', - 'STAT_DEALS', - 'STAT_EQUITYDD_PERCENT', - 'STAT_EQUITYMIN', - 'STAT_EQUITY_DDREL_PERCENT', - 'STAT_EQUITY_DD', - 'STAT_EQUITY_DD_RELATIVE', - 'STAT_EXPECTED_PAYOFF', - 'STAT_GROSS_LOSS', - 'STAT_GROSS_PROFIT', - 'STAT_INITIAL_DEPOSIT', - 'STAT_LONG_TRADES', - 'STAT_LOSSTRADES_AVGCON', - 'STAT_LOSS_TRADES', - 'STAT_MAX_CONLOSSES', - 'STAT_MAX_CONLOSS_TRADES', - 'STAT_MAX_CONPROFIT_TRADES', - 'STAT_MAX_CONWINS', - 'STAT_MAX_LOSSTRADE', - 'STAT_MAX_PROFITTRADE', - 'STAT_MIN_MARGINLEVEL', - 'STAT_PROFITTRADES_AVGCON', - 'STAT_PROFIT', - 'STAT_PROFIT_FACTOR', - 'STAT_PROFIT_LONGTRADES', - 'STAT_PROFIT_SHORTTRADES', - 'STAT_PROFIT_TRADES', - 'STAT_RECOVERY_FACTOR', - 'STAT_SHARPE_RATIO', - 'STAT_SHORT_TRADES', - 'STAT_TRADES', - 'STAT_WITHDRAWAL', - 'STO_CLOSECLOSE', - 'STO_LOWHIGH', - 'STYLE_DASHDOTDOT', - 'STYLE_DASHDOT', - 'STYLE_DASH', - 'STYLE_DOT', - 'STYLE_SOLID', - 'SUNDAY', - 'SYMBOL_ARROWDOWN', - 'SYMBOL_ARROWUP', - 'SYMBOL_CHECKSIGN', - 'SYMBOL_LEFTPRICE', - 'SYMBOL_RIGHTPRICE', - 'SYMBOL_STOPSIGN', - 'SYMBOL_THUMBSDOWN', - 'SYMBOL_THUMBSUP', - 'TERMINAL_BUILD', - 'TERMINAL_CODEPAGE', - 'TERMINAL_COMMONDATA_PATH', - 'TERMINAL_COMPANY', - 'TERMINAL_CONNECTED', - 'TERMINAL_CPU_CORES', - 'TERMINAL_DATA_PATH', - 'TERMINAL_DISK_SPACE', - 'TERMINAL_DLLS_ALLOWED', - 'TERMINAL_EMAIL_ENABLED', - 'TERMINAL_FTP_ENABLED', - 'TERMINAL_LANGUAGE', - 'TERMINAL_MAXBARS', - 'TERMINAL_MEMORY_AVAILABLE', - 'TERMINAL_MEMORY_PHYSICAL', - 'TERMINAL_MEMORY_TOTAL', - 'TERMINAL_MEMORY_USED', - 'TERMINAL_NAME', - 'TERMINAL_OPENCL_SUPPORT', - 'TERMINAL_PATH', - 'TERMINAL_TRADE_ALLOWED', - 'TERMINAL_X64', - 'THURSDAY', - 'TRADE_ACTION_DEAL', - 'TRADE_ACTION_MODIFY', - 'TRADE_ACTION_PENDING', - 'TRADE_ACTION_REMOVE', - 'TRADE_ACTION_SLTP', - 'TUESDAY', - 'UCHAR_MAX', - 'UINT_MAX', - 'ULONG_MAX', - 'USHORT_MAX', - 'VOLUME_REAL', - 'VOLUME_TICK', - 'WEDNESDAY', - 'WHOLE_ARRAY', - 'WRONG_VALUE', - 'clrNONE', - '__DATETIME__', - '__DATE__', - '__FILE__', - '__FUNCSIG__', - '__FUNCTION__', - '__LINE__', - '__MQL4BUILD__', - '__MQLBUILD__', - '__PATH__', -) - -colors = ( - 'AliceBlue', - 'AntiqueWhite', - 'Aquamarine', - 'Aqua', - 'Beige', - 'Bisque', - 'Black', - 'BlanchedAlmond', - 'BlueViolet', - 'Blue', - 'Brown', - 'BurlyWood', - 'CadetBlue', - 'Chartreuse', - 'Chocolate', - 'Coral', - 'CornflowerBlue', - 'Cornsilk', - 'Crimson', - 'DarkBlue', - 'DarkGoldenrod', - 'DarkGray', - 'DarkGreen', - 'DarkKhaki', - 'DarkOliveGreen', - 'DarkOrange', - 'DarkOrchid', - 'DarkSalmon', - 'DarkSeaGreen', - 'DarkSlateBlue', - 'DarkSlateGray', - 'DarkTurquoise', - 'DarkViolet', - 'DeepPink', - 'DeepSkyBlue', - 'DimGray', - 'DodgerBlue', - 'FireBrick', - 'ForestGreen', - 'Gainsboro', - 'Goldenrod', - 'Gold', - 'Gray', - 'GreenYellow', - 'Green', - 'Honeydew', - 'HotPink', - 'IndianRed', - 'Indigo', - 'Ivory', - 'Khaki', - 'LavenderBlush', - 'Lavender', - 'LawnGreen', - 'LemonChiffon', - 'LightBlue', - 'LightCoral', - 'LightCyan', - 'LightGoldenrod', - 'LightGray', - 'LightGreen', - 'LightPink', - 'LightSalmon', - 'LightSeaGreen', - 'LightSkyBlue', - 'LightSlateGray', - 'LightSteelBlue', - 'LightYellow', - 'LimeGreen', - 'Lime', - 'Linen', - 'Magenta', - 'Maroon', - 'MediumAquamarine', - 'MediumBlue', - 'MediumOrchid', - 'MediumPurple', - 'MediumSeaGreen', - 'MediumSlateBlue', - 'MediumSpringGreen', - 'MediumTurquoise', - 'MediumVioletRed', - 'MidnightBlue', - 'MintCream', - 'MistyRose', - 'Moccasin', - 'NavajoWhite', - 'Navy', - 'OldLace', - 'OliveDrab', - 'Olive', - 'OrangeRed', - 'Orange', - 'Orchid', - 'PaleGoldenrod', - 'PaleGreen', - 'PaleTurquoise', - 'PaleVioletRed', - 'PapayaWhip', - 'PeachPuff', - 'Peru', - 'Pink', - 'Plum', - 'PowderBlue', - 'Purple', - 'Red', - 'RosyBrown', - 'RoyalBlue', - 'SaddleBrown', - 'Salmon', - 'SandyBrown', - 'SeaGreen', - 'Seashell', - 'Sienna', - 'Silver', - 'SkyBlue', - 'SlateBlue', - 'SlateGray', - 'Snow', - 'SpringGreen', - 'SteelBlue', - 'Tan', - 'Teal', - 'Thistle', - 'Tomato', - 'Turquoise', - 'Violet', - 'Wheat', - 'WhiteSmoke', - 'White', - 'YellowGreen', - 'Yellow', -) - -keywords = ( - 'input', '_Digits', '_Point', '_LastError', '_Period', '_RandomSeed', - '_StopFlag', '_Symbol', '_UninitReason', 'Ask', 'Bars', 'Bid', - 'Close', 'Digits', 'High', 'Low', 'Open', 'Point', 'Time', - 'Volume', -) -c_types = ( - 'void', 'char', 'uchar', 'bool', 'short', 'ushort', 'int', 'uint', - 'color', 'long', 'ulong', 'datetime', 'float', 'double', - 'string', -) diff --git a/wakatime/packages/py2/pygments/lexers/_openedge_builtins.py b/wakatime/packages/py2/pygments/lexers/_openedge_builtins.py deleted file mode 100644 index 758dba2..0000000 --- a/wakatime/packages/py2/pygments/lexers/_openedge_builtins.py +++ /dev/null @@ -1,2547 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._openedge_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Builtin list for the OpenEdgeLexer. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -OPENEDGEKEYWORDS = ( - 'ABSOLUTE', - 'ABS', - 'ABSO', - 'ABSOL', - 'ABSOLU', - 'ABSOLUT', - 'ACCELERATOR', - 'ACCUMULATE', - 'ACCUM', - 'ACCUMU', - 'ACCUMUL', - 'ACCUMULA', - 'ACCUMULAT', - 'ACTIVE-FORM', - 'ACTIVE-WINDOW', - 'ADD', - 'ADD-BUFFER', - 'ADD-CALC-COLUMN', - 'ADD-COLUMNS-FROM', - 'ADD-EVENTS-PROCEDURE', - 'ADD-FIELDS-FROM', - 'ADD-FIRST', - 'ADD-INDEX-FIELD', - 'ADD-LAST', - 'ADD-LIKE-COLUMN', - 'ADD-LIKE-FIELD', - 'ADD-LIKE-INDEX', - 'ADD-NEW-FIELD', - 'ADD-NEW-INDEX', - 'ADD-SCHEMA-LOCATION', - 'ADD-SUPER-PROCEDURE', - 'ADM-DATA', - 'ADVISE', - 'ALERT-BOX', - 'ALIAS', - 'ALL', - 'ALLOW-COLUMN-SEARCHING', - 'ALLOW-REPLICATION', - 'ALTER', - 'ALWAYS-ON-TOP', - 'AMBIGUOUS', - 'AMBIG', - 'AMBIGU', - 'AMBIGUO', - 'AMBIGUOU', - 'ANALYZE', - 'ANALYZ', - 'AND', - 'ANSI-ONLY', - 'ANY', - 'ANYWHERE', - 'APPEND', - 'APPL-ALERT-BOXES', - 'APPL-ALERT', - 'APPL-ALERT-', - 'APPL-ALERT-B', - 'APPL-ALERT-BO', - 'APPL-ALERT-BOX', - 'APPL-ALERT-BOXE', - 'APPL-CONTEXT-ID', - 'APPLICATION', - 'APPLY', - 'APPSERVER-INFO', - 'APPSERVER-PASSWORD', - 'APPSERVER-USERID', - 'ARRAY-MESSAGE', - 'AS', - 'ASC', - 'ASCENDING', - 'ASCE', - 'ASCEN', - 'ASCEND', - 'ASCENDI', - 'ASCENDIN', - 'ASK-OVERWRITE', - 'ASSEMBLY', - 'ASSIGN', - 'ASYNCHRONOUS', - 'ASYNC-REQUEST-COUNT', - 'ASYNC-REQUEST-HANDLE', - 'AT', - 'ATTACHED-PAIRLIST', - 'ATTR-SPACE', - 'ATTR', - 'ATTRI', - 'ATTRIB', - 'ATTRIBU', - 'ATTRIBUT', - 'AUDIT-CONTROL', - 'AUDIT-ENABLED', - 'AUDIT-EVENT-CONTEXT', - 'AUDIT-POLICY', - 'AUTHENTICATION-FAILED', - 'AUTHORIZATION', - 'AUTO-COMPLETION', - 'AUTO-COMP', - 'AUTO-COMPL', - 'AUTO-COMPLE', - 'AUTO-COMPLET', - 'AUTO-COMPLETI', - 'AUTO-COMPLETIO', - 'AUTO-ENDKEY', - 'AUTO-END-KEY', - 'AUTO-GO', - 'AUTO-INDENT', - 'AUTO-IND', - 'AUTO-INDE', - 'AUTO-INDEN', - 'AUTOMATIC', - 'AUTO-RESIZE', - 'AUTO-RETURN', - 'AUTO-RET', - 'AUTO-RETU', - 'AUTO-RETUR', - 'AUTO-SYNCHRONIZE', - 'AUTO-ZAP', - 'AUTO-Z', - 'AUTO-ZA', - 'AVAILABLE', - 'AVAIL', - 'AVAILA', - 'AVAILAB', - 'AVAILABL', - 'AVAILABLE-FORMATS', - 'AVERAGE', - 'AVE', - 'AVER', - 'AVERA', - 'AVERAG', - 'AVG', - 'BACKGROUND', - 'BACK', - 'BACKG', - 'BACKGR', - 'BACKGRO', - 'BACKGROU', - 'BACKGROUN', - 'BACKWARDS', - 'BACKWARD', - 'BASE64-DECODE', - 'BASE64-ENCODE', - 'BASE-ADE', - 'BASE-KEY', - 'BATCH-MODE', - 'BATCH', - 'BATCH-', - 'BATCH-M', - 'BATCH-MO', - 'BATCH-MOD', - 'BATCH-SIZE', - 'BEFORE-HIDE', - 'BEFORE-H', - 'BEFORE-HI', - 'BEFORE-HID', - 'BEGIN-EVENT-GROUP', - 'BEGINS', - 'BELL', - 'BETWEEN', - 'BGCOLOR', - 'BGC', - 'BGCO', - 'BGCOL', - 'BGCOLO', - 'BIG-ENDIAN', - 'BINARY', - 'BIND', - 'BIND-WHERE', - 'BLANK', - 'BLOCK-ITERATION-DISPLAY', - 'BORDER-BOTTOM-CHARS', - 'BORDER-B', - 'BORDER-BO', - 'BORDER-BOT', - 'BORDER-BOTT', - 'BORDER-BOTTO', - 'BORDER-BOTTOM-PIXELS', - 'BORDER-BOTTOM-P', - 'BORDER-BOTTOM-PI', - 'BORDER-BOTTOM-PIX', - 'BORDER-BOTTOM-PIXE', - 'BORDER-BOTTOM-PIXEL', - 'BORDER-LEFT-CHARS', - 'BORDER-L', - 'BORDER-LE', - 'BORDER-LEF', - 'BORDER-LEFT', - 'BORDER-LEFT-', - 'BORDER-LEFT-C', - 'BORDER-LEFT-CH', - 'BORDER-LEFT-CHA', - 'BORDER-LEFT-CHAR', - 'BORDER-LEFT-PIXELS', - 'BORDER-LEFT-P', - 'BORDER-LEFT-PI', - 'BORDER-LEFT-PIX', - 'BORDER-LEFT-PIXE', - 'BORDER-LEFT-PIXEL', - 'BORDER-RIGHT-CHARS', - 'BORDER-R', - 'BORDER-RI', - 'BORDER-RIG', - 'BORDER-RIGH', - 'BORDER-RIGHT', - 'BORDER-RIGHT-', - 'BORDER-RIGHT-C', - 'BORDER-RIGHT-CH', - 'BORDER-RIGHT-CHA', - 'BORDER-RIGHT-CHAR', - 'BORDER-RIGHT-PIXELS', - 'BORDER-RIGHT-P', - 'BORDER-RIGHT-PI', - 'BORDER-RIGHT-PIX', - 'BORDER-RIGHT-PIXE', - 'BORDER-RIGHT-PIXEL', - 'BORDER-TOP-CHARS', - 'BORDER-T', - 'BORDER-TO', - 'BORDER-TOP', - 'BORDER-TOP-', - 'BORDER-TOP-C', - 'BORDER-TOP-CH', - 'BORDER-TOP-CHA', - 'BORDER-TOP-CHAR', - 'BORDER-TOP-PIXELS', - 'BORDER-TOP-P', - 'BORDER-TOP-PI', - 'BORDER-TOP-PIX', - 'BORDER-TOP-PIXE', - 'BORDER-TOP-PIXEL', - 'BOX', - 'BOX-SELECTABLE', - 'BOX-SELECT', - 'BOX-SELECTA', - 'BOX-SELECTAB', - 'BOX-SELECTABL', - 'BREAK', - 'BROWSE', - 'BUFFER', - 'BUFFER-CHARS', - 'BUFFER-COMPARE', - 'BUFFER-COPY', - 'BUFFER-CREATE', - 'BUFFER-DELETE', - 'BUFFER-FIELD', - 'BUFFER-HANDLE', - 'BUFFER-LINES', - 'BUFFER-NAME', - 'BUFFER-RELEASE', - 'BUFFER-VALUE', - 'BUTTON', - 'BUTTONS', - 'BY', - 'BY-POINTER', - 'BY-VARIANT-POINTER', - 'CACHE', - 'CACHE-SIZE', - 'CALL', - 'CALL-NAME', - 'CALL-TYPE', - 'CANCEL-BREAK', - 'CANCEL-BUTTON', - 'CAN-CREATE', - 'CAN-DELETE', - 'CAN-DO', - 'CAN-FIND', - 'CAN-QUERY', - 'CAN-READ', - 'CAN-SET', - 'CAN-WRITE', - 'CAPS', - 'CAREFUL-PAINT', - 'CASE', - 'CASE-SENSITIVE', - 'CASE-SEN', - 'CASE-SENS', - 'CASE-SENSI', - 'CASE-SENSIT', - 'CASE-SENSITI', - 'CASE-SENSITIV', - 'CAST', - 'CATCH', - 'CDECL', - 'CENTERED', - 'CENTER', - 'CENTERE', - 'CHAINED', - 'CHARACTER_LENGTH', - 'CHARSET', - 'CHECK', - 'CHECKED', - 'CHOOSE', - 'CHR', - 'CLASS', - 'CLASS-TYPE', - 'CLEAR', - 'CLEAR-APPL-CONTEXT', - 'CLEAR-LOG', - 'CLEAR-SELECTION', - 'CLEAR-SELECT', - 'CLEAR-SELECTI', - 'CLEAR-SELECTIO', - 'CLEAR-SORT-ARROWS', - 'CLEAR-SORT-ARROW', - 'CLIENT-CONNECTION-ID', - 'CLIENT-PRINCIPAL', - 'CLIENT-TTY', - 'CLIENT-TYPE', - 'CLIENT-WORKSTATION', - 'CLIPBOARD', - 'CLOSE', - 'CLOSE-LOG', - 'CODE', - 'CODEBASE-LOCATOR', - 'CODEPAGE', - 'CODEPAGE-CONVERT', - 'COLLATE', - 'COL-OF', - 'COLON', - 'COLON-ALIGNED', - 'COLON-ALIGN', - 'COLON-ALIGNE', - 'COLOR', - 'COLOR-TABLE', - 'COLUMN', - 'COL', - 'COLU', - 'COLUM', - 'COLUMN-BGCOLOR', - 'COLUMN-DCOLOR', - 'COLUMN-FGCOLOR', - 'COLUMN-FONT', - 'COLUMN-LABEL', - 'COLUMN-LAB', - 'COLUMN-LABE', - 'COLUMN-MOVABLE', - 'COLUMN-OF', - 'COLUMN-PFCOLOR', - 'COLUMN-READ-ONLY', - 'COLUMN-RESIZABLE', - 'COLUMNS', - 'COLUMN-SCROLLING', - 'COMBO-BOX', - 'COMMAND', - 'COMPARES', - 'COMPILE', - 'COMPILER', - 'COMPLETE', - 'COM-SELF', - 'CONFIG-NAME', - 'CONNECT', - 'CONNECTED', - 'CONSTRUCTOR', - 'CONTAINS', - 'CONTENTS', - 'CONTEXT', - 'CONTEXT-HELP', - 'CONTEXT-HELP-FILE', - 'CONTEXT-HELP-ID', - 'CONTEXT-POPUP', - 'CONTROL', - 'CONTROL-BOX', - 'CONTROL-FRAME', - 'CONVERT', - 'CONVERT-3D-COLORS', - 'CONVERT-TO-OFFSET', - 'CONVERT-TO-OFFS', - 'CONVERT-TO-OFFSE', - 'COPY-DATASET', - 'COPY-LOB', - 'COPY-SAX-ATTRIBUTES', - 'COPY-TEMP-TABLE', - 'COUNT', - 'COUNT-OF', - 'CPCASE', - 'CPCOLL', - 'CPINTERNAL', - 'CPLOG', - 'CPPRINT', - 'CPRCODEIN', - 'CPRCODEOUT', - 'CPSTREAM', - 'CPTERM', - 'CRC-VALUE', - 'CREATE', - 'CREATE-LIKE', - 'CREATE-LIKE-SEQUENTIAL', - 'CREATE-NODE-NAMESPACE', - 'CREATE-RESULT-LIST-ENTRY', - 'CREATE-TEST-FILE', - 'CURRENT', - 'CURRENT_DATE', - 'CURRENT-CHANGED', - 'CURRENT-COLUMN', - 'CURRENT-ENVIRONMENT', - 'CURRENT-ENV', - 'CURRENT-ENVI', - 'CURRENT-ENVIR', - 'CURRENT-ENVIRO', - 'CURRENT-ENVIRON', - 'CURRENT-ENVIRONM', - 'CURRENT-ENVIRONME', - 'CURRENT-ENVIRONMEN', - 'CURRENT-ITERATION', - 'CURRENT-LANGUAGE', - 'CURRENT-LANG', - 'CURRENT-LANGU', - 'CURRENT-LANGUA', - 'CURRENT-LANGUAG', - 'CURRENT-QUERY', - 'CURRENT-RESULT-ROW', - 'CURRENT-ROW-MODIFIED', - 'CURRENT-VALUE', - 'CURRENT-WINDOW', - 'CURSOR', - 'CURS', - 'CURSO', - 'CURSOR-CHAR', - 'CURSOR-LINE', - 'CURSOR-OFFSET', - 'DATABASE', - 'DATA-BIND', - 'DATA-ENTRY-RETURN', - 'DATA-ENTRY-RET', - 'DATA-ENTRY-RETU', - 'DATA-ENTRY-RETUR', - 'DATA-RELATION', - 'DATA-REL', - 'DATA-RELA', - 'DATA-RELAT', - 'DATA-RELATI', - 'DATA-RELATIO', - 'DATASERVERS', - 'DATASET', - 'DATASET-HANDLE', - 'DATA-SOURCE', - 'DATA-SOURCE-COMPLETE-MAP', - 'DATA-SOURCE-MODIFIED', - 'DATA-SOURCE-ROWID', - 'DATA-TYPE', - 'DATA-T', - 'DATA-TY', - 'DATA-TYP', - 'DATE-FORMAT', - 'DATE-F', - 'DATE-FO', - 'DATE-FOR', - 'DATE-FORM', - 'DATE-FORMA', - 'DAY', - 'DBCODEPAGE', - 'DBCOLLATION', - 'DBNAME', - 'DBPARAM', - 'DB-REFERENCES', - 'DBRESTRICTIONS', - 'DBREST', - 'DBRESTR', - 'DBRESTRI', - 'DBRESTRIC', - 'DBRESTRICT', - 'DBRESTRICTI', - 'DBRESTRICTIO', - 'DBRESTRICTION', - 'DBTASKID', - 'DBTYPE', - 'DBVERSION', - 'DBVERS', - 'DBVERSI', - 'DBVERSIO', - 'DCOLOR', - 'DDE', - 'DDE-ERROR', - 'DDE-ID', - 'DDE-I', - 'DDE-ITEM', - 'DDE-NAME', - 'DDE-TOPIC', - 'DEBLANK', - 'DEBUG', - 'DEBU', - 'DEBUG-ALERT', - 'DEBUGGER', - 'DEBUG-LIST', - 'DECIMALS', - 'DECLARE', - 'DECLARE-NAMESPACE', - 'DECRYPT', - 'DEFAULT', - 'DEFAULT-BUFFER-HANDLE', - 'DEFAULT-BUTTON', - 'DEFAUT-B', - 'DEFAUT-BU', - 'DEFAUT-BUT', - 'DEFAUT-BUTT', - 'DEFAUT-BUTTO', - 'DEFAULT-COMMIT', - 'DEFAULT-EXTENSION', - 'DEFAULT-EX', - 'DEFAULT-EXT', - 'DEFAULT-EXTE', - 'DEFAULT-EXTEN', - 'DEFAULT-EXTENS', - 'DEFAULT-EXTENSI', - 'DEFAULT-EXTENSIO', - 'DEFAULT-NOXLATE', - 'DEFAULT-NOXL', - 'DEFAULT-NOXLA', - 'DEFAULT-NOXLAT', - 'DEFAULT-VALUE', - 'DEFAULT-WINDOW', - 'DEFINED', - 'DEFINE-USER-EVENT-MANAGER', - 'DELETE', - 'DEL', - 'DELE', - 'DELET', - 'DELETE-CHARACTER', - 'DELETE-CHAR', - 'DELETE-CHARA', - 'DELETE-CHARAC', - 'DELETE-CHARACT', - 'DELETE-CHARACTE', - 'DELETE-CURRENT-ROW', - 'DELETE-LINE', - 'DELETE-RESULT-LIST-ENTRY', - 'DELETE-SELECTED-ROW', - 'DELETE-SELECTED-ROWS', - 'DELIMITER', - 'DESC', - 'DESCENDING', - 'DESCE', - 'DESCEN', - 'DESCEND', - 'DESCENDI', - 'DESCENDIN', - 'DESELECT-FOCUSED-ROW', - 'DESELECTION', - 'DESELECT-ROWS', - 'DESELECT-SELECTED-ROW', - 'DESTRUCTOR', - 'DIALOG-BOX', - 'DICTIONARY', - 'DICT', - 'DICTI', - 'DICTIO', - 'DICTION', - 'DICTIONA', - 'DICTIONAR', - 'DIR', - 'DISABLE', - 'DISABLE-AUTO-ZAP', - 'DISABLED', - 'DISABLE-DUMP-TRIGGERS', - 'DISABLE-LOAD-TRIGGERS', - 'DISCONNECT', - 'DISCON', - 'DISCONN', - 'DISCONNE', - 'DISCONNEC', - 'DISP', - 'DISPLAY', - 'DISPL', - 'DISPLA', - 'DISPLAY-MESSAGE', - 'DISPLAY-TYPE', - 'DISPLAY-T', - 'DISPLAY-TY', - 'DISPLAY-TYP', - 'DISTINCT', - 'DO', - 'DOMAIN-DESCRIPTION', - 'DOMAIN-NAME', - 'DOMAIN-TYPE', - 'DOS', - 'DOUBLE', - 'DOWN', - 'DRAG-ENABLED', - 'DROP', - 'DROP-DOWN', - 'DROP-DOWN-LIST', - 'DROP-FILE-NOTIFY', - 'DROP-TARGET', - 'DUMP', - 'DYNAMIC', - 'DYNAMIC-FUNCTION', - 'EACH', - 'ECHO', - 'EDGE-CHARS', - 'EDGE', - 'EDGE-', - 'EDGE-C', - 'EDGE-CH', - 'EDGE-CHA', - 'EDGE-CHAR', - 'EDGE-PIXELS', - 'EDGE-P', - 'EDGE-PI', - 'EDGE-PIX', - 'EDGE-PIXE', - 'EDGE-PIXEL', - 'EDIT-CAN-PASTE', - 'EDIT-CAN-UNDO', - 'EDIT-CLEAR', - 'EDIT-COPY', - 'EDIT-CUT', - 'EDITING', - 'EDITOR', - 'EDIT-PASTE', - 'EDIT-UNDO', - 'ELSE', - 'EMPTY', - 'EMPTY-TEMP-TABLE', - 'ENABLE', - 'ENABLED-FIELDS', - 'ENCODE', - 'ENCRYPT', - 'ENCRYPT-AUDIT-MAC-KEY', - 'ENCRYPTION-SALT', - 'END', - 'END-DOCUMENT', - 'END-ELEMENT', - 'END-EVENT-GROUP', - 'END-FILE-DROP', - 'ENDKEY', - 'END-KEY', - 'END-MOVE', - 'END-RESIZE', - 'END-ROW-RESIZE', - 'END-USER-PROMPT', - 'ENTERED', - 'ENTRY', - 'EQ', - 'ERROR', - 'ERROR-COLUMN', - 'ERROR-COL', - 'ERROR-COLU', - 'ERROR-COLUM', - 'ERROR-ROW', - 'ERROR-STACK-TRACE', - 'ERROR-STATUS', - 'ERROR-STAT', - 'ERROR-STATU', - 'ESCAPE', - 'ETIME', - 'EVENT-GROUP-ID', - 'EVENT-PROCEDURE', - 'EVENT-PROCEDURE-CONTEXT', - 'EVENTS', - 'EVENT', - 'EVENT-TYPE', - 'EVENT-T', - 'EVENT-TY', - 'EVENT-TYP', - 'EXCEPT', - 'EXCLUSIVE-ID', - 'EXCLUSIVE-LOCK', - 'EXCLUSIVE', - 'EXCLUSIVE-', - 'EXCLUSIVE-L', - 'EXCLUSIVE-LO', - 'EXCLUSIVE-LOC', - 'EXCLUSIVE-WEB-USER', - 'EXECUTE', - 'EXISTS', - 'EXP', - 'EXPAND', - 'EXPANDABLE', - 'EXPLICIT', - 'EXPORT', - 'EXPORT-PRINCIPAL', - 'EXTENDED', - 'EXTENT', - 'EXTERNAL', - 'FALSE', - 'FETCH', - 'FETCH-SELECTED-ROW', - 'FGCOLOR', - 'FGC', - 'FGCO', - 'FGCOL', - 'FGCOLO', - 'FIELD', - 'FIELDS', - 'FILE', - 'FILE-CREATE-DATE', - 'FILE-CREATE-TIME', - 'FILE-INFORMATION', - 'FILE-INFO', - 'FILE-INFOR', - 'FILE-INFORM', - 'FILE-INFORMA', - 'FILE-INFORMAT', - 'FILE-INFORMATI', - 'FILE-INFORMATIO', - 'FILE-MOD-DATE', - 'FILE-MOD-TIME', - 'FILENAME', - 'FILE-NAME', - 'FILE-OFFSET', - 'FILE-OFF', - 'FILE-OFFS', - 'FILE-OFFSE', - 'FILE-SIZE', - 'FILE-TYPE', - 'FILL', - 'FILLED', - 'FILL-IN', - 'FILTERS', - 'FINAL', - 'FINALLY', - 'FIND', - 'FIND-BY-ROWID', - 'FIND-CASE-SENSITIVE', - 'FIND-CURRENT', - 'FINDER', - 'FIND-FIRST', - 'FIND-GLOBAL', - 'FIND-LAST', - 'FIND-NEXT-OCCURRENCE', - 'FIND-PREV-OCCURRENCE', - 'FIND-SELECT', - 'FIND-UNIQUE', - 'FIND-WRAP-AROUND', - 'FIRST', - 'FIRST-ASYNCH-REQUEST', - 'FIRST-CHILD', - 'FIRST-COLUMN', - 'FIRST-FORM', - 'FIRST-OBJECT', - 'FIRST-OF', - 'FIRST-PROCEDURE', - 'FIRST-PROC', - 'FIRST-PROCE', - 'FIRST-PROCED', - 'FIRST-PROCEDU', - 'FIRST-PROCEDUR', - 'FIRST-SERVER', - 'FIRST-TAB-ITEM', - 'FIRST-TAB-I', - 'FIRST-TAB-IT', - 'FIRST-TAB-ITE', - 'FIT-LAST-COLUMN', - 'FIXED-ONLY', - 'FLAT-BUTTON', - 'FLOAT', - 'FOCUS', - 'FOCUSED-ROW', - 'FOCUSED-ROW-SELECTED', - 'FONT', - 'FONT-TABLE', - 'FOR', - 'FORCE-FILE', - 'FOREGROUND', - 'FORE', - 'FOREG', - 'FOREGR', - 'FOREGRO', - 'FOREGROU', - 'FOREGROUN', - 'FORM', - 'FORMAT', - 'FORMA', - 'FORMATTED', - 'FORMATTE', - 'FORM-LONG-INPUT', - 'FORWARD', - 'FORWARDS', - 'FRAGMENT', - 'FRAGMEN', - 'FRAME', - 'FRAM', - 'FRAME-COL', - 'FRAME-DB', - 'FRAME-DOWN', - 'FRAME-FIELD', - 'FRAME-FILE', - 'FRAME-INDEX', - 'FRAME-INDE', - 'FRAME-LINE', - 'FRAME-NAME', - 'FRAME-ROW', - 'FRAME-SPACING', - 'FRAME-SPA', - 'FRAME-SPAC', - 'FRAME-SPACI', - 'FRAME-SPACIN', - 'FRAME-VALUE', - 'FRAME-VAL', - 'FRAME-VALU', - 'FRAME-X', - 'FRAME-Y', - 'FREQUENCY', - 'FROM', - 'FROM-CHARS', - 'FROM-C', - 'FROM-CH', - 'FROM-CHA', - 'FROM-CHAR', - 'FROM-CURRENT', - 'FROM-CUR', - 'FROM-CURR', - 'FROM-CURRE', - 'FROM-CURREN', - 'FROM-PIXELS', - 'FROM-P', - 'FROM-PI', - 'FROM-PIX', - 'FROM-PIXE', - 'FROM-PIXEL', - 'FULL-HEIGHT-CHARS', - 'FULL-HEIGHT', - 'FULL-HEIGHT-', - 'FULL-HEIGHT-C', - 'FULL-HEIGHT-CH', - 'FULL-HEIGHT-CHA', - 'FULL-HEIGHT-CHAR', - 'FULL-HEIGHT-PIXELS', - 'FULL-HEIGHT-P', - 'FULL-HEIGHT-PI', - 'FULL-HEIGHT-PIX', - 'FULL-HEIGHT-PIXE', - 'FULL-HEIGHT-PIXEL', - 'FULL-PATHNAME', - 'FULL-PATHN', - 'FULL-PATHNA', - 'FULL-PATHNAM', - 'FULL-WIDTH-CHARS', - 'FULL-WIDTH', - 'FULL-WIDTH-', - 'FULL-WIDTH-C', - 'FULL-WIDTH-CH', - 'FULL-WIDTH-CHA', - 'FULL-WIDTH-CHAR', - 'FULL-WIDTH-PIXELS', - 'FULL-WIDTH-P', - 'FULL-WIDTH-PI', - 'FULL-WIDTH-PIX', - 'FULL-WIDTH-PIXE', - 'FULL-WIDTH-PIXEL', - 'FUNCTION', - 'FUNCTION-CALL-TYPE', - 'GATEWAYS', - 'GATEWAY', - 'GE', - 'GENERATE-MD5', - 'GENERATE-PBE-KEY', - 'GENERATE-PBE-SALT', - 'GENERATE-RANDOM-KEY', - 'GENERATE-UUID', - 'GET', - 'GET-ATTR-CALL-TYPE', - 'GET-ATTRIBUTE-NODE', - 'GET-BINARY-DATA', - 'GET-BLUE-VALUE', - 'GET-BLUE', - 'GET-BLUE-', - 'GET-BLUE-V', - 'GET-BLUE-VA', - 'GET-BLUE-VAL', - 'GET-BLUE-VALU', - 'GET-BROWSE-COLUMN', - 'GET-BUFFER-HANDLEGETBYTE', - 'GET-BYTE', - 'GET-CALLBACK-PROC-CONTEXT', - 'GET-CALLBACK-PROC-NAME', - 'GET-CGI-LIST', - 'GET-CGI-LONG-VALUE', - 'GET-CGI-VALUE', - 'GET-CODEPAGES', - 'GET-COLLATIONS', - 'GET-CONFIG-VALUE', - 'GET-CURRENT', - 'GET-DOUBLE', - 'GET-DROPPED-FILE', - 'GET-DYNAMIC', - 'GET-ERROR-COLUMN', - 'GET-ERROR-ROW', - 'GET-FILE', - 'GET-FILE-NAME', - 'GET-FILE-OFFSET', - 'GET-FILE-OFFSE', - 'GET-FIRST', - 'GET-FLOAT', - 'GET-GREEN-VALUE', - 'GET-GREEN', - 'GET-GREEN-', - 'GET-GREEN-V', - 'GET-GREEN-VA', - 'GET-GREEN-VAL', - 'GET-GREEN-VALU', - 'GET-INDEX-BY-NAMESPACE-NAME', - 'GET-INDEX-BY-QNAME', - 'GET-INT64', - 'GET-ITERATION', - 'GET-KEY-VALUE', - 'GET-KEY-VAL', - 'GET-KEY-VALU', - 'GET-LAST', - 'GET-LOCALNAME-BY-INDEX', - 'GET-LONG', - 'GET-MESSAGE', - 'GET-NEXT', - 'GET-NUMBER', - 'GET-POINTER-VALUE', - 'GET-PREV', - 'GET-PRINTERS', - 'GET-PROPERTY', - 'GET-QNAME-BY-INDEX', - 'GET-RED-VALUE', - 'GET-RED', - 'GET-RED-', - 'GET-RED-V', - 'GET-RED-VA', - 'GET-RED-VAL', - 'GET-RED-VALU', - 'GET-REPOSITIONED-ROW', - 'GET-RGB-VALUE', - 'GET-SELECTED-WIDGET', - 'GET-SELECTED', - 'GET-SELECTED-', - 'GET-SELECTED-W', - 'GET-SELECTED-WI', - 'GET-SELECTED-WID', - 'GET-SELECTED-WIDG', - 'GET-SELECTED-WIDGE', - 'GET-SHORT', - 'GET-SIGNATURE', - 'GET-SIZE', - 'GET-STRING', - 'GET-TAB-ITEM', - 'GET-TEXT-HEIGHT-CHARS', - 'GET-TEXT-HEIGHT', - 'GET-TEXT-HEIGHT-', - 'GET-TEXT-HEIGHT-C', - 'GET-TEXT-HEIGHT-CH', - 'GET-TEXT-HEIGHT-CHA', - 'GET-TEXT-HEIGHT-CHAR', - 'GET-TEXT-HEIGHT-PIXELS', - 'GET-TEXT-HEIGHT-P', - 'GET-TEXT-HEIGHT-PI', - 'GET-TEXT-HEIGHT-PIX', - 'GET-TEXT-HEIGHT-PIXE', - 'GET-TEXT-HEIGHT-PIXEL', - 'GET-TEXT-WIDTH-CHARS', - 'GET-TEXT-WIDTH', - 'GET-TEXT-WIDTH-', - 'GET-TEXT-WIDTH-C', - 'GET-TEXT-WIDTH-CH', - 'GET-TEXT-WIDTH-CHA', - 'GET-TEXT-WIDTH-CHAR', - 'GET-TEXT-WIDTH-PIXELS', - 'GET-TEXT-WIDTH-P', - 'GET-TEXT-WIDTH-PI', - 'GET-TEXT-WIDTH-PIX', - 'GET-TEXT-WIDTH-PIXE', - 'GET-TEXT-WIDTH-PIXEL', - 'GET-TYPE-BY-INDEX', - 'GET-TYPE-BY-NAMESPACE-NAME', - 'GET-TYPE-BY-QNAME', - 'GET-UNSIGNED-LONG', - 'GET-UNSIGNED-SHORT', - 'GET-URI-BY-INDEX', - 'GET-VALUE-BY-INDEX', - 'GET-VALUE-BY-NAMESPACE-NAME', - 'GET-VALUE-BY-QNAME', - 'GET-WAIT-STATE', - 'GLOBAL', - 'GO-ON', - 'GO-PENDING', - 'GO-PEND', - 'GO-PENDI', - 'GO-PENDIN', - 'GRANT', - 'GRAPHIC-EDGE', - 'GRAPHIC-E', - 'GRAPHIC-ED', - 'GRAPHIC-EDG', - 'GRID-FACTOR-HORIZONTAL', - 'GRID-FACTOR-H', - 'GRID-FACTOR-HO', - 'GRID-FACTOR-HOR', - 'GRID-FACTOR-HORI', - 'GRID-FACTOR-HORIZ', - 'GRID-FACTOR-HORIZO', - 'GRID-FACTOR-HORIZON', - 'GRID-FACTOR-HORIZONT', - 'GRID-FACTOR-HORIZONTA', - 'GRID-FACTOR-VERTICAL', - 'GRID-FACTOR-V', - 'GRID-FACTOR-VE', - 'GRID-FACTOR-VER', - 'GRID-FACTOR-VERT', - 'GRID-FACTOR-VERTI', - 'GRID-FACTOR-VERTIC', - 'GRID-FACTOR-VERTICA', - 'GRID-SNAP', - 'GRID-UNIT-HEIGHT-CHARS', - 'GRID-UNIT-HEIGHT', - 'GRID-UNIT-HEIGHT-', - 'GRID-UNIT-HEIGHT-C', - 'GRID-UNIT-HEIGHT-CH', - 'GRID-UNIT-HEIGHT-CHA', - 'GRID-UNIT-HEIGHT-PIXELS', - 'GRID-UNIT-HEIGHT-P', - 'GRID-UNIT-HEIGHT-PI', - 'GRID-UNIT-HEIGHT-PIX', - 'GRID-UNIT-HEIGHT-PIXE', - 'GRID-UNIT-HEIGHT-PIXEL', - 'GRID-UNIT-WIDTH-CHARS', - 'GRID-UNIT-WIDTH', - 'GRID-UNIT-WIDTH-', - 'GRID-UNIT-WIDTH-C', - 'GRID-UNIT-WIDTH-CH', - 'GRID-UNIT-WIDTH-CHA', - 'GRID-UNIT-WIDTH-CHAR', - 'GRID-UNIT-WIDTH-PIXELS', - 'GRID-UNIT-WIDTH-P', - 'GRID-UNIT-WIDTH-PI', - 'GRID-UNIT-WIDTH-PIX', - 'GRID-UNIT-WIDTH-PIXE', - 'GRID-UNIT-WIDTH-PIXEL', - 'GRID-VISIBLE', - 'GROUP', - 'GT', - 'GUID', - 'HANDLER', - 'HAS-RECORDS', - 'HAVING', - 'HEADER', - 'HEIGHT-CHARS', - 'HEIGHT', - 'HEIGHT-', - 'HEIGHT-C', - 'HEIGHT-CH', - 'HEIGHT-CHA', - 'HEIGHT-CHAR', - 'HEIGHT-PIXELS', - 'HEIGHT-P', - 'HEIGHT-PI', - 'HEIGHT-PIX', - 'HEIGHT-PIXE', - 'HEIGHT-PIXEL', - 'HELP', - 'HEX-DECODE', - 'HEX-ENCODE', - 'HIDDEN', - 'HIDE', - 'HORIZONTAL', - 'HORI', - 'HORIZ', - 'HORIZO', - 'HORIZON', - 'HORIZONT', - 'HORIZONTA', - 'HOST-BYTE-ORDER', - 'HTML-CHARSET', - 'HTML-END-OF-LINE', - 'HTML-END-OF-PAGE', - 'HTML-FRAME-BEGIN', - 'HTML-FRAME-END', - 'HTML-HEADER-BEGIN', - 'HTML-HEADER-END', - 'HTML-TITLE-BEGIN', - 'HTML-TITLE-END', - 'HWND', - 'ICON', - 'IF', - 'IMAGE', - 'IMAGE-DOWN', - 'IMAGE-INSENSITIVE', - 'IMAGE-SIZE', - 'IMAGE-SIZE-CHARS', - 'IMAGE-SIZE-C', - 'IMAGE-SIZE-CH', - 'IMAGE-SIZE-CHA', - 'IMAGE-SIZE-CHAR', - 'IMAGE-SIZE-PIXELS', - 'IMAGE-SIZE-P', - 'IMAGE-SIZE-PI', - 'IMAGE-SIZE-PIX', - 'IMAGE-SIZE-PIXE', - 'IMAGE-SIZE-PIXEL', - 'IMAGE-UP', - 'IMMEDIATE-DISPLAY', - 'IMPLEMENTS', - 'IMPORT', - 'IMPORT-PRINCIPAL', - 'IN', - 'INCREMENT-EXCLUSIVE-ID', - 'INDEX', - 'INDEXED-REPOSITION', - 'INDEX-HINT', - 'INDEX-INFORMATION', - 'INDICATOR', - 'INFORMATION', - 'INFO', - 'INFOR', - 'INFORM', - 'INFORMA', - 'INFORMAT', - 'INFORMATI', - 'INFORMATIO', - 'IN-HANDLE', - 'INHERIT-BGCOLOR', - 'INHERIT-BGC', - 'INHERIT-BGCO', - 'INHERIT-BGCOL', - 'INHERIT-BGCOLO', - 'INHERIT-FGCOLOR', - 'INHERIT-FGC', - 'INHERIT-FGCO', - 'INHERIT-FGCOL', - 'INHERIT-FGCOLO', - 'INHERITS', - 'INITIAL', - 'INIT', - 'INITI', - 'INITIA', - 'INITIAL-DIR', - 'INITIAL-FILTER', - 'INITIALIZE-DOCUMENT-TYPE', - 'INITIATE', - 'INNER-CHARS', - 'INNER-LINES', - 'INPUT', - 'INPUT-OUTPUT', - 'INPUT-O', - 'INPUT-OU', - 'INPUT-OUT', - 'INPUT-OUTP', - 'INPUT-OUTPU', - 'INPUT-VALUE', - 'INSERT', - 'INSERT-ATTRIBUTE', - 'INSERT-BACKTAB', - 'INSERT-B', - 'INSERT-BA', - 'INSERT-BAC', - 'INSERT-BACK', - 'INSERT-BACKT', - 'INSERT-BACKTA', - 'INSERT-FILE', - 'INSERT-ROW', - 'INSERT-STRING', - 'INSERT-TAB', - 'INSERT-T', - 'INSERT-TA', - 'INTERFACE', - 'INTERNAL-ENTRIES', - 'INTO', - 'INVOKE', - 'IS', - 'IS-ATTR-SPACE', - 'IS-ATTR', - 'IS-ATTR-', - 'IS-ATTR-S', - 'IS-ATTR-SP', - 'IS-ATTR-SPA', - 'IS-ATTR-SPAC', - 'IS-CLASS', - 'IS-CLAS', - 'IS-LEAD-BYTE', - 'IS-OPEN', - 'IS-PARAMETER-SET', - 'IS-ROW-SELECTED', - 'IS-SELECTED', - 'ITEM', - 'ITEMS-PER-ROW', - 'JOIN', - 'JOIN-BY-SQLDB', - 'KBLABEL', - 'KEEP-CONNECTION-OPEN', - 'KEEP-FRAME-Z-ORDER', - 'KEEP-FRAME-Z', - 'KEEP-FRAME-Z-', - 'KEEP-FRAME-Z-O', - 'KEEP-FRAME-Z-OR', - 'KEEP-FRAME-Z-ORD', - 'KEEP-FRAME-Z-ORDE', - 'KEEP-MESSAGES', - 'KEEP-SECURITY-CACHE', - 'KEEP-TAB-ORDER', - 'KEY', - 'KEYCODE', - 'KEY-CODE', - 'KEYFUNCTION', - 'KEYFUNC', - 'KEYFUNCT', - 'KEYFUNCTI', - 'KEYFUNCTIO', - 'KEY-FUNCTION', - 'KEY-FUNC', - 'KEY-FUNCT', - 'KEY-FUNCTI', - 'KEY-FUNCTIO', - 'KEYLABEL', - 'KEY-LABEL', - 'KEYS', - 'KEYWORD', - 'KEYWORD-ALL', - 'LABEL', - 'LABEL-BGCOLOR', - 'LABEL-BGC', - 'LABEL-BGCO', - 'LABEL-BGCOL', - 'LABEL-BGCOLO', - 'LABEL-DCOLOR', - 'LABEL-DC', - 'LABEL-DCO', - 'LABEL-DCOL', - 'LABEL-DCOLO', - 'LABEL-FGCOLOR', - 'LABEL-FGC', - 'LABEL-FGCO', - 'LABEL-FGCOL', - 'LABEL-FGCOLO', - 'LABEL-FONT', - 'LABEL-PFCOLOR', - 'LABEL-PFC', - 'LABEL-PFCO', - 'LABEL-PFCOL', - 'LABEL-PFCOLO', - 'LABELS', - 'LANDSCAPE', - 'LANGUAGES', - 'LANGUAGE', - 'LARGE', - 'LARGE-TO-SMALL', - 'LAST', - 'LAST-ASYNCH-REQUEST', - 'LAST-BATCH', - 'LAST-CHILD', - 'LAST-EVENT', - 'LAST-EVEN', - 'LAST-FORM', - 'LASTKEY', - 'LAST-KEY', - 'LAST-OBJECT', - 'LAST-OF', - 'LAST-PROCEDURE', - 'LAST-PROCE', - 'LAST-PROCED', - 'LAST-PROCEDU', - 'LAST-PROCEDUR', - 'LAST-SERVER', - 'LAST-TAB-ITEM', - 'LAST-TAB-I', - 'LAST-TAB-IT', - 'LAST-TAB-ITE', - 'LC', - 'LDBNAME', - 'LE', - 'LEAVE', - 'LEFT-ALIGNED', - 'LEFT-ALIGN', - 'LEFT-ALIGNE', - 'LEFT-TRIM', - 'LENGTH', - 'LIBRARY', - 'LIKE', - 'LIKE-SEQUENTIAL', - 'LINE', - 'LINE-COUNTER', - 'LINE-COUNT', - 'LINE-COUNTE', - 'LIST-EVENTS', - 'LISTING', - 'LISTI', - 'LISTIN', - 'LIST-ITEM-PAIRS', - 'LIST-ITEMS', - 'LIST-PROPERTY-NAMES', - 'LIST-QUERY-ATTRS', - 'LIST-SET-ATTRS', - 'LIST-WIDGETS', - 'LITERAL-QUESTION', - 'LITTLE-ENDIAN', - 'LOAD', - 'LOAD-DOMAINS', - 'LOAD-ICON', - 'LOAD-IMAGE', - 'LOAD-IMAGE-DOWN', - 'LOAD-IMAGE-INSENSITIVE', - 'LOAD-IMAGE-UP', - 'LOAD-MOUSE-POINTER', - 'LOAD-MOUSE-P', - 'LOAD-MOUSE-PO', - 'LOAD-MOUSE-POI', - 'LOAD-MOUSE-POIN', - 'LOAD-MOUSE-POINT', - 'LOAD-MOUSE-POINTE', - 'LOAD-PICTURE', - 'LOAD-SMALL-ICON', - 'LOCAL-NAME', - 'LOCATOR-COLUMN-NUMBER', - 'LOCATOR-LINE-NUMBER', - 'LOCATOR-PUBLIC-ID', - 'LOCATOR-SYSTEM-ID', - 'LOCATOR-TYPE', - 'LOCKED', - 'LOCK-REGISTRATION', - 'LOG', - 'LOG-AUDIT-EVENT', - 'LOGIN-EXPIRATION-TIMESTAMP', - 'LOGIN-HOST', - 'LOGIN-STATE', - 'LOG-MANAGER', - 'LOGOUT', - 'LOOKAHEAD', - 'LOOKUP', - 'LT', - 'MACHINE-CLASS', - 'MANDATORY', - 'MANUAL-HIGHLIGHT', - 'MAP', - 'MARGIN-EXTRA', - 'MARGIN-HEIGHT-CHARS', - 'MARGIN-HEIGHT', - 'MARGIN-HEIGHT-', - 'MARGIN-HEIGHT-C', - 'MARGIN-HEIGHT-CH', - 'MARGIN-HEIGHT-CHA', - 'MARGIN-HEIGHT-CHAR', - 'MARGIN-HEIGHT-PIXELS', - 'MARGIN-HEIGHT-P', - 'MARGIN-HEIGHT-PI', - 'MARGIN-HEIGHT-PIX', - 'MARGIN-HEIGHT-PIXE', - 'MARGIN-HEIGHT-PIXEL', - 'MARGIN-WIDTH-CHARS', - 'MARGIN-WIDTH', - 'MARGIN-WIDTH-', - 'MARGIN-WIDTH-C', - 'MARGIN-WIDTH-CH', - 'MARGIN-WIDTH-CHA', - 'MARGIN-WIDTH-CHAR', - 'MARGIN-WIDTH-PIXELS', - 'MARGIN-WIDTH-P', - 'MARGIN-WIDTH-PI', - 'MARGIN-WIDTH-PIX', - 'MARGIN-WIDTH-PIXE', - 'MARGIN-WIDTH-PIXEL', - 'MARK-NEW', - 'MARK-ROW-STATE', - 'MATCHES', - 'MAX-BUTTON', - 'MAX-CHARS', - 'MAX-DATA-GUESS', - 'MAX-HEIGHT', - 'MAX-HEIGHT-CHARS', - 'MAX-HEIGHT-C', - 'MAX-HEIGHT-CH', - 'MAX-HEIGHT-CHA', - 'MAX-HEIGHT-CHAR', - 'MAX-HEIGHT-PIXELS', - 'MAX-HEIGHT-P', - 'MAX-HEIGHT-PI', - 'MAX-HEIGHT-PIX', - 'MAX-HEIGHT-PIXE', - 'MAX-HEIGHT-PIXEL', - 'MAXIMIZE', - 'MAXIMUM', - 'MAX', - 'MAXI', - 'MAXIM', - 'MAXIMU', - 'MAXIMUM-LEVEL', - 'MAX-ROWS', - 'MAX-SIZE', - 'MAX-VALUE', - 'MAX-VAL', - 'MAX-VALU', - 'MAX-WIDTH-CHARS', - 'MAX-WIDTH', - 'MAX-WIDTH-', - 'MAX-WIDTH-C', - 'MAX-WIDTH-CH', - 'MAX-WIDTH-CHA', - 'MAX-WIDTH-CHAR', - 'MAX-WIDTH-PIXELS', - 'MAX-WIDTH-P', - 'MAX-WIDTH-PI', - 'MAX-WIDTH-PIX', - 'MAX-WIDTH-PIXE', - 'MAX-WIDTH-PIXEL', - 'MD5-DIGEST', - 'MEMBER', - 'MEMPTR-TO-NODE-VALUE', - 'MENU', - 'MENUBAR', - 'MENU-BAR', - 'MENU-ITEM', - 'MENU-KEY', - 'MENU-K', - 'MENU-KE', - 'MENU-MOUSE', - 'MENU-M', - 'MENU-MO', - 'MENU-MOU', - 'MENU-MOUS', - 'MERGE-BY-FIELD', - 'MESSAGE', - 'MESSAGE-AREA', - 'MESSAGE-AREA-FONT', - 'MESSAGE-LINES', - 'METHOD', - 'MIN-BUTTON', - 'MIN-COLUMN-WIDTH-CHARS', - 'MIN-COLUMN-WIDTH-C', - 'MIN-COLUMN-WIDTH-CH', - 'MIN-COLUMN-WIDTH-CHA', - 'MIN-COLUMN-WIDTH-CHAR', - 'MIN-COLUMN-WIDTH-PIXELS', - 'MIN-COLUMN-WIDTH-P', - 'MIN-COLUMN-WIDTH-PI', - 'MIN-COLUMN-WIDTH-PIX', - 'MIN-COLUMN-WIDTH-PIXE', - 'MIN-COLUMN-WIDTH-PIXEL', - 'MIN-HEIGHT-CHARS', - 'MIN-HEIGHT', - 'MIN-HEIGHT-', - 'MIN-HEIGHT-C', - 'MIN-HEIGHT-CH', - 'MIN-HEIGHT-CHA', - 'MIN-HEIGHT-CHAR', - 'MIN-HEIGHT-PIXELS', - 'MIN-HEIGHT-P', - 'MIN-HEIGHT-PI', - 'MIN-HEIGHT-PIX', - 'MIN-HEIGHT-PIXE', - 'MIN-HEIGHT-PIXEL', - 'MINIMUM', - 'MIN', - 'MINI', - 'MINIM', - 'MINIMU', - 'MIN-SIZE', - 'MIN-VALUE', - 'MIN-VAL', - 'MIN-VALU', - 'MIN-WIDTH-CHARS', - 'MIN-WIDTH', - 'MIN-WIDTH-', - 'MIN-WIDTH-C', - 'MIN-WIDTH-CH', - 'MIN-WIDTH-CHA', - 'MIN-WIDTH-CHAR', - 'MIN-WIDTH-PIXELS', - 'MIN-WIDTH-P', - 'MIN-WIDTH-PI', - 'MIN-WIDTH-PIX', - 'MIN-WIDTH-PIXE', - 'MIN-WIDTH-PIXEL', - 'MODIFIED', - 'MODULO', - 'MOD', - 'MODU', - 'MODUL', - 'MONTH', - 'MOUSE', - 'MOUSE-POINTER', - 'MOUSE-P', - 'MOUSE-PO', - 'MOUSE-POI', - 'MOUSE-POIN', - 'MOUSE-POINT', - 'MOUSE-POINTE', - 'MOVABLE', - 'MOVE-AFTER-TAB-ITEM', - 'MOVE-AFTER', - 'MOVE-AFTER-', - 'MOVE-AFTER-T', - 'MOVE-AFTER-TA', - 'MOVE-AFTER-TAB', - 'MOVE-AFTER-TAB-', - 'MOVE-AFTER-TAB-I', - 'MOVE-AFTER-TAB-IT', - 'MOVE-AFTER-TAB-ITE', - 'MOVE-BEFORE-TAB-ITEM', - 'MOVE-BEFOR', - 'MOVE-BEFORE', - 'MOVE-BEFORE-', - 'MOVE-BEFORE-T', - 'MOVE-BEFORE-TA', - 'MOVE-BEFORE-TAB', - 'MOVE-BEFORE-TAB-', - 'MOVE-BEFORE-TAB-I', - 'MOVE-BEFORE-TAB-IT', - 'MOVE-BEFORE-TAB-ITE', - 'MOVE-COLUMN', - 'MOVE-COL', - 'MOVE-COLU', - 'MOVE-COLUM', - 'MOVE-TO-BOTTOM', - 'MOVE-TO-B', - 'MOVE-TO-BO', - 'MOVE-TO-BOT', - 'MOVE-TO-BOTT', - 'MOVE-TO-BOTTO', - 'MOVE-TO-EOF', - 'MOVE-TO-TOP', - 'MOVE-TO-T', - 'MOVE-TO-TO', - 'MPE', - 'MULTI-COMPILE', - 'MULTIPLE', - 'MULTIPLE-KEY', - 'MULTITASKING-INTERVAL', - 'MUST-EXIST', - 'NAME', - 'NAMESPACE-PREFIX', - 'NAMESPACE-URI', - 'NATIVE', - 'NE', - 'NEEDS-APPSERVER-PROMPT', - 'NEEDS-PROMPT', - 'NEW', - 'NEW-INSTANCE', - 'NEW-ROW', - 'NEXT', - 'NEXT-COLUMN', - 'NEXT-PROMPT', - 'NEXT-ROWID', - 'NEXT-SIBLING', - 'NEXT-TAB-ITEM', - 'NEXT-TAB-I', - 'NEXT-TAB-IT', - 'NEXT-TAB-ITE', - 'NEXT-VALUE', - 'NO', - 'NO-APPLY', - 'NO-ARRAY-MESSAGE', - 'NO-ASSIGN', - 'NO-ATTR-LIST', - 'NO-ATTR', - 'NO-ATTR-', - 'NO-ATTR-L', - 'NO-ATTR-LI', - 'NO-ATTR-LIS', - 'NO-ATTR-SPACE', - 'NO-ATTR-S', - 'NO-ATTR-SP', - 'NO-ATTR-SPA', - 'NO-ATTR-SPAC', - 'NO-AUTO-VALIDATE', - 'NO-BIND-WHERE', - 'NO-BOX', - 'NO-CONSOLE', - 'NO-CONVERT', - 'NO-CONVERT-3D-COLORS', - 'NO-CURRENT-VALUE', - 'NO-DEBUG', - 'NODE-VALUE-TO-MEMPTR', - 'NO-DRAG', - 'NO-ECHO', - 'NO-EMPTY-SPACE', - 'NO-ERROR', - 'NO-FILL', - 'NO-F', - 'NO-FI', - 'NO-FIL', - 'NO-FOCUS', - 'NO-HELP', - 'NO-HIDE', - 'NO-INDEX-HINT', - 'NO-INHERIT-BGCOLOR', - 'NO-INHERIT-BGC', - 'NO-INHERIT-BGCO', - 'NO-INHERIT-FGCOLOR', - 'NO-INHERIT-FGC', - 'NO-INHERIT-FGCO', - 'NO-INHERIT-FGCOL', - 'NO-INHERIT-FGCOLO', - 'NO-JOIN-BY-SQLDB', - 'NO-LABELS', - 'NO-LABE', - 'NO-LOBS', - 'NO-LOCK', - 'NO-LOOKAHEAD', - 'NO-MAP', - 'NO-MESSAGE', - 'NO-MES', - 'NO-MESS', - 'NO-MESSA', - 'NO-MESSAG', - 'NONAMESPACE-SCHEMA-LOCATION', - 'NONE', - 'NO-PAUSE', - 'NO-PREFETCH', - 'NO-PREFE', - 'NO-PREFET', - 'NO-PREFETC', - 'NORMALIZE', - 'NO-ROW-MARKERS', - 'NO-SCROLLBAR-VERTICAL', - 'NO-SEPARATE-CONNECTION', - 'NO-SEPARATORS', - 'NOT', - 'NO-TAB-STOP', - 'NOT-ACTIVE', - 'NO-UNDERLINE', - 'NO-UND', - 'NO-UNDE', - 'NO-UNDER', - 'NO-UNDERL', - 'NO-UNDERLI', - 'NO-UNDERLIN', - 'NO-UNDO', - 'NO-VALIDATE', - 'NO-VAL', - 'NO-VALI', - 'NO-VALID', - 'NO-VALIDA', - 'NO-VALIDAT', - 'NOW', - 'NO-WAIT', - 'NO-WORD-WRAP', - 'NULL', - 'NUM-ALIASES', - 'NUM-ALI', - 'NUM-ALIA', - 'NUM-ALIAS', - 'NUM-ALIASE', - 'NUM-BUFFERS', - 'NUM-BUTTONS', - 'NUM-BUT', - 'NUM-BUTT', - 'NUM-BUTTO', - 'NUM-BUTTON', - 'NUM-COLUMNS', - 'NUM-COL', - 'NUM-COLU', - 'NUM-COLUM', - 'NUM-COLUMN', - 'NUM-COPIES', - 'NUM-DBS', - 'NUM-DROPPED-FILES', - 'NUM-ENTRIES', - 'NUMERIC', - 'NUMERIC-FORMAT', - 'NUMERIC-F', - 'NUMERIC-FO', - 'NUMERIC-FOR', - 'NUMERIC-FORM', - 'NUMERIC-FORMA', - 'NUM-FIELDS', - 'NUM-FORMATS', - 'NUM-ITEMS', - 'NUM-ITERATIONS', - 'NUM-LINES', - 'NUM-LOCKED-COLUMNS', - 'NUM-LOCKED-COL', - 'NUM-LOCKED-COLU', - 'NUM-LOCKED-COLUM', - 'NUM-LOCKED-COLUMN', - 'NUM-MESSAGES', - 'NUM-PARAMETERS', - 'NUM-REFERENCES', - 'NUM-REPLACED', - 'NUM-RESULTS', - 'NUM-SELECTED-ROWS', - 'NUM-SELECTED-WIDGETS', - 'NUM-SELECTED', - 'NUM-SELECTED-', - 'NUM-SELECTED-W', - 'NUM-SELECTED-WI', - 'NUM-SELECTED-WID', - 'NUM-SELECTED-WIDG', - 'NUM-SELECTED-WIDGE', - 'NUM-SELECTED-WIDGET', - 'NUM-TABS', - 'NUM-TO-RETAIN', - 'NUM-VISIBLE-COLUMNS', - 'OCTET-LENGTH', - 'OF', - 'OFF', - 'OK', - 'OK-CANCEL', - 'OLD', - 'ON', - 'ON-FRAME-BORDER', - 'ON-FRAME', - 'ON-FRAME-', - 'ON-FRAME-B', - 'ON-FRAME-BO', - 'ON-FRAME-BOR', - 'ON-FRAME-BORD', - 'ON-FRAME-BORDE', - 'OPEN', - 'OPSYS', - 'OPTION', - 'OR', - 'ORDERED-JOIN', - 'ORDINAL', - 'OS-APPEND', - 'OS-COMMAND', - 'OS-COPY', - 'OS-CREATE-DIR', - 'OS-DELETE', - 'OS-DIR', - 'OS-DRIVES', - 'OS-DRIVE', - 'OS-ERROR', - 'OS-GETENV', - 'OS-RENAME', - 'OTHERWISE', - 'OUTPUT', - 'OVERLAY', - 'OVERRIDE', - 'OWNER', - 'PAGE', - 'PAGE-BOTTOM', - 'PAGE-BOT', - 'PAGE-BOTT', - 'PAGE-BOTTO', - 'PAGED', - 'PAGE-NUMBER', - 'PAGE-NUM', - 'PAGE-NUMB', - 'PAGE-NUMBE', - 'PAGE-SIZE', - 'PAGE-TOP', - 'PAGE-WIDTH', - 'PAGE-WID', - 'PAGE-WIDT', - 'PARAMETER', - 'PARAM', - 'PARAME', - 'PARAMET', - 'PARAMETE', - 'PARENT', - 'PARSE-STATUS', - 'PARTIAL-KEY', - 'PASCAL', - 'PASSWORD-FIELD', - 'PATHNAME', - 'PAUSE', - 'PBE-HASH-ALGORITHM', - 'PBE-HASH-ALG', - 'PBE-HASH-ALGO', - 'PBE-HASH-ALGOR', - 'PBE-HASH-ALGORI', - 'PBE-HASH-ALGORIT', - 'PBE-HASH-ALGORITH', - 'PBE-KEY-ROUNDS', - 'PDBNAME', - 'PERSISTENT', - 'PERSIST', - 'PERSISTE', - 'PERSISTEN', - 'PERSISTENT-CACHE-DISABLED', - 'PFCOLOR', - 'PFC', - 'PFCO', - 'PFCOL', - 'PFCOLO', - 'PIXELS', - 'PIXELS-PER-COLUMN', - 'PIXELS-PER-COL', - 'PIXELS-PER-COLU', - 'PIXELS-PER-COLUM', - 'PIXELS-PER-ROW', - 'POPUP-MENU', - 'POPUP-M', - 'POPUP-ME', - 'POPUP-MEN', - 'POPUP-ONLY', - 'POPUP-O', - 'POPUP-ON', - 'POPUP-ONL', - 'PORTRAIT', - 'POSITION', - 'PRECISION', - 'PREFER-DATASET', - 'PREPARED', - 'PREPARE-STRING', - 'PREPROCESS', - 'PREPROC', - 'PREPROCE', - 'PREPROCES', - 'PRESELECT', - 'PRESEL', - 'PRESELE', - 'PRESELEC', - 'PREV', - 'PREV-COLUMN', - 'PREV-SIBLING', - 'PREV-TAB-ITEM', - 'PREV-TAB-I', - 'PREV-TAB-IT', - 'PREV-TAB-ITE', - 'PRIMARY', - 'PRINTER', - 'PRINTER-CONTROL-HANDLE', - 'PRINTER-HDC', - 'PRINTER-NAME', - 'PRINTER-PORT', - 'PRINTER-SETUP', - 'PRIVATE', - 'PRIVATE-DATA', - 'PRIVATE-D', - 'PRIVATE-DA', - 'PRIVATE-DAT', - 'PRIVILEGES', - 'PROCEDURE', - 'PROCE', - 'PROCED', - 'PROCEDU', - 'PROCEDUR', - 'PROCEDURE-CALL-TYPE', - 'PROCESS', - 'PROC-HANDLE', - 'PROC-HA', - 'PROC-HAN', - 'PROC-HAND', - 'PROC-HANDL', - 'PROC-STATUS', - 'PROC-ST', - 'PROC-STA', - 'PROC-STAT', - 'PROC-STATU', - 'proc-text', - 'proc-text-buffe', - 'PROFILER', - 'PROGRAM-NAME', - 'PROGRESS', - 'PROGRESS-SOURCE', - 'PROGRESS-S', - 'PROGRESS-SO', - 'PROGRESS-SOU', - 'PROGRESS-SOUR', - 'PROGRESS-SOURC', - 'PROMPT', - 'PROMPT-FOR', - 'PROMPT-F', - 'PROMPT-FO', - 'PROMSGS', - 'PROPATH', - 'PROPERTY', - 'PROTECTED', - 'PROVERSION', - 'PROVERS', - 'PROVERSI', - 'PROVERSIO', - 'PROXY', - 'PROXY-PASSWORD', - 'PROXY-USERID', - 'PUBLIC', - 'PUBLIC-ID', - 'PUBLISH', - 'PUBLISHED-EVENTS', - 'PUT', - 'PUTBYTE', - 'PUT-BYTE', - 'PUT-DOUBLE', - 'PUT-FLOAT', - 'PUT-INT64', - 'PUT-KEY-VALUE', - 'PUT-KEY-VAL', - 'PUT-KEY-VALU', - 'PUT-LONG', - 'PUT-SHORT', - 'PUT-STRING', - 'PUT-UNSIGNED-LONG', - 'QUERY', - 'QUERY-CLOSE', - 'QUERY-OFF-END', - 'QUERY-OPEN', - 'QUERY-PREPARE', - 'QUERY-TUNING', - 'QUESTION', - 'QUIT', - 'QUOTER', - 'RADIO-BUTTONS', - 'RADIO-SET', - 'RANDOM', - 'RAW-TRANSFER', - 'RCODE-INFORMATION', - 'RCODE-INFO', - 'RCODE-INFOR', - 'RCODE-INFORM', - 'RCODE-INFORMA', - 'RCODE-INFORMAT', - 'RCODE-INFORMATI', - 'RCODE-INFORMATIO', - 'READ-AVAILABLE', - 'READ-EXACT-NUM', - 'READ-FILE', - 'READKEY', - 'READ-ONLY', - 'READ-XML', - 'READ-XMLSCHEMA', - 'REAL', - 'RECORD-LENGTH', - 'RECTANGLE', - 'RECT', - 'RECTA', - 'RECTAN', - 'RECTANG', - 'RECTANGL', - 'RECURSIVE', - 'REFERENCE-ONLY', - 'REFRESH', - 'REFRESHABLE', - 'REFRESH-AUDIT-POLICY', - 'REGISTER-DOMAIN', - 'RELEASE', - 'REMOTE', - 'REMOVE-EVENTS-PROCEDURE', - 'REMOVE-SUPER-PROCEDURE', - 'REPEAT', - 'REPLACE', - 'REPLACE-SELECTION-TEXT', - 'REPOSITION', - 'REPOSITION-BACKWARD', - 'REPOSITION-FORWARD', - 'REPOSITION-MODE', - 'REPOSITION-TO-ROW', - 'REPOSITION-TO-ROWID', - 'REQUEST', - 'RESET', - 'RESIZABLE', - 'RESIZA', - 'RESIZAB', - 'RESIZABL', - 'RESIZE', - 'RESTART-ROW', - 'RESTART-ROWID', - 'RETAIN', - 'RETAIN-SHAPE', - 'RETRY', - 'RETRY-CANCEL', - 'RETURN', - 'RETURN-INSERTED', - 'RETURN-INS', - 'RETURN-INSE', - 'RETURN-INSER', - 'RETURN-INSERT', - 'RETURN-INSERTE', - 'RETURNS', - 'RETURN-TO-START-DIR', - 'RETURN-TO-START-DI', - 'RETURN-VALUE', - 'RETURN-VAL', - 'RETURN-VALU', - 'RETURN-VALUE-DATA-TYPE', - 'REVERSE-FROM', - 'REVERT', - 'REVOKE', - 'RGB-VALUE', - 'RIGHT-ALIGNED', - 'RETURN-ALIGN', - 'RETURN-ALIGNE', - 'RIGHT-TRIM', - 'R-INDEX', - 'ROLES', - 'ROUND', - 'ROUTINE-LEVEL', - 'ROW', - 'ROW-HEIGHT-CHARS', - 'ROW-HEIGHT-PIXELS', - 'ROW-MARKERS', - 'ROW-OF', - 'ROW-RESIZABLE', - 'RULE', - 'RUN', - 'RUN-PROCEDURE', - 'SAVE', - 'SAVE-AS', - 'SAVE-FILE', - 'SAX-COMPLETE', - 'SAX-COMPLE', - 'SAX-COMPLET', - 'SAX-PARSE', - 'SAX-PARSE-FIRST', - 'SAX-PARSE-NEXT', - 'SAX-PARSER-ERROR', - 'SAX-RUNNING', - 'SAX-UNINITIALIZED', - 'SAX-WRITE-BEGIN', - 'SAX-WRITE-COMPLETE', - 'SAX-WRITE-CONTENT', - 'SAX-WRITE-ELEMENT', - 'SAX-WRITE-ERROR', - 'SAX-WRITE-IDLE', - 'SAX-WRITER', - 'SAX-WRITE-TAG', - 'SCHEMA', - 'SCHEMA-LOCATION', - 'SCHEMA-MARSHAL', - 'SCHEMA-PATH', - 'SCREEN', - 'SCREEN-IO', - 'SCREEN-LINES', - 'SCREEN-VALUE', - 'SCREEN-VAL', - 'SCREEN-VALU', - 'SCROLL', - 'SCROLLABLE', - 'SCROLLBAR-HORIZONTAL', - 'SCROLLBAR-H', - 'SCROLLBAR-HO', - 'SCROLLBAR-HOR', - 'SCROLLBAR-HORI', - 'SCROLLBAR-HORIZ', - 'SCROLLBAR-HORIZO', - 'SCROLLBAR-HORIZON', - 'SCROLLBAR-HORIZONT', - 'SCROLLBAR-HORIZONTA', - 'SCROLL-BARS', - 'SCROLLBAR-VERTICAL', - 'SCROLLBAR-V', - 'SCROLLBAR-VE', - 'SCROLLBAR-VER', - 'SCROLLBAR-VERT', - 'SCROLLBAR-VERTI', - 'SCROLLBAR-VERTIC', - 'SCROLLBAR-VERTICA', - 'SCROLL-DELTA', - 'SCROLLED-ROW-POSITION', - 'SCROLLED-ROW-POS', - 'SCROLLED-ROW-POSI', - 'SCROLLED-ROW-POSIT', - 'SCROLLED-ROW-POSITI', - 'SCROLLED-ROW-POSITIO', - 'SCROLLING', - 'SCROLL-OFFSET', - 'SCROLL-TO-CURRENT-ROW', - 'SCROLL-TO-ITEM', - 'SCROLL-TO-I', - 'SCROLL-TO-IT', - 'SCROLL-TO-ITE', - 'SCROLL-TO-SELECTED-ROW', - 'SDBNAME', - 'SEAL', - 'SEAL-TIMESTAMP', - 'SEARCH', - 'SEARCH-SELF', - 'SEARCH-TARGET', - 'SECTION', - 'SECURITY-POLICY', - 'SEEK', - 'SELECT', - 'SELECTABLE', - 'SELECT-ALL', - 'SELECTED', - 'SELECT-FOCUSED-ROW', - 'SELECTION', - 'SELECTION-END', - 'SELECTION-LIST', - 'SELECTION-START', - 'SELECTION-TEXT', - 'SELECT-NEXT-ROW', - 'SELECT-PREV-ROW', - 'SELECT-ROW', - 'SELF', - 'SEND', - 'send-sql-statement', - 'send-sql', - 'SENSITIVE', - 'SEPARATE-CONNECTION', - 'SEPARATOR-FGCOLOR', - 'SEPARATORS', - 'SERVER', - 'SERVER-CONNECTION-BOUND', - 'SERVER-CONNECTION-BOUND-REQUEST', - 'SERVER-CONNECTION-CONTEXT', - 'SERVER-CONNECTION-ID', - 'SERVER-OPERATING-MODE', - 'SESSION', - 'SESSION-ID', - 'SET', - 'SET-APPL-CONTEXT', - 'SET-ATTR-CALL-TYPE', - 'SET-ATTRIBUTE-NODE', - 'SET-BLUE-VALUE', - 'SET-BLUE', - 'SET-BLUE-', - 'SET-BLUE-V', - 'SET-BLUE-VA', - 'SET-BLUE-VAL', - 'SET-BLUE-VALU', - 'SET-BREAK', - 'SET-BUFFERS', - 'SET-CALLBACK', - 'SET-CLIENT', - 'SET-COMMIT', - 'SET-CONTENTS', - 'SET-CURRENT-VALUE', - 'SET-DB-CLIENT', - 'SET-DYNAMIC', - 'SET-EVENT-MANAGER-OPTION', - 'SET-GREEN-VALUE', - 'SET-GREEN', - 'SET-GREEN-', - 'SET-GREEN-V', - 'SET-GREEN-VA', - 'SET-GREEN-VAL', - 'SET-GREEN-VALU', - 'SET-INPUT-SOURCE', - 'SET-OPTION', - 'SET-OUTPUT-DESTINATION', - 'SET-PARAMETER', - 'SET-POINTER-VALUE', - 'SET-PROPERTY', - 'SET-RED-VALUE', - 'SET-RED', - 'SET-RED-', - 'SET-RED-V', - 'SET-RED-VA', - 'SET-RED-VAL', - 'SET-RED-VALU', - 'SET-REPOSITIONED-ROW', - 'SET-RGB-VALUE', - 'SET-ROLLBACK', - 'SET-SELECTION', - 'SET-SIZE', - 'SET-SORT-ARROW', - 'SETUSERID', - 'SETUSER', - 'SETUSERI', - 'SET-WAIT-STATE', - 'SHA1-DIGEST', - 'SHARED', - 'SHARE-LOCK', - 'SHARE', - 'SHARE-', - 'SHARE-L', - 'SHARE-LO', - 'SHARE-LOC', - 'SHOW-IN-TASKBAR', - 'SHOW-STATS', - 'SHOW-STAT', - 'SIDE-LABEL-HANDLE', - 'SIDE-LABEL-H', - 'SIDE-LABEL-HA', - 'SIDE-LABEL-HAN', - 'SIDE-LABEL-HAND', - 'SIDE-LABEL-HANDL', - 'SIDE-LABELS', - 'SIDE-LAB', - 'SIDE-LABE', - 'SIDE-LABEL', - 'SILENT', - 'SIMPLE', - 'SINGLE', - 'SIZE', - 'SIZE-CHARS', - 'SIZE-C', - 'SIZE-CH', - 'SIZE-CHA', - 'SIZE-CHAR', - 'SIZE-PIXELS', - 'SIZE-P', - 'SIZE-PI', - 'SIZE-PIX', - 'SIZE-PIXE', - 'SIZE-PIXEL', - 'SKIP', - 'SKIP-DELETED-RECORD', - 'SLIDER', - 'SMALL-ICON', - 'SMALLINT', - 'SMALL-TITLE', - 'SOME', - 'SORT', - 'SORT-ASCENDING', - 'SORT-NUMBER', - 'SOURCE', - 'SOURCE-PROCEDURE', - 'SPACE', - 'SQL', - 'SQRT', - 'SSL-SERVER-NAME', - 'STANDALONE', - 'START', - 'START-DOCUMENT', - 'START-ELEMENT', - 'START-MOVE', - 'START-RESIZE', - 'START-ROW-RESIZE', - 'STATE-DETAIL', - 'STATIC', - 'STATUS', - 'STATUS-AREA', - 'STATUS-AREA-FONT', - 'STDCALL', - 'STOP', - 'STOP-PARSING', - 'STOPPED', - 'STOPPE', - 'STORED-PROCEDURE', - 'STORED-PROC', - 'STORED-PROCE', - 'STORED-PROCED', - 'STORED-PROCEDU', - 'STORED-PROCEDUR', - 'STREAM', - 'STREAM-HANDLE', - 'STREAM-IO', - 'STRETCH-TO-FIT', - 'STRICT', - 'STRING', - 'STRING-VALUE', - 'STRING-XREF', - 'SUB-AVERAGE', - 'SUB-AVE', - 'SUB-AVER', - 'SUB-AVERA', - 'SUB-AVERAG', - 'SUB-COUNT', - 'SUB-MAXIMUM', - 'SUM-MAX', - 'SUM-MAXI', - 'SUM-MAXIM', - 'SUM-MAXIMU', - 'SUB-MENU', - 'SUBSUB-', - 'SUB-MIN', - 'SUBSCRIBE', - 'SUBSTITUTE', - 'SUBST', - 'SUBSTI', - 'SUBSTIT', - 'SUBSTITU', - 'SUBSTITUT', - 'SUBSTRING', - 'SUBSTR', - 'SUBSTRI', - 'SUBSTRIN', - 'SUB-TOTAL', - 'SUBTYPE', - 'SUM', - 'SUPER', - 'SUPER-PROCEDURES', - 'SUPPRESS-NAMESPACE-PROCESSING', - 'SUPPRESS-WARNINGS', - 'SUPPRESS-W', - 'SUPPRESS-WA', - 'SUPPRESS-WAR', - 'SUPPRESS-WARN', - 'SUPPRESS-WARNI', - 'SUPPRESS-WARNIN', - 'SUPPRESS-WARNING', - 'SYMMETRIC-ENCRYPTION-ALGORITHM', - 'SYMMETRIC-ENCRYPTION-IV', - 'SYMMETRIC-ENCRYPTION-KEY', - 'SYMMETRIC-SUPPORT', - 'SYSTEM-ALERT-BOXES', - 'SYSTEM-ALERT', - 'SYSTEM-ALERT-', - 'SYSTEM-ALERT-B', - 'SYSTEM-ALERT-BO', - 'SYSTEM-ALERT-BOX', - 'SYSTEM-ALERT-BOXE', - 'SYSTEM-DIALOG', - 'SYSTEM-HELP', - 'SYSTEM-ID', - 'TABLE', - 'TABLE-HANDLE', - 'TABLE-NUMBER', - 'TAB-POSITION', - 'TAB-STOP', - 'TARGET', - 'TARGET-PROCEDURE', - 'TEMP-DIRECTORY', - 'TEMP-DIR', - 'TEMP-DIRE', - 'TEMP-DIREC', - 'TEMP-DIRECT', - 'TEMP-DIRECTO', - 'TEMP-DIRECTOR', - 'TEMP-TABLE', - 'TEMP-TABLE-PREPARE', - 'TERM', - 'TERMINAL', - 'TERMI', - 'TERMIN', - 'TERMINA', - 'TERMINATE', - 'TEXT', - 'TEXT-CURSOR', - 'TEXT-SEG-GROW', - 'TEXT-SELECTED', - 'THEN', - 'THIS-OBJECT', - 'THIS-PROCEDURE', - 'THREE-D', - 'THROW', - 'THROUGH', - 'THRU', - 'TIC-MARKS', - 'TIME', - 'TIME-SOURCE', - 'TITLE', - 'TITLE-BGCOLOR', - 'TITLE-BGC', - 'TITLE-BGCO', - 'TITLE-BGCOL', - 'TITLE-BGCOLO', - 'TITLE-DCOLOR', - 'TITLE-DC', - 'TITLE-DCO', - 'TITLE-DCOL', - 'TITLE-DCOLO', - 'TITLE-FGCOLOR', - 'TITLE-FGC', - 'TITLE-FGCO', - 'TITLE-FGCOL', - 'TITLE-FGCOLO', - 'TITLE-FONT', - 'TITLE-FO', - 'TITLE-FON', - 'TO', - 'TODAY', - 'TOGGLE-BOX', - 'TOOLTIP', - 'TOOLTIPS', - 'TOPIC', - 'TOP-NAV-QUERY', - 'TOP-ONLY', - 'TO-ROWID', - 'TOTAL', - 'TRAILING', - 'TRANS', - 'TRANSACTION', - 'TRANSACTION-MODE', - 'TRANS-INIT-PROCEDURE', - 'TRANSPARENT', - 'TRIGGER', - 'TRIGGERS', - 'TRIM', - 'TRUE', - 'TRUNCATE', - 'TRUNC', - 'TRUNCA', - 'TRUNCAT', - 'TYPE', - 'TYPE-OF', - 'UNBOX', - 'UNBUFFERED', - 'UNBUFF', - 'UNBUFFE', - 'UNBUFFER', - 'UNBUFFERE', - 'UNDERLINE', - 'UNDERL', - 'UNDERLI', - 'UNDERLIN', - 'UNDO', - 'UNFORMATTED', - 'UNFORM', - 'UNFORMA', - 'UNFORMAT', - 'UNFORMATT', - 'UNFORMATTE', - 'UNION', - 'UNIQUE', - 'UNIQUE-ID', - 'UNIQUE-MATCH', - 'UNIX', - 'UNLESS-HIDDEN', - 'UNLOAD', - 'UNSIGNED-LONG', - 'UNSUBSCRIBE', - 'UP', - 'UPDATE', - 'UPDATE-ATTRIBUTE', - 'URL', - 'URL-DECODE', - 'URL-ENCODE', - 'URL-PASSWORD', - 'URL-USERID', - 'USE', - 'USE-DICT-EXPS', - 'USE-FILENAME', - 'USE-INDEX', - 'USER', - 'USE-REVVIDEO', - 'USERID', - 'USER-ID', - 'USE-TEXT', - 'USE-UNDERLINE', - 'USE-WIDGET-POOL', - 'USING', - 'V6DISPLAY', - 'V6FRAME', - 'VALIDATE', - 'VALIDATE-EXPRESSION', - 'VALIDATE-MESSAGE', - 'VALIDATE-SEAL', - 'VALIDATION-ENABLED', - 'VALID-EVENT', - 'VALID-HANDLE', - 'VALID-OBJECT', - 'VALUE', - 'VALUE-CHANGED', - 'VALUES', - 'VARIABLE', - 'VAR', - 'VARI', - 'VARIA', - 'VARIAB', - 'VARIABL', - 'VERBOSE', - 'VERSION', - 'VERTICAL', - 'VERT', - 'VERTI', - 'VERTIC', - 'VERTICA', - 'VIEW', - 'VIEW-AS', - 'VIEW-FIRST-COLUMN-ON-REOPEN', - 'VIRTUAL-HEIGHT-CHARS', - 'VIRTUAL-HEIGHT', - 'VIRTUAL-HEIGHT-', - 'VIRTUAL-HEIGHT-C', - 'VIRTUAL-HEIGHT-CH', - 'VIRTUAL-HEIGHT-CHA', - 'VIRTUAL-HEIGHT-CHAR', - 'VIRTUAL-HEIGHT-PIXELS', - 'VIRTUAL-HEIGHT-P', - 'VIRTUAL-HEIGHT-PI', - 'VIRTUAL-HEIGHT-PIX', - 'VIRTUAL-HEIGHT-PIXE', - 'VIRTUAL-HEIGHT-PIXEL', - 'VIRTUAL-WIDTH-CHARS', - 'VIRTUAL-WIDTH', - 'VIRTUAL-WIDTH-', - 'VIRTUAL-WIDTH-C', - 'VIRTUAL-WIDTH-CH', - 'VIRTUAL-WIDTH-CHA', - 'VIRTUAL-WIDTH-CHAR', - 'VIRTUAL-WIDTH-PIXELS', - 'VIRTUAL-WIDTH-P', - 'VIRTUAL-WIDTH-PI', - 'VIRTUAL-WIDTH-PIX', - 'VIRTUAL-WIDTH-PIXE', - 'VIRTUAL-WIDTH-PIXEL', - 'VISIBLE', - 'VOID', - 'WAIT', - 'WAIT-FOR', - 'WARNING', - 'WEB-CONTEXT', - 'WEEKDAY', - 'WHEN', - 'WHERE', - 'WHILE', - 'WIDGET', - 'WIDGET-ENTER', - 'WIDGET-E', - 'WIDGET-EN', - 'WIDGET-ENT', - 'WIDGET-ENTE', - 'WIDGET-ID', - 'WIDGET-LEAVE', - 'WIDGET-L', - 'WIDGET-LE', - 'WIDGET-LEA', - 'WIDGET-LEAV', - 'WIDGET-POOL', - 'WIDTH-CHARS', - 'WIDTH', - 'WIDTH-', - 'WIDTH-C', - 'WIDTH-CH', - 'WIDTH-CHA', - 'WIDTH-CHAR', - 'WIDTH-PIXELS', - 'WIDTH-P', - 'WIDTH-PI', - 'WIDTH-PIX', - 'WIDTH-PIXE', - 'WIDTH-PIXEL', - 'WINDOW', - 'WINDOW-MAXIMIZED', - 'WINDOW-MAXIM', - 'WINDOW-MAXIMI', - 'WINDOW-MAXIMIZ', - 'WINDOW-MAXIMIZE', - 'WINDOW-MINIMIZED', - 'WINDOW-MINIM', - 'WINDOW-MINIMI', - 'WINDOW-MINIMIZ', - 'WINDOW-MINIMIZE', - 'WINDOW-NAME', - 'WINDOW-NORMAL', - 'WINDOW-STATE', - 'WINDOW-STA', - 'WINDOW-STAT', - 'WINDOW-SYSTEM', - 'WITH', - 'WORD-INDEX', - 'WORD-WRAP', - 'WORK-AREA-HEIGHT-PIXELS', - 'WORK-AREA-WIDTH-PIXELS', - 'WORK-AREA-X', - 'WORK-AREA-Y', - 'WORKFILE', - 'WORK-TABLE', - 'WORK-TAB', - 'WORK-TABL', - 'WRITE', - 'WRITE-CDATA', - 'WRITE-CHARACTERS', - 'WRITE-COMMENT', - 'WRITE-DATA-ELEMENT', - 'WRITE-EMPTY-ELEMENT', - 'WRITE-ENTITY-REF', - 'WRITE-EXTERNAL-DTD', - 'WRITE-FRAGMENT', - 'WRITE-MESSAGE', - 'WRITE-PROCESSING-INSTRUCTION', - 'WRITE-STATUS', - 'WRITE-XML', - 'WRITE-XMLSCHEMA', - 'X', - 'XCODE', - 'XML-DATA-TYPE', - 'XML-NODE-TYPE', - 'XML-SCHEMA-PATH', - 'XML-SUPPRESS-NAMESPACE-PROCESSING', - 'X-OF', - 'XREF', - 'XREF-XML', - 'Y', - 'YEAR', - 'YEAR-OFFSET', - 'YES', - 'YES-NO', - 'YES-NO-CANCEL', - 'Y-OF' -) diff --git a/wakatime/packages/py2/pygments/lexers/_sourcemod_builtins.py b/wakatime/packages/py2/pygments/lexers/_sourcemod_builtins.py deleted file mode 100644 index 40ef529..0000000 --- a/wakatime/packages/py2/pygments/lexers/_sourcemod_builtins.py +++ /dev/null @@ -1,1161 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers._sourcemod_builtins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This file contains the names of SourceMod functions. - It is able to re-generate itself. - - Do not edit the FUNCTIONS list by hand. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from __future__ import print_function - -FUNCTIONS = ( - 'OnEntityCreated', - 'OnEntityDestroyed', - 'OnGetGameDescription', - 'OnLevelInit', - 'SDKHook', - 'SDKHookEx', - 'SDKUnhook', - 'SDKHooks_TakeDamage', - 'SDKHooks_DropWeapon', - 'TopMenuHandler', - 'CreateTopMenu', - 'LoadTopMenuConfig', - 'AddToTopMenu', - 'GetTopMenuInfoString', - 'GetTopMenuObjName', - 'RemoveFromTopMenu', - 'DisplayTopMenu', - 'DisplayTopMenuCategory', - 'FindTopMenuCategory', - 'SetTopMenuTitleCaching', - 'OnAdminMenuCreated', - 'OnAdminMenuReady', - 'GetAdminTopMenu', - 'AddTargetsToMenu', - 'AddTargetsToMenu2', - 'RedisplayAdminMenu', - 'TEHook', - 'AddTempEntHook', - 'RemoveTempEntHook', - 'TE_Start', - 'TE_IsValidProp', - 'TE_WriteNum', - 'TE_ReadNum', - 'TE_WriteFloat', - 'TE_ReadFloat', - 'TE_WriteVector', - 'TE_ReadVector', - 'TE_WriteAngles', - 'TE_WriteFloatArray', - 'TE_Send', - 'TE_WriteEncodedEnt', - 'TE_SendToAll', - 'TE_SendToClient', - 'CreateKeyValues', - 'KvSetString', - 'KvSetNum', - 'KvSetUInt64', - 'KvSetFloat', - 'KvSetColor', - 'KvSetVector', - 'KvGetString', - 'KvGetNum', - 'KvGetFloat', - 'KvGetColor', - 'KvGetUInt64', - 'KvGetVector', - 'KvJumpToKey', - 'KvJumpToKeySymbol', - 'KvGotoFirstSubKey', - 'KvGotoNextKey', - 'KvSavePosition', - 'KvDeleteKey', - 'KvDeleteThis', - 'KvGoBack', - 'KvRewind', - 'KvGetSectionName', - 'KvSetSectionName', - 'KvGetDataType', - 'KeyValuesToFile', - 'FileToKeyValues', - 'StringToKeyValues', - 'KvSetEscapeSequences', - 'KvNodesInStack', - 'KvCopySubkeys', - 'KvFindKeyById', - 'KvGetNameSymbol', - 'KvGetSectionSymbol', - 'TE_SetupSparks', - 'TE_SetupSmoke', - 'TE_SetupDust', - 'TE_SetupMuzzleFlash', - 'TE_SetupMetalSparks', - 'TE_SetupEnergySplash', - 'TE_SetupArmorRicochet', - 'TE_SetupGlowSprite', - 'TE_SetupExplosion', - 'TE_SetupBloodSprite', - 'TE_SetupBeamRingPoint', - 'TE_SetupBeamPoints', - 'TE_SetupBeamLaser', - 'TE_SetupBeamRing', - 'TE_SetupBeamFollow', - 'HookEvent', - 'HookEventEx', - 'UnhookEvent', - 'CreateEvent', - 'FireEvent', - 'CancelCreatedEvent', - 'GetEventBool', - 'SetEventBool', - 'GetEventInt', - 'SetEventInt', - 'GetEventFloat', - 'SetEventFloat', - 'GetEventString', - 'SetEventString', - 'GetEventName', - 'SetEventBroadcast', - 'GetUserMessageType', - 'GetUserMessageId', - 'GetUserMessageName', - 'StartMessage', - 'StartMessageEx', - 'EndMessage', - 'MsgHook', - 'MsgPostHook', - 'HookUserMessage', - 'UnhookUserMessage', - 'StartMessageAll', - 'StartMessageOne', - 'InactivateClient', - 'ReconnectClient', - 'GetMaxEntities', - 'GetEntityCount', - 'IsValidEntity', - 'IsValidEdict', - 'IsEntNetworkable', - 'CreateEdict', - 'RemoveEdict', - 'GetEdictFlags', - 'SetEdictFlags', - 'GetEdictClassname', - 'GetEntityNetClass', - 'ChangeEdictState', - 'GetEntData', - 'SetEntData', - 'GetEntDataFloat', - 'SetEntDataFloat', - 'GetEntDataEnt2', - 'SetEntDataEnt2', - 'GetEntDataVector', - 'SetEntDataVector', - 'GetEntDataString', - 'SetEntDataString', - 'FindSendPropOffs', - 'FindSendPropInfo', - 'FindDataMapOffs', - 'FindDataMapInfo', - 'GetEntSendPropOffs', - 'GetEntProp', - 'SetEntProp', - 'GetEntPropFloat', - 'SetEntPropFloat', - 'GetEntPropEnt', - 'SetEntPropEnt', - 'GetEntPropVector', - 'SetEntPropVector', - 'GetEntPropString', - 'SetEntPropString', - 'GetEntPropArraySize', - 'GetEntDataArray', - 'SetEntDataArray', - 'GetEntityAddress', - 'GetEntityClassname', - 'float', - 'FloatMul', - 'FloatDiv', - 'FloatAdd', - 'FloatSub', - 'FloatFraction', - 'RoundToZero', - 'RoundToCeil', - 'RoundToFloor', - 'RoundToNearest', - 'FloatCompare', - 'SquareRoot', - 'Pow', - 'Exponential', - 'Logarithm', - 'Sine', - 'Cosine', - 'Tangent', - 'FloatAbs', - 'ArcTangent', - 'ArcCosine', - 'ArcSine', - 'ArcTangent2', - 'RoundFloat', - 'operator%', - 'DegToRad', - 'RadToDeg', - 'GetURandomInt', - 'GetURandomFloat', - 'SetURandomSeed', - 'SetURandomSeedSimple', - 'RemovePlayerItem', - 'GivePlayerItem', - 'GetPlayerWeaponSlot', - 'IgniteEntity', - 'ExtinguishEntity', - 'TeleportEntity', - 'ForcePlayerSuicide', - 'SlapPlayer', - 'FindEntityByClassname', - 'GetClientEyeAngles', - 'CreateEntityByName', - 'DispatchSpawn', - 'DispatchKeyValue', - 'DispatchKeyValueFloat', - 'DispatchKeyValueVector', - 'GetClientAimTarget', - 'GetTeamCount', - 'GetTeamName', - 'GetTeamScore', - 'SetTeamScore', - 'GetTeamClientCount', - 'SetEntityModel', - 'GetPlayerDecalFile', - 'GetPlayerJingleFile', - 'GetServerNetStats', - 'EquipPlayerWeapon', - 'ActivateEntity', - 'SetClientInfo', - 'GivePlayerAmmo', - 'SetClientListeningFlags', - 'GetClientListeningFlags', - 'SetListenOverride', - 'GetListenOverride', - 'IsClientMuted', - 'TR_GetPointContents', - 'TR_GetPointContentsEnt', - 'TR_TraceRay', - 'TR_TraceHull', - 'TR_TraceRayFilter', - 'TR_TraceHullFilter', - 'TR_TraceRayEx', - 'TR_TraceHullEx', - 'TR_TraceRayFilterEx', - 'TR_TraceHullFilterEx', - 'TR_GetFraction', - 'TR_GetEndPosition', - 'TR_GetEntityIndex', - 'TR_DidHit', - 'TR_GetHitGroup', - 'TR_GetPlaneNormal', - 'TR_PointOutsideWorld', - 'SortIntegers', - 'SortFloats', - 'SortStrings', - 'SortFunc1D', - 'SortCustom1D', - 'SortCustom2D', - 'SortADTArray', - 'SortFuncADTArray', - 'SortADTArrayCustom', - 'CompileRegex', - 'MatchRegex', - 'GetRegexSubString', - 'SimpleRegexMatch', - 'TF2_GetPlayerClass', - 'TF2_SetPlayerClass', - 'TF2_RemoveWeaponSlot', - 'TF2_RemoveAllWeapons', - 'TF2_IsPlayerInCondition', - 'TF2_GetObjectType', - 'TF2_GetObjectMode', - 'NominateMap', - 'RemoveNominationByMap', - 'RemoveNominationByOwner', - 'GetExcludeMapList', - 'GetNominatedMapList', - 'CanMapChooserStartVote', - 'InitiateMapChooserVote', - 'HasEndOfMapVoteFinished', - 'EndOfMapVoteEnabled', - 'OnNominationRemoved', - 'OnMapVoteStarted', - 'CreateTimer', - 'KillTimer', - 'TriggerTimer', - 'GetTickedTime', - 'GetMapTimeLeft', - 'GetMapTimeLimit', - 'ExtendMapTimeLimit', - 'GetTickInterval', - 'OnMapTimeLeftChanged', - 'IsServerProcessing', - 'CreateDataTimer', - 'ByteCountToCells', - 'CreateArray', - 'ClearArray', - 'CloneArray', - 'ResizeArray', - 'GetArraySize', - 'PushArrayCell', - 'PushArrayString', - 'PushArrayArray', - 'GetArrayCell', - 'GetArrayString', - 'GetArrayArray', - 'SetArrayCell', - 'SetArrayString', - 'SetArrayArray', - 'ShiftArrayUp', - 'RemoveFromArray', - 'SwapArrayItems', - 'FindStringInArray', - 'FindValueInArray', - 'ProcessTargetString', - 'ReplyToTargetError', - 'MultiTargetFilter', - 'AddMultiTargetFilter', - 'RemoveMultiTargetFilter', - 'OnBanClient', - 'OnBanIdentity', - 'OnRemoveBan', - 'BanClient', - 'BanIdentity', - 'RemoveBan', - 'CreateTrie', - 'SetTrieValue', - 'SetTrieArray', - 'SetTrieString', - 'GetTrieValue', - 'GetTrieArray', - 'GetTrieString', - 'RemoveFromTrie', - 'ClearTrie', - 'GetTrieSize', - 'GetFunctionByName', - 'CreateGlobalForward', - 'CreateForward', - 'GetForwardFunctionCount', - 'AddToForward', - 'RemoveFromForward', - 'RemoveAllFromForward', - 'Call_StartForward', - 'Call_StartFunction', - 'Call_PushCell', - 'Call_PushCellRef', - 'Call_PushFloat', - 'Call_PushFloatRef', - 'Call_PushArray', - 'Call_PushArrayEx', - 'Call_PushString', - 'Call_PushStringEx', - 'Call_Finish', - 'Call_Cancel', - 'NativeCall', - 'CreateNative', - 'ThrowNativeError', - 'GetNativeStringLength', - 'GetNativeString', - 'SetNativeString', - 'GetNativeCell', - 'GetNativeCellRef', - 'SetNativeCellRef', - 'GetNativeArray', - 'SetNativeArray', - 'FormatNativeString', - 'RequestFrameCallback', - 'RequestFrame', - 'OnRebuildAdminCache', - 'DumpAdminCache', - 'AddCommandOverride', - 'GetCommandOverride', - 'UnsetCommandOverride', - 'CreateAdmGroup', - 'FindAdmGroup', - 'SetAdmGroupAddFlag', - 'GetAdmGroupAddFlag', - 'GetAdmGroupAddFlags', - 'SetAdmGroupImmuneFrom', - 'GetAdmGroupImmuneCount', - 'GetAdmGroupImmuneFrom', - 'AddAdmGroupCmdOverride', - 'GetAdmGroupCmdOverride', - 'RegisterAuthIdentType', - 'CreateAdmin', - 'GetAdminUsername', - 'BindAdminIdentity', - 'SetAdminFlag', - 'GetAdminFlag', - 'GetAdminFlags', - 'AdminInheritGroup', - 'GetAdminGroupCount', - 'GetAdminGroup', - 'SetAdminPassword', - 'GetAdminPassword', - 'FindAdminByIdentity', - 'RemoveAdmin', - 'FlagBitsToBitArray', - 'FlagBitArrayToBits', - 'FlagArrayToBits', - 'FlagBitsToArray', - 'FindFlagByName', - 'FindFlagByChar', - 'FindFlagChar', - 'ReadFlagString', - 'CanAdminTarget', - 'CreateAuthMethod', - 'SetAdmGroupImmunityLevel', - 'GetAdmGroupImmunityLevel', - 'SetAdminImmunityLevel', - 'GetAdminImmunityLevel', - 'FlagToBit', - 'BitToFlag', - 'ServerCommand', - 'ServerCommandEx', - 'InsertServerCommand', - 'ServerExecute', - 'ClientCommand', - 'FakeClientCommand', - 'FakeClientCommandEx', - 'PrintToServer', - 'PrintToConsole', - 'ReplyToCommand', - 'GetCmdReplySource', - 'SetCmdReplySource', - 'IsChatTrigger', - 'ShowActivity2', - 'ShowActivity', - 'ShowActivityEx', - 'FormatActivitySource', - 'SrvCmd', - 'RegServerCmd', - 'ConCmd', - 'RegConsoleCmd', - 'RegAdminCmd', - 'GetCmdArgs', - 'GetCmdArg', - 'GetCmdArgString', - 'CreateConVar', - 'FindConVar', - 'ConVarChanged', - 'HookConVarChange', - 'UnhookConVarChange', - 'GetConVarBool', - 'SetConVarBool', - 'GetConVarInt', - 'SetConVarInt', - 'GetConVarFloat', - 'SetConVarFloat', - 'GetConVarString', - 'SetConVarString', - 'ResetConVar', - 'GetConVarDefault', - 'GetConVarFlags', - 'SetConVarFlags', - 'GetConVarBounds', - 'SetConVarBounds', - 'GetConVarName', - 'QueryClientConVar', - 'GetCommandIterator', - 'ReadCommandIterator', - 'CheckCommandAccess', - 'CheckAccess', - 'IsValidConVarChar', - 'GetCommandFlags', - 'SetCommandFlags', - 'FindFirstConCommand', - 'FindNextConCommand', - 'SendConVarValue', - 'AddServerTag', - 'RemoveServerTag', - 'CommandListener', - 'AddCommandListener', - 'RemoveCommandListener', - 'CommandExists', - 'OnClientSayCommand', - 'OnClientSayCommand_Post', - 'TF2_IgnitePlayer', - 'TF2_RespawnPlayer', - 'TF2_RegeneratePlayer', - 'TF2_AddCondition', - 'TF2_RemoveCondition', - 'TF2_SetPlayerPowerPlay', - 'TF2_DisguisePlayer', - 'TF2_RemovePlayerDisguise', - 'TF2_StunPlayer', - 'TF2_MakeBleed', - 'TF2_GetClass', - 'TF2_CalcIsAttackCritical', - 'TF2_OnIsHolidayActive', - 'TF2_IsHolidayActive', - 'TF2_IsPlayerInDuel', - 'TF2_RemoveWearable', - 'TF2_OnConditionAdded', - 'TF2_OnConditionRemoved', - 'TF2_OnWaitingForPlayersStart', - 'TF2_OnWaitingForPlayersEnd', - 'TF2_OnPlayerTeleport', - 'SQL_Connect', - 'SQL_DefConnect', - 'SQL_ConnectCustom', - 'SQLite_UseDatabase', - 'SQL_CheckConfig', - 'SQL_GetDriver', - 'SQL_ReadDriver', - 'SQL_GetDriverIdent', - 'SQL_GetDriverProduct', - 'SQL_SetCharset', - 'SQL_GetAffectedRows', - 'SQL_GetInsertId', - 'SQL_GetError', - 'SQL_EscapeString', - 'SQL_QuoteString', - 'SQL_FastQuery', - 'SQL_Query', - 'SQL_PrepareQuery', - 'SQL_FetchMoreResults', - 'SQL_HasResultSet', - 'SQL_GetRowCount', - 'SQL_GetFieldCount', - 'SQL_FieldNumToName', - 'SQL_FieldNameToNum', - 'SQL_FetchRow', - 'SQL_MoreRows', - 'SQL_Rewind', - 'SQL_FetchString', - 'SQL_FetchFloat', - 'SQL_FetchInt', - 'SQL_IsFieldNull', - 'SQL_FetchSize', - 'SQL_BindParamInt', - 'SQL_BindParamFloat', - 'SQL_BindParamString', - 'SQL_Execute', - 'SQL_LockDatabase', - 'SQL_UnlockDatabase', - 'SQLTCallback', - 'SQL_IsSameConnection', - 'SQL_TConnect', - 'SQL_TQuery', - 'SQL_CreateTransaction', - 'SQL_AddQuery', - 'SQLTxnSuccess', - 'SQLTxnFailure', - 'SQL_ExecuteTransaction', - 'CloseHandle', - 'CloneHandle', - 'MenuHandler', - 'CreateMenu', - 'DisplayMenu', - 'DisplayMenuAtItem', - 'AddMenuItem', - 'InsertMenuItem', - 'RemoveMenuItem', - 'RemoveAllMenuItems', - 'GetMenuItem', - 'GetMenuSelectionPosition', - 'GetMenuItemCount', - 'SetMenuPagination', - 'GetMenuPagination', - 'GetMenuStyle', - 'SetMenuTitle', - 'GetMenuTitle', - 'CreatePanelFromMenu', - 'GetMenuExitButton', - 'SetMenuExitButton', - 'GetMenuExitBackButton', - 'SetMenuExitBackButton', - 'SetMenuNoVoteButton', - 'CancelMenu', - 'GetMenuOptionFlags', - 'SetMenuOptionFlags', - 'IsVoteInProgress', - 'CancelVote', - 'VoteMenu', - 'VoteMenuToAll', - 'VoteHandler', - 'SetVoteResultCallback', - 'CheckVoteDelay', - 'IsClientInVotePool', - 'RedrawClientVoteMenu', - 'GetMenuStyleHandle', - 'CreatePanel', - 'CreateMenuEx', - 'GetClientMenu', - 'CancelClientMenu', - 'GetMaxPageItems', - 'GetPanelStyle', - 'SetPanelTitle', - 'DrawPanelItem', - 'DrawPanelText', - 'CanPanelDrawFlags', - 'SetPanelKeys', - 'SendPanelToClient', - 'GetPanelTextRemaining', - 'GetPanelCurrentKey', - 'SetPanelCurrentKey', - 'RedrawMenuItem', - 'InternalShowMenu', - 'GetMenuVoteInfo', - 'IsNewVoteAllowed', - 'PrefetchSound', - 'EmitAmbientSound', - 'FadeClientVolume', - 'StopSound', - 'EmitSound', - 'EmitSentence', - 'GetDistGainFromSoundLevel', - 'AmbientSHook', - 'NormalSHook', - 'AddAmbientSoundHook', - 'AddNormalSoundHook', - 'RemoveAmbientSoundHook', - 'RemoveNormalSoundHook', - 'EmitSoundToClient', - 'EmitSoundToAll', - 'ATTN_TO_SNDLEVEL', - 'GetGameSoundParams', - 'EmitGameSound', - 'EmitAmbientGameSound', - 'EmitGameSoundToClient', - 'EmitGameSoundToAll', - 'PrecacheScriptSound', - 'strlen', - 'StrContains', - 'strcmp', - 'strncmp', - 'StrEqual', - 'strcopy', - 'Format', - 'FormatEx', - 'VFormat', - 'StringToInt', - 'StringToIntEx', - 'IntToString', - 'StringToFloat', - 'StringToFloatEx', - 'FloatToString', - 'BreakString', - 'TrimString', - 'SplitString', - 'ReplaceString', - 'ReplaceStringEx', - 'GetCharBytes', - 'IsCharAlpha', - 'IsCharNumeric', - 'IsCharSpace', - 'IsCharMB', - 'IsCharUpper', - 'IsCharLower', - 'StripQuotes', - 'CharToUpper', - 'CharToLower', - 'FindCharInString', - 'StrCat', - 'ExplodeString', - 'ImplodeStrings', - 'GetVectorLength', - 'GetVectorDistance', - 'GetVectorDotProduct', - 'GetVectorCrossProduct', - 'NormalizeVector', - 'GetAngleVectors', - 'GetVectorAngles', - 'GetVectorVectors', - 'AddVectors', - 'SubtractVectors', - 'ScaleVector', - 'NegateVector', - 'MakeVectorFromPoints', - 'BaseComm_IsClientGagged', - 'BaseComm_IsClientMuted', - 'BaseComm_SetClientGag', - 'BaseComm_SetClientMute', - 'FormatUserLogText', - 'FindPluginByFile', - 'FindTarget', - 'AcceptEntityInput', - 'SetVariantBool', - 'SetVariantString', - 'SetVariantInt', - 'SetVariantFloat', - 'SetVariantVector3D', - 'SetVariantPosVector3D', - 'SetVariantColor', - 'SetVariantEntity', - 'GameRules_GetProp', - 'GameRules_SetProp', - 'GameRules_GetPropFloat', - 'GameRules_SetPropFloat', - 'GameRules_GetPropEnt', - 'GameRules_SetPropEnt', - 'GameRules_GetPropVector', - 'GameRules_SetPropVector', - 'GameRules_GetPropString', - 'GameRules_SetPropString', - 'GameRules_GetRoundState', - 'OnClientConnect', - 'OnClientConnected', - 'OnClientPutInServer', - 'OnClientDisconnect', - 'OnClientDisconnect_Post', - 'OnClientCommand', - 'OnClientSettingsChanged', - 'OnClientAuthorized', - 'OnClientPreAdminCheck', - 'OnClientPostAdminFilter', - 'OnClientPostAdminCheck', - 'GetMaxClients', - 'GetMaxHumanPlayers', - 'GetClientCount', - 'GetClientName', - 'GetClientIP', - 'GetClientAuthString', - 'GetClientAuthId', - 'GetSteamAccountID', - 'GetClientUserId', - 'IsClientConnected', - 'IsClientInGame', - 'IsClientInKickQueue', - 'IsClientAuthorized', - 'IsFakeClient', - 'IsClientSourceTV', - 'IsClientReplay', - 'IsClientObserver', - 'IsPlayerAlive', - 'GetClientInfo', - 'GetClientTeam', - 'SetUserAdmin', - 'GetUserAdmin', - 'AddUserFlags', - 'RemoveUserFlags', - 'SetUserFlagBits', - 'GetUserFlagBits', - 'CanUserTarget', - 'RunAdminCacheChecks', - 'NotifyPostAdminCheck', - 'CreateFakeClient', - 'SetFakeClientConVar', - 'GetClientHealth', - 'GetClientModel', - 'GetClientWeapon', - 'GetClientMaxs', - 'GetClientMins', - 'GetClientAbsAngles', - 'GetClientAbsOrigin', - 'GetClientArmor', - 'GetClientDeaths', - 'GetClientFrags', - 'GetClientDataRate', - 'IsClientTimingOut', - 'GetClientTime', - 'GetClientLatency', - 'GetClientAvgLatency', - 'GetClientAvgLoss', - 'GetClientAvgChoke', - 'GetClientAvgData', - 'GetClientAvgPackets', - 'GetClientOfUserId', - 'KickClient', - 'KickClientEx', - 'ChangeClientTeam', - 'GetClientSerial', - 'GetClientFromSerial', - 'FindStringTable', - 'GetNumStringTables', - 'GetStringTableNumStrings', - 'GetStringTableMaxStrings', - 'GetStringTableName', - 'FindStringIndex', - 'ReadStringTable', - 'GetStringTableDataLength', - 'GetStringTableData', - 'SetStringTableData', - 'AddToStringTable', - 'LockStringTables', - 'AddFileToDownloadsTable', - 'GetEntityFlags', - 'SetEntityFlags', - 'GetEntityMoveType', - 'SetEntityMoveType', - 'GetEntityRenderMode', - 'SetEntityRenderMode', - 'GetEntityRenderFx', - 'SetEntityRenderFx', - 'SetEntityRenderColor', - 'GetEntityGravity', - 'SetEntityGravity', - 'SetEntityHealth', - 'GetClientButtons', - 'EntityOutput', - 'HookEntityOutput', - 'UnhookEntityOutput', - 'HookSingleEntityOutput', - 'UnhookSingleEntityOutput', - 'SMC_CreateParser', - 'SMC_ParseFile', - 'SMC_GetErrorString', - 'SMC_ParseStart', - 'SMC_SetParseStart', - 'SMC_ParseEnd', - 'SMC_SetParseEnd', - 'SMC_NewSection', - 'SMC_KeyValue', - 'SMC_EndSection', - 'SMC_SetReaders', - 'SMC_RawLine', - 'SMC_SetRawLine', - 'BfWriteBool', - 'BfWriteByte', - 'BfWriteChar', - 'BfWriteShort', - 'BfWriteWord', - 'BfWriteNum', - 'BfWriteFloat', - 'BfWriteString', - 'BfWriteEntity', - 'BfWriteAngle', - 'BfWriteCoord', - 'BfWriteVecCoord', - 'BfWriteVecNormal', - 'BfWriteAngles', - 'BfReadBool', - 'BfReadByte', - 'BfReadChar', - 'BfReadShort', - 'BfReadWord', - 'BfReadNum', - 'BfReadFloat', - 'BfReadString', - 'BfReadEntity', - 'BfReadAngle', - 'BfReadCoord', - 'BfReadVecCoord', - 'BfReadVecNormal', - 'BfReadAngles', - 'BfGetNumBytesLeft', - 'CreateProfiler', - 'StartProfiling', - 'StopProfiling', - 'GetProfilerTime', - 'OnPluginStart', - 'AskPluginLoad2', - 'OnPluginEnd', - 'OnPluginPauseChange', - 'OnGameFrame', - 'OnMapStart', - 'OnMapEnd', - 'OnConfigsExecuted', - 'OnAutoConfigsBuffered', - 'OnAllPluginsLoaded', - 'GetMyHandle', - 'GetPluginIterator', - 'MorePlugins', - 'ReadPlugin', - 'GetPluginStatus', - 'GetPluginFilename', - 'IsPluginDebugging', - 'GetPluginInfo', - 'FindPluginByNumber', - 'SetFailState', - 'ThrowError', - 'GetTime', - 'FormatTime', - 'LoadGameConfigFile', - 'GameConfGetOffset', - 'GameConfGetKeyValue', - 'GameConfGetAddress', - 'GetSysTickCount', - 'AutoExecConfig', - 'RegPluginLibrary', - 'LibraryExists', - 'GetExtensionFileStatus', - 'OnLibraryAdded', - 'OnLibraryRemoved', - 'ReadMapList', - 'SetMapListCompatBind', - 'OnClientFloodCheck', - 'OnClientFloodResult', - 'CanTestFeatures', - 'GetFeatureStatus', - 'RequireFeature', - 'LoadFromAddress', - 'StoreToAddress', - 'CreateStack', - 'PushStackCell', - 'PushStackString', - 'PushStackArray', - 'PopStackCell', - 'PopStackString', - 'PopStackArray', - 'IsStackEmpty', - 'PopStack', - 'OnPlayerRunCmd', - 'BuildPath', - 'OpenDirectory', - 'ReadDirEntry', - 'OpenFile', - 'DeleteFile', - 'ReadFileLine', - 'ReadFile', - 'ReadFileString', - 'WriteFile', - 'WriteFileString', - 'WriteFileLine', - 'ReadFileCell', - 'WriteFileCell', - 'IsEndOfFile', - 'FileSeek', - 'FilePosition', - 'FileExists', - 'RenameFile', - 'DirExists', - 'FileSize', - 'FlushFile', - 'RemoveDir', - 'CreateDirectory', - 'GetFileTime', - 'LogToOpenFile', - 'LogToOpenFileEx', - 'PbReadInt', - 'PbReadFloat', - 'PbReadBool', - 'PbReadString', - 'PbReadColor', - 'PbReadAngle', - 'PbReadVector', - 'PbReadVector2D', - 'PbGetRepeatedFieldCount', - 'PbSetInt', - 'PbSetFloat', - 'PbSetBool', - 'PbSetString', - 'PbSetColor', - 'PbSetAngle', - 'PbSetVector', - 'PbSetVector2D', - 'PbAddInt', - 'PbAddFloat', - 'PbAddBool', - 'PbAddString', - 'PbAddColor', - 'PbAddAngle', - 'PbAddVector', - 'PbAddVector2D', - 'PbRemoveRepeatedFieldValue', - 'PbReadMessage', - 'PbReadRepeatedMessage', - 'PbAddMessage', - 'SetNextMap', - 'GetNextMap', - 'ForceChangeLevel', - 'GetMapHistorySize', - 'GetMapHistory', - 'GeoipCode2', - 'GeoipCode3', - 'GeoipCountry', - 'MarkNativeAsOptional', - 'RegClientCookie', - 'FindClientCookie', - 'SetClientCookie', - 'GetClientCookie', - 'SetAuthIdCookie', - 'AreClientCookiesCached', - 'OnClientCookiesCached', - 'CookieMenuHandler', - 'SetCookiePrefabMenu', - 'SetCookieMenuItem', - 'ShowCookieMenu', - 'GetCookieIterator', - 'ReadCookieIterator', - 'GetCookieAccess', - 'GetClientCookieTime', - 'LoadTranslations', - 'SetGlobalTransTarget', - 'GetClientLanguage', - 'GetServerLanguage', - 'GetLanguageCount', - 'GetLanguageInfo', - 'SetClientLanguage', - 'GetLanguageByCode', - 'GetLanguageByName', - 'CS_OnBuyCommand', - 'CS_OnCSWeaponDrop', - 'CS_OnGetWeaponPrice', - 'CS_OnTerminateRound', - 'CS_RespawnPlayer', - 'CS_SwitchTeam', - 'CS_DropWeapon', - 'CS_TerminateRound', - 'CS_GetTranslatedWeaponAlias', - 'CS_GetWeaponPrice', - 'CS_GetClientClanTag', - 'CS_SetClientClanTag', - 'CS_GetTeamScore', - 'CS_SetTeamScore', - 'CS_GetMVPCount', - 'CS_SetMVPCount', - 'CS_GetClientContributionScore', - 'CS_SetClientContributionScore', - 'CS_GetClientAssists', - 'CS_SetClientAssists', - 'CS_AliasToWeaponID', - 'CS_WeaponIDToAlias', - 'CS_IsValidWeaponID', - 'CS_UpdateClientModel', - 'LogToGame', - 'SetRandomSeed', - 'GetRandomFloat', - 'GetRandomInt', - 'IsMapValid', - 'IsDedicatedServer', - 'GetEngineTime', - 'GetGameTime', - 'GetGameTickCount', - 'GetGameDescription', - 'GetGameFolderName', - 'GetCurrentMap', - 'PrecacheModel', - 'PrecacheSentenceFile', - 'PrecacheDecal', - 'PrecacheGeneric', - 'IsModelPrecached', - 'IsDecalPrecached', - 'IsGenericPrecached', - 'PrecacheSound', - 'IsSoundPrecached', - 'CreateDialog', - 'GetEngineVersion', - 'PrintToChat', - 'PrintToChatAll', - 'PrintCenterText', - 'PrintCenterTextAll', - 'PrintHintText', - 'PrintHintTextToAll', - 'ShowVGUIPanel', - 'CreateHudSynchronizer', - 'SetHudTextParams', - 'SetHudTextParamsEx', - 'ShowSyncHudText', - 'ClearSyncHud', - 'ShowHudText', - 'ShowMOTDPanel', - 'DisplayAskConnectBox', - 'EntIndexToEntRef', - 'EntRefToEntIndex', - 'MakeCompatEntRef', - 'SetClientViewEntity', - 'SetLightStyle', - 'GetClientEyePosition', - 'CreateDataPack', - 'WritePackCell', - 'WritePackFloat', - 'WritePackString', - 'ReadPackCell', - 'ReadPackFloat', - 'ReadPackString', - 'ResetPack', - 'GetPackPosition', - 'SetPackPosition', - 'IsPackReadable', - 'LogMessage', - 'LogToFile', - 'LogToFileEx', - 'LogAction', - 'LogError', - 'OnLogAction', - 'GameLogHook', - 'AddGameLogHook', - 'RemoveGameLogHook', - 'FindTeamByName', - 'StartPrepSDKCall', - 'PrepSDKCall_SetVirtual', - 'PrepSDKCall_SetSignature', - 'PrepSDKCall_SetAddress', - 'PrepSDKCall_SetFromConf', - 'PrepSDKCall_SetReturnInfo', - 'PrepSDKCall_AddParameter', - 'EndPrepSDKCall', - 'SDKCall', - 'GetPlayerResourceEntity', -) -if __name__ == '__main__': - import re - import sys - try: - from urllib import FancyURLopener - except ImportError: - from urllib.request import FancyURLopener - - from pygments.util import format_lines - - # urllib ends up wanting to import a module called 'math' -- if - # pygments/lexers is in the path, this ends badly. - for i in range(len(sys.path)-1, -1, -1): - if sys.path[i].endswith('/lexers'): - del sys.path[i] - - class Opener(FancyURLopener): - version = 'Mozilla/5.0 (Pygments Sourcemod Builtins Update)' - - opener = Opener() - - def get_version(): - f = opener.open('http://docs.sourcemod.net/api/index.php') - r = re.compile(r'SourceMod v\.([\d\.]+(?:-\w+)?)') - for line in f: - m = r.search(line) - if m is not None: - return m.groups()[0] - raise ValueError('No version in api docs') - - def get_sm_functions(): - f = opener.open('http://docs.sourcemod.net/api/SMfuncs.js') - r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);') - functions = [] - for line in f: - m = r.match(line) - if m is not None: - functions.append(m.groups()[0]) - return functions - - def regenerate(filename, natives): - with open(filename) as fp: - content = fp.read() - - header = content[:content.find('FUNCTIONS = (')] - footer = content[content.find("if __name__ == '__main__':")-1:] - - - with open(filename, 'w') as fp: - fp.write(header) - fp.write(format_lines('FUNCTIONS', natives)) - fp.write(footer) - - def run(): - version = get_version() - print('> Downloading function index for SourceMod %s' % version) - functions = get_sm_functions() - print('> %d functions found:' % len(functions)) - - functionlist = [] - for full_function_name in functions: - print('>> %s' % full_function_name) - functionlist.append(full_function_name) - - regenerate(__file__, functionlist) - - - run() diff --git a/wakatime/packages/py2/pygments/lexers/actionscript.py b/wakatime/packages/py2/pygments/lexers/actionscript.py deleted file mode 100644 index 2bf8a11..0000000 --- a/wakatime/packages/py2/pygments/lexers/actionscript.py +++ /dev/null @@ -1,240 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.actionscript - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for ActionScript and MXML. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, bygroups, using, this, words, default -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation - -__all__ = ['ActionScriptLexer', 'ActionScript3Lexer', 'MxmlLexer'] - - -class ActionScriptLexer(RegexLexer): - """ - For ActionScript source code. - - .. versionadded:: 0.9 - """ - - name = 'ActionScript' - aliases = ['as', 'actionscript'] - filenames = ['*.as'] - mimetypes = ['application/x-actionscript', 'text/x-actionscript', - 'text/actionscript'] - - flags = re.DOTALL - tokens = { - 'root': [ - (r'\s+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex), - (r'[~^*!%&<>|+=:;,/?\\-]+', Operator), - (r'[{}\[\]();.]+', Punctuation), - (words(( - 'case', 'default', 'for', 'each', 'in', 'while', 'do', 'break', - 'return', 'continue', 'if', 'else', 'throw', 'try', 'catch', - 'var', 'with', 'new', 'typeof', 'arguments', 'instanceof', 'this', - 'switch'), suffix=r'\b'), - Keyword), - (words(( - 'class', 'public', 'final', 'internal', 'native', 'override', 'private', - 'protected', 'static', 'import', 'extends', 'implements', 'interface', - 'intrinsic', 'return', 'super', 'dynamic', 'function', 'const', 'get', - 'namespace', 'package', 'set'), suffix=r'\b'), - Keyword.Declaration), - (r'(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\b', - Keyword.Constant), - (words(( - 'Accessibility', 'AccessibilityProperties', 'ActionScriptVersion', - 'ActivityEvent', 'AntiAliasType', 'ApplicationDomain', 'AsBroadcaster', 'Array', - 'AsyncErrorEvent', 'AVM1Movie', 'BevelFilter', 'Bitmap', 'BitmapData', - 'BitmapDataChannel', 'BitmapFilter', 'BitmapFilterQuality', 'BitmapFilterType', - 'BlendMode', 'BlurFilter', 'Boolean', 'ByteArray', 'Camera', 'Capabilities', 'CapsStyle', - 'Class', 'Color', 'ColorMatrixFilter', 'ColorTransform', 'ContextMenu', - 'ContextMenuBuiltInItems', 'ContextMenuEvent', 'ContextMenuItem', - 'ConvultionFilter', 'CSMSettings', 'DataEvent', 'Date', 'DefinitionError', - 'DeleteObjectSample', 'Dictionary', 'DisplacmentMapFilter', 'DisplayObject', - 'DisplacmentMapFilterMode', 'DisplayObjectContainer', 'DropShadowFilter', - 'Endian', 'EOFError', 'Error', 'ErrorEvent', 'EvalError', 'Event', 'EventDispatcher', - 'EventPhase', 'ExternalInterface', 'FileFilter', 'FileReference', - 'FileReferenceList', 'FocusDirection', 'FocusEvent', 'Font', 'FontStyle', 'FontType', - 'FrameLabel', 'FullScreenEvent', 'Function', 'GlowFilter', 'GradientBevelFilter', - 'GradientGlowFilter', 'GradientType', 'Graphics', 'GridFitType', 'HTTPStatusEvent', - 'IBitmapDrawable', 'ID3Info', 'IDataInput', 'IDataOutput', 'IDynamicPropertyOutput' - 'IDynamicPropertyWriter', 'IEventDispatcher', 'IExternalizable', - 'IllegalOperationError', 'IME', 'IMEConversionMode', 'IMEEvent', 'int', - 'InteractiveObject', 'InterpolationMethod', 'InvalidSWFError', 'InvokeEvent', - 'IOError', 'IOErrorEvent', 'JointStyle', 'Key', 'Keyboard', 'KeyboardEvent', 'KeyLocation', - 'LineScaleMode', 'Loader', 'LoaderContext', 'LoaderInfo', 'LoadVars', 'LocalConnection', - 'Locale', 'Math', 'Matrix', 'MemoryError', 'Microphone', 'MorphShape', 'Mouse', 'MouseEvent', - 'MovieClip', 'MovieClipLoader', 'Namespace', 'NetConnection', 'NetStatusEvent', - 'NetStream', 'NewObjectSample', 'Number', 'Object', 'ObjectEncoding', 'PixelSnapping', - 'Point', 'PrintJob', 'PrintJobOptions', 'PrintJobOrientation', 'ProgressEvent', 'Proxy', - 'QName', 'RangeError', 'Rectangle', 'ReferenceError', 'RegExp', 'Responder', 'Sample', - 'Scene', 'ScriptTimeoutError', 'Security', 'SecurityDomain', 'SecurityError', - 'SecurityErrorEvent', 'SecurityPanel', 'Selection', 'Shape', 'SharedObject', - 'SharedObjectFlushStatus', 'SimpleButton', 'Socket', 'Sound', 'SoundChannel', - 'SoundLoaderContext', 'SoundMixer', 'SoundTransform', 'SpreadMethod', 'Sprite', - 'StackFrame', 'StackOverflowError', 'Stage', 'StageAlign', 'StageDisplayState', - 'StageQuality', 'StageScaleMode', 'StaticText', 'StatusEvent', 'String', 'StyleSheet', - 'SWFVersion', 'SyncEvent', 'SyntaxError', 'System', 'TextColorType', 'TextField', - 'TextFieldAutoSize', 'TextFieldType', 'TextFormat', 'TextFormatAlign', - 'TextLineMetrics', 'TextRenderer', 'TextSnapshot', 'Timer', 'TimerEvent', 'Transform', - 'TypeError', 'uint', 'URIError', 'URLLoader', 'URLLoaderDataFormat', 'URLRequest', - 'URLRequestHeader', 'URLRequestMethod', 'URLStream', 'URLVariabeles', 'VerifyError', - 'Video', 'XML', 'XMLDocument', 'XMLList', 'XMLNode', 'XMLNodeType', 'XMLSocket', - 'XMLUI'), suffix=r'\b'), - Name.Builtin), - (words(( - 'decodeURI', 'decodeURIComponent', 'encodeURI', 'escape', 'eval', 'isFinite', 'isNaN', - 'isXMLName', 'clearInterval', 'fscommand', 'getTimer', 'getURL', 'getVersion', - 'parseFloat', 'parseInt', 'setInterval', 'trace', 'updateAfterEvent', - 'unescape'), suffix=r'\b'), - Name.Function), - (r'[$a-zA-Z_]\w*', Name.Other), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-f]+', Number.Hex), - (r'[0-9]+', Number.Integer), - (r'"(\\\\|\\"|[^"])*"', String.Double), - (r"'(\\\\|\\'|[^'])*'", String.Single), - ] - } - - -class ActionScript3Lexer(RegexLexer): - """ - For ActionScript 3 source code. - - .. versionadded:: 0.11 - """ - - name = 'ActionScript 3' - aliases = ['as3', 'actionscript3'] - filenames = ['*.as'] - mimetypes = ['application/x-actionscript3', 'text/x-actionscript3', - 'text/actionscript3'] - - identifier = r'[$a-zA-Z_]\w*' - typeidentifier = identifier + '(?:\.<\w+>)?' - - flags = re.DOTALL | re.MULTILINE - tokens = { - 'root': [ - (r'\s+', Text), - (r'(function\s+)(' + identifier + r')(\s*)(\()', - bygroups(Keyword.Declaration, Name.Function, Text, Operator), - 'funcparams'), - (r'(var|const)(\s+)(' + identifier + r')(\s*)(:)(\s*)(' + - typeidentifier + r')', - bygroups(Keyword.Declaration, Text, Name, Text, Punctuation, Text, - Keyword.Type)), - (r'(import|package)(\s+)((?:' + identifier + r'|\.)+)(\s*)', - bygroups(Keyword, Text, Name.Namespace, Text)), - (r'(new)(\s+)(' + typeidentifier + r')(\s*)(\()', - bygroups(Keyword, Text, Keyword.Type, Text, Operator)), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'/(\\\\|\\/|[^\n])*/[gisx]*', String.Regex), - (r'(\.)(' + identifier + r')', bygroups(Operator, Name.Attribute)), - (r'(case|default|for|each|in|while|do|break|return|continue|if|else|' - r'throw|try|catch|with|new|typeof|arguments|instanceof|this|' - r'switch|import|include|as|is)\b', - Keyword), - (r'(class|public|final|internal|native|override|private|protected|' - r'static|import|extends|implements|interface|intrinsic|return|super|' - r'dynamic|function|const|get|namespace|package|set)\b', - Keyword.Declaration), - (r'(true|false|null|NaN|Infinity|-Infinity|undefined|void)\b', - Keyword.Constant), - (r'(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|' - r'isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|' - r'isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|' - r'unescape)\b', Name.Function), - (identifier, Name), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-f]+', Number.Hex), - (r'[0-9]+', Number.Integer), - (r'"(\\\\|\\"|[^"])*"', String.Double), - (r"'(\\\\|\\'|[^'])*'", String.Single), - (r'[~^*!%&<>|+=:;,/?\\{}\[\]().-]+', Operator), - ], - 'funcparams': [ - (r'\s+', Text), - (r'(\s*)(\.\.\.)?(' + identifier + r')(\s*)(:)(\s*)(' + - typeidentifier + r'|\*)(\s*)', - bygroups(Text, Punctuation, Name, Text, Operator, Text, - Keyword.Type, Text), 'defval'), - (r'\)', Operator, 'type') - ], - 'type': [ - (r'(\s*)(:)(\s*)(' + typeidentifier + r'|\*)', - bygroups(Text, Operator, Text, Keyword.Type), '#pop:2'), - (r'\s+', Text, '#pop:2'), - default('#pop:2') - ], - 'defval': [ - (r'(=)(\s*)([^(),]+)(\s*)(,?)', - bygroups(Operator, Text, using(this), Text, Operator), '#pop'), - (r',', Operator, '#pop'), - default('#pop') - ] - } - - def analyse_text(text): - if re.match(r'\w+\s*:\s*\w', text): - return 0.3 - return 0 - - -class MxmlLexer(RegexLexer): - """ - For MXML markup. - Nested AS3 in )', bygroups(using(XmlLexer), - Other, - using(XmlLexer))), - (r'(.+?)(?=<)', using(XmlLexer)), - (r'.+', using(XmlLexer)), - ], - } - - -# TODO support multiple languages within the same source file -class CSharpAspxLexer(DelegatingLexer): - """ - Lexer for highligting C# within ASP.NET pages. - """ - - name = 'aspx-cs' - aliases = ['aspx-cs'] - filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'] - mimetypes = [] - - def __init__(self, **options): - super(CSharpAspxLexer, self).__init__(CSharpLexer, GenericAspxLexer, - **options) - - def analyse_text(text): - if re.search(r'Page\s*Language="C#"', text, re.I) is not None: - return 0.2 - elif re.search(r'script[^>]+language=["\']C#', text, re.I) is not None: - return 0.15 - - -class VbNetAspxLexer(DelegatingLexer): - """ - Lexer for highligting Visual Basic.net within ASP.NET pages. - """ - - name = 'aspx-vb' - aliases = ['aspx-vb'] - filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'] - mimetypes = [] - - def __init__(self, **options): - super(VbNetAspxLexer, self).__init__(VbNetLexer, GenericAspxLexer, - **options) - - def analyse_text(text): - if re.search(r'Page\s*Language="Vb"', text, re.I) is not None: - return 0.2 - elif re.search(r'script[^>]+language=["\']vb', text, re.I) is not None: - return 0.15 - - -# Very close to functional.OcamlLexer -class FSharpLexer(RegexLexer): - """ - For the F# language (version 3.0). - - AAAAACK Strings - http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818775 - - .. versionadded:: 1.5 - """ - - name = 'FSharp' - aliases = ['fsharp'] - filenames = ['*.fs', '*.fsi'] - mimetypes = ['text/x-fsharp'] - - keywords = [ - 'abstract', 'as', 'assert', 'base', 'begin', 'class', 'default', - 'delegate', 'do!', 'do', 'done', 'downcast', 'downto', 'elif', 'else', - 'end', 'exception', 'extern', 'false', 'finally', 'for', 'function', - 'fun', 'global', 'if', 'inherit', 'inline', 'interface', 'internal', - 'in', 'lazy', 'let!', 'let', 'match', 'member', 'module', 'mutable', - 'namespace', 'new', 'null', 'of', 'open', 'override', 'private', 'public', - 'rec', 'return!', 'return', 'select', 'static', 'struct', 'then', 'to', - 'true', 'try', 'type', 'upcast', 'use!', 'use', 'val', 'void', 'when', - 'while', 'with', 'yield!', 'yield', - ] - # Reserved words; cannot hurt to color them as keywords too. - keywords += [ - 'atomic', 'break', 'checked', 'component', 'const', 'constraint', - 'constructor', 'continue', 'eager', 'event', 'external', 'fixed', - 'functor', 'include', 'method', 'mixin', 'object', 'parallel', - 'process', 'protected', 'pure', 'sealed', 'tailcall', 'trait', - 'virtual', 'volatile', - ] - keyopts = [ - '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.', - '->', '-', '\.\.', '\.', '::', ':=', ':>', ':', ';;', ';', '<-', - '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]', - '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>', - ] - - operators = r'[!$%&*+\./:<=>?@^|~-]' - word_operators = ['and', 'or', 'not'] - prefix_syms = r'[!?~]' - infix_syms = r'[=<>@^|&+\*/$%-]' - primitives = [ - 'sbyte', 'byte', 'char', 'nativeint', 'unativeint', 'float32', 'single', - 'float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', - 'uint32', 'int64', 'uint64', 'decimal', 'unit', 'bool', 'string', - 'list', 'exn', 'obj', 'enum', - ] - - # See http://msdn.microsoft.com/en-us/library/dd233181.aspx and/or - # http://fsharp.org/about/files/spec.pdf for reference. Good luck. - - tokens = { - 'escape-sequence': [ - (r'\\[\\"\'ntbrafv]', String.Escape), - (r'\\[0-9]{3}', String.Escape), - (r'\\u[0-9a-fA-F]{4}', String.Escape), - (r'\\U[0-9a-fA-F]{8}', String.Escape), - ], - 'root': [ - (r'\s+', Text), - (r'\(\)|\[\]', Name.Builtin.Pseudo), - (r'\b(?`_ language. - - .. versionadded:: 0.7 - """ - - name = 'Dylan' - aliases = ['dylan'] - filenames = ['*.dylan', '*.dyl', '*.intr'] - mimetypes = ['text/x-dylan'] - - flags = re.IGNORECASE - - builtins = set(( - 'subclass', 'abstract', 'block', 'concrete', 'constant', 'class', - 'compiler-open', 'compiler-sideways', 'domain', 'dynamic', - 'each-subclass', 'exception', 'exclude', 'function', 'generic', - 'handler', 'inherited', 'inline', 'inline-only', 'instance', - 'interface', 'import', 'keyword', 'library', 'macro', 'method', - 'module', 'open', 'primary', 'required', 'sealed', 'sideways', - 'singleton', 'slot', 'thread', 'variable', 'virtual')) - - keywords = set(( - 'above', 'afterwards', 'begin', 'below', 'by', 'case', 'cleanup', - 'create', 'define', 'else', 'elseif', 'end', 'export', 'finally', - 'for', 'from', 'if', 'in', 'let', 'local', 'otherwise', 'rename', - 'select', 'signal', 'then', 'to', 'unless', 'until', 'use', 'when', - 'while')) - - operators = set(( - '~', '+', '-', '*', '|', '^', '=', '==', '~=', '~==', '<', '<=', - '>', '>=', '&', '|')) - - functions = set(( - 'abort', 'abs', 'add', 'add!', 'add-method', 'add-new', 'add-new!', - 'all-superclasses', 'always', 'any?', 'applicable-method?', 'apply', - 'aref', 'aref-setter', 'as', 'as-lowercase', 'as-lowercase!', - 'as-uppercase', 'as-uppercase!', 'ash', 'backward-iteration-protocol', - 'break', 'ceiling', 'ceiling/', 'cerror', 'check-type', 'choose', - 'choose-by', 'complement', 'compose', 'concatenate', 'concatenate-as', - 'condition-format-arguments', 'condition-format-string', 'conjoin', - 'copy-sequence', 'curry', 'default-handler', 'dimension', 'dimensions', - 'direct-subclasses', 'direct-superclasses', 'disjoin', 'do', - 'do-handlers', 'element', 'element-setter', 'empty?', 'error', 'even?', - 'every?', 'false-or', 'fill!', 'find-key', 'find-method', 'first', - 'first-setter', 'floor', 'floor/', 'forward-iteration-protocol', - 'function-arguments', 'function-return-values', - 'function-specializers', 'gcd', 'generic-function-mandatory-keywords', - 'generic-function-methods', 'head', 'head-setter', 'identity', - 'initialize', 'instance?', 'integral?', 'intersection', - 'key-sequence', 'key-test', 'last', 'last-setter', 'lcm', 'limited', - 'list', 'logand', 'logbit?', 'logior', 'lognot', 'logxor', 'make', - 'map', 'map-as', 'map-into', 'max', 'member?', 'merge-hash-codes', - 'min', 'modulo', 'negative', 'negative?', 'next-method', - 'object-class', 'object-hash', 'odd?', 'one-of', 'pair', 'pop', - 'pop-last', 'positive?', 'push', 'push-last', 'range', 'rank', - 'rcurry', 'reduce', 'reduce1', 'remainder', 'remove', 'remove!', - 'remove-duplicates', 'remove-duplicates!', 'remove-key!', - 'remove-method', 'replace-elements!', 'replace-subsequence!', - 'restart-query', 'return-allowed?', 'return-description', - 'return-query', 'reverse', 'reverse!', 'round', 'round/', - 'row-major-index', 'second', 'second-setter', 'shallow-copy', - 'signal', 'singleton', 'size', 'size-setter', 'slot-initialized?', - 'sort', 'sort!', 'sorted-applicable-methods', 'subsequence-position', - 'subtype?', 'table-protocol', 'tail', 'tail-setter', 'third', - 'third-setter', 'truncate', 'truncate/', 'type-error-expected-type', - 'type-error-value', 'type-for-copy', 'type-union', 'union', 'values', - 'vector', 'zero?')) - - valid_name = '\\\\?[\\w!&*<>|^$%@\\-+~?/=]+' - - def get_tokens_unprocessed(self, text): - for index, token, value in RegexLexer.get_tokens_unprocessed(self, text): - if token is Name: - lowercase_value = value.lower() - if lowercase_value in self.builtins: - yield index, Name.Builtin, value - continue - if lowercase_value in self.keywords: - yield index, Keyword, value - continue - if lowercase_value in self.functions: - yield index, Name.Builtin, value - continue - if lowercase_value in self.operators: - yield index, Operator, value - continue - yield index, token, value - - tokens = { - 'root': [ - # Whitespace - (r'\s+', Text), - - # single line comment - (r'//.*?\n', Comment.Single), - - # lid header - (r'([a-z0-9-]+)(:)([ \t]*)(.*(?:\n[ \t].+)*)', - bygroups(Name.Attribute, Operator, Text, String)), - - default('code') # no header match, switch to code - ], - 'code': [ - # Whitespace - (r'\s+', Text), - - # single line comment - (r'//.*?\n', Comment.Single), - - # multi-line comment - (r'/\*', Comment.Multiline, 'comment'), - - # strings and characters - (r'"', String, 'string'), - (r"'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\\'\n])'", String.Char), - - # binary integer - (r'#b[01]+', Number.Bin), - - # octal integer - (r'#o[0-7]+', Number.Oct), - - # floating point - (r'[-+]?(\d*\.\d+(e[-+]?\d+)?|\d+(\.\d*)?e[-+]?\d+)', Number.Float), - - # decimal integer - (r'[-+]?\d+', Number.Integer), - - # hex integer - (r'#x[0-9a-f]+', Number.Hex), - - # Macro parameters - (r'(\?' + valid_name + ')(:)' - r'(token|name|variable|expression|body|case-body|\*)', - bygroups(Name.Tag, Operator, Name.Builtin)), - (r'(\?)(:)(token|name|variable|expression|body|case-body|\*)', - bygroups(Name.Tag, Operator, Name.Builtin)), - (r'\?' + valid_name, Name.Tag), - - # Punctuation - (r'(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],.;])', Punctuation), - - # Most operators are picked up as names and then re-flagged. - # This one isn't valid in a name though, so we pick it up now. - (r':=', Operator), - - # Pick up #t / #f before we match other stuff with #. - (r'#[tf]', Literal), - - # #"foo" style keywords - (r'#"', String.Symbol, 'keyword'), - - # #rest, #key, #all-keys, etc. - (r'#[a-z0-9-]+', Keyword), - - # required-init-keyword: style keywords. - (valid_name + ':', Keyword), - - # class names - (r'<' + valid_name + '>', Name.Class), - - # define variable forms. - (r'\*' + valid_name + '\*', Name.Variable.Global), - - # define constant forms. - (r'\$' + valid_name, Name.Constant), - - # everything else. We re-flag some of these in the method above. - (valid_name, Name), - ], - 'comment': [ - (r'[^*/]', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline) - ], - 'keyword': [ - (r'"', String.Symbol, '#pop'), - (r'[^\\"]+', String.Symbol), # all other characters - ], - 'string': [ - (r'"', String, '#pop'), - (r'\\([\\abfnrtv"\']|x[a-f0-9]{2,4}|[0-7]{1,3})', String.Escape), - (r'[^\\"\n]+', String), # all other characters - (r'\\\n', String), # line continuation - (r'\\', String), # stray backslash - ] - } - - -class DylanLidLexer(RegexLexer): - """ - For Dylan LID (Library Interchange Definition) files. - - .. versionadded:: 1.6 - """ - - name = 'DylanLID' - aliases = ['dylan-lid', 'lid'] - filenames = ['*.lid', '*.hdp'] - mimetypes = ['text/x-dylan-lid'] - - flags = re.IGNORECASE - - tokens = { - 'root': [ - # Whitespace - (r'\s+', Text), - - # single line comment - (r'//.*?\n', Comment.Single), - - # lid header - (r'(.*?)(:)([ \t]*)(.*(?:\n[ \t].+)*)', - bygroups(Name.Attribute, Operator, Text, String)), - ] - } - - -class DylanConsoleLexer(Lexer): - """ - For Dylan interactive console output like: - - .. sourcecode:: dylan-console - - ? let a = 1; - => 1 - ? a - => 1 - - This is based on a copy of the RubyConsoleLexer. - - .. versionadded:: 1.6 - """ - name = 'Dylan session' - aliases = ['dylan-console', 'dylan-repl'] - filenames = ['*.dylan-console'] - mimetypes = ['text/x-dylan-console'] - - _line_re = re.compile('.*?\n') - _prompt_re = re.compile('\?| ') - - def get_tokens_unprocessed(self, text): - dylexer = DylanLexer(**self.options) - - curcode = '' - insertions = [] - for match in self._line_re.finditer(text): - line = match.group() - m = self._prompt_re.match(line) - if m is not None: - end = m.end() - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:end])])) - curcode += line[end:] - else: - if curcode: - for item in do_insertions(insertions, - dylexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - yield match.start(), Generic.Output, line - if curcode: - for item in do_insertions(insertions, - dylexer.get_tokens_unprocessed(curcode)): - yield item diff --git a/wakatime/packages/py3/pygments/lexers/ecl.py b/wakatime/packages/py3/pygments/lexers/ecl.py deleted file mode 100644 index 5c9b3bd..0000000 --- a/wakatime/packages/py3/pygments/lexers/ecl.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.ecl - ~~~~~~~~~~~~~~~~~~~ - - Lexers for the ECL language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include, bygroups, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error - -__all__ = ['ECLLexer'] - - -class ECLLexer(RegexLexer): - """ - Lexer for the declarative big-data `ECL - `_ - language. - - .. versionadded:: 1.5 - """ - - name = 'ECL' - aliases = ['ecl'] - filenames = ['*.ecl'] - mimetypes = ['application/x-ecl'] - - flags = re.IGNORECASE | re.MULTILINE - - tokens = { - 'root': [ - include('whitespace'), - include('statements'), - ], - 'whitespace': [ - (r'\s+', Text), - (r'\/\/.*', Comment.Single), - (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline), - ], - 'statements': [ - include('types'), - include('keywords'), - include('functions'), - include('hash'), - (r'"', String, 'string'), - (r'\'', String, 'string'), - (r'(\d+\.\d*|\.\d+|\d+)e[+-]?\d+[lu]*', Number.Float), - (r'(\d+\.\d*|\.\d+|\d+f)f?', Number.Float), - (r'0x[0-9a-f]+[lu]*', Number.Hex), - (r'0[0-7]+[lu]*', Number.Oct), - (r'\d+[lu]*', Number.Integer), - (r'\*/', Error), - (r'[~!%^&*+=|?:<>/-]+', Operator), - (r'[{}()\[\],.;]', Punctuation), - (r'[a-z_]\w*', Name), - ], - 'hash': [ - (r'^#.*$', Comment.Preproc), - ], - 'types': [ - (r'(RECORD|END)\D', Keyword.Declaration), - (r'((?:ASCII|BIG_ENDIAN|BOOLEAN|DATA|DECIMAL|EBCDIC|INTEGER|PATTERN|' - r'QSTRING|REAL|RECORD|RULE|SET OF|STRING|TOKEN|UDECIMAL|UNICODE|' - r'UNSIGNED|VARSTRING|VARUNICODE)\d*)(\s+)', - bygroups(Keyword.Type, Text)), - ], - 'keywords': [ - (words(( - 'APPLY', 'ASSERT', 'BUILD', 'BUILDINDEX', 'EVALUATE', 'FAIL', - 'KEYDIFF', 'KEYPATCH', 'LOADXML', 'NOTHOR', 'NOTIFY', 'OUTPUT', - 'PARALLEL', 'SEQUENTIAL', 'SOAPCALL', 'CHECKPOINT', 'DEPRECATED', - 'FAILCODE', 'FAILMESSAGE', 'FAILURE', 'GLOBAL', 'INDEPENDENT', - 'ONWARNING', 'PERSIST', 'PRIORITY', 'RECOVERY', 'STORED', 'SUCCESS', - 'WAIT', 'WHEN'), suffix=r'\b'), - Keyword.Reserved), - # These are classed differently, check later - (words(( - 'ALL', 'AND', 'ANY', 'AS', 'ATMOST', 'BEFORE', 'BEGINC++', 'BEST', 'BETWEEN', 'CASE', - 'CONST', 'COUNTER', 'CSV', 'DESCEND', 'ENCRYPT', 'ENDC++', 'ENDMACRO', 'EXCEPT', - 'EXCLUSIVE', 'EXPIRE', 'EXPORT', 'EXTEND', 'FALSE', 'FEW', 'FIRST', 'FLAT', 'FULL', - 'FUNCTION', 'GROUP', 'HEADER', 'HEADING', 'HOLE', 'IFBLOCK', 'IMPORT', 'IN', 'JOINED', - 'KEEP', 'KEYED', 'LAST', 'LEFT', 'LIMIT', 'LOAD', 'LOCAL', 'LOCALE', 'LOOKUP', 'MACRO', - 'MANY', 'MAXCOUNT', 'MAXLENGTH', 'MIN SKEW', 'MODULE', 'INTERFACE', 'NAMED', 'NOCASE', - 'NOROOT', 'NOSCAN', 'NOSORT', 'NOT', 'OF', 'ONLY', 'OPT', 'OR', 'OUTER', 'OVERWRITE', - 'PACKED', 'PARTITION', 'PENALTY', 'PHYSICALLENGTH', 'PIPE', 'QUOTE', 'RELATIONSHIP', - 'REPEAT', 'RETURN', 'RIGHT', 'SCAN', 'SELF', 'SEPARATOR', 'SERVICE', 'SHARED', 'SKEW', - 'SKIP', 'SQL', 'STORE', 'TERMINATOR', 'THOR', 'THRESHOLD', 'TOKEN', 'TRANSFORM', 'TRIM', - 'TRUE', 'TYPE', 'UNICODEORDER', 'UNSORTED', 'VALIDATE', 'VIRTUAL', 'WHOLE', 'WILD', - 'WITHIN', 'XML', 'XPATH', '__COMPRESSED__'), suffix=r'\b'), - Keyword.Reserved), - ], - 'functions': [ - (words(( - 'ABS', 'ACOS', 'ALLNODES', 'ASCII', 'ASIN', 'ASSTRING', 'ATAN', 'ATAN2', 'AVE', 'CASE', - 'CHOOSE', 'CHOOSEN', 'CHOOSESETS', 'CLUSTERSIZE', 'COMBINE', 'CORRELATION', 'COS', - 'COSH', 'COUNT', 'COVARIANCE', 'CRON', 'DATASET', 'DEDUP', 'DEFINE', 'DENORMALIZE', - 'DISTRIBUTE', 'DISTRIBUTED', 'DISTRIBUTION', 'EBCDIC', 'ENTH', 'ERROR', 'EVALUATE', - 'EVENT', 'EVENTEXTRA', 'EVENTNAME', 'EXISTS', 'EXP', 'FAILCODE', 'FAILMESSAGE', - 'FETCH', 'FROMUNICODE', 'GETISVALID', 'GLOBAL', 'GRAPH', 'GROUP', 'HASH', 'HASH32', - 'HASH64', 'HASHCRC', 'HASHMD5', 'HAVING', 'IF', 'INDEX', 'INTFORMAT', 'ISVALID', - 'ITERATE', 'JOIN', 'KEYUNICODE', 'LENGTH', 'LIBRARY', 'LIMIT', 'LN', 'LOCAL', 'LOG', 'LOOP', - 'MAP', 'MATCHED', 'MATCHLENGTH', 'MATCHPOSITION', 'MATCHTEXT', 'MATCHUNICODE', - 'MAX', 'MERGE', 'MERGEJOIN', 'MIN', 'NOLOCAL', 'NONEMPTY', 'NORMALIZE', 'PARSE', 'PIPE', - 'POWER', 'PRELOAD', 'PROCESS', 'PROJECT', 'PULL', 'RANDOM', 'RANGE', 'RANK', 'RANKED', - 'REALFORMAT', 'RECORDOF', 'REGEXFIND', 'REGEXREPLACE', 'REGROUP', 'REJECTED', - 'ROLLUP', 'ROUND', 'ROUNDUP', 'ROW', 'ROWDIFF', 'SAMPLE', 'SET', 'SIN', 'SINH', 'SIZEOF', - 'SOAPCALL', 'SORT', 'SORTED', 'SQRT', 'STEPPED', 'STORED', 'SUM', 'TABLE', 'TAN', 'TANH', - 'THISNODE', 'TOPN', 'TOUNICODE', 'TRANSFER', 'TRIM', 'TRUNCATE', 'TYPEOF', 'UNGROUP', - 'UNICODEORDER', 'VARIANCE', 'WHICH', 'WORKUNIT', 'XMLDECODE', 'XMLENCODE', - 'XMLTEXT', 'XMLUNICODE'), suffix=r'\b'), - Name.Function), - ], - 'string': [ - (r'"', String, '#pop'), - (r'\'', String, '#pop'), - (r'[^"\']+', String), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/erlang.py b/wakatime/packages/py3/pygments/lexers/erlang.py deleted file mode 100644 index 563f774..0000000 --- a/wakatime/packages/py3/pygments/lexers/erlang.py +++ /dev/null @@ -1,511 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.erlang - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Erlang. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \ - include, default -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic - -__all__ = ['ErlangLexer', 'ErlangShellLexer', 'ElixirConsoleLexer', - 'ElixirLexer'] - - -line_re = re.compile('.*?\n') - - -class ErlangLexer(RegexLexer): - """ - For the Erlang functional programming language. - - Blame Jeremy Thurgood (http://jerith.za.net/). - - .. versionadded:: 0.9 - """ - - name = 'Erlang' - aliases = ['erlang'] - filenames = ['*.erl', '*.hrl', '*.es', '*.escript'] - mimetypes = ['text/x-erlang'] - - keywords = ( - 'after', 'begin', 'case', 'catch', 'cond', 'end', 'fun', 'if', - 'let', 'of', 'query', 'receive', 'try', 'when', - ) - - builtins = ( # See erlang(3) man page - 'abs', 'append_element', 'apply', 'atom_to_list', 'binary_to_list', - 'bitstring_to_list', 'binary_to_term', 'bit_size', 'bump_reductions', - 'byte_size', 'cancel_timer', 'check_process_code', 'delete_module', - 'demonitor', 'disconnect_node', 'display', 'element', 'erase', 'exit', - 'float', 'float_to_list', 'fun_info', 'fun_to_list', - 'function_exported', 'garbage_collect', 'get', 'get_keys', - 'group_leader', 'hash', 'hd', 'integer_to_list', 'iolist_to_binary', - 'iolist_size', 'is_atom', 'is_binary', 'is_bitstring', 'is_boolean', - 'is_builtin', 'is_float', 'is_function', 'is_integer', 'is_list', - 'is_number', 'is_pid', 'is_port', 'is_process_alive', 'is_record', - 'is_reference', 'is_tuple', 'length', 'link', 'list_to_atom', - 'list_to_binary', 'list_to_bitstring', 'list_to_existing_atom', - 'list_to_float', 'list_to_integer', 'list_to_pid', 'list_to_tuple', - 'load_module', 'localtime_to_universaltime', 'make_tuple', 'md5', - 'md5_final', 'md5_update', 'memory', 'module_loaded', 'monitor', - 'monitor_node', 'node', 'nodes', 'open_port', 'phash', 'phash2', - 'pid_to_list', 'port_close', 'port_command', 'port_connect', - 'port_control', 'port_call', 'port_info', 'port_to_list', - 'process_display', 'process_flag', 'process_info', 'purge_module', - 'put', 'read_timer', 'ref_to_list', 'register', 'resume_process', - 'round', 'send', 'send_after', 'send_nosuspend', 'set_cookie', - 'setelement', 'size', 'spawn', 'spawn_link', 'spawn_monitor', - 'spawn_opt', 'split_binary', 'start_timer', 'statistics', - 'suspend_process', 'system_flag', 'system_info', 'system_monitor', - 'system_profile', 'term_to_binary', 'tl', 'trace', 'trace_delivered', - 'trace_info', 'trace_pattern', 'trunc', 'tuple_size', 'tuple_to_list', - 'universaltime_to_localtime', 'unlink', 'unregister', 'whereis' - ) - - operators = r'(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)' - word_operators = ( - 'and', 'andalso', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor', - 'div', 'not', 'or', 'orelse', 'rem', 'xor' - ) - - atom_re = r"(?:[a-z]\w*|'[^\n']*[^\\]')" - - variable_re = r'(?:[A-Z_]\w*)' - - escape_re = r'(?:\\(?:[bdefnrstv\'"\\/]|[0-7][0-7]?[0-7]?|\^[a-zA-Z]))' - - macro_re = r'(?:'+variable_re+r'|'+atom_re+r')' - - base_re = r'(?:[2-9]|[12][0-9]|3[0-6])' - - tokens = { - 'root': [ - (r'\s+', Text), - (r'%.*\n', Comment), - (words(keywords, suffix=r'\b'), Keyword), - (words(builtins, suffix=r'\b'), Name.Builtin), - (words(word_operators, suffix=r'\b'), Operator.Word), - (r'^-', Punctuation, 'directive'), - (operators, Operator), - (r'"', String, 'string'), - (r'<<', Name.Label), - (r'>>', Name.Label), - ('(' + atom_re + ')(:)', bygroups(Name.Namespace, Punctuation)), - ('(?:^|(?<=:))(' + atom_re + r')(\s*)(\()', - bygroups(Name.Function, Text, Punctuation)), - (r'[+-]?' + base_re + r'#[0-9a-zA-Z]+', Number.Integer), - (r'[+-]?\d+', Number.Integer), - (r'[+-]?\d+.\d+', Number.Float), - (r'[]\[:_@\".{}()|;,]', Punctuation), - (variable_re, Name.Variable), - (atom_re, Name), - (r'\?'+macro_re, Name.Constant), - (r'\$(?:'+escape_re+r'|\\[ %]|[^\\])', String.Char), - (r'#'+atom_re+r'(:?\.'+atom_re+r')?', Name.Label), - ], - 'string': [ - (escape_re, String.Escape), - (r'"', String, '#pop'), - (r'~[0-9.*]*[~#+bBcdefginpPswWxX]', String.Interpol), - (r'[^"\\~]+', String), - (r'~', String), - ], - 'directive': [ - (r'(define)(\s*)(\()('+macro_re+r')', - bygroups(Name.Entity, Text, Punctuation, Name.Constant), '#pop'), - (r'(record)(\s*)(\()('+macro_re+r')', - bygroups(Name.Entity, Text, Punctuation, Name.Label), '#pop'), - (atom_re, Name.Entity, '#pop'), - ], - } - - -class ErlangShellLexer(Lexer): - """ - Shell sessions in erl (for Erlang code). - - .. versionadded:: 1.1 - """ - name = 'Erlang erl session' - aliases = ['erl'] - filenames = ['*.erl-sh'] - mimetypes = ['text/x-erl-shellsession'] - - _prompt_re = re.compile(r'\d+>(?=\s|\Z)') - - def get_tokens_unprocessed(self, text): - erlexer = ErlangLexer(**self.options) - - curcode = '' - insertions = [] - for match in line_re.finditer(text): - line = match.group() - m = self._prompt_re.match(line) - if m is not None: - end = m.end() - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:end])])) - curcode += line[end:] - else: - if curcode: - for item in do_insertions(insertions, - erlexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - if line.startswith('*'): - yield match.start(), Generic.Traceback, line - else: - yield match.start(), Generic.Output, line - if curcode: - for item in do_insertions(insertions, - erlexer.get_tokens_unprocessed(curcode)): - yield item - - -def gen_elixir_string_rules(name, symbol, token): - states = {} - states['string_' + name] = [ - (r'[^#%s\\]+' % (symbol,), token), - include('escapes'), - (r'\\.', token), - (r'(%s)' % (symbol,), bygroups(token), "#pop"), - include('interpol') - ] - return states - - -def gen_elixir_sigstr_rules(term, token, interpol=True): - if interpol: - return [ - (r'[^#%s\\]+' % (term,), token), - include('escapes'), - (r'\\.', token), - (r'%s[a-zA-Z]*' % (term,), token, '#pop'), - include('interpol') - ] - else: - return [ - (r'[^%s\\]+' % (term,), token), - (r'\\.', token), - (r'%s[a-zA-Z]*' % (term,), token, '#pop'), - ] - - -class ElixirLexer(RegexLexer): - """ - For the `Elixir language `_. - - .. versionadded:: 1.5 - """ - - name = 'Elixir' - aliases = ['elixir', 'ex', 'exs'] - filenames = ['*.ex', '*.exs'] - mimetypes = ['text/x-elixir'] - - KEYWORD = ('fn', 'do', 'end', 'after', 'else', 'rescue', 'catch') - KEYWORD_OPERATOR = ('not', 'and', 'or', 'when', 'in') - BUILTIN = ( - 'case', 'cond', 'for', 'if', 'unless', 'try', 'receive', 'raise', - 'quote', 'unquote', 'unquote_splicing', 'throw', 'super' - ) - BUILTIN_DECLARATION = ( - 'def', 'defp', 'defmodule', 'defprotocol', 'defmacro', 'defmacrop', - 'defdelegate', 'defexception', 'defstruct', 'defimpl', 'defcallback' - ) - - BUILTIN_NAMESPACE = ('import', 'require', 'use', 'alias') - CONSTANT = ('nil', 'true', 'false') - - PSEUDO_VAR = ('_', '__MODULE__', '__DIR__', '__ENV__', '__CALLER__') - - OPERATORS3 = ( - '<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==', - '~>>', '<~>', '|~>', '<|>', - ) - OPERATORS2 = ( - '==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~', - '->', '<-', '|', '.', '=', '~>', '<~', - ) - OPERATORS1 = ('<', '>', '+', '-', '*', '/', '!', '^', '&') - - PUNCTUATION = ( - '\\\\', '<<', '>>', '=>', '(', ')', ':', ';', ',', '[', ']' - ) - - def get_tokens_unprocessed(self, text): - for index, token, value in RegexLexer.get_tokens_unprocessed(self, text): - if token is Name: - if value in self.KEYWORD: - yield index, Keyword, value - elif value in self.KEYWORD_OPERATOR: - yield index, Operator.Word, value - elif value in self.BUILTIN: - yield index, Keyword, value - elif value in self.BUILTIN_DECLARATION: - yield index, Keyword.Declaration, value - elif value in self.BUILTIN_NAMESPACE: - yield index, Keyword.Namespace, value - elif value in self.CONSTANT: - yield index, Name.Constant, value - elif value in self.PSEUDO_VAR: - yield index, Name.Builtin.Pseudo, value - else: - yield index, token, value - else: - yield index, token, value - - def gen_elixir_sigil_rules(): - # all valid sigil terminators (excluding heredocs) - terminators = [ - (r'\{', r'\}', 'cb'), - (r'\[', r'\]', 'sb'), - (r'\(', r'\)', 'pa'), - (r'<', r'>', 'ab'), - (r'/', r'/', 'slas'), - (r'\|', r'\|', 'pipe'), - ('"', '"', 'quot'), - ("'", "'", 'apos'), - ] - - # heredocs have slightly different rules - triquotes = [(r'"""', 'triquot'), (r"'''", 'triapos')] - - token = String.Other - states = {'sigils': []} - - for term, name in triquotes: - states['sigils'] += [ - (r'(~[a-z])(%s)' % (term,), bygroups(token, String.Heredoc), - (name + '-end', name + '-intp')), - (r'(~[A-Z])(%s)' % (term,), bygroups(token, String.Heredoc), - (name + '-end', name + '-no-intp')), - ] - - states[name + '-end'] = [ - (r'[a-zA-Z]+', token, '#pop'), - default('#pop'), - ] - states[name + '-intp'] = [ - (r'^\s*' + term, String.Heredoc, '#pop'), - include('heredoc_interpol'), - ] - states[name + '-no-intp'] = [ - (r'^\s*' + term, String.Heredoc, '#pop'), - include('heredoc_no_interpol'), - ] - - for lterm, rterm, name in terminators: - states['sigils'] += [ - (r'~[a-z]' + lterm, token, name + '-intp'), - (r'~[A-Z]' + lterm, token, name + '-no-intp'), - ] - states[name + '-intp'] = gen_elixir_sigstr_rules(rterm, token) - states[name + '-no-intp'] = \ - gen_elixir_sigstr_rules(rterm, token, interpol=False) - - return states - - op3_re = "|".join(re.escape(s) for s in OPERATORS3) - op2_re = "|".join(re.escape(s) for s in OPERATORS2) - op1_re = "|".join(re.escape(s) for s in OPERATORS1) - ops_re = r'(?:%s|%s|%s)' % (op3_re, op2_re, op1_re) - punctuation_re = "|".join(re.escape(s) for s in PUNCTUATION) - alnum = '\w' - name_re = r'(?:\.\.\.|[a-z_]%s*[!?]?)' % alnum - modname_re = r'[A-Z]%(alnum)s*(?:\.[A-Z]%(alnum)s*)*' % {'alnum': alnum} - complex_name_re = r'(?:%s|%s|%s)' % (name_re, modname_re, ops_re) - special_atom_re = r'(?:\.\.\.|<<>>|%\{\}|%|\{\})' - - long_hex_char_re = r'(\\x\{)([\da-fA-F]+)(\})' - hex_char_re = r'(\\x[\da-fA-F]{1,2})' - escape_char_re = r'(\\[abdefnrstv])' - - tokens = { - 'root': [ - (r'\s+', Text), - (r'#.*$', Comment.Single), - - # Various kinds of characters - (r'(\?)' + long_hex_char_re, - bygroups(String.Char, - String.Escape, Number.Hex, String.Escape)), - (r'(\?)' + hex_char_re, - bygroups(String.Char, String.Escape)), - (r'(\?)' + escape_char_re, - bygroups(String.Char, String.Escape)), - (r'\?\\?.', String.Char), - - # '::' has to go before atoms - (r':::', String.Symbol), - (r'::', Operator), - - # atoms - (r':' + special_atom_re, String.Symbol), - (r':' + complex_name_re, String.Symbol), - (r':"', String.Symbol, 'string_double_atom'), - (r":'", String.Symbol, 'string_single_atom'), - - # [keywords: ...] - (r'(%s|%s)(:)(?=\s|\n)' % (special_atom_re, complex_name_re), - bygroups(String.Symbol, Punctuation)), - - # @attributes - (r'@' + name_re, Name.Attribute), - - # identifiers - (name_re, Name), - (r'(%%?)(%s)' % (modname_re,), bygroups(Punctuation, Name.Class)), - - # operators and punctuation - (op3_re, Operator), - (op2_re, Operator), - (punctuation_re, Punctuation), - (r'&\d', Name.Entity), # anon func arguments - (op1_re, Operator), - - # numbers - (r'0b[01]+', Number.Bin), - (r'0o[0-7]+', Number.Oct), - (r'0x[\da-fA-F]+', Number.Hex), - (r'\d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?', Number.Float), - (r'\d(_?\d)*', Number.Integer), - - # strings and heredocs - (r'"""\s*', String.Heredoc, 'heredoc_double'), - (r"'''\s*$", String.Heredoc, 'heredoc_single'), - (r'"', String.Double, 'string_double'), - (r"'", String.Single, 'string_single'), - - include('sigils'), - - (r'%\{', Punctuation, 'map_key'), - (r'\{', Punctuation, 'tuple'), - ], - 'heredoc_double': [ - (r'^\s*"""', String.Heredoc, '#pop'), - include('heredoc_interpol'), - ], - 'heredoc_single': [ - (r"^\s*'''", String.Heredoc, '#pop'), - include('heredoc_interpol'), - ], - 'heredoc_interpol': [ - (r'[^#\\\n]+', String.Heredoc), - include('escapes'), - (r'\\.', String.Heredoc), - (r'\n+', String.Heredoc), - include('interpol'), - ], - 'heredoc_no_interpol': [ - (r'[^\\\n]+', String.Heredoc), - (r'\\.', String.Heredoc), - (r'\n+', String.Heredoc), - ], - 'escapes': [ - (long_hex_char_re, - bygroups(String.Escape, Number.Hex, String.Escape)), - (hex_char_re, String.Escape), - (escape_char_re, String.Escape), - ], - 'interpol': [ - (r'#\{', String.Interpol, 'interpol_string'), - ], - 'interpol_string': [ - (r'\}', String.Interpol, "#pop"), - include('root') - ], - 'map_key': [ - include('root'), - (r':', Punctuation, 'map_val'), - (r'=>', Punctuation, 'map_val'), - (r'\}', Punctuation, '#pop'), - ], - 'map_val': [ - include('root'), - (r',', Punctuation, '#pop'), - (r'(?=\})', Punctuation, '#pop'), - ], - 'tuple': [ - include('root'), - (r'\}', Punctuation, '#pop'), - ], - } - tokens.update(gen_elixir_string_rules('double', '"', String.Double)) - tokens.update(gen_elixir_string_rules('single', "'", String.Single)) - tokens.update(gen_elixir_string_rules('double_atom', '"', String.Symbol)) - tokens.update(gen_elixir_string_rules('single_atom', "'", String.Symbol)) - tokens.update(gen_elixir_sigil_rules()) - - -class ElixirConsoleLexer(Lexer): - """ - For Elixir interactive console (iex) output like: - - .. sourcecode:: iex - - iex> [head | tail] = [1,2,3] - [1,2,3] - iex> head - 1 - iex> tail - [2,3] - iex> [head | tail] - [1,2,3] - iex> length [head | tail] - 3 - - .. versionadded:: 1.5 - """ - - name = 'Elixir iex session' - aliases = ['iex'] - mimetypes = ['text/x-elixir-shellsession'] - - _prompt_re = re.compile('(iex|\.{3})(\(\d+\))?> ') - - def get_tokens_unprocessed(self, text): - exlexer = ElixirLexer(**self.options) - - curcode = '' - in_error = False - insertions = [] - for match in line_re.finditer(text): - line = match.group() - if line.startswith(u'** '): - in_error = True - insertions.append((len(curcode), - [(0, Generic.Error, line[:-1])])) - curcode += line[-1:] - else: - m = self._prompt_re.match(line) - if m is not None: - in_error = False - end = m.end() - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:end])])) - curcode += line[end:] - else: - if curcode: - for item in do_insertions( - insertions, exlexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - token = Generic.Error if in_error else Generic.Output - yield match.start(), token, line - if curcode: - for item in do_insertions( - insertions, exlexer.get_tokens_unprocessed(curcode)): - yield item diff --git a/wakatime/packages/py3/pygments/lexers/esoteric.py b/wakatime/packages/py3/pygments/lexers/esoteric.py deleted file mode 100644 index 7a026ae..0000000 --- a/wakatime/packages/py3/pygments/lexers/esoteric.py +++ /dev/null @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.esoteric - ~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for esoteric languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer, include -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error - -__all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer'] - - -class BrainfuckLexer(RegexLexer): - """ - Lexer for the esoteric `BrainFuck `_ - language. - """ - - name = 'Brainfuck' - aliases = ['brainfuck', 'bf'] - filenames = ['*.bf', '*.b'] - mimetypes = ['application/x-brainfuck'] - - tokens = { - 'common': [ - # use different colors for different instruction types - (r'[.,]+', Name.Tag), - (r'[+-]+', Name.Builtin), - (r'[<>]+', Name.Variable), - (r'[^.,+\-<>\[\]]+', Comment), - ], - 'root': [ - (r'\[', Keyword, 'loop'), - (r'\]', Error), - include('common'), - ], - 'loop': [ - (r'\[', Keyword, '#push'), - (r'\]', Keyword, '#pop'), - include('common'), - ] - } - - -class BefungeLexer(RegexLexer): - """ - Lexer for the esoteric `Befunge `_ - language. - - .. versionadded:: 0.7 - """ - name = 'Befunge' - aliases = ['befunge'] - filenames = ['*.befunge'] - mimetypes = ['application/x-befunge'] - - tokens = { - 'root': [ - (r'[0-9a-f]', Number), - (r'[+*/%!`-]', Operator), # Traditional math - (r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives - (r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives - (r'[|_mw]', Keyword), - (r'[{}]', Name.Tag), # Befunge-98 stack ops - (r'".*?"', String.Double), # Strings don't appear to allow escapes - (r'\'.', String.Single), # Single character - (r'[#;]', Comment), # Trampoline... depends on direction hit - (r'[pg&~=@iotsy]', Keyword), # Misc - (r'[()A-Z]', Comment), # Fingerprints - (r'\s+', Text), # Whitespace doesn't matter - ], - } - - -class RedcodeLexer(RegexLexer): - """ - A simple Redcode lexer based on ICWS'94. - Contributed by Adam Blinkinsop . - - .. versionadded:: 0.8 - """ - name = 'Redcode' - aliases = ['redcode'] - filenames = ['*.cw'] - - opcodes = ('DAT', 'MOV', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', - 'JMP', 'JMZ', 'JMN', 'DJN', 'CMP', 'SLT', 'SPL', - 'ORG', 'EQU', 'END') - modifiers = ('A', 'B', 'AB', 'BA', 'F', 'X', 'I') - - tokens = { - 'root': [ - # Whitespace: - (r'\s+', Text), - (r';.*$', Comment.Single), - # Lexemes: - # Identifiers - (r'\b(%s)\b' % '|'.join(opcodes), Name.Function), - (r'\b(%s)\b' % '|'.join(modifiers), Name.Decorator), - (r'[A-Za-z_]\w+', Name), - # Operators - (r'[-+*/%]', Operator), - (r'[#$@<>]', Operator), # mode - (r'[.,]', Punctuation), # mode - # Numbers - (r'[-+]?\d+', Number.Integer), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/fortran.py b/wakatime/packages/py3/pygments/lexers/fortran.py deleted file mode 100644 index 3ef6ff4..0000000 --- a/wakatime/packages/py3/pygments/lexers/fortran.py +++ /dev/null @@ -1,161 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.fortran - ~~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Fortran languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation - -__all__ = ['FortranLexer'] - - -class FortranLexer(RegexLexer): - """ - Lexer for FORTRAN 90 code. - - .. versionadded:: 0.10 - """ - name = 'Fortran' - aliases = ['fortran'] - filenames = ['*.f', '*.f90', '*.F', '*.F90'] - mimetypes = ['text/x-fortran'] - flags = re.IGNORECASE | re.MULTILINE - - # Data Types: INTEGER, REAL, COMPLEX, LOGICAL, CHARACTER and DOUBLE PRECISION - # Operators: **, *, +, -, /, <, >, <=, >=, ==, /= - # Logical (?): NOT, AND, OR, EQV, NEQV - - # Builtins: - # http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Table-of-Intrinsic-Functions.html - - tokens = { - 'root': [ - (r'^#.*\n', Comment.Preproc), - (r'!.*\n', Comment), - include('strings'), - include('core'), - (r'[a-z][\w$]*', Name), - include('nums'), - (r'[\s]+', Text), - ], - 'core': [ - # Statements - (words(( - 'ABSTRACT', 'ACCEPT', 'ALL', 'ALLSTOP', 'ALLOCATABLE', 'ALLOCATE', - 'ARRAY', 'ASSIGN', 'ASSOCIATE', 'ASYNCHRONOUS', 'BACKSPACE', 'BIND', - 'BLOCK', 'BLOCKDATA', 'BYTE', 'CALL', 'CASE', 'CLASS', 'CLOSE', - 'CODIMENSION', 'COMMON', 'CONCURRRENT', 'CONTIGUOUS', 'CONTAINS', - 'CONTINUE', 'CRITICAL', 'CYCLE', 'DATA', 'DEALLOCATE', 'DECODE', - 'DEFERRED', 'DIMENSION', 'DO', 'ELEMENTAL', 'ELSE', 'ENCODE', 'END', - 'ENTRY', 'ENUM', 'ENUMERATOR', 'EQUIVALENCE', 'EXIT', 'EXTENDS', - 'EXTERNAL', 'EXTRINSIC', 'FILE', 'FINAL', 'FORALL', 'FORMAT', - 'FUNCTION', 'GENERIC', 'GOTO', 'IF', 'IMAGES', 'IMPLICIT', - 'IMPORT', 'IMPURE', 'INCLUDE', 'INQUIRE', 'INTENT', 'INTERFACE', - 'INTRINSIC', 'IS', 'LOCK', 'MEMORY', 'MODULE', 'NAMELIST', 'NULLIFY', - 'NONE', 'NON_INTRINSIC', 'NON_OVERRIDABLE', 'NOPASS', 'OPEN', 'OPTIONAL', - 'OPTIONS', 'PARAMETER', 'PASS', 'PAUSE', 'POINTER', 'PRINT', 'PRIVATE', - 'PROGRAM', 'PROCEDURE', 'PROTECTED', 'PUBLIC', 'PURE', 'READ', - 'RECURSIVE', 'RESULT', 'RETURN', 'REWIND', 'SAVE', 'SELECT', 'SEQUENCE', - 'STOP', 'SUBMODULE', 'SUBROUTINE', 'SYNC', 'SYNCALL', 'SYNCIMAGES', - 'SYNCMEMORY', 'TARGET', 'THEN', 'TYPE', 'UNLOCK', 'USE', 'VALUE', - 'VOLATILE', 'WHERE', 'WRITE', 'WHILE'), prefix=r'\b', suffix=r'\s*\b'), - Keyword), - - # Data Types - (words(( - 'CHARACTER', 'COMPLEX', 'DOUBLE PRECISION', 'DOUBLE COMPLEX', 'INTEGER', - 'LOGICAL', 'REAL', 'C_INT', 'C_SHORT', 'C_LONG', 'C_LONG_LONG', 'C_SIGNED_CHAR', - 'C_SIZE_T', 'C_INT8_T', 'C_INT16_T', 'C_INT32_T', 'C_INT64_T', 'C_INT_LEAST8_T', - 'C_INT_LEAST16_T', 'C_INT_LEAST32_T', 'C_INT_LEAST64_T', 'C_INT_FAST8_T', - 'C_INT_FAST16_T', 'C_INT_FAST32_T', 'C_INT_FAST64_T', 'C_INTMAX_T', - 'C_INTPTR_T', 'C_FLOAT', 'C_DOUBLE', 'C_LONG_DOUBLE', 'C_FLOAT_COMPLEX', - 'C_DOUBLE_COMPLEX', 'C_LONG_DOUBLE_COMPLEX', 'C_BOOL', 'C_CHAR', 'C_PTR', - 'C_FUNPTR'), prefix=r'\b', suffix=r'\s*\b'), - Keyword.Type), - - # Operators - (r'(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)', Operator), - - (r'(::)', Keyword.Declaration), - - (r'[()\[\],:&%;.]', Punctuation), - # Intrinsics - (words(( - 'Abort', 'Abs', 'Access', 'AChar', 'ACos', 'ACosH', 'AdjustL', - 'AdjustR', 'AImag', 'AInt', 'Alarm', 'All', 'Allocated', 'ALog', - 'AMax', 'AMin', 'AMod', 'And', 'ANInt', 'Any', 'ASin', 'ASinH', - 'Associated', 'ATan', 'ATanH', 'Atomic_Define', 'Atomic_Ref', - 'BesJ', 'BesJN', 'Bessel_J0', 'Bessel_J1', 'Bessel_JN', 'Bessel_Y0', - 'Bessel_Y1', 'Bessel_YN', 'BesY', 'BesYN', 'BGE', 'BGT', 'BLE', - 'BLT', 'Bit_Size', 'BTest', 'CAbs', 'CCos', 'Ceiling', 'CExp', - 'Char', 'ChDir', 'ChMod', 'CLog', 'Cmplx', 'Command_Argument_Count', - 'Complex', 'Conjg', 'Cos', 'CosH', 'Count', 'CPU_Time', 'CShift', - 'CSin', 'CSqRt', 'CTime', 'C_Loc', 'C_Associated', - 'C_Null_Ptr', 'C_Null_Funptr', 'C_F_Pointer', 'C_F_ProcPointer', - 'C_Null_Char', 'C_Alert', 'C_Backspace', 'C_Form_Feed', 'C_FunLoc', - 'C_Sizeof', 'C_New_Line', 'C_Carriage_Return', - 'C_Horizontal_Tab', 'C_Vertical_Tab', 'DAbs', 'DACos', 'DASin', - 'DATan', 'Date_and_Time', 'DbesJ', 'DbesJN', 'DbesY', - 'DbesYN', 'Dble', 'DCos', 'DCosH', 'DDiM', 'DErF', - 'DErFC', 'DExp', 'Digits', 'DiM', 'DInt', 'DLog', 'DMax', - 'DMin', 'DMod', 'DNInt', 'Dot_Product', 'DProd', 'DSign', 'DSinH', - 'DShiftL', 'DShiftR', 'DSin', 'DSqRt', 'DTanH', 'DTan', 'DTime', - 'EOShift', 'Epsilon', 'ErF', 'ErFC', 'ErFC_Scaled', 'ETime', - 'Execute_Command_Line', 'Exit', 'Exp', 'Exponent', 'Extends_Type_Of', - 'FDate', 'FGet', 'FGetC', 'FindLoc', 'Float', 'Floor', 'Flush', - 'FNum', 'FPutC', 'FPut', 'Fraction', 'FSeek', 'FStat', 'FTell', - 'Gamma', 'GError', 'GetArg', 'Get_Command', 'Get_Command_Argument', - 'Get_Environment_Variable', 'GetCWD', 'GetEnv', 'GetGId', 'GetLog', - 'GetPId', 'GetUId', 'GMTime', 'HostNm', 'Huge', 'Hypot', 'IAbs', - 'IAChar', 'IAll', 'IAnd', 'IAny', 'IArgC', 'IBClr', 'IBits', - 'IBSet', 'IChar', 'IDate', 'IDiM', 'IDInt', 'IDNInt', 'IEOr', - 'IErrNo', 'IFix', 'Imag', 'ImagPart', 'Image_Index', 'Index', - 'Int', 'IOr', 'IParity', 'IRand', 'IsaTty', 'IShft', 'IShftC', - 'ISign', 'Iso_C_Binding', 'Is_Contiguous', 'Is_Iostat_End', - 'Is_Iostat_Eor', 'ITime', 'Kill', 'Kind', 'LBound', 'LCoBound', - 'Len', 'Len_Trim', 'LGe', 'LGt', 'Link', 'LLe', 'LLt', 'LnBlnk', - 'Loc', 'Log', 'Log_Gamma', 'Logical', 'Long', 'LShift', 'LStat', - 'LTime', 'MaskL', 'MaskR', 'MatMul', 'Max', 'MaxExponent', - 'MaxLoc', 'MaxVal', 'MClock', 'Merge', 'Merge_Bits', 'Move_Alloc', - 'Min', 'MinExponent', 'MinLoc', 'MinVal', 'Mod', 'Modulo', 'MvBits', - 'Nearest', 'New_Line', 'NInt', 'Norm2', 'Not', 'Null', 'Num_Images', - 'Or', 'Pack', 'Parity', 'PError', 'Precision', 'Present', 'Product', - 'Radix', 'Rand', 'Random_Number', 'Random_Seed', 'Range', 'Real', - 'RealPart', 'Rename', 'Repeat', 'Reshape', 'RRSpacing', 'RShift', - 'Same_Type_As', 'Scale', 'Scan', 'Second', 'Selected_Char_Kind', - 'Selected_Int_Kind', 'Selected_Real_Kind', 'Set_Exponent', 'Shape', - 'ShiftA', 'ShiftL', 'ShiftR', 'Short', 'Sign', 'Signal', 'SinH', - 'Sin', 'Sleep', 'Sngl', 'Spacing', 'Spread', 'SqRt', 'SRand', - 'Stat', 'Storage_Size', 'Sum', 'SymLnk', 'System', 'System_Clock', - 'Tan', 'TanH', 'Time', 'This_Image', 'Tiny', 'TrailZ', 'Transfer', - 'Transpose', 'Trim', 'TtyNam', 'UBound', 'UCoBound', 'UMask', - 'Unlink', 'Unpack', 'Verify', 'XOr', 'ZAbs', 'ZCos', 'ZExp', - 'ZLog', 'ZSin', 'ZSqRt'), prefix=r'\b', suffix=r'\s*\b'), - Name.Builtin), - - # Booleans - (r'\.(true|false)\.', Name.Builtin), - # Comparing Operators - (r'\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.', Operator.Word), - ], - - 'strings': [ - (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), - (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), - ], - - 'nums': [ - (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer), - (r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), - (r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/foxpro.py b/wakatime/packages/py3/pygments/lexers/foxpro.py deleted file mode 100644 index 99a65ce..0000000 --- a/wakatime/packages/py3/pygments/lexers/foxpro.py +++ /dev/null @@ -1,428 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.foxpro - ~~~~~~~~~~~~~~~~~~~~~~ - - Simple lexer for Microsoft Visual FoxPro source code. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer -from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \ - Name, String - -__all__ = ['FoxProLexer'] - - -class FoxProLexer(RegexLexer): - """Lexer for Microsoft Visual FoxPro language. - - FoxPro syntax allows to shorten all keywords and function names - to 4 characters. Shortened forms are not recognized by this lexer. - - .. versionadded:: 1.6 - """ - - name = 'FoxPro' - aliases = ['foxpro', 'vfp', 'clipper', 'xbase'] - filenames = ['*.PRG', '*.prg'] - mimetype = [] - - flags = re.IGNORECASE | re.MULTILINE - - tokens = { - 'root': [ - (r';\s*\n', Punctuation), # consume newline - (r'(^|\n)\s*', Text, 'newline'), - - # Square brackets may be used for array indices - # and for string literal. Look for arrays - # before matching string literals. - (r'(?<=\w)\[[0-9, ]+\]', Text), - (r'\'[^\'\n]*\'|"[^"\n]*"|\[[^]*]\]', String), - (r'(^\s*\*|&&|&&).*?\n', Comment.Single), - - (r'(ABS|ACLASS|ACOPY|ACOS|ADATABASES|ADBOBJECTS|ADDBS|' - r'ADDPROPERTY|ADEL|ADIR|ADLLS|ADOCKSTATE|AELEMENT|AERROR|' - r'AEVENTS|AFIELDS|AFONT|AGETCLASS|AGETFILEVERSION|AINS|' - r'AINSTANCE|ALANGUAGE|ALEN|ALIAS|ALINES|ALLTRIM|' - r'AMEMBERS|AMOUSEOBJ|ANETRESOURCES|APRINTERS|APROCINFO|' - r'ASC|ASCAN|ASELOBJ|ASESSIONS|ASIN|ASORT|ASQLHANDLES|' - r'ASTACKINFO|ASUBSCRIPT|AT|AT_C|ATAGINFO|ATAN|ATC|ATCC|' - r'ATCLINE|ATLINE|ATN2|AUSED|AVCXCLASSES|BAR|BARCOUNT|' - r'BARPROMPT|BETWEEN|BINDEVENT|BINTOC|BITAND|BITCLEAR|' - r'BITLSHIFT|BITNOT|BITOR|BITRSHIFT|BITSET|BITTEST|BITXOR|' - r'BOF|CANDIDATE|CAPSLOCK|CAST|CDOW|CDX|CEILING|CHR|CHRSAW|' - r'CHRTRAN|CHRTRANC|CLEARRESULTSET|CMONTH|CNTBAR|CNTPAD|COL|' - r'COM|Functions|COMARRAY|COMCLASSINFO|COMPOBJ|COMPROP|' - r'COMRETURNERROR|COS|CPCONVERT|CPCURRENT|CPDBF|CREATEBINARY|' - r'CREATEOBJECT|CREATEOBJECTEX|CREATEOFFLINE|CTOBIN|CTOD|' - r'CTOT|CURDIR|CURSORGETPROP|CURSORSETPROP|CURSORTOXML|' - r'CURVAL|DATE|DATETIME|DAY|DBC|DBF|DBGETPROP|DBSETPROP|' - r'DBUSED|DDEAbortTrans|DDEAdvise|DDEEnabled|DDEExecute|' - r'DDEInitiate|DDELastError|DDEPoke|DDERequest|DDESetOption|' - r'DDESetService|DDESetTopic|DDETerminate|DEFAULTEXT|' - r'DELETED|DESCENDING|DIFFERENCE|DIRECTORY|DISKSPACE|' - r'DisplayPath|DMY|DODEFAULT|DOW|DRIVETYPE|DROPOFFLINE|' - r'DTOC|DTOR|DTOS|DTOT|EDITSOURCE|EMPTY|EOF|ERROR|EVAL(UATE)?|' - r'EVENTHANDLER|EVL|EXECSCRIPT|EXP|FCHSIZE|FCLOSE|FCOUNT|' - r'FCREATE|FDATE|FEOF|FERROR|FFLUSH|FGETS|FIELD|FILE|' - r'FILETOSTR|FILTER|FKLABEL|FKMAX|FLDLIST|FLOCK|FLOOR|' - r'FONTMETRIC|FOPEN|FOR|FORCEEXT|FORCEPATH|FOUND|FPUTS|' - r'FREAD|FSEEK|FSIZE|FTIME|FULLPATH|FV|FWRITE|' - r'GETAUTOINCVALUE|GETBAR|GETCOLOR|GETCP|GETDIR|GETENV|' - r'GETFILE|GETFLDSTATE|GETFONT|GETINTERFACE|' - r'GETNEXTMODIFIED|GETOBJECT|GETPAD|GETPEM|GETPICT|' - r'GETPRINTER|GETRESULTSET|GETWORDCOUNT|GETWORDNUM|' - r'GETCURSORADAPTER|GOMONTH|HEADER|HOME|HOUR|ICASE|' - r'IDXCOLLATE|IIF|IMESTATUS|INDBC|INDEXSEEK|INKEY|INLIST|' - r'INPUTBOX|INSMODE|INT|ISALPHA|ISBLANK|ISCOLOR|ISDIGIT|' - r'ISEXCLUSIVE|ISFLOCKED|ISLEADBYTE|ISLOWER|ISMEMOFETCHED|' - r'ISMOUSE|ISNULL|ISPEN|ISREADONLY|ISRLOCKED|' - r'ISTRANSACTABLE|ISUPPER|JUSTDRIVE|JUSTEXT|JUSTFNAME|' - r'JUSTPATH|JUSTSTEM|KEY|KEYMATCH|LASTKEY|LEFT|LEFTC|LEN|' - r'LENC|LIKE|LIKEC|LINENO|LOADPICTURE|LOCFILE|LOCK|LOG|' - r'LOG10|LOOKUP|LOWER|LTRIM|LUPDATE|MAKETRANSACTABLE|MAX|' - r'MCOL|MDOWN|MDX|MDY|MEMLINES|MEMORY|MENU|MESSAGE|' - r'MESSAGEBOX|MIN|MINUTE|MLINE|MOD|MONTH|MRKBAR|MRKPAD|' - r'MROW|MTON|MWINDOW|NDX|NEWOBJECT|NORMALIZE|NTOM|NUMLOCK|' - r'NVL|OBJNUM|OBJTOCLIENT|OBJVAR|OCCURS|OEMTOANSI|OLDVAL|' - r'ON|ORDER|OS|PAD|PADL|PARAMETERS|PAYMENT|PCOL|PCOUNT|' - r'PEMSTATUS|PI|POPUP|PRIMARY|PRINTSTATUS|PRMBAR|PRMPAD|' - r'PROGRAM|PROMPT|PROPER|PROW|PRTINFO|PUTFILE|PV|QUARTER|' - r'RAISEEVENT|RAND|RAT|RATC|RATLINE|RDLEVEL|READKEY|RECCOUNT|' - r'RECNO|RECSIZE|REFRESH|RELATION|REPLICATE|REQUERY|RGB|' - r'RGBSCHEME|RIGHT|RIGHTC|RLOCK|ROUND|ROW|RTOD|RTRIM|' - r'SAVEPICTURE|SCHEME|SCOLS|SEC|SECONDS|SEEK|SELECT|SET|' - r'SETFLDSTATE|SETRESULTSET|SIGN|SIN|SKPBAR|SKPPAD|SOUNDEX|' - r'SPACE|SQLCANCEL|SQLCOLUMNS|SQLCOMMIT|SQLCONNECT|' - r'SQLDISCONNECT|SQLEXEC|SQLGETPROP|SQLIDLEDISCONNECT|' - r'SQLMORERESULTS|SQLPREPARE|SQLROLLBACK|SQLSETPROP|' - r'SQLSTRINGCONNECT|SQLTABLES|SQRT|SROWS|STR|STRCONV|' - r'STREXTRACT|STRTOFILE|STRTRAN|STUFF|STUFFC|SUBSTR|' - r'SUBSTRC|SYS|SYSMETRIC|TABLEREVERT|TABLEUPDATE|TAG|' - r'TAGCOUNT|TAGNO|TAN|TARGET|TEXTMERGE|TIME|TRANSFORM|' - r'TRIM|TTOC|TTOD|TXNLEVEL|TXTWIDTH|TYPE|UNBINDEVENTS|' - r'UNIQUE|UPDATED|UPPER|USED|VAL|VARREAD|VARTYPE|VERSION|' - r'WBORDER|WCHILD|WCOLS|WDOCKABLE|WEEK|WEXIST|WFONT|WLAST|' - r'WLCOL|WLROW|WMAXIMUM|WMINIMUM|WONTOP|WOUTPUT|WPARENT|' - r'WREAD|WROWS|WTITLE|WVISIBLE|XMLTOCURSOR|XMLUPDATEGRAM|' - r'YEAR)(?=\s*\()', Name.Function), - - (r'_ALIGNMENT|_ASCIICOLS|_ASCIIROWS|_ASSIST|_BEAUTIFY|_BOX|' - r'_BROWSER|_BUILDER|_CALCMEM|_CALCVALUE|_CLIPTEXT|_CONVERTER|' - r'_COVERAGE|_CUROBJ|_DBLCLICK|_DIARYDATE|_DOS|_FOXDOC|_FOXREF|' - r'_GALLERY|_GENGRAPH|_GENHTML|_GENMENU|_GENPD|_GENSCRN|' - r'_GENXTAB|_GETEXPR|_INCLUDE|_INCSEEK|_INDENT|_LMARGIN|_MAC|' - r'_MENUDESIGNER|_MLINE|_PADVANCE|_PAGENO|_PAGETOTAL|_PBPAGE|' - r'_PCOLNO|_PCOPIES|_PDRIVER|_PDSETUP|_PECODE|_PEJECT|_PEPAGE|' - r'_PLENGTH|_PLINENO|_PLOFFSET|_PPITCH|_PQUALITY|_PRETEXT|' - r'_PSCODE|_PSPACING|_PWAIT|_RMARGIN|_REPORTBUILDER|' - r'_REPORTOUTPUT|_REPORTPREVIEW|_SAMPLES|_SCCTEXT|_SCREEN|' - r'_SHELL|_SPELLCHK|_STARTUP|_TABS|_TALLY|_TASKPANE|_TEXT|' - r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|' - r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo), - - (r'THISFORMSET|THISFORM|THIS', Name.Builtin), - - (r'Application|CheckBox|Collection|Column|ComboBox|' - r'CommandButton|CommandGroup|Container|Control|CursorAdapter|' - r'Cursor|Custom|DataEnvironment|DataObject|EditBox|' - r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|' - r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|' - r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|' - r'Project|Relation|ReportListener|Separator|Servers|Server|' - r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|' - r'XMLAdapter|XMLField|XMLTable', Name.Class), - - (r'm\.[a-z_]\w*', Name.Variable), - (r'\.(F|T|AND|OR|NOT|NULL)\.|\b(AND|OR|NOT|NULL)\b', Operator.Word), - - (r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|' - r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|' - r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|' - r'AllowCellSelection|AllowDelete|AllowHeaderSizing|' - r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|' - r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|' - r'AlwaysOnBottom|AlwaysOnTop|Anchor|Application|' - r'AutoActivate|AutoCenter|AutoCloseTables|AutoComplete|' - r'AutoCompSource|AutoCompTable|AutoHideScrollBar|' - r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|' - r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|' - r'BaseClass|BatchUpdateCount|BindControls|BorderColor|' - r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|' - r'BreakOnError|BufferModeOverride|BufferMode|' - r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|' - r'Centered|Century|ChildAlias|ChildOrder|ChildTable|' - r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|' - r'ColorScheme|ColorSource|ColumnCount|ColumnLines|' - r'ColumnOrder|Columns|ColumnWidths|CommandClauses|' - r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|' - r'ContinuousScroll|ControlBox|ControlCount|Controls|' - r'ControlSource|ConversionFunc|Count|CurrentControl|' - r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|' - r'CursorSchema|CursorSource|CursorStatus|Curvature|' - r'Database|DataSessionID|DataSession|DataSourceType|' - r'DataSource|DataType|DateFormat|DateMark|Debug|' - r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|' - r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|' - r'DeleteCmd|DeleteMark|Description|Desktop|' - r'Details|DisabledBackColor|DisabledForeColor|' - r'DisabledItemBackColor|DisabledItemForeColor|' - r'DisabledPicture|DisableEncode|DisplayCount|' - r'DisplayValue|Dockable|Docked|DockPosition|' - r'DocumentFile|DownPicture|DragIcon|DragMode|DrawMode|' - r'DrawStyle|DrawWidth|DynamicAlignment|DynamicBackColor|' - r'DynamicForeColor|DynamicCurrentControl|DynamicFontBold|' - r'DynamicFontItalic|DynamicFontStrikethru|' - r'DynamicFontUnderline|DynamicFontName|DynamicFontOutline|' - r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|' - r'DynamicLineHeight|EditorOptions|Enabled|' - r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|' - r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|' - r'FetchMemoDataSource|FetchMemo|FetchSize|' - r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|' - r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|' - r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|' - r'FontExtend|FontName|FontOutline|FontShadow|FontSize|' - r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|' - r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|' - r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|' - r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|' - r'HelpContextID|HideSelection|HighlightBackColor|' - r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|' - r'HighlightRow|Highlight|HomeDir|Hours|HostName|' - r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|' - r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|' - r'InsertCmdDataSource|InsertCmdRefreshCmd|' - r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|' - r'InsertCmd|Instancing|IntegralHeight|' - r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|' - r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|' - r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|' - r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|' - r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|' - r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|' - r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|' - r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|' - r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|' - r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|' - r'MemoWindow|Message|MinButton|MinHeight|MinWidth|' - r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|' - r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|' - r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|' - r'NumberOfElements|Object|OLEClass|OLEDragMode|' - r'OLEDragPicture|OLEDropEffects|OLEDropHasData|' - r'OLEDropMode|OLEDropTextInsertion|OLELCID|' - r'OLERequestPendingTimeout|OLEServerBusyRaiseError|' - r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|' - r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|' - r'OutputPageCount|OutputType|PageCount|PageHeight|' - r'PageNo|PageOrder|Pages|PageTotal|PageWidth|' - r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|' - r'Parent|Partition|PasswordChar|PictureMargin|' - r'PicturePosition|PictureSpacing|PictureSelectionDisplay|' - r'PictureVal|Picture|Prepared|' - r'PolyPoints|PreserveWhiteSpace|PreviewContainer|' - r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|' - r'ProjectHookLibrary|ProjectHook|QuietMode|' - r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|' - r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|' - r'RecordSource|RefreshAlias|' - r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|' - r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|' - r'RelativeColumn|RelativeRow|ReleaseType|Resizable|' - r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|' - r'Rotation|RowColChange|RowHeight|RowSourceType|' - r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|' - r'Seconds|SelectCmd|SelectedID|' - r'SelectedItemBackColor|SelectedItemForeColor|Selected|' - r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|' - r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|' - r'ServerClass|ServerHelpFile|ServerName|' - r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|' - r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|' - r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|' - r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|' - r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|' - r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|' - r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|' - r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|' - r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|' - r'UpdateCmdDataSourceType|UpdateCmdDataSource|' - r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|' - r'UpdateCmdRefreshKeyFieldList|UpdateCmd|' - r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|' - r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|' - r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|' - r'VersionCompany|VersionCopyright|VersionDescription|' - r'VersionNumber|VersionProduct|VersionTrademarks|Version|' - r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|' - r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|' - r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|' - r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|' - r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|' - r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|' - r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|' - r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|' - r'XSDtype|ZoomBox)', Name.Attribute), - - (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|' - r'AddProperty|AddTableSchema|AddToSCC|Add|' - r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|' - r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|' - r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|' - r'Close|Cls|CursorAttach|CursorDetach|CursorFill|' - r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|' - r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|' - r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|' - r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|' - r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|' - r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|' - r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|' - r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|' - r'RemoveItem|RemoveListItem|RemoveObject|Remove|' - r'Render|Requery|RequestData|ResetToDefault|Reset|Run|' - r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|' - r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|' - r'SupportsListenerType|TextHeight|TextWidth|ToCursor|' - r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|' - r'WriteExpression|WriteMethod|ZOrder)', Name.Function), - - (r'\.(Activate|AdjustObjectSize|AfterBand|AfterBuild|' - r'AfterCloseTables|AfterCursorAttach|AfterCursorClose|' - r'AfterCursorDetach|AfterCursorFill|AfterCursorRefresh|' - r'AfterCursorUpdate|AfterDelete|AfterInsert|' - r'AfterRecordRefresh|AfterUpdate|AfterDock|AfterReport|' - r'AfterRowColChange|BeforeBand|BeforeCursorAttach|' - r'BeforeCursorClose|BeforeCursorDetach|BeforeCursorFill|' - r'BeforeCursorRefresh|BeforeCursorUpdate|BeforeDelete|' - r'BeforeInsert|BeforeDock|BeforeOpenTables|' - r'BeforeRecordRefresh|BeforeReport|BeforeRowColChange|' - r'BeforeUpdate|Click|dbc_Activate|dbc_AfterAddTable|' - r'dbc_AfterAppendProc|dbc_AfterCloseTable|dbc_AfterCopyProc|' - r'dbc_AfterCreateConnection|dbc_AfterCreateOffline|' - r'dbc_AfterCreateTable|dbc_AfterCreateView|dbc_AfterDBGetProp|' - r'dbc_AfterDBSetProp|dbc_AfterDeleteConnection|' - r'dbc_AfterDropOffline|dbc_AfterDropTable|' - r'dbc_AfterModifyConnection|dbc_AfterModifyProc|' - r'dbc_AfterModifyTable|dbc_AfterModifyView|dbc_AfterOpenTable|' - r'dbc_AfterRemoveTable|dbc_AfterRenameConnection|' - r'dbc_AfterRenameTable|dbc_AfterRenameView|' - r'dbc_AfterValidateData|dbc_BeforeAddTable|' - r'dbc_BeforeAppendProc|dbc_BeforeCloseTable|' - r'dbc_BeforeCopyProc|dbc_BeforeCreateConnection|' - r'dbc_BeforeCreateOffline|dbc_BeforeCreateTable|' - r'dbc_BeforeCreateView|dbc_BeforeDBGetProp|' - r'dbc_BeforeDBSetProp|dbc_BeforeDeleteConnection|' - r'dbc_BeforeDropOffline|dbc_BeforeDropTable|' - r'dbc_BeforeModifyConnection|dbc_BeforeModifyProc|' - r'dbc_BeforeModifyTable|dbc_BeforeModifyView|' - r'dbc_BeforeOpenTable|dbc_BeforeRemoveTable|' - r'dbc_BeforeRenameConnection|dbc_BeforeRenameTable|' - r'dbc_BeforeRenameView|dbc_BeforeValidateData|' - r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|' - r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|' - r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|' - r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|' - r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|' - r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|' - r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|' - r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|' - r'QueryAddFile|QueryModifyFile|QueryNewFile|QueryRemoveFile|' - r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|' - r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|' - r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|' - r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function), - - (r'\s+', Text), - # everything else is not colored - (r'.', Text), - ], - 'newline': [ - (r'\*.*?$', Comment.Single, '#pop'), - (r'(ACCEPT|ACTIVATE\s*MENU|ACTIVATE\s*POPUP|ACTIVATE\s*SCREEN|' - r'ACTIVATE\s*WINDOW|APPEND|APPEND\s*FROM|APPEND\s*FROM\s*ARRAY|' - r'APPEND\s*GENERAL|APPEND\s*MEMO|ASSIST|AVERAGE|BLANK|BROWSE|' - r'BUILD\s*APP|BUILD\s*EXE|BUILD\s*PROJECT|CALCULATE|CALL|' - r'CANCEL|CHANGE|CLEAR|CLOSE|CLOSE\s*MEMO|COMPILE|CONTINUE|' - r'COPY\s*FILE|COPY\s*INDEXES|COPY\s*MEMO|COPY\s*STRUCTURE|' - r'COPY\s*STRUCTURE\s*EXTENDED|COPY\s*TAG|COPY\s*TO|' - r'COPY\s*TO\s*ARRAY|COUNT|CREATE|CREATE\s*COLOR\s*SET|' - r'CREATE\s*CURSOR|CREATE\s*FROM|CREATE\s*LABEL|CREATE\s*MENU|' - r'CREATE\s*PROJECT|CREATE\s*QUERY|CREATE\s*REPORT|' - r'CREATE\s*SCREEN|CREATE\s*TABLE|CREATE\s*VIEW|DDE|' - r'DEACTIVATE\s*MENU|DEACTIVATE\s*POPUP|DEACTIVATE\s*WINDOW|' - r'DECLARE|DEFINE\s*BAR|DEFINE\s*BOX|DEFINE\s*MENU|' - r'DEFINE\s*PAD|DEFINE\s*POPUP|DEFINE\s*WINDOW|DELETE|' - r'DELETE\s*FILE|DELETE\s*TAG|DIMENSION|DIRECTORY|DISPLAY|' - r'DISPLAY\s*FILES|DISPLAY\s*MEMORY|DISPLAY\s*STATUS|' - r'DISPLAY\s*STRUCTURE|DO|EDIT|EJECT|EJECT\s*PAGE|ERASE|' - r'EXIT|EXPORT|EXTERNAL|FILER|FIND|FLUSH|FUNCTION|GATHER|' - r'GETEXPR|GO|GOTO|HELP|HIDE\s*MENU|HIDE\s*POPUP|' - r'HIDE\s*WINDOW|IMPORT|INDEX|INPUT|INSERT|JOIN|KEYBOARD|' - r'LABEL|LIST|LOAD|LOCATE|LOOP|MENU|MENU\s*TO|MODIFY\s*COMMAND|' - r'MODIFY\s*FILE|MODIFY\s*GENERAL|MODIFY\s*LABEL|MODIFY\s*MEMO|' - r'MODIFY\s*MENU|MODIFY\s*PROJECT|MODIFY\s*QUERY|' - r'MODIFY\s*REPORT|MODIFY\s*SCREEN|MODIFY\s*STRUCTURE|' - r'MODIFY\s*WINDOW|MOVE\s*POPUP|MOVE\s*WINDOW|NOTE|' - r'ON\s*APLABOUT|ON\s*BAR|ON\s*ERROR|ON\s*ESCAPE|' - r'ON\s*EXIT\s*BAR|ON\s*EXIT\s*MENU|ON\s*EXIT\s*PAD|' - r'ON\s*EXIT\s*POPUP|ON\s*KEY|ON\s*KEY\s*=|ON\s*KEY\s*LABEL|' - r'ON\s*MACHELP|ON\s*PAD|ON\s*PAGE|ON\s*READERROR|' - r'ON\s*SELECTION\s*BAR|ON\s*SELECTION\s*MENU|' - r'ON\s*SELECTION\s*PAD|ON\s*SELECTION\s*POPUP|ON\s*SHUTDOWN|' - r'PACK|PARAMETERS|PLAY\s*MACRO|POP\s*KEY|POP\s*MENU|' - r'POP\s*POPUP|PRIVATE|PROCEDURE|PUBLIC|PUSH\s*KEY|' - r'PUSH\s*MENU|PUSH\s*POPUP|QUIT|READ|READ\s*MENU|RECALL|' - r'REINDEX|RELEASE|RELEASE\s*MODULE|RENAME|REPLACE|' - r'REPLACE\s*FROM\s*ARRAY|REPORT|RESTORE\s*FROM|' - r'RESTORE\s*MACROS|RESTORE\s*SCREEN|RESTORE\s*WINDOW|' - r'RESUME|RETRY|RETURN|RUN|RUN\s*\/N"|RUNSCRIPT|' - r'SAVE\s*MACROS|SAVE\s*SCREEN|SAVE\s*TO|SAVE\s*WINDOWS|' - r'SCATTER|SCROLL|SEEK|SELECT|SET|SET\s*ALTERNATE|' - r'SET\s*ANSI|SET\s*APLABOUT|SET\s*AUTOSAVE|SET\s*BELL|' - r'SET\s*BLINK|SET\s*BLOCKSIZE|SET\s*BORDER|SET\s*BRSTATUS|' - r'SET\s*CARRY|SET\s*CENTURY|SET\s*CLEAR|SET\s*CLOCK|' - r'SET\s*COLLATE|SET\s*COLOR\s*OF|SET\s*COLOR\s*OF\s*SCHEME|' - r'SET\s*COLOR\s*SET|SET\s*COLOR\s*TO|SET\s*COMPATIBLE|' - r'SET\s*CONFIRM|SET\s*CONSOLE|SET\s*CURRENCY|SET\s*CURSOR|' - r'SET\s*DATE|SET\s*DEBUG|SET\s*DECIMALS|SET\s*DEFAULT|' - r'SET\s*DELETED|SET\s*DELIMITERS|SET\s*DEVELOPMENT|' - r'SET\s*DEVICE|SET\s*DISPLAY|SET\s*DOHISTORY|SET\s*ECHO|' - r'SET\s*ESCAPE|SET\s*EXACT|SET\s*EXCLUSIVE|SET\s*FIELDS|' - r'SET\s*FILTER|SET\s*FIXED|SET\s*FORMAT|SET\s*FULLPATH|' - r'SET\s*FUNCTION|SET\s*HEADINGS|SET\s*HELP|SET\s*HELPFILTER|' - r'SET\s*HOURS|SET\s*INDEX|SET\s*INTENSITY|SET\s*KEY|' - r'SET\s*KEYCOMP|SET\s*LIBRARY|SET\s*LOCK|SET\s*LOGERRORS|' - r'SET\s*MACDESKTOP|SET\s*MACHELP|SET\s*MACKEY|SET\s*MARGIN|' - r'SET\s*MARK\s*OF|SET\s*MARK\s*TO|SET\s*MEMOWIDTH|' - r'SET\s*MESSAGE|SET\s*MOUSE|SET\s*MULTILOCKS|SET\s*NEAR|' - r'SET\s*NOCPTRANS|SET\s*NOTIFY|SET\s*ODOMETER|SET\s*OPTIMIZE|' - r'SET\s*ORDER|SET\s*PALETTE|SET\s*PATH|SET\s*PDSETUP|' - r'SET\s*POINT|SET\s*PRINTER|SET\s*PROCEDURE|SET\s*READBORDER|' - r'SET\s*REFRESH|SET\s*RELATION|SET\s*RELATION\s*OFF|' - r'SET\s*REPROCESS|SET\s*RESOURCE|SET\s*SAFETY|SET\s*SCOREBOARD|' - r'SET\s*SEPARATOR|SET\s*SHADOWS|SET\s*SKIP|SET\s*SKIP\s*OF|' - r'SET\s*SPACE|SET\s*STATUS|SET\s*STATUS\s*BAR|SET\s*STEP|' - r'SET\s*STICKY|SET\s*SYSMENU|SET\s*TALK|SET\s*TEXTMERGE|' - r'SET\s*TEXTMERGE\s*DELIMITERS|SET\s*TOPIC|SET\s*TRBETWEEN|' - r'SET\s*TYPEAHEAD|SET\s*UDFPARMS|SET\s*UNIQUE|SET\s*VIEW|' - r'SET\s*VOLUME|SET\s*WINDOW\s*OF\s*MEMO|SET\s*XCMDFILE|' - r'SHOW\s*GET|SHOW\s*GETS|SHOW\s*MENU|SHOW\s*OBJECT|' - r'SHOW\s*POPUP|SHOW\s*WINDOW|SIZE\s*POPUP|SKIP|SORT|' - r'STORE|SUM|SUSPEND|TOTAL|TYPE|UNLOCK|UPDATE|USE|WAIT|' - r'ZAP|ZOOM\s*WINDOW|DO\s*CASE|CASE|OTHERWISE|ENDCASE|' - r'DO\s*WHILE|ENDDO|FOR|ENDFOR|NEXT|IF|ELSE|ENDIF|PRINTJOB|' - r'ENDPRINTJOB|SCAN|ENDSCAN|TEXT|ENDTEXT|=)', - Keyword.Reserved, '#pop'), - (r'#\s*(IF|ELIF|ELSE|ENDIF|DEFINE|IFDEF|IFNDEF|INCLUDE)', - Comment.Preproc, '#pop'), - (r'(m\.)?[a-z_]\w*', Name.Variable, '#pop'), - (r'.', Text, '#pop'), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/functional.py b/wakatime/packages/py3/pygments/lexers/functional.py deleted file mode 100644 index 791e8b6..0000000 --- a/wakatime/packages/py3/pygments/lexers/functional.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.functional - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Just export lexer classes previously contained in this module. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexers.lisp import SchemeLexer, CommonLispLexer, RacketLexer, \ - NewLispLexer -from pygments.lexers.haskell import HaskellLexer, LiterateHaskellLexer, \ - KokaLexer -from pygments.lexers.theorem import CoqLexer -from pygments.lexers.erlang import ErlangLexer, ErlangShellLexer, \ - ElixirConsoleLexer, ElixirLexer -from pygments.lexers.ml import SMLLexer, OcamlLexer, OpaLexer - -__all__ = [] diff --git a/wakatime/packages/py3/pygments/lexers/haskell.py b/wakatime/packages/py3/pygments/lexers/haskell.py deleted file mode 100644 index 089cdf4..0000000 --- a/wakatime/packages/py3/pygments/lexers/haskell.py +++ /dev/null @@ -1,840 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.haskell - ~~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Haskell and related languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \ - default, include -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic -from pygments import unistring as uni - -__all__ = ['HaskellLexer', 'IdrisLexer', 'AgdaLexer', 'CryptolLexer', - 'LiterateHaskellLexer', 'LiterateIdrisLexer', 'LiterateAgdaLexer', - 'LiterateCryptolLexer', 'KokaLexer'] - - -line_re = re.compile('.*?\n') - - -class HaskellLexer(RegexLexer): - """ - A Haskell lexer based on the lexemes defined in the Haskell 98 Report. - - .. versionadded:: 0.8 - """ - name = 'Haskell' - aliases = ['haskell', 'hs'] - filenames = ['*.hs'] - mimetypes = ['text/x-haskell'] - - flags = re.MULTILINE | re.UNICODE - - reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else', - 'if', 'in', 'infix[lr]?', 'instance', - 'let', 'newtype', 'of', 'then', 'type', 'where', '_') - ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK', - 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE', - 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN', - 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL') - - tokens = { - 'root': [ - # Whitespace: - (r'\s+', Text), - # (r'--\s*|.*$', Comment.Doc), - (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), - (r'\{-', Comment.Multiline, 'comment'), - # Lexemes: - # Identifiers - (r'\bimport\b', Keyword.Reserved, 'import'), - (r'\bmodule\b', Keyword.Reserved, 'module'), - (r'\berror\b', Name.Exception), - (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), - (r"'[^\\]'", String.Char), # this has to come before the TH quote - (r'^[_' + uni.Ll + r'][\w\']*', Name.Function), - (r"'?[_" + uni.Ll + r"][\w']*", Name), - (r"('')?[" + uni.Lu + r"][\w\']*", Keyword.Type), - # Operators - (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator - (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials - (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators - (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators - # Numbers - (r'\d+[eE][+-]?\d+', Number.Float), - (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), - (r'0[oO][0-7]+', Number.Oct), - (r'0[xX][\da-fA-F]+', Number.Hex), - (r'\d+', Number.Integer), - # Character/String Literals - (r"'", String.Char, 'character'), - (r'"', String, 'string'), - # Special - (r'\[\]', Keyword.Type), - (r'\(\)', Name.Builtin), - (r'[][(),;`{}]', Punctuation), - ], - 'import': [ - # Import statements - (r'\s+', Text), - (r'"', String, 'string'), - # after "funclist" state - (r'\)', Punctuation, '#pop'), - (r'qualified\b', Keyword), - # import X as Y - (r'([' + uni.Lu + r'][\w.]*)(\s+)(as)(\s+)([' + uni.Lu + r'][\w.]*)', - bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'), - # import X hiding (functions) - (r'([' + uni.Lu + r'][\w.]*)(\s+)(hiding)(\s+)(\()', - bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'), - # import X (functions) - (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()', - bygroups(Name.Namespace, Text, Punctuation), 'funclist'), - # import X - (r'[\w.]+', Name.Namespace, '#pop'), - ], - 'module': [ - (r'\s+', Text), - (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()', - bygroups(Name.Namespace, Text, Punctuation), 'funclist'), - (r'[' + uni.Lu + r'][\w.]*', Name.Namespace, '#pop'), - ], - 'funclist': [ - (r'\s+', Text), - (r'[' + uni.Lu + r']\w*', Keyword.Type), - (r'(_[\w\']+|[' + uni.Ll + r'][\w\']*)', Name.Function), - (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), - (r'\{-', Comment.Multiline, 'comment'), - (r',', Punctuation), - (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), - # (HACK, but it makes sense to push two instances, believe me) - (r'\(', Punctuation, ('funclist', 'funclist')), - (r'\)', Punctuation, '#pop:2'), - ], - # NOTE: the next four states are shared in the AgdaLexer; make sure - # any change is compatible with Agda as well or copy over and change - 'comment': [ - # Multiline Comments - (r'[^-{}]+', Comment.Multiline), - (r'\{-', Comment.Multiline, '#push'), - (r'-\}', Comment.Multiline, '#pop'), - (r'[-{}]', Comment.Multiline), - ], - 'character': [ - # Allows multi-chars, incorrectly. - (r"[^\\']'", String.Char, '#pop'), - (r"\\", String.Escape, 'escape'), - ("'", String.Char, '#pop'), - ], - 'string': [ - (r'[^\\"]+', String), - (r"\\", String.Escape, 'escape'), - ('"', String, '#pop'), - ], - 'escape': [ - (r'[abfnrtv"\'&\\]', String.Escape, '#pop'), - (r'\^[][' + uni.Lu + r'@^_]', String.Escape, '#pop'), - ('|'.join(ascii), String.Escape, '#pop'), - (r'o[0-7]+', String.Escape, '#pop'), - (r'x[\da-fA-F]+', String.Escape, '#pop'), - (r'\d+', String.Escape, '#pop'), - (r'\s+\\', String.Escape, '#pop'), - ], - } - - -class IdrisLexer(RegexLexer): - """ - A lexer for the dependently typed programming language Idris. - - Based on the Haskell and Agda Lexer. - - .. versionadded:: 2.0 - """ - name = 'Idris' - aliases = ['idris', 'idr'] - filenames = ['*.idr'] - mimetypes = ['text/x-idris'] - - reserved = ('case', 'class', 'data', 'default', 'using', 'do', 'else', - 'if', 'in', 'infix[lr]?', 'instance', 'rewrite', 'auto', - 'namespace', 'codata', 'mutual', 'private', 'public', 'abstract', - 'total', 'partial', - 'let', 'proof', 'of', 'then', 'static', 'where', '_', 'with', - 'pattern', 'term', 'syntax', 'prefix', - 'postulate', 'parameters', 'record', 'dsl', 'impossible', 'implicit', - 'tactics', 'intros', 'intro', 'compute', 'refine', 'exact', 'trivial') - - ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK', - 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE', - 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN', - 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL') - - directives = ('lib', 'link', 'flag', 'include', 'hide', 'freeze', 'access', - 'default', 'logging', 'dynamic', 'name', 'error_handlers', 'language') - - tokens = { - 'root': [ - # Comments - (r'^(\s*)(%%%s)' % '|'.join(directives), - bygroups(Text, Keyword.Reserved)), - (r'(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$', bygroups(Text, Comment.Single)), - (r'(\s*)(\|{3}.*?)$', bygroups(Text, Comment.Single)), - (r'(\s*)(\{-)', bygroups(Text, Comment.Multiline), 'comment'), - # Declaration - (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)', - bygroups(Text, Name.Function, Text, Operator.Word, Text)), - # Identifiers - (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), - (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'), - (r"('')?[A-Z][\w\']*", Keyword.Type), - (r'[a-z][\w\']*', Text), - # Special Symbols - (r'(<-|::|->|=>|=)', Operator.Word), # specials - (r'([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials - # Numbers - (r'\d+[eE][+-]?\d+', Number.Float), - (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), - (r'0[xX][\da-fA-F]+', Number.Hex), - (r'\d+', Number.Integer), - # Strings - (r"'", String.Char, 'character'), - (r'"', String, 'string'), - (r'[^\s(){}]+', Text), - (r'\s+?', Text), # Whitespace - ], - 'module': [ - (r'\s+', Text), - (r'([A-Z][\w.]*)(\s+)(\()', - bygroups(Name.Namespace, Text, Punctuation), 'funclist'), - (r'[A-Z][\w.]*', Name.Namespace, '#pop'), - ], - 'funclist': [ - (r'\s+', Text), - (r'[A-Z]\w*', Keyword.Type), - (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), - (r'--.*$', Comment.Single), - (r'\{-', Comment.Multiline, 'comment'), - (r',', Punctuation), - (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), - # (HACK, but it makes sense to push two instances, believe me) - (r'\(', Punctuation, ('funclist', 'funclist')), - (r'\)', Punctuation, '#pop:2'), - ], - # NOTE: the next four states are shared in the AgdaLexer; make sure - # any change is compatible with Agda as well or copy over and change - 'comment': [ - # Multiline Comments - (r'[^-{}]+', Comment.Multiline), - (r'\{-', Comment.Multiline, '#push'), - (r'-\}', Comment.Multiline, '#pop'), - (r'[-{}]', Comment.Multiline), - ], - 'character': [ - # Allows multi-chars, incorrectly. - (r"[^\\']", String.Char), - (r"\\", String.Escape, 'escape'), - ("'", String.Char, '#pop'), - ], - 'string': [ - (r'[^\\"]+', String), - (r"\\", String.Escape, 'escape'), - ('"', String, '#pop'), - ], - 'escape': [ - (r'[abfnrtv"\'&\\]', String.Escape, '#pop'), - (r'\^[][A-Z@^_]', String.Escape, '#pop'), - ('|'.join(ascii), String.Escape, '#pop'), - (r'o[0-7]+', String.Escape, '#pop'), - (r'x[\da-fA-F]+', String.Escape, '#pop'), - (r'\d+', String.Escape, '#pop'), - (r'\s+\\', String.Escape, '#pop') - ], - } - - -class AgdaLexer(RegexLexer): - """ - For the `Agda `_ - dependently typed functional programming language and proof assistant. - - .. versionadded:: 2.0 - """ - - name = 'Agda' - aliases = ['agda'] - filenames = ['*.agda'] - mimetypes = ['text/x-agda'] - - reserved = ['abstract', 'codata', 'coinductive', 'constructor', 'data', - 'field', 'forall', 'hiding', 'in', 'inductive', 'infix', - 'infixl', 'infixr', 'instance', 'let', 'mutual', 'open', - 'pattern', 'postulate', 'primitive', 'private', - 'quote', 'quoteGoal', 'quoteTerm', - 'record', 'renaming', 'rewrite', 'syntax', 'tactic', - 'unquote', 'unquoteDecl', 'using', 'where', 'with'] - - tokens = { - 'root': [ - # Declaration - (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)', - bygroups(Text, Name.Function, Text, Operator.Word, Text)), - # Comments - (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), - (r'\{-', Comment.Multiline, 'comment'), - # Holes - (r'\{!', Comment.Directive, 'hole'), - # Lexemes: - # Identifiers - (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), - (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'), - (r'\b(Set|Prop)\b', Keyword.Type), - # Special Symbols - (r'(\(|\)|\{|\})', Operator), - (u'(\\.{1,3}|\\||\u039B|\u2200|\u2192|:|=|->)', Operator.Word), - # Numbers - (r'\d+[eE][+-]?\d+', Number.Float), - (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), - (r'0[xX][\da-fA-F]+', Number.Hex), - (r'\d+', Number.Integer), - # Strings - (r"'", String.Char, 'character'), - (r'"', String, 'string'), - (r'[^\s(){}]+', Text), - (r'\s+?', Text), # Whitespace - ], - 'hole': [ - # Holes - (r'[^!{}]+', Comment.Directive), - (r'\{!', Comment.Directive, '#push'), - (r'!\}', Comment.Directive, '#pop'), - (r'[!{}]', Comment.Directive), - ], - 'module': [ - (r'\{-', Comment.Multiline, 'comment'), - (r'[a-zA-Z][\w.]*', Name, '#pop'), - (r'[^a-zA-Z]+', Text) - ], - 'comment': HaskellLexer.tokens['comment'], - 'character': HaskellLexer.tokens['character'], - 'string': HaskellLexer.tokens['string'], - 'escape': HaskellLexer.tokens['escape'] - } - - -class CryptolLexer(RegexLexer): - """ - FIXME: A Cryptol2 lexer based on the lexemes defined in the Haskell 98 Report. - - .. versionadded:: 2.0 - """ - name = 'Cryptol' - aliases = ['cryptol', 'cry'] - filenames = ['*.cry'] - mimetypes = ['text/x-cryptol'] - - reserved = ('Arith', 'Bit', 'Cmp', 'False', 'Inf', 'True', 'else', - 'export', 'extern', 'fin', 'if', 'import', 'inf', 'lg2', - 'max', 'min', 'module', 'newtype', 'pragma', 'property', - 'then', 'type', 'where', 'width') - ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK', - 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE', - 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN', - 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL') - - tokens = { - 'root': [ - # Whitespace: - (r'\s+', Text), - # (r'--\s*|.*$', Comment.Doc), - (r'//.*$', Comment.Single), - (r'/\*', Comment.Multiline, 'comment'), - # Lexemes: - # Identifiers - (r'\bimport\b', Keyword.Reserved, 'import'), - (r'\bmodule\b', Keyword.Reserved, 'module'), - (r'\berror\b', Name.Exception), - (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), - (r'^[_a-z][\w\']*', Name.Function), - (r"'?[_a-z][\w']*", Name), - (r"('')?[A-Z][\w\']*", Keyword.Type), - # Operators - (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator - (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials - (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators - (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators - # Numbers - (r'\d+[eE][+-]?\d+', Number.Float), - (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), - (r'0[oO][0-7]+', Number.Oct), - (r'0[xX][\da-fA-F]+', Number.Hex), - (r'\d+', Number.Integer), - # Character/String Literals - (r"'", String.Char, 'character'), - (r'"', String, 'string'), - # Special - (r'\[\]', Keyword.Type), - (r'\(\)', Name.Builtin), - (r'[][(),;`{}]', Punctuation), - ], - 'import': [ - # Import statements - (r'\s+', Text), - (r'"', String, 'string'), - # after "funclist" state - (r'\)', Punctuation, '#pop'), - (r'qualified\b', Keyword), - # import X as Y - (r'([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][\w.]*)', - bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'), - # import X hiding (functions) - (r'([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()', - bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'), - # import X (functions) - (r'([A-Z][\w.]*)(\s+)(\()', - bygroups(Name.Namespace, Text, Punctuation), 'funclist'), - # import X - (r'[\w.]+', Name.Namespace, '#pop'), - ], - 'module': [ - (r'\s+', Text), - (r'([A-Z][\w.]*)(\s+)(\()', - bygroups(Name.Namespace, Text, Punctuation), 'funclist'), - (r'[A-Z][\w.]*', Name.Namespace, '#pop'), - ], - 'funclist': [ - (r'\s+', Text), - (r'[A-Z]\w*', Keyword.Type), - (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), - # TODO: these don't match the comments in docs, remove. - #(r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), - #(r'{-', Comment.Multiline, 'comment'), - (r',', Punctuation), - (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), - # (HACK, but it makes sense to push two instances, believe me) - (r'\(', Punctuation, ('funclist', 'funclist')), - (r'\)', Punctuation, '#pop:2'), - ], - 'comment': [ - # Multiline Comments - (r'[^/*]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline), - ], - 'character': [ - # Allows multi-chars, incorrectly. - (r"[^\\']'", String.Char, '#pop'), - (r"\\", String.Escape, 'escape'), - ("'", String.Char, '#pop'), - ], - 'string': [ - (r'[^\\"]+', String), - (r"\\", String.Escape, 'escape'), - ('"', String, '#pop'), - ], - 'escape': [ - (r'[abfnrtv"\'&\\]', String.Escape, '#pop'), - (r'\^[][A-Z@^_]', String.Escape, '#pop'), - ('|'.join(ascii), String.Escape, '#pop'), - (r'o[0-7]+', String.Escape, '#pop'), - (r'x[\da-fA-F]+', String.Escape, '#pop'), - (r'\d+', String.Escape, '#pop'), - (r'\s+\\', String.Escape, '#pop'), - ], - } - - EXTRA_KEYWORDS = set(('join', 'split', 'reverse', 'transpose', 'width', - 'length', 'tail', '<<', '>>', '<<<', '>>>', 'const', - 'reg', 'par', 'seq', 'ASSERT', 'undefined', 'error', - 'trace')) - - def get_tokens_unprocessed(self, text): - stack = ['root'] - for index, token, value in \ - RegexLexer.get_tokens_unprocessed(self, text, stack): - if token is Name and value in self.EXTRA_KEYWORDS: - yield index, Name.Builtin, value - else: - yield index, token, value - - -class LiterateLexer(Lexer): - """ - Base class for lexers of literate file formats based on LaTeX or Bird-style - (prefixing each code line with ">"). - - Additional options accepted: - - `litstyle` - If given, must be ``"bird"`` or ``"latex"``. If not given, the style - is autodetected: if the first non-whitespace character in the source - is a backslash or percent character, LaTeX is assumed, else Bird. - """ - - bird_re = re.compile(r'(>[ \t]*)(.*\n)') - - def __init__(self, baselexer, **options): - self.baselexer = baselexer - Lexer.__init__(self, **options) - - def get_tokens_unprocessed(self, text): - style = self.options.get('litstyle') - if style is None: - style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird' - - code = '' - insertions = [] - if style == 'bird': - # bird-style - for match in line_re.finditer(text): - line = match.group() - m = self.bird_re.match(line) - if m: - insertions.append((len(code), - [(0, Comment.Special, m.group(1))])) - code += m.group(2) - else: - insertions.append((len(code), [(0, Text, line)])) - else: - # latex-style - from pygments.lexers.markup import TexLexer - lxlexer = TexLexer(**self.options) - codelines = 0 - latex = '' - for match in line_re.finditer(text): - line = match.group() - if codelines: - if line.lstrip().startswith('\\end{code}'): - codelines = 0 - latex += line - else: - code += line - elif line.lstrip().startswith('\\begin{code}'): - codelines = 1 - latex += line - insertions.append((len(code), - list(lxlexer.get_tokens_unprocessed(latex)))) - latex = '' - else: - latex += line - insertions.append((len(code), - list(lxlexer.get_tokens_unprocessed(latex)))) - for item in do_insertions(insertions, self.baselexer.get_tokens_unprocessed(code)): - yield item - - -class LiterateHaskellLexer(LiterateLexer): - """ - For Literate Haskell (Bird-style or LaTeX) source. - - Additional options accepted: - - `litstyle` - If given, must be ``"bird"`` or ``"latex"``. If not given, the style - is autodetected: if the first non-whitespace character in the source - is a backslash or percent character, LaTeX is assumed, else Bird. - - .. versionadded:: 0.9 - """ - name = 'Literate Haskell' - aliases = ['lhs', 'literate-haskell', 'lhaskell'] - filenames = ['*.lhs'] - mimetypes = ['text/x-literate-haskell'] - - def __init__(self, **options): - hslexer = HaskellLexer(**options) - LiterateLexer.__init__(self, hslexer, **options) - - -class LiterateIdrisLexer(LiterateLexer): - """ - For Literate Idris (Bird-style or LaTeX) source. - - Additional options accepted: - - `litstyle` - If given, must be ``"bird"`` or ``"latex"``. If not given, the style - is autodetected: if the first non-whitespace character in the source - is a backslash or percent character, LaTeX is assumed, else Bird. - - .. versionadded:: 2.0 - """ - name = 'Literate Idris' - aliases = ['lidr', 'literate-idris', 'lidris'] - filenames = ['*.lidr'] - mimetypes = ['text/x-literate-idris'] - - def __init__(self, **options): - hslexer = IdrisLexer(**options) - LiterateLexer.__init__(self, hslexer, **options) - - -class LiterateAgdaLexer(LiterateLexer): - """ - For Literate Agda source. - - Additional options accepted: - - `litstyle` - If given, must be ``"bird"`` or ``"latex"``. If not given, the style - is autodetected: if the first non-whitespace character in the source - is a backslash or percent character, LaTeX is assumed, else Bird. - - .. versionadded:: 2.0 - """ - name = 'Literate Agda' - aliases = ['lagda', 'literate-agda'] - filenames = ['*.lagda'] - mimetypes = ['text/x-literate-agda'] - - def __init__(self, **options): - agdalexer = AgdaLexer(**options) - LiterateLexer.__init__(self, agdalexer, litstyle='latex', **options) - - -class LiterateCryptolLexer(LiterateLexer): - """ - For Literate Cryptol (Bird-style or LaTeX) source. - - Additional options accepted: - - `litstyle` - If given, must be ``"bird"`` or ``"latex"``. If not given, the style - is autodetected: if the first non-whitespace character in the source - is a backslash or percent character, LaTeX is assumed, else Bird. - - .. versionadded:: 2.0 - """ - name = 'Literate Cryptol' - aliases = ['lcry', 'literate-cryptol', 'lcryptol'] - filenames = ['*.lcry'] - mimetypes = ['text/x-literate-cryptol'] - - def __init__(self, **options): - crylexer = CryptolLexer(**options) - LiterateLexer.__init__(self, crylexer, **options) - - -class KokaLexer(RegexLexer): - """ - Lexer for the `Koka `_ - language. - - .. versionadded:: 1.6 - """ - - name = 'Koka' - aliases = ['koka'] - filenames = ['*.kk', '*.kki'] - mimetypes = ['text/x-koka'] - - keywords = [ - 'infix', 'infixr', 'infixl', - 'type', 'cotype', 'rectype', 'alias', - 'struct', 'con', - 'fun', 'function', 'val', 'var', - 'external', - 'if', 'then', 'else', 'elif', 'return', 'match', - 'private', 'public', 'private', - 'module', 'import', 'as', - 'include', 'inline', - 'rec', - 'try', 'yield', 'enum', - 'interface', 'instance', - ] - - # keywords that are followed by a type - typeStartKeywords = [ - 'type', 'cotype', 'rectype', 'alias', 'struct', 'enum', - ] - - # keywords valid in a type - typekeywords = [ - 'forall', 'exists', 'some', 'with', - ] - - # builtin names and special names - builtin = [ - 'for', 'while', 'repeat', - 'foreach', 'foreach-indexed', - 'error', 'catch', 'finally', - 'cs', 'js', 'file', 'ref', 'assigned', - ] - - # symbols that can be in an operator - symbols = r'[$%&*+@!/\\^~=.:\-?|<>]+' - - # symbol boundary: an operator keyword should not be followed by any of these - sboundary = '(?!'+symbols+')' - - # name boundary: a keyword should not be followed by any of these - boundary = '(?![\w/])' - - # koka token abstractions - tokenType = Name.Attribute - tokenTypeDef = Name.Class - tokenConstructor = Generic.Emph - - # main lexer - tokens = { - 'root': [ - include('whitespace'), - - # go into type mode - (r'::?' + sboundary, tokenType, 'type'), - (r'(alias)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), - 'alias-type'), - (r'(struct)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), - 'struct-type'), - ((r'(%s)' % '|'.join(typeStartKeywords)) + - r'(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), - 'type'), - - # special sequences of tokens (we use ?: for non-capturing group as - # required by 'bygroups') - (r'(module)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)', - bygroups(Keyword, Text, Keyword, Name.Namespace)), - (r'(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)' - r'(?:(\s*)(=)(\s*)((?:qualified\s*)?)' - r'((?:[a-z]\w*/)*[a-z]\w*))?', - bygroups(Keyword, Text, Name.Namespace, Text, Keyword, Text, - Keyword, Name.Namespace)), - - (r'(^(?:(?:public|private)\s*)?(?:function|fun|val))' - r'(\s+)([a-z]\w*|\((?:' + symbols + r'|/)\))', - bygroups(Keyword, Text, Name.Function)), - (r'(^(?:(?:public|private)\s*)?external)(\s+)(inline\s+)?' - r'([a-z]\w*|\((?:' + symbols + r'|/)\))', - bygroups(Keyword, Text, Keyword, Name.Function)), - - # keywords - (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword.Type), - (r'(%s)' % '|'.join(keywords) + boundary, Keyword), - (r'(%s)' % '|'.join(builtin) + boundary, Keyword.Pseudo), - (r'::?|:=|\->|[=.]' + sboundary, Keyword), - - # names - (r'((?:[a-z]\w*/)*)([A-Z]\w*)', - bygroups(Name.Namespace, tokenConstructor)), - (r'((?:[a-z]\w*/)*)([a-z]\w*)', bygroups(Name.Namespace, Name)), - (r'((?:[a-z]\w*/)*)(\((?:' + symbols + r'|/)\))', - bygroups(Name.Namespace, Name)), - (r'_\w*', Name.Variable), - - # literal string - (r'@"', String.Double, 'litstring'), - - # operators - (symbols + "|/(?![*/])", Operator), - (r'`', Operator), - (r'[{}()\[\];,]', Punctuation), - - # literals. No check for literal characters with len > 1 - (r'[0-9]+\.[0-9]+([eE][\-+]?[0-9]+)?', Number.Float), - (r'0[xX][0-9a-fA-F]+', Number.Hex), - (r'[0-9]+', Number.Integer), - - (r"'", String.Char, 'char'), - (r'"', String.Double, 'string'), - ], - - # type started by alias - 'alias-type': [ - (r'=', Keyword), - include('type') - ], - - # type started by struct - 'struct-type': [ - (r'(?=\((?!,*\)))', Punctuation, '#pop'), - include('type') - ], - - # type started by colon - 'type': [ - (r'[(\[<]', tokenType, 'type-nested'), - include('type-content') - ], - - # type nested in brackets: can contain parameters, comma etc. - 'type-nested': [ - (r'[)\]>]', tokenType, '#pop'), - (r'[(\[<]', tokenType, 'type-nested'), - (r',', tokenType), - (r'([a-z]\w*)(\s*)(:)(?!:)', - bygroups(Name, Text, tokenType)), # parameter name - include('type-content') - ], - - # shared contents of a type - 'type-content': [ - include('whitespace'), - - # keywords - (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword), - (r'(?=((%s)' % '|'.join(keywords) + boundary + '))', - Keyword, '#pop'), # need to match because names overlap... - - # kinds - (r'[EPHVX]' + boundary, tokenType), - - # type names - (r'[a-z][0-9]*(?![\w/])', tokenType), - (r'_\w*', tokenType.Variable), # Generic.Emph - (r'((?:[a-z]\w*/)*)([A-Z]\w*)', - bygroups(Name.Namespace, tokenType)), - (r'((?:[a-z]\w*/)*)([a-z]\w+)', - bygroups(Name.Namespace, tokenType)), - - # type keyword operators - (r'::|->|[.:|]', tokenType), - - # catchall - default('#pop') - ], - - # comments and literals - 'whitespace': [ - (r'\n\s*#.*$', Comment.Preproc), - (r'\s+', Text), - (r'/\*', Comment.Multiline, 'comment'), - (r'//.*$', Comment.Single) - ], - 'comment': [ - (r'[^/*]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline), - ], - 'litstring': [ - (r'[^"]+', String.Double), - (r'""', String.Escape), - (r'"', String.Double, '#pop'), - ], - 'string': [ - (r'[^\\"\n]+', String.Double), - include('escape-sequence'), - (r'["\n]', String.Double, '#pop'), - ], - 'char': [ - (r'[^\\\'\n]+', String.Char), - include('escape-sequence'), - (r'[\'\n]', String.Char, '#pop'), - ], - 'escape-sequence': [ - (r'\\[nrt\\"\']', String.Escape), - (r'\\x[0-9a-fA-F]{2}', String.Escape), - (r'\\u[0-9a-fA-F]{4}', String.Escape), - # Yes, \U literals are 6 hex digits. - (r'\\U[0-9a-fA-F]{6}', String.Escape) - ] - } diff --git a/wakatime/packages/py3/pygments/lexers/haxe.py b/wakatime/packages/py3/pygments/lexers/haxe.py deleted file mode 100644 index 69c0add..0000000 --- a/wakatime/packages/py3/pygments/lexers/haxe.py +++ /dev/null @@ -1,936 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.haxe - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Haxe and related stuff. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \ - default -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic, Whitespace - -__all__ = ['HaxeLexer', 'HxmlLexer'] - - -class HaxeLexer(ExtendedRegexLexer): - """ - For Haxe source code (http://haxe.org/). - - .. versionadded:: 1.3 - """ - - name = 'Haxe' - aliases = ['hx', 'haxe', 'hxsl'] - filenames = ['*.hx', '*.hxsl'] - mimetypes = ['text/haxe', 'text/x-haxe', 'text/x-hx'] - - # keywords extracted from lexer.mll in the haxe compiler source - keyword = (r'(?:function|class|static|var|if|else|while|do|for|' - r'break|return|continue|extends|implements|import|' - r'switch|case|default|public|private|try|untyped|' - r'catch|new|this|throw|extern|enum|in|interface|' - r'cast|override|dynamic|typedef|package|' - r'inline|using|null|true|false|abstract)\b') - - # idtype in lexer.mll - typeid = r'_*[A-Z]\w*' - - # combined ident and dollar and idtype - ident = r'(?:_*[a-z]\w*|_+[0-9]\w*|' + typeid + '|_+|\$\w+)' - - binop = (r'(?:%=|&=|\|=|\^=|\+=|\-=|\*=|/=|<<=|>\s*>\s*=|>\s*>\s*>\s*=|==|' - r'!=|<=|>\s*=|&&|\|\||<<|>>>|>\s*>|\.\.\.|<|>|%|&|\||\^|\+|\*|' - r'/|\-|=>|=)') - - # ident except keywords - ident_no_keyword = r'(?!' + keyword + ')' + ident - - flags = re.DOTALL | re.MULTILINE - - preproc_stack = [] - - def preproc_callback(self, match, ctx): - proc = match.group(2) - - if proc == 'if': - # store the current stack - self.preproc_stack.append(ctx.stack[:]) - elif proc in ['else', 'elseif']: - # restore the stack back to right before #if - if self.preproc_stack: - ctx.stack = self.preproc_stack[-1][:] - elif proc == 'end': - # remove the saved stack of previous #if - if self.preproc_stack: - self.preproc_stack.pop() - - # #if and #elseif should follow by an expr - if proc in ['if', 'elseif']: - ctx.stack.append('preproc-expr') - - # #error can be optionally follow by the error msg - if proc in ['error']: - ctx.stack.append('preproc-error') - - yield match.start(), Comment.Preproc, '#' + proc - ctx.pos = match.end() - - tokens = { - 'root': [ - include('spaces'), - include('meta'), - (r'(?:package)\b', Keyword.Namespace, ('semicolon', 'package')), - (r'(?:import)\b', Keyword.Namespace, ('semicolon', 'import')), - (r'(?:using)\b', Keyword.Namespace, ('semicolon', 'using')), - (r'(?:extern|private)\b', Keyword.Declaration), - (r'(?:abstract)\b', Keyword.Declaration, 'abstract'), - (r'(?:class|interface)\b', Keyword.Declaration, 'class'), - (r'(?:enum)\b', Keyword.Declaration, 'enum'), - (r'(?:typedef)\b', Keyword.Declaration, 'typedef'), - - # top-level expression - # although it is not supported in haxe, but it is common to write - # expression in web pages the positive lookahead here is to prevent - # an infinite loop at the EOF - (r'(?=.)', Text, 'expr-statement'), - ], - - # space/tab/comment/preproc - 'spaces': [ - (r'\s+', Text), - (r'//[^\n\r]*', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'(#)(if|elseif|else|end|error)\b', preproc_callback), - ], - - 'string-single-interpol': [ - (r'\$\{', String.Interpol, ('string-interpol-close', 'expr')), - (r'\$\$', String.Escape), - (r'\$(?=' + ident + ')', String.Interpol, 'ident'), - include('string-single'), - ], - - 'string-single': [ - (r"'", String.Single, '#pop'), - (r'\\.', String.Escape), - (r'.', String.Single), - ], - - 'string-double': [ - (r'"', String.Double, '#pop'), - (r'\\.', String.Escape), - (r'.', String.Double), - ], - - 'string-interpol-close': [ - (r'\$'+ident, String.Interpol), - (r'\}', String.Interpol, '#pop'), - ], - - 'package': [ - include('spaces'), - (ident, Name.Namespace), - (r'\.', Punctuation, 'import-ident'), - default('#pop'), - ], - - 'import': [ - include('spaces'), - (ident, Name.Namespace), - (r'\*', Keyword), # wildcard import - (r'\.', Punctuation, 'import-ident'), - (r'in', Keyword.Namespace, 'ident'), - default('#pop'), - ], - - 'import-ident': [ - include('spaces'), - (r'\*', Keyword, '#pop'), # wildcard import - (ident, Name.Namespace, '#pop'), - ], - - 'using': [ - include('spaces'), - (ident, Name.Namespace), - (r'\.', Punctuation, 'import-ident'), - default('#pop'), - ], - - 'preproc-error': [ - (r'\s+', Comment.Preproc), - (r"'", String.Single, ('#pop', 'string-single')), - (r'"', String.Double, ('#pop', 'string-double')), - default('#pop'), - ], - - 'preproc-expr': [ - (r'\s+', Comment.Preproc), - (r'\!', Comment.Preproc), - (r'\(', Comment.Preproc, ('#pop', 'preproc-parenthesis')), - - (ident, Comment.Preproc, '#pop'), - - # Float - (r'\.[0-9]+', Number.Float), - (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float), - (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float), - (r'[0-9]+\.[0-9]+', Number.Float), - (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float), - - # Int - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+', Number.Integer), - - # String - (r"'", String.Single, ('#pop', 'string-single')), - (r'"', String.Double, ('#pop', 'string-double')), - ], - - 'preproc-parenthesis': [ - (r'\s+', Comment.Preproc), - (r'\)', Comment.Preproc, '#pop'), - default('preproc-expr-in-parenthesis'), - ], - - 'preproc-expr-chain': [ - (r'\s+', Comment.Preproc), - (binop, Comment.Preproc, ('#pop', 'preproc-expr-in-parenthesis')), - default('#pop'), - ], - - # same as 'preproc-expr' but able to chain 'preproc-expr-chain' - 'preproc-expr-in-parenthesis': [ - (r'\s+', Comment.Preproc), - (r'\!', Comment.Preproc), - (r'\(', Comment.Preproc, - ('#pop', 'preproc-expr-chain', 'preproc-parenthesis')), - - (ident, Comment.Preproc, ('#pop', 'preproc-expr-chain')), - - # Float - (r'\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), - (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), - (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), - (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')), - (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, ('#pop', 'preproc-expr-chain')), - - # Int - (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'preproc-expr-chain')), - (r'[0-9]+', Number.Integer, ('#pop', 'preproc-expr-chain')), - - # String - (r"'", String.Single, - ('#pop', 'preproc-expr-chain', 'string-single')), - (r'"', String.Double, - ('#pop', 'preproc-expr-chain', 'string-double')), - ], - - 'abstract': [ - include('spaces'), - default(('#pop', 'abstract-body', 'abstract-relation', - 'abstract-opaque', 'type-param-constraint', 'type-name')), - ], - - 'abstract-body': [ - include('spaces'), - (r'\{', Punctuation, ('#pop', 'class-body')), - ], - - 'abstract-opaque': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'parenthesis-close', 'type')), - default('#pop'), - ], - - 'abstract-relation': [ - include('spaces'), - (r'(?:to|from)', Keyword.Declaration, 'type'), - (r',', Punctuation), - default('#pop'), - ], - - 'meta': [ - include('spaces'), - (r'@', Name.Decorator, ('meta-body', 'meta-ident', 'meta-colon')), - ], - - # optional colon - 'meta-colon': [ - include('spaces'), - (r':', Name.Decorator, '#pop'), - default('#pop'), - ], - - # same as 'ident' but set token as Name.Decorator instead of Name - 'meta-ident': [ - include('spaces'), - (ident, Name.Decorator, '#pop'), - ], - - 'meta-body': [ - include('spaces'), - (r'\(', Name.Decorator, ('#pop', 'meta-call')), - default('#pop'), - ], - - 'meta-call': [ - include('spaces'), - (r'\)', Name.Decorator, '#pop'), - default(('#pop', 'meta-call-sep', 'expr')), - ], - - 'meta-call-sep': [ - include('spaces'), - (r'\)', Name.Decorator, '#pop'), - (r',', Punctuation, ('#pop', 'meta-call')), - ], - - 'typedef': [ - include('spaces'), - default(('#pop', 'typedef-body', 'type-param-constraint', - 'type-name')), - ], - - 'typedef-body': [ - include('spaces'), - (r'=', Operator, ('#pop', 'optional-semicolon', 'type')), - ], - - 'enum': [ - include('spaces'), - default(('#pop', 'enum-body', 'bracket-open', - 'type-param-constraint', 'type-name')), - ], - - 'enum-body': [ - include('spaces'), - include('meta'), - (r'\}', Punctuation, '#pop'), - (ident_no_keyword, Name, ('enum-member', 'type-param-constraint')), - ], - - 'enum-member': [ - include('spaces'), - (r'\(', Punctuation, - ('#pop', 'semicolon', 'flag', 'function-param')), - default(('#pop', 'semicolon', 'flag')), - ], - - 'class': [ - include('spaces'), - default(('#pop', 'class-body', 'bracket-open', 'extends', - 'type-param-constraint', 'type-name')), - ], - - 'extends': [ - include('spaces'), - (r'(?:extends|implements)\b', Keyword.Declaration, 'type'), - (r',', Punctuation), # the comma is made optional here, since haxe2 - # requires the comma but haxe3 does not allow it - default('#pop'), - ], - - 'bracket-open': [ - include('spaces'), - (r'\{', Punctuation, '#pop'), - ], - - 'bracket-close': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - ], - - 'class-body': [ - include('spaces'), - include('meta'), - (r'\}', Punctuation, '#pop'), - (r'(?:static|public|private|override|dynamic|inline|macro)\b', - Keyword.Declaration), - default('class-member'), - ], - - 'class-member': [ - include('spaces'), - (r'(var)\b', Keyword.Declaration, - ('#pop', 'optional-semicolon', 'var')), - (r'(function)\b', Keyword.Declaration, - ('#pop', 'optional-semicolon', 'class-method')), - ], - - # local function, anonymous or not - 'function-local': [ - include('spaces'), - (ident_no_keyword, Name.Function, - ('#pop', 'optional-expr', 'flag', 'function-param', - 'parenthesis-open', 'type-param-constraint')), - default(('#pop', 'optional-expr', 'flag', 'function-param', - 'parenthesis-open', 'type-param-constraint')), - ], - - 'optional-expr': [ - include('spaces'), - include('expr'), - default('#pop'), - ], - - 'class-method': [ - include('spaces'), - (ident, Name.Function, ('#pop', 'optional-expr', 'flag', - 'function-param', 'parenthesis-open', - 'type-param-constraint')), - ], - - # function arguments - 'function-param': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - (r'\?', Punctuation), - (ident_no_keyword, Name, - ('#pop', 'function-param-sep', 'assign', 'flag')), - ], - - 'function-param-sep': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'function-param')), - ], - - 'prop-get-set': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'parenthesis-close', - 'prop-get-set-opt', 'comma', 'prop-get-set-opt')), - default('#pop'), - ], - - 'prop-get-set-opt': [ - include('spaces'), - (r'(?:default|null|never|dynamic|get|set)\b', Keyword, '#pop'), - (ident_no_keyword, Text, '#pop'), # custom getter/setter - ], - - 'expr-statement': [ - include('spaces'), - # makes semicolon optional here, just to avoid checking the last - # one is bracket or not. - default(('#pop', 'optional-semicolon', 'expr')), - ], - - 'expr': [ - include('spaces'), - (r'@', Name.Decorator, ('#pop', 'optional-expr', 'meta-body', - 'meta-ident', 'meta-colon')), - (r'(?:\+\+|\-\-|~(?!/)|!|\-)', Operator), - (r'\(', Punctuation, ('#pop', 'expr-chain', 'parenthesis')), - (r'(?:static|public|private|override|dynamic|inline)\b', - Keyword.Declaration), - (r'(?:function)\b', Keyword.Declaration, ('#pop', 'expr-chain', - 'function-local')), - (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket')), - (r'(?:true|false|null)\b', Keyword.Constant, ('#pop', 'expr-chain')), - (r'(?:this)\b', Keyword, ('#pop', 'expr-chain')), - (r'(?:cast)\b', Keyword, ('#pop', 'expr-chain', 'cast')), - (r'(?:try)\b', Keyword, ('#pop', 'catch', 'expr')), - (r'(?:var)\b', Keyword.Declaration, ('#pop', 'var')), - (r'(?:new)\b', Keyword, ('#pop', 'expr-chain', 'new')), - (r'(?:switch)\b', Keyword, ('#pop', 'switch')), - (r'(?:if)\b', Keyword, ('#pop', 'if')), - (r'(?:do)\b', Keyword, ('#pop', 'do')), - (r'(?:while)\b', Keyword, ('#pop', 'while')), - (r'(?:for)\b', Keyword, ('#pop', 'for')), - (r'(?:untyped|throw)\b', Keyword), - (r'(?:return)\b', Keyword, ('#pop', 'optional-expr')), - (r'(?:macro)\b', Keyword, ('#pop', 'macro')), - (r'(?:continue|break)\b', Keyword, '#pop'), - (r'(?:\$\s*[a-z]\b|\$(?!'+ident+'))', Name, ('#pop', 'dollar')), - (ident_no_keyword, Name, ('#pop', 'expr-chain')), - - # Float - (r'\.[0-9]+', Number.Float, ('#pop', 'expr-chain')), - (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')), - (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')), - (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'expr-chain')), - (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, ('#pop', 'expr-chain')), - - # Int - (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'expr-chain')), - (r'[0-9]+', Number.Integer, ('#pop', 'expr-chain')), - - # String - (r"'", String.Single, ('#pop', 'expr-chain', 'string-single-interpol')), - (r'"', String.Double, ('#pop', 'expr-chain', 'string-double')), - - # EReg - (r'~/(\\\\|\\/|[^/\n])*/[gimsu]*', String.Regex, ('#pop', 'expr-chain')), - - # Array - (r'\[', Punctuation, ('#pop', 'expr-chain', 'array-decl')), - ], - - 'expr-chain': [ - include('spaces'), - (r'(?:\+\+|\-\-)', Operator), - (binop, Operator, ('#pop', 'expr')), - (r'(?:in)\b', Keyword, ('#pop', 'expr')), - (r'\?', Operator, ('#pop', 'expr', 'ternary', 'expr')), - (r'(\.)(' + ident_no_keyword + ')', bygroups(Punctuation, Name)), - (r'\[', Punctuation, 'array-access'), - (r'\(', Punctuation, 'call'), - default('#pop'), - ], - - # macro reification - 'macro': [ - include('spaces'), - include('meta'), - (r':', Punctuation, ('#pop', 'type')), - - (r'(?:extern|private)\b', Keyword.Declaration), - (r'(?:abstract)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'abstract')), - (r'(?:class|interface)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'macro-class')), - (r'(?:enum)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'enum')), - (r'(?:typedef)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'typedef')), - - default(('#pop', 'expr')), - ], - - 'macro-class': [ - (r'\{', Punctuation, ('#pop', 'class-body')), - include('class') - ], - - # cast can be written as "cast expr" or "cast(expr, type)" - 'cast': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'parenthesis-close', - 'cast-type', 'expr')), - default(('#pop', 'expr')), - ], - - # optionally give a type as the 2nd argument of cast() - 'cast-type': [ - include('spaces'), - (r',', Punctuation, ('#pop', 'type')), - default('#pop'), - ], - - 'catch': [ - include('spaces'), - (r'(?:catch)\b', Keyword, ('expr', 'function-param', - 'parenthesis-open')), - default('#pop'), - ], - - # do-while loop - 'do': [ - include('spaces'), - default(('#pop', 'do-while', 'expr')), - ], - - # the while after do - 'do-while': [ - include('spaces'), - (r'(?:while)\b', Keyword, ('#pop', 'parenthesis', - 'parenthesis-open')), - ], - - 'while': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')), - ], - - 'for': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')), - ], - - 'if': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'else', 'optional-semicolon', 'expr', - 'parenthesis')), - ], - - 'else': [ - include('spaces'), - (r'(?:else)\b', Keyword, ('#pop', 'expr')), - default('#pop'), - ], - - 'switch': [ - include('spaces'), - default(('#pop', 'switch-body', 'bracket-open', 'expr')), - ], - - 'switch-body': [ - include('spaces'), - (r'(?:case|default)\b', Keyword, ('case-block', 'case')), - (r'\}', Punctuation, '#pop'), - ], - - 'case': [ - include('spaces'), - (r':', Punctuation, '#pop'), - default(('#pop', 'case-sep', 'case-guard', 'expr')), - ], - - 'case-sep': [ - include('spaces'), - (r':', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'case')), - ], - - 'case-guard': [ - include('spaces'), - (r'(?:if)\b', Keyword, ('#pop', 'parenthesis', 'parenthesis-open')), - default('#pop'), - ], - - # optional multiple expr under a case - 'case-block': [ - include('spaces'), - (r'(?!(?:case|default)\b|\})', Keyword, 'expr-statement'), - default('#pop'), - ], - - 'new': [ - include('spaces'), - default(('#pop', 'call', 'parenthesis-open', 'type')), - ], - - 'array-decl': [ - include('spaces'), - (r'\]', Punctuation, '#pop'), - default(('#pop', 'array-decl-sep', 'expr')), - ], - - 'array-decl-sep': [ - include('spaces'), - (r'\]', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'array-decl')), - ], - - 'array-access': [ - include('spaces'), - default(('#pop', 'array-access-close', 'expr')), - ], - - 'array-access-close': [ - include('spaces'), - (r'\]', Punctuation, '#pop'), - ], - - 'comma': [ - include('spaces'), - (r',', Punctuation, '#pop'), - ], - - 'colon': [ - include('spaces'), - (r':', Punctuation, '#pop'), - ], - - 'semicolon': [ - include('spaces'), - (r';', Punctuation, '#pop'), - ], - - 'optional-semicolon': [ - include('spaces'), - (r';', Punctuation, '#pop'), - default('#pop'), - ], - - # identity that CAN be a Haxe keyword - 'ident': [ - include('spaces'), - (ident, Name, '#pop'), - ], - - 'dollar': [ - include('spaces'), - (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket-close', 'expr')), - default(('#pop', 'expr-chain')), - ], - - 'type-name': [ - include('spaces'), - (typeid, Name, '#pop'), - ], - - 'type-full-name': [ - include('spaces'), - (r'\.', Punctuation, 'ident'), - default('#pop'), - ], - - 'type': [ - include('spaces'), - (r'\?', Punctuation), - (ident, Name, ('#pop', 'type-check', 'type-full-name')), - (r'\{', Punctuation, ('#pop', 'type-check', 'type-struct')), - (r'\(', Punctuation, ('#pop', 'type-check', 'type-parenthesis')), - ], - - 'type-parenthesis': [ - include('spaces'), - default(('#pop', 'parenthesis-close', 'type')), - ], - - 'type-check': [ - include('spaces'), - (r'->', Punctuation, ('#pop', 'type')), - (r'<(?!=)', Punctuation, 'type-param'), - default('#pop'), - ], - - 'type-struct': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - (r'\?', Punctuation), - (r'>', Punctuation, ('comma', 'type')), - (ident_no_keyword, Name, ('#pop', 'type-struct-sep', 'type', 'colon')), - include('class-body'), - ], - - 'type-struct-sep': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'type-struct')), - ], - - # type-param can be a normal type or a constant literal... - 'type-param-type': [ - # Float - (r'\.[0-9]+', Number.Float, '#pop'), - (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, '#pop'), - (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, '#pop'), - (r'[0-9]+\.[0-9]+', Number.Float, '#pop'), - (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, '#pop'), - - # Int - (r'0x[0-9a-fA-F]+', Number.Hex, '#pop'), - (r'[0-9]+', Number.Integer, '#pop'), - - # String - (r"'", String.Single, ('#pop', 'string-single')), - (r'"', String.Double, ('#pop', 'string-double')), - - # EReg - (r'~/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex, '#pop'), - - # Array - (r'\[', Operator, ('#pop', 'array-decl')), - - include('type'), - ], - - # type-param part of a type - # ie. the path in Map - 'type-param': [ - include('spaces'), - default(('#pop', 'type-param-sep', 'type-param-type')), - ], - - 'type-param-sep': [ - include('spaces'), - (r'>', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'type-param')), - ], - - # optional type-param that may include constraint - # ie. - 'type-param-constraint': [ - include('spaces'), - (r'<(?!=)', Punctuation, ('#pop', 'type-param-constraint-sep', - 'type-param-constraint-flag', 'type-name')), - default('#pop'), - ], - - 'type-param-constraint-sep': [ - include('spaces'), - (r'>', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'type-param-constraint-sep', - 'type-param-constraint-flag', 'type-name')), - ], - - # the optional constraint inside type-param - 'type-param-constraint-flag': [ - include('spaces'), - (r':', Punctuation, ('#pop', 'type-param-constraint-flag-type')), - default('#pop'), - ], - - 'type-param-constraint-flag-type': [ - include('spaces'), - (r'\(', Punctuation, ('#pop', 'type-param-constraint-flag-type-sep', - 'type')), - default(('#pop', 'type')), - ], - - 'type-param-constraint-flag-type-sep': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - (r',', Punctuation, 'type'), - ], - - # a parenthesis expr that contain exactly one expr - 'parenthesis': [ - include('spaces'), - default(('#pop', 'parenthesis-close', 'flag', 'expr')), - ], - - 'parenthesis-open': [ - include('spaces'), - (r'\(', Punctuation, '#pop'), - ], - - 'parenthesis-close': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - ], - - 'var': [ - include('spaces'), - (ident_no_keyword, Text, ('#pop', 'var-sep', 'assign', 'flag', 'prop-get-set')), - ], - - # optional more var decl. - 'var-sep': [ - include('spaces'), - (r',', Punctuation, ('#pop', 'var')), - default('#pop'), - ], - - # optional assignment - 'assign': [ - include('spaces'), - (r'=', Operator, ('#pop', 'expr')), - default('#pop'), - ], - - # optional type flag - 'flag': [ - include('spaces'), - (r':', Punctuation, ('#pop', 'type')), - default('#pop'), - ], - - # colon as part of a ternary operator (?:) - 'ternary': [ - include('spaces'), - (r':', Operator, '#pop'), - ], - - # function call - 'call': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - default(('#pop', 'call-sep', 'expr')), - ], - - # after a call param - 'call-sep': [ - include('spaces'), - (r'\)', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'call')), - ], - - # bracket can be block or object - 'bracket': [ - include('spaces'), - (r'(?!(?:\$\s*[a-z]\b|\$(?!'+ident+')))' + ident_no_keyword, Name, - ('#pop', 'bracket-check')), - (r"'", String.Single, ('#pop', 'bracket-check', 'string-single')), - (r'"', String.Double, ('#pop', 'bracket-check', 'string-double')), - default(('#pop', 'block')), - ], - - 'bracket-check': [ - include('spaces'), - (r':', Punctuation, ('#pop', 'object-sep', 'expr')), # is object - default(('#pop', 'block', 'optional-semicolon', 'expr-chain')), # is block - ], - - # code block - 'block': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - default('expr-statement'), - ], - - # object in key-value pairs - 'object': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - default(('#pop', 'object-sep', 'expr', 'colon', 'ident-or-string')) - ], - - # a key of an object - 'ident-or-string': [ - include('spaces'), - (ident_no_keyword, Name, '#pop'), - (r"'", String.Single, ('#pop', 'string-single')), - (r'"', String.Double, ('#pop', 'string-double')), - ], - - # after a key-value pair in object - 'object-sep': [ - include('spaces'), - (r'\}', Punctuation, '#pop'), - (r',', Punctuation, ('#pop', 'object')), - ], - - - - } - - def analyse_text(text): - if re.match(r'\w+\s*:\s*\w', text): - return 0.3 - - -class HxmlLexer(RegexLexer): - """ - Lexer for `haXe build `_ files. - - .. versionadded:: 1.6 - """ - name = 'Hxml' - aliases = ['haxeml', 'hxml'] - filenames = ['*.hxml'] - - tokens = { - 'root': [ - # Seperator - (r'(--)(next)', bygroups(Punctuation, Generic.Heading)), - # Compiler switches with one dash - (r'(-)(prompt|debug|v)', bygroups(Punctuation, Keyword.Keyword)), - # Compilerswitches with two dashes - (r'(--)(neko-source|flash-strict|flash-use-stage|no-opt|no-traces|' - r'no-inline|times|no-output)', bygroups(Punctuation, Keyword)), - # Targets and other options that take an argument - (r'(-)(cpp|js|neko|x|as3|swf9?|swf-lib|php|xml|main|lib|D|resource|' - r'cp|cmd)( +)(.+)', - bygroups(Punctuation, Keyword, Whitespace, String)), - # Options that take only numerical arguments - (r'(-)(swf-version)( +)(\d+)', - bygroups(Punctuation, Keyword, Number.Integer)), - # An Option that defines the size, the fps and the background - # color of an flash movie - (r'(-)(swf-header)( +)(\d+)(:)(\d+)(:)(\d+)(:)([A-Fa-f0-9]{6})', - bygroups(Punctuation, Keyword, Whitespace, Number.Integer, - Punctuation, Number.Integer, Punctuation, Number.Integer, - Punctuation, Number.Hex)), - # options with two dashes that takes arguments - (r'(--)(js-namespace|php-front|php-lib|remap|gen-hx-classes)( +)' - r'(.+)', bygroups(Punctuation, Keyword, Whitespace, String)), - # Single line comment, multiline ones are not allowed. - (r'#.*', Comment.Single) - ] - } diff --git a/wakatime/packages/py3/pygments/lexers/hdl.py b/wakatime/packages/py3/pygments/lexers/hdl.py deleted file mode 100644 index c8e3471..0000000 --- a/wakatime/packages/py3/pygments/lexers/hdl.py +++ /dev/null @@ -1,375 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.hdl - ~~~~~~~~~~~~~~~~~~~ - - Lexers for hardware descriptor languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, bygroups, include, using, this, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error - -__all__ = ['VerilogLexer', 'SystemVerilogLexer', 'VhdlLexer'] - - -class VerilogLexer(RegexLexer): - """ - For verilog source code with preprocessor directives. - - .. versionadded:: 1.4 - """ - name = 'verilog' - aliases = ['verilog', 'v'] - filenames = ['*.v'] - mimetypes = ['text/x-verilog'] - - #: optional Comment or Whitespace - _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' - - tokens = { - 'root': [ - (r'^\s*`define', Comment.Preproc, 'macro'), - (r'\n', Text), - (r'\s+', Text), - (r'\\\n', Text), # line continuation - (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single), - (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), - (r'[{}#@]', Punctuation), - (r'L?"', String, 'string'), - (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), - (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'([0-9]+)|(\'h)[0-9a-fA-F]+', Number.Hex), - (r'([0-9]+)|(\'b)[01]+', Number.Bin), - (r'([0-9]+)|(\'d)[0-9]+', Number.Integer), - (r'([0-9]+)|(\'o)[0-7]+', Number.Oct), - (r'\'[01xz]', Number), - (r'\d+[Ll]?', Number.Integer), - (r'\*/', Error), - (r'[~!%^&*+=|?:<>/-]', Operator), - (r'[()\[\],.;\']', Punctuation), - (r'`[a-zA-Z_]\w*', Name.Constant), - - (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)), - (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text), - 'import'), - - (words(( - 'always', 'always_comb', 'always_ff', 'always_latch', 'and', - 'assign', 'automatic', 'begin', 'break', 'buf', 'bufif0', 'bufif1', - 'case', 'casex', 'casez', 'cmos', 'const', 'continue', 'deassign', - 'default', 'defparam', 'disable', 'do', 'edge', 'else', 'end', 'endcase', - 'endfunction', 'endgenerate', 'endmodule', 'endpackage', 'endprimitive', - 'endspecify', 'endtable', 'endtask', 'enum', 'event', 'final', 'for', - 'force', 'forever', 'fork', 'function', 'generate', 'genvar', 'highz0', - 'highz1', 'if', 'initial', 'inout', 'input', 'integer', 'join', 'large', - 'localparam', 'macromodule', 'medium', 'module', 'nand', 'negedge', - 'nmos', 'nor', 'not', 'notif0', 'notif1', 'or', 'output', 'packed', - 'parameter', 'pmos', 'posedge', 'primitive', 'pull0', 'pull1', - 'pulldown', 'pullup', 'rcmos', 'ref', 'release', 'repeat', 'return', - 'rnmos', 'rpmos', 'rtran', 'rtranif0', 'rtranif1', 'scalared', 'signed', - 'small', 'specify', 'specparam', 'strength', 'string', 'strong0', - 'strong1', 'struct', 'table', 'task', 'tran', 'tranif0', 'tranif1', - 'type', 'typedef', 'unsigned', 'var', 'vectored', 'void', 'wait', - 'weak0', 'weak1', 'while', 'xnor', 'xor'), suffix=r'\b'), - Keyword), - - (words(( - 'accelerate', 'autoexpand_vectornets', 'celldefine', 'default_nettype', - 'else', 'elsif', 'endcelldefine', 'endif', 'endprotect', 'endprotected', - 'expand_vectornets', 'ifdef', 'ifndef', 'include', 'noaccelerate', - 'noexpand_vectornets', 'noremove_gatenames', 'noremove_netnames', - 'nounconnected_drive', 'protect', 'protected', 'remove_gatenames', - 'remove_netnames', 'resetall', 'timescale', 'unconnected_drive', - 'undef'), prefix=r'`', suffix=r'\b'), - Comment.Preproc), - - (words(( - 'bits', 'bitstoreal', 'bitstoshortreal', 'countdrivers', 'display', 'fclose', - 'fdisplay', 'finish', 'floor', 'fmonitor', 'fopen', 'fstrobe', 'fwrite', - 'getpattern', 'history', 'incsave', 'input', 'itor', 'key', 'list', 'log', - 'monitor', 'monitoroff', 'monitoron', 'nokey', 'nolog', 'printtimescale', - 'random', 'readmemb', 'readmemh', 'realtime', 'realtobits', 'reset', - 'reset_count', 'reset_value', 'restart', 'rtoi', 'save', 'scale', 'scope', - 'shortrealtobits', 'showscopes', 'showvariables', 'showvars', 'sreadmemb', - 'sreadmemh', 'stime', 'stop', 'strobe', 'time', 'timeformat', 'write'), - prefix=r'\$', suffix=r'\b'), - Name.Builtin), - - (words(( - 'byte', 'shortint', 'int', 'longint', 'integer', 'time', - 'bit', 'logic', 'reg', 'supply0', 'supply1', 'tri', 'triand', - 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo' - 'shortreal', 'real', 'realtime'), suffix=r'\b'), - Keyword.Type), - ('[a-zA-Z_]\w*:(?!:)', Name.Label), - ('[a-zA-Z_]\w*', Name), - ], - 'string': [ - (r'"', String, '#pop'), - (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape), - (r'[^\\"\n]+', String), # all other characters - (r'\\\n', String), # line continuation - (r'\\', String), # stray backslash - ], - 'macro': [ - (r'[^/\n]+', Comment.Preproc), - (r'/[*](.|\n)*?[*]/', Comment.Multiline), - (r'//.*?\n', Comment.Single, '#pop'), - (r'/', Comment.Preproc), - (r'(?<=\\)\n', Comment.Preproc), - (r'\n', Comment.Preproc, '#pop'), - ], - 'import': [ - (r'[\w:]+\*?', Name.Namespace, '#pop') - ] - } - - def get_tokens_unprocessed(self, text): - for index, token, value in \ - RegexLexer.get_tokens_unprocessed(self, text): - # Convention: mark all upper case names as constants - if token is Name: - if value.isupper(): - token = Name.Constant - yield index, token, value - - -class SystemVerilogLexer(RegexLexer): - """ - Extends verilog lexer to recognise all SystemVerilog keywords from IEEE - 1800-2009 standard. - - .. versionadded:: 1.5 - """ - name = 'systemverilog' - aliases = ['systemverilog', 'sv'] - filenames = ['*.sv', '*.svh'] - mimetypes = ['text/x-systemverilog'] - - #: optional Comment or Whitespace - _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' - - tokens = { - 'root': [ - (r'^\s*`define', Comment.Preproc, 'macro'), - (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)), - (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text), 'import'), - - (r'\n', Text), - (r'\s+', Text), - (r'\\\n', Text), # line continuation - (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single), - (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), - (r'[{}#@]', Punctuation), - (r'L?"', String, 'string'), - (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), - (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'([0-9]+)|(\'h)[0-9a-fA-F]+', Number.Hex), - (r'([0-9]+)|(\'b)[01]+', Number.Bin), - (r'([0-9]+)|(\'d)[0-9]+', Number.Integer), - (r'([0-9]+)|(\'o)[0-7]+', Number.Oct), - (r'\'[01xz]', Number), - (r'\d+[Ll]?', Number.Integer), - (r'\*/', Error), - (r'[~!%^&*+=|?:<>/-]', Operator), - (r'[()\[\],.;\']', Punctuation), - (r'`[a-zA-Z_]\w*', Name.Constant), - - (words(( - 'accept_on', 'alias', 'always', 'always_comb', 'always_ff', 'always_latch', - 'and', 'assert', 'assign', 'assume', 'automatic', 'before', 'begin', 'bind', 'bins', - 'binsof', 'bit', 'break', 'buf', 'bufif0', 'bufif1', 'byte', 'case', 'casex', 'casez', - 'cell', 'chandle', 'checker', 'class', 'clocking', 'cmos', 'config', 'const', 'constraint', - 'context', 'continue', 'cover', 'covergroup', 'coverpoint', 'cross', 'deassign', - 'default', 'defparam', 'design', 'disable', 'dist', 'do', 'edge', 'else', 'end', 'endcase', - 'endchecker', 'endclass', 'endclocking', 'endconfig', 'endfunction', 'endgenerate', - 'endgroup', 'endinterface', 'endmodule', 'endpackage', 'endprimitive', - 'endprogram', 'endproperty', 'endsequence', 'endspecify', 'endtable', - 'endtask', 'enum', 'event', 'eventually', 'expect', 'export', 'extends', 'extern', - 'final', 'first_match', 'for', 'force', 'foreach', 'forever', 'fork', 'forkjoin', - 'function', 'generate', 'genvar', 'global', 'highz0', 'highz1', 'if', 'iff', 'ifnone', - 'ignore_bins', 'illegal_bins', 'implies', 'import', 'incdir', 'include', - 'initial', 'inout', 'input', 'inside', 'instance', 'int', 'integer', 'interface', - 'intersect', 'join', 'join_any', 'join_none', 'large', 'let', 'liblist', 'library', - 'local', 'localparam', 'logic', 'longint', 'macromodule', 'matches', 'medium', - 'modport', 'module', 'nand', 'negedge', 'new', 'nexttime', 'nmos', 'nor', 'noshowcancelled', - 'not', 'notif0', 'notif1', 'null', 'or', 'output', 'package', 'packed', 'parameter', - 'pmos', 'posedge', 'primitive', 'priority', 'program', 'property', 'protected', - 'pull0', 'pull1', 'pulldown', 'pullup', 'pulsestyle_ondetect', 'pulsestyle_onevent', - 'pure', 'rand', 'randc', 'randcase', 'randsequence', 'rcmos', 'real', 'realtime', - 'ref', 'reg', 'reject_on', 'release', 'repeat', 'restrict', 'return', 'rnmos', - 'rpmos', 'rtran', 'rtranif0', 'rtranif1', 's_always', 's_eventually', 's_nexttime', - 's_until', 's_until_with', 'scalared', 'sequence', 'shortint', 'shortreal', - 'showcancelled', 'signed', 'small', 'solve', 'specify', 'specparam', 'static', - 'string', 'strong', 'strong0', 'strong1', 'struct', 'super', 'supply0', 'supply1', - 'sync_accept_on', 'sync_reject_on', 'table', 'tagged', 'task', 'this', 'throughout', - 'time', 'timeprecision', 'timeunit', 'tran', 'tranif0', 'tranif1', 'tri', 'tri0', - 'tri1', 'triand', 'trior', 'trireg', 'type', 'typedef', 'union', 'unique', 'unique0', - 'unsigned', 'until', 'until_with', 'untyped', 'use', 'uwire', 'var', 'vectored', - 'virtual', 'void', 'wait', 'wait_order', 'wand', 'weak', 'weak0', 'weak1', 'while', - 'wildcard', 'wire', 'with', 'within', 'wor', 'xnor', 'xor'), suffix=r'\b'), - Keyword), - - (words(( - '`__FILE__', '`__LINE__', '`begin_keywords', '`celldefine', '`default_nettype', - '`define', '`else', '`elsif', '`end_keywords', '`endcelldefine', '`endif', - '`ifdef', '`ifndef', '`include', '`line', '`nounconnected_drive', '`pragma', - '`resetall', '`timescale', '`unconnected_drive', '`undef', '`undefineall'), - suffix=r'\b'), - Comment.Preproc), - - (words(( - '$display', '$displayb', '$displayh', '$displayo', '$dumpall', '$dumpfile', - '$dumpflush', '$dumplimit', '$dumpoff', '$dumpon', '$dumpports', - '$dumpportsall', '$dumpportsflush', '$dumpportslimit', '$dumpportsoff', - '$dumpportson', '$dumpvars', '$fclose', '$fdisplay', '$fdisplayb', - '$fdisplayh', '$fdisplayo', '$feof', '$ferror', '$fflush', '$fgetc', - '$fgets', '$finish', '$fmonitor', '$fmonitorb', '$fmonitorh', '$fmonitoro', - '$fopen', '$fread', '$fscanf', '$fseek', '$fstrobe', '$fstrobeb', '$fstrobeh', - '$fstrobeo', '$ftell', '$fwrite', '$fwriteb', '$fwriteh', '$fwriteo', - '$monitor', '$monitorb', '$monitorh', '$monitoro', '$monitoroff', - '$monitoron', '$plusargs', '$random', '$readmemb', '$readmemh', '$rewind', - '$sformat', '$sformatf', '$sscanf', '$strobe', '$strobeb', '$strobeh', '$strobeo', - '$swrite', '$swriteb', '$swriteh', '$swriteo', '$test', '$ungetc', - '$value$plusargs', '$write', '$writeb', '$writeh', '$writememb', - '$writememh', '$writeo'), suffix=r'\b'), - Name.Builtin), - - (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), - (words(( - 'byte', 'shortint', 'int', 'longint', 'integer', 'time', - 'bit', 'logic', 'reg', 'supply0', 'supply1', 'tri', 'triand', - 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo' - 'shortreal', 'real', 'realtime'), suffix=r'\b'), - Keyword.Type), - ('[a-zA-Z_]\w*:(?!:)', Name.Label), - ('[a-zA-Z_]\w*', Name), - ], - 'classname': [ - (r'[a-zA-Z_]\w*', Name.Class, '#pop'), - ], - 'string': [ - (r'"', String, '#pop'), - (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape), - (r'[^\\"\n]+', String), # all other characters - (r'\\\n', String), # line continuation - (r'\\', String), # stray backslash - ], - 'macro': [ - (r'[^/\n]+', Comment.Preproc), - (r'/[*](.|\n)*?[*]/', Comment.Multiline), - (r'//.*?\n', Comment.Single, '#pop'), - (r'/', Comment.Preproc), - (r'(?<=\\)\n', Comment.Preproc), - (r'\n', Comment.Preproc, '#pop'), - ], - 'import': [ - (r'[\w:]+\*?', Name.Namespace, '#pop') - ] - } - - def get_tokens_unprocessed(self, text): - for index, token, value in \ - RegexLexer.get_tokens_unprocessed(self, text): - # Convention: mark all upper case names as constants - if token is Name: - if value.isupper(): - token = Name.Constant - yield index, token, value - - -class VhdlLexer(RegexLexer): - """ - For VHDL source code. - - .. versionadded:: 1.5 - """ - name = 'vhdl' - aliases = ['vhdl'] - filenames = ['*.vhdl', '*.vhd'] - mimetypes = ['text/x-vhdl'] - flags = re.MULTILINE | re.IGNORECASE - - tokens = { - 'root': [ - (r'\n', Text), - (r'\s+', Text), - (r'\\\n', Text), # line continuation - (r'--.*?$', Comment.Single), - (r"'(U|X|0|1|Z|W|L|H|-)'", String.Char), - (r'[~!%^&*+=|?:<>/-]', Operator), - (r"'[a-z_]\w*", Name.Attribute), - (r'[()\[\],.;\']', Punctuation), - (r'"[^\n\\]*"', String), - - (r'(library)(\s+)([a-z_]\w*)', - bygroups(Keyword, Text, Name.Namespace)), - (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)), - (r'(use)(\s+)([a-z_][\w.]*)', - bygroups(Keyword, Text, Name.Namespace)), - (r'(entity|component)(\s+)([a-z_]\w*)', - bygroups(Keyword, Text, Name.Class)), - (r'(architecture|configuration)(\s+)([a-z_]\w*)(\s+)' - r'(of)(\s+)([a-z_]\w*)(\s+)(is)', - bygroups(Keyword, Text, Name.Class, Text, Keyword, Text, - Name.Class, Text, Keyword)), - - (r'(end)(\s+)', bygroups(using(this), Text), 'endblock'), - - include('types'), - include('keywords'), - include('numbers'), - - (r'[a-z_]\w*', Name), - ], - 'endblock': [ - include('keywords'), - (r'[a-z_]\w*', Name.Class), - (r'(\s+)', Text), - (r';', Punctuation, '#pop'), - ], - 'types': [ - (words(( - 'boolean', 'bit', 'character', 'severity_level', 'integer', 'time', - 'delay_length', 'natural', 'positive', 'string', 'bit_vector', - 'file_open_kind', 'file_open_status', 'std_ulogic', 'std_ulogic_vector', - 'std_logic', 'std_logic_vector'), suffix=r'\b'), - Keyword.Type), - ], - 'keywords': [ - (words(( - 'abs', 'access', 'after', 'alias', 'all', 'and', - 'architecture', 'array', 'assert', 'attribute', 'begin', 'block', - 'body', 'buffer', 'bus', 'case', 'component', 'configuration', - 'constant', 'disconnect', 'downto', 'else', 'elsif', 'end', - 'entity', 'exit', 'file', 'for', 'function', 'generate', - 'generic', 'group', 'guarded', 'if', 'impure', 'in', - 'inertial', 'inout', 'is', 'label', 'library', 'linkage', - 'literal', 'loop', 'map', 'mod', 'nand', 'new', - 'next', 'nor', 'not', 'null', 'of', 'on', - 'open', 'or', 'others', 'out', 'package', 'port', - 'postponed', 'procedure', 'process', 'pure', 'range', 'record', - 'register', 'reject', 'return', 'rol', 'ror', 'select', - 'severity', 'signal', 'shared', 'sla', 'sli', 'sra', - 'srl', 'subtype', 'then', 'to', 'transport', 'type', - 'units', 'until', 'use', 'variable', 'wait', 'when', - 'while', 'with', 'xnor', 'xor'), suffix=r'\b'), - Keyword), - ], - 'numbers': [ - (r'\d{1,2}#[0-9a-f_]+#?', Number.Integer), - (r'\d+', Number.Integer), - (r'(\d+\.\d*|\.\d+|\d+)E[+-]?\d+', Number.Float), - (r'X"[0-9a-f_]+"', Number.Hex), - (r'O"[0-7_]+"', Number.Oct), - (r'B"[01_]+"', Number.Bin), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/igor.py b/wakatime/packages/py3/pygments/lexers/igor.py deleted file mode 100644 index dcf9770..0000000 --- a/wakatime/packages/py3/pygments/lexers/igor.py +++ /dev/null @@ -1,279 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.igor - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Igor Pro. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, words -from pygments.token import Text, Comment, Keyword, Name, String - -__all__ = ['IgorLexer'] - - -class IgorLexer(RegexLexer): - """ - Pygments Lexer for Igor Pro procedure files (.ipf). - See http://www.wavemetrics.com/ and http://www.igorexchange.com/. - - .. versionadded:: 2.0 - """ - - name = 'Igor' - aliases = ['igor', 'igorpro'] - filenames = ['*.ipf'] - mimetypes = ['text/ipf'] - - flags = re.IGNORECASE | re.MULTILINE - - flowControl = ( - 'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'strswitch', 'switch', - 'case', 'default', 'endswitch', 'do', 'while', 'try', 'catch', 'endtry', - 'break', 'continue', 'return', - ) - types = ( - 'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE', - 'STRUCT', 'dfref' - ) - keywords = ( - 'override', 'ThreadSafe', 'static', 'FuncFit', 'Proc', 'Picture', - 'Prompt', 'DoPrompt', 'macro', 'window', 'graph', 'function', 'end', - 'Structure', 'EndStructure', 'EndMacro', 'Menu', 'SubMenu', - ) - operations = ( - 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio', - 'AddMovieFrame', 'APMath', 'Append', 'AppendImage', - 'AppendLayoutObject', 'AppendMatrixContour', 'AppendText', - 'AppendToGraph', 'AppendToLayout', 'AppendToTable', 'AppendXYZContour', - 'AutoPositionWindow', 'BackgroundInfo', 'Beep', 'BoundingBall', - 'BrowseURL', 'BuildMenu', 'Button', 'cd', 'Chart', 'CheckBox', - 'CheckDisplayed', 'ChooseColor', 'Close', 'CloseMovie', 'CloseProc', - 'ColorScale', 'ColorTab2Wave', 'Concatenate', 'ControlBar', - 'ControlInfo', 'ControlUpdate', 'ConvexHull', 'Convolve', 'CopyFile', - 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'Cross', - 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor', - 'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions', - 'DefaultFont', 'DefaultGuiControls', 'DefaultGuiFont', 'DefineGuide', - 'DelayUpdate', 'DeleteFile', 'DeleteFolder', 'DeletePoints', - 'Differentiate', 'dir', 'Display', 'DisplayHelpTopic', - 'DisplayProcedure', 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow', - 'DoXOPIdle', 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine', - 'DrawOval', 'DrawPICT', 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText', - 'DSPDetrend', 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder', - 'DWT', 'EdgeStats', 'Edit', 'ErrorBars', 'Execute', 'ExecuteScriptText', - 'ExperimentModified', 'Extract', 'FastGaussTransform', 'FastOp', - 'FBinRead', 'FBinWrite', 'FFT', 'FIFO2Wave', 'FIFOStatus', 'FilterFIR', - 'FilterIIR', 'FindLevel', 'FindLevels', 'FindPeak', 'FindPointsInPoly', - 'FindRoots', 'FindSequence', 'FindValue', 'FPClustering', 'fprintf', - 'FReadLine', 'FSetPos', 'FStatus', 'FTPDelete', 'FTPDownload', - 'FTPUpload', 'FuncFit', 'FuncFitMD', 'GetAxis', 'GetFileFolderInfo', - 'GetLastUserMenuInfo', 'GetMarquee', 'GetSelection', 'GetWindow', - 'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', 'GroupBox', - 'Hanning', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools', - 'HilbertTransform', 'Histogram', 'IFFT', 'ImageAnalyzeParticles', - 'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection', - 'ImageFileInfo', 'ImageFilter', 'ImageFocus', 'ImageGenerateROIMask', - 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate', - 'ImageLineProfile', 'ImageLoad', 'ImageMorphology', 'ImageRegistration', - 'ImageRemoveBackground', 'ImageRestore', 'ImageRotate', 'ImageSave', - 'ImageSeedFill', 'ImageSnake', 'ImageStats', 'ImageThreshold', - 'ImageTransform', 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort', - 'InsertPoints', 'Integrate', 'IntegrateODE', 'Interp3DPath', - 'Interpolate3D', 'KillBackground', 'KillControl', 'KillDataFolder', - 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', 'KillStrings', - 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', 'Layout', - 'Legend', 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData', - 'LoadPackagePreferences', 'LoadPICT', 'LoadWave', 'Loess', - 'LombPeriodogram', 'Make', 'MakeIndex', 'MarkPerfTestTime', - 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', 'MatrixFilter', - 'MatrixGaussJ', 'MatrixInverse', 'MatrixLinearSolve', - 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD', - 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve', - 'MatrixSVBkSub', 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText', - 'Modify', 'ModifyContour', 'ModifyControl', 'ModifyControlList', - 'ModifyFreeAxis', 'ModifyGraph', 'ModifyImage', 'ModifyLayout', - 'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', 'MoveDataFolder', - 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', 'MoveVariable', - 'MoveWave', 'MoveWindow', 'NeuralNetworkRun', 'NeuralNetworkTrain', - 'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewImage', - 'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath', - 'NewWaterfall', 'Note', 'Notebook', 'NotebookAction', 'Open', - 'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo', - 'PauseForUser', 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction', - 'PlaySnd', 'PlaySound', 'PopupContextualMenu', 'PopupMenu', - 'Preferences', 'PrimeFactors', 'Print', 'printf', 'PrintGraphs', - 'PrintLayout', 'PrintNotebook', 'PrintSettings', 'PrintTable', - 'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit', - 'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour', - 'RemoveFromGraph', 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage', - 'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder', - 'RenamePath', 'RenamePICT', 'RenameWindow', 'ReorderImages', - 'ReorderTraces', 'ReplaceText', 'ReplaceWave', 'Resample', - 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', 'SaveData', - 'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook', - 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy', - 'SetActiveSubwindow', 'SetAxis', 'SetBackground', 'SetDashPattern', - 'SetDataFolder', 'SetDimLabel', 'SetDrawEnv', 'SetDrawLayer', - 'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', 'SetIgorMenuMode', - 'SetIgorOption', 'SetMarquee', 'SetProcessSleep', 'SetRandomSeed', - 'SetScale', 'SetVariable', 'SetWaveLock', 'SetWindow', 'ShowIgorMenus', - 'ShowInfo', 'ShowTools', 'Silent', 'Sleep', 'Slider', 'Smooth', - 'SmoothCustom', 'Sort', 'SoundInRecord', 'SoundInSet', - 'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart', - 'SphericalInterpolate', 'SphericalTriangulate', 'SplitString', - 'sprintf', 'sscanf', 'Stack', 'StackWindows', - 'StatsAngularDistanceTest', 'StatsANOVA1Test', 'StatsANOVA2NRTest', - 'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest', - 'StatsCircularCorrelationTest', 'StatsCircularMeans', - 'StatsCircularMoments', 'StatsCircularTwoSampleTest', - 'StatsCochranTest', 'StatsContingencyTable', 'StatsDIPTest', - 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest', - 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKendallTauTest', - 'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest', - 'StatsLinearRegression', 'StatsMultiCorrelationTest', - 'StatsNPMCTest', 'StatsNPNominalSRTest', 'StatsQuantiles', - 'StatsRankCorrelationTest', 'StatsResample', 'StatsSample', - 'StatsScheffeTest', 'StatsSignTest', 'StatsSRTest', 'StatsTTest', - 'StatsTukeyTest', 'StatsVariancesTest', 'StatsWatsonUSquaredTest', - 'StatsWatsonWilliamsTest', 'StatsWheelerWatsonTest', - 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', 'String', - 'StructGet', 'StructPut', 'TabControl', 'Tag', 'TextBox', 'Tile', - 'TileWindows', 'TitleBox', 'ToCommandLine', 'ToolsGrid', - 'Triangulate3d', 'Unwrap', 'ValDisplay', 'Variable', 'WaveMeanStdv', - 'WaveStats', 'WaveTransform', 'wfprintf', 'WignerTransform', - 'WindowFunction', - ) - functions = ( - 'abs', 'acos', 'acosh', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', 'alog', - 'area', 'areaXY', 'asin', 'asinh', 'atan', 'atan2', 'atanh', - 'AxisValFromPixel', 'Besseli', 'Besselj', 'Besselk', 'Bessely', 'bessi', - 'bessj', 'bessk', 'bessy', 'beta', 'betai', 'BinarySearch', - 'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise', 'cabs', - 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', 'chebyshev', - 'chebyshevU', 'CheckName', 'cmplx', 'cmpstr', 'conj', 'ContourZ', 'cos', - 'cosh', 'cot', 'CountObjects', 'CountObjectsDFR', 'cpowi', - 'CreationDate', 'csc', 'DataFolderExists', 'DataFolderRefsEqual', - 'DataFolderRefStatus', 'date2secs', 'datetime', 'DateToJulian', - 'Dawson', 'DDEExecute', 'DDEInitiate', 'DDEPokeString', 'DDEPokeWave', - 'DDERequestWave', 'DDEStatus', 'DDETerminate', 'deltax', 'digamma', - 'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', 'erf', - 'erfc', 'exists', 'exp', 'expInt', 'expNoise', 'factorial', 'fakedata', - 'faverage', 'faverageXY', 'FindDimLabel', 'FindListItem', 'floor', - 'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin', - 'gamma', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss', - 'Gauss1D', 'Gauss2D', 'gcd', 'GetDefaultFontSize', - 'GetDefaultFontStyle', 'GetKeyState', 'GetRTError', 'gnoise', - 'GrepString', 'hcsr', 'hermite', 'hermiteGauss', 'HyperG0F1', - 'HyperG1F1', 'HyperG2F1', 'HyperGNoise', 'HyperGPFQ', 'IgorVersion', - 'ilim', 'imag', 'Inf', 'Integrate1D', 'interp', 'Interp2D', 'Interp3D', - 'inverseERF', 'inverseERFC', 'ItemsInList', 'jlim', 'Laguerre', - 'LaguerreA', 'LaguerreGauss', 'leftx', 'LegendreA', 'limit', 'ln', - 'log', 'logNormalNoise', 'lorentzianNoise', 'magsqr', 'MandelbrotPoint', - 'MarcumQ', 'MatrixDet', 'MatrixDot', 'MatrixRank', 'MatrixTrace', 'max', - 'mean', 'min', 'mod', 'ModDate', 'NaN', 'norm', 'NumberByKey', - 'numpnts', 'numtype', 'NumVarOrDefault', 'NVAR_Exists', 'p2rect', - 'ParamIsDefault', 'pcsr', 'Pi', 'PixelFromAxisVal', 'pnt2x', - 'poissonNoise', 'poly', 'poly2D', 'PolygonArea', 'qcsr', 'r2polar', - 'real', 'rightx', 'round', 'sawtooth', 'ScreenResolution', 'sec', - 'SelectNumber', 'sign', 'sin', 'sinc', 'sinh', 'SphericalBessJ', - 'SphericalBessJD', 'SphericalBessY', 'SphericalBessYD', - 'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF', - 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF', - 'StatsCauchyCDF', 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF', - 'StatsCMSSDCDF', 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF', - 'StatsErlangCDF', 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF', - 'StatsEValuePDF', 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF', - 'StatsFPDF', 'StatsFriedmanCDF', 'StatsGammaCDF', 'StatsGammaPDF', - 'StatsGeometricCDF', 'StatsGeometricPDF', 'StatsHyperGCDF', - 'StatsHyperGPDF', 'StatsInvBetaCDF', 'StatsInvBinomialCDF', - 'StatsInvCauchyCDF', 'StatsInvChiCDF', 'StatsInvCMSSDCDF', - 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF', - 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF', - 'StatsInvGeometricCDF', 'StatsInvKuiperCDF', 'StatsInvLogisticCDF', - 'StatsInvLogNormalCDF', 'StatsInvMaxwellCDF', 'StatsInvMooreCDF', - 'StatsInvNBinomialCDF', 'StatsInvNCChiCDF', 'StatsInvNCFCDF', - 'StatsInvNormalCDF', 'StatsInvParetoCDF', 'StatsInvPoissonCDF', - 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF', - 'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF', - 'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF', - 'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF', - 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF', - 'StatsLogNormalCDF', 'StatsLogNormalPDF', 'StatsMaxwellCDF', - 'StatsMaxwellPDF', 'StatsMedian', 'StatsMooreCDF', 'StatsNBinomialCDF', - 'StatsNBinomialPDF', 'StatsNCChiCDF', 'StatsNCChiPDF', 'StatsNCFCDF', - 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', 'StatsNormalCDF', - 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', 'StatsPermute', - 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF', - 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF', - 'StatsRayleighCDF', 'StatsRayleighPDF', 'StatsRectangularCDF', - 'StatsRectangularPDF', 'StatsRunsCDF', 'StatsSpearmanRhoCDF', - 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF', - 'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean', - 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise', - 'StatsVonMisesPDF', 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF', - 'StatsWeibullPDF', 'StopMSTimer', 'str2num', 'stringCRC', 'stringmatch', - 'strlen', 'strsearch', 'StudentA', 'StudentT', 'sum', 'SVAR_Exists', - 'TagVal', 'tan', 'tanh', 'ThreadGroupCreate', 'ThreadGroupRelease', - 'ThreadGroupWait', 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks', - 'trunc', 'Variance', 'vcsr', 'WaveCRC', 'WaveDims', 'WaveExists', - 'WaveMax', 'WaveMin', 'WaveRefsEqual', 'WaveType', 'WhichListItem', - 'WinType', 'WNoise', 'x', 'x2pnt', 'xcsr', 'y', 'z', 'zcsr', 'ZernikeR', - ) - functions += ( - 'AddListItem', 'AnnotationInfo', 'AnnotationList', 'AxisInfo', - 'AxisList', 'CaptureHistory', 'ChildWindowList', 'CleanupName', - 'ContourInfo', 'ContourNameList', 'ControlNameList', 'CsrInfo', - 'CsrWave', 'CsrXWave', 'CTabList', 'DataFolderDir', 'date', - 'DDERequestString', 'FontList', 'FuncRefInfo', 'FunctionInfo', - 'FunctionList', 'FunctionPath', 'GetDataFolder', 'GetDefaultFont', - 'GetDimLabel', 'GetErrMessage', 'GetFormula', - 'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR', - 'GetRTErrMessage', 'GetRTStackInfo', 'GetScrapText', 'GetUserData', - 'GetWavesDataFolder', 'GrepList', 'GuideInfo', 'GuideNameList', 'Hash', - 'IgorInfo', 'ImageInfo', 'ImageNameList', 'IndexedDir', 'IndexedFile', - 'JulianToDate', 'LayoutInfo', 'ListMatch', 'LowerStr', 'MacroList', - 'NameOfWave', 'note', 'num2char', 'num2istr', 'num2str', - 'OperationList', 'PadString', 'ParseFilePath', 'PathList', 'PICTInfo', - 'PICTList', 'PossiblyQuoteName', 'ProcedureText', 'RemoveByKey', - 'RemoveEnding', 'RemoveFromList', 'RemoveListItem', - 'ReplaceNumberByKey', 'ReplaceString', 'ReplaceStringByKey', - 'Secs2Date', 'Secs2Time', 'SelectString', 'SortList', - 'SpecialCharacterInfo', 'SpecialCharacterList', 'SpecialDirPath', - 'StringByKey', 'StringFromList', 'StringList', 'StrVarOrDefault', - 'TableInfo', 'TextFile', 'ThreadGroupGetDF', 'time', 'TraceFromPixel', - 'TraceInfo', 'TraceNameList', 'UniqueName', 'UnPadString', 'UpperStr', - 'VariableList', 'WaveInfo', 'WaveList', 'WaveName', 'WaveUnits', - 'WinList', 'WinName', 'WinRecreation', 'XWaveName', - 'ContourNameToWaveRef', 'CsrWaveRef', 'CsrXWaveRef', - 'ImageNameToWaveRef', 'NewFreeWave', 'TagWaveRef', 'TraceNameToWaveRef', - 'WaveRefIndexed', 'XWaveRefFromTrace', 'GetDataFolderDFR', - 'GetWavesDataFolderDFR', 'NewFreeDataFolder', 'ThreadGroupGetDFR', - ) - - tokens = { - 'root': [ - (r'//.*$', Comment.Single), - (r'"([^"\\]|\\.)*"', String), - # Flow Control. - (words(flowControl, prefix=r'\b', suffix=r'\b'), Keyword), - # Types. - (words(types, prefix=r'\b', suffix=r'\b'), Keyword.Type), - # Keywords. - (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword.Reserved), - # Built-in operations. - (words(operations, prefix=r'\b', suffix=r'\b'), Name.Class), - # Built-in functions. - (words(functions, prefix=r'\b', suffix=r'\b'), Name.Function), - # Compiler directives. - (r'^#(include|pragma|define|ifdef|ifndef|endif)', - Name.Decorator), - (r'[^a-z"/]+$', Text), - (r'.', Text), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/iolang.py b/wakatime/packages/py3/pygments/lexers/iolang.py deleted file mode 100644 index 0bf86f5..0000000 --- a/wakatime/packages/py3/pygments/lexers/iolang.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.iolang - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for the Io language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number - -__all__ = ['IoLexer'] - - -class IoLexer(RegexLexer): - """ - For `Io `_ (a small, prototype-based - programming language) source. - - .. versionadded:: 0.10 - """ - name = 'Io' - filenames = ['*.io'] - aliases = ['io'] - mimetypes = ['text/x-iosrc'] - tokens = { - 'root': [ - (r'\n', Text), - (r'\s+', Text), - # Comments - (r'//(.*?)\n', Comment.Single), - (r'#(.*?)\n', Comment.Single), - (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), - (r'/\+', Comment.Multiline, 'nestedcomment'), - # DoubleQuotedString - (r'"(\\\\|\\"|[^"])*"', String), - # Operators - (r'::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}', - Operator), - # keywords - (r'(clone|do|doFile|doString|method|for|if|else|elseif|then)\b', - Keyword), - # constants - (r'(nil|false|true)\b', Name.Constant), - # names - (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b', - Name.Builtin), - ('[a-zA-Z_]\w*', Name), - # numbers - (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), - (r'\d+', Number.Integer) - ], - 'nestedcomment': [ - (r'[^+/]+', Comment.Multiline), - (r'/\+', Comment.Multiline, '#push'), - (r'\+/', Comment.Multiline, '#pop'), - (r'[+/]', Comment.Multiline), - ] - } diff --git a/wakatime/packages/py3/pygments/lexers/julia.py b/wakatime/packages/py3/pygments/lexers/julia.py deleted file mode 100644 index ba80a79..0000000 --- a/wakatime/packages/py3/pygments/lexers/julia.py +++ /dev/null @@ -1,194 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.julia - ~~~~~~~~~~~~~~~~~~~~~ - - Lexers for the Julia language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, bygroups, combined, do_insertions -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic -from pygments.util import shebang_matches - -__all__ = ['JuliaLexer', 'JuliaConsoleLexer'] - - -class JuliaLexer(RegexLexer): - """ - For `Julia `_ source code. - - .. versionadded:: 1.6 - """ - name = 'Julia' - aliases = ['julia', 'jl'] - filenames = ['*.jl'] - mimetypes = ['text/x-julia', 'application/x-julia'] - - builtins = [ - 'exit', 'whos', 'edit', 'load', 'is', 'isa', 'isequal', 'typeof', 'tuple', - 'ntuple', 'uid', 'hash', 'finalizer', 'convert', 'promote', 'subtype', - 'typemin', 'typemax', 'realmin', 'realmax', 'sizeof', 'eps', 'promote_type', - 'method_exists', 'applicable', 'invoke', 'dlopen', 'dlsym', 'system', - 'error', 'throw', 'assert', 'new', 'Inf', 'Nan', 'pi', 'im', - ] - - tokens = { - 'root': [ - (r'\n', Text), - (r'[^\S\n]+', Text), - (r'#=', Comment.Multiline, "blockcomment"), - (r'#.*$', Comment), - (r'[]{}:(),;[@]', Punctuation), - (r'\\\n', Text), - (r'\\', Text), - - # keywords - (r'(begin|while|for|in|return|break|continue|' - r'macro|quote|let|if|elseif|else|try|catch|end|' - r'bitstype|ccall|do|using|module|import|export|' - r'importall|baremodule|immutable)\b', Keyword), - (r'(local|global|const)\b', Keyword.Declaration), - (r'(Bool|Int|Int8|Int16|Int32|Int64|Uint|Uint8|Uint16|Uint32|Uint64' - r'|Float32|Float64|Complex64|Complex128|Any|Nothing|None)\b', - Keyword.Type), - - # functions - (r'(function)((?:\s|\\\s)+)', - bygroups(Keyword, Name.Function), 'funcname'), - - # types - (r'(type|typealias|abstract)((?:\s|\\\s)+)', - bygroups(Keyword, Name.Class), 'typename'), - - # operators - (r'==|!=|<=|>=|->|&&|\|\||::|<:|[-~+/*%=<>&^|.?!$]', Operator), - (r'\.\*|\.\^|\.\\|\.\/|\\', Operator), - - # builtins - ('(' + '|'.join(builtins) + r')\b', Name.Builtin), - - # backticks - (r'`(?s).*?`', String.Backtick), - - # chars - (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|" - r"\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char), - - # try to match trailing transpose - (r'(?<=[.\w)\]])\'+', Operator), - - # strings - (r'(?:[IL])"', String, 'string'), - (r'[E]?"', String, combined('stringescape', 'string')), - - # names - (r'@[\w.]+', Name.Decorator), - (r'[a-zA-Z_]\w*', Name), - - # numbers - (r'(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?', Number.Float), - (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float), - (r'\d+(_\d+)+[eEf][+-]?[0-9]+', Number.Float), - (r'\d+[eEf][+-]?[0-9]+', Number.Float), - (r'0b[01]+(_[01]+)+', Number.Bin), - (r'0b[01]+', Number.Bin), - (r'0o[0-7]+(_[0-7]+)+', Number.Oct), - (r'0o[0-7]+', Number.Oct), - (r'0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+', Number.Hex), - (r'0x[a-fA-F0-9]+', Number.Hex), - (r'\d+(_\d+)+', Number.Integer), - (r'\d+', Number.Integer) - ], - - 'funcname': [ - ('[a-zA-Z_]\w*', Name.Function, '#pop'), - ('\([^\s\w{]{1,2}\)', Operator, '#pop'), - ('[^\s\w{]{1,2}', Operator, '#pop'), - ], - - 'typename': [ - ('[a-zA-Z_]\w*', Name.Class, '#pop') - ], - - 'stringescape': [ - (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|' - r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape) - ], - "blockcomment": [ - (r'[^=#]', Comment.Multiline), - (r'#=', Comment.Multiline, '#push'), - (r'=#', Comment.Multiline, '#pop'), - (r'[=#]', Comment.Multiline), - ], - 'string': [ - (r'"', String, '#pop'), - (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings - (r'\$(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?', - String.Interpol), - (r'[^\\"$]+', String), - # quotes, dollar signs, and backslashes must be parsed one at a time - (r'["\\]', String), - # unhandled string formatting sign - (r'\$', String) - ], - } - - def analyse_text(text): - return shebang_matches(text, r'julia') - - -line_re = re.compile('.*?\n') - - -class JuliaConsoleLexer(Lexer): - """ - For Julia console sessions. Modeled after MatlabSessionLexer. - - .. versionadded:: 1.6 - """ - name = 'Julia console' - aliases = ['jlcon'] - - def get_tokens_unprocessed(self, text): - jllexer = JuliaLexer(**self.options) - - curcode = '' - insertions = [] - - for match in line_re.finditer(text): - line = match.group() - - if line.startswith('julia>'): - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:6])])) - curcode += line[6:] - - elif line.startswith(' '): - - idx = len(curcode) - - # without is showing error on same line as before...? - line = "\n" + line - token = (0, Generic.Traceback, line) - insertions.append((idx, [token])) - - else: - if curcode: - for item in do_insertions( - insertions, jllexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - - yield match.start(), Generic.Output, line - - if curcode: # or item: - for item in do_insertions( - insertions, jllexer.get_tokens_unprocessed(curcode)): - yield item diff --git a/wakatime/packages/py3/pygments/lexers/jvm.py b/wakatime/packages/py3/pygments/lexers/jvm.py deleted file mode 100644 index 76e3c24..0000000 --- a/wakatime/packages/py3/pygments/lexers/jvm.py +++ /dev/null @@ -1,1560 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.jvm - ~~~~~~~~~~~~~~~~~~~ - - Pygments lexers for JVM languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ - this, combined, default, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation -from pygments.util import shebang_matches -from pygments import unistring as uni - -__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer', - 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer', - 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer', - 'PigLexer', 'GoloLexer', 'JasminLexer'] - - -class JavaLexer(RegexLexer): - """ - For `Java `_ source code. - """ - - name = 'Java' - aliases = ['java'] - filenames = ['*.java'] - mimetypes = ['text/x-java'] - - flags = re.MULTILINE | re.DOTALL | re.UNICODE - - tokens = { - 'root': [ - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - # keywords: go before method names to avoid lexing "throw new XYZ" - # as a method signature - (r'(assert|break|case|catch|continue|default|do|else|finally|for|' - r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b', - Keyword), - # method names - (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments - r'((?:[^\W\d]|\$)[\w$]*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'@[^\W\d][\w.]*', Name.Decorator), - (r'(abstract|const|enum|extends|final|implements|native|private|' - r'protected|public|static|strictfp|super|synchronized|throws|' - r'transient|volatile)\b', Keyword.Declaration), - (r'(boolean|byte|char|double|float|int|long|short|void)\b', - Keyword.Type), - (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'(true|false|null)\b', Keyword.Constant), - (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), 'class'), - (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'"(\\\\|\\"|[^"])*"', String), - (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), - (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)), - (r'^\s*([^\W\d]|\$)[\w$]*:', Name.Label), - (r'([^\W\d]|\$)[\w$]*', Name), - (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+(_+[0-9]+)*L?', Number.Integer), - (r'\n', Text) - ], - 'class': [ - (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop') - ], - 'import': [ - (r'[\w.]+\*?', Name.Namespace, '#pop') - ], - } - - -class AspectJLexer(JavaLexer): - """ - For `AspectJ `_ source code. - - .. versionadded:: 1.6 - """ - - name = 'AspectJ' - aliases = ['aspectj'] - filenames = ['*.aj'] - mimetypes = ['text/x-aspectj'] - - aj_keywords = set(( - 'aspect', 'pointcut', 'privileged', 'call', 'execution', - 'initialization', 'preinitialization', 'handler', 'get', 'set', - 'staticinitialization', 'target', 'args', 'within', 'withincode', - 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around', - 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare', - 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint', - 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart', - 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow', - 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance' - )) - aj_inter_type = set(('parents:', 'warning:', 'error:', 'soft:', 'precedence:')) - aj_inter_type_annotation = set(('@type', '@method', '@constructor', '@field')) - - def get_tokens_unprocessed(self, text): - for index, token, value in JavaLexer.get_tokens_unprocessed(self, text): - if token is Name and value in self.aj_keywords: - yield index, Keyword, value - elif token is Name.Label and value in self.aj_inter_type: - yield index, Keyword, value[:-1] - yield index, Operator, value[-1] - elif token is Name.Decorator and value in self.aj_inter_type_annotation: - yield index, Keyword, value - else: - yield index, token, value - - -class ScalaLexer(RegexLexer): - """ - For `Scala `_ source code. - """ - - name = 'Scala' - aliases = ['scala'] - filenames = ['*.scala'] - mimetypes = ['text/x-scala'] - - flags = re.MULTILINE | re.DOTALL - - # don't use raw unicode strings! - op = (u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1' - u'\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9' - u'\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2' - u'\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38' - u'\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940' - u'\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c' - u'\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118' - u'\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144' - u'\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767' - u'\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb' - u'\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020' - u'\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3' - u'\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff' - u'\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66' - u'\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+') - - letter = (u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6' - u'\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386' - u'\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2' - u'\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5' - u'\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5' - u'\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961' - u'\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1' - u'\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd' - u'\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9' - u'\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1' - u'\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30' - u'\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4' - u'\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f' - u'\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070' - u'\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f' - u'\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711' - u'\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc' - u'\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7' - u'\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf' - u'\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77' - u'\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb' - u'\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113' - u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139' - u'\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c' - u'\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029' - u'\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e' - u'\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c' - u'\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f' - u'\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822' - u'\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28' - u'\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28' - u'\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a' - u'\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]') - - upper = (u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108' - u'\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c' - u'\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130' - u'\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145' - u'\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a' - u'\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e' - u'\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182' - u'\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194' - u'\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7' - u'\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc' - u'\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9' - u'\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee' - u'\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204' - u'\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218' - u'\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c' - u'\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246' - u'\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f' - u'\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0' - u'\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7' - u'\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a' - u'\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e' - u'\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a' - u'\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae' - u'\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1' - u'\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6' - u'\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea' - u'\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe' - u'\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512' - u'\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556' - u'\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e' - u'\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22' - u'\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36' - u'\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a' - u'\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e' - u'\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72' - u'\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86' - u'\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2' - u'\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6' - u'\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca' - u'\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede' - u'\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2' - u'\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d' - u'\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f' - u'\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb' - u'\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112' - u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133' - u'\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67' - u'\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86' - u'\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a' - u'\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae' - u'\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2' - u'\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6' - u'\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646' - u'\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a' - u'\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682' - u'\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696' - u'\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736' - u'\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a' - u'\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e' - u'\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b' - u'\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]') - - idrest = u'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op) - letter_letter_digit = u'%s(?:%s|\d)*' % (letter, letter) - - tokens = { - 'root': [ - # method names - (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'), - (u"'%s" % idrest, Text.Symbol), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*', Comment.Multiline, 'comment'), - (u'@%s' % idrest, Name.Decorator), - (u'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|' - u'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|' - u'lazy|match|new|override|pr(?:ivate|otected)' - u'|re(?:quires|turn)|s(?:ealed|uper)|' - u't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\\b|' - u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\\b|(?=\\s)|$)', Keyword), - (u':(?!%s)' % op, Keyword, 'type'), - (u'%s%s\\b' % (upper, idrest), Name.Class), - (r'(true|false|null)\b', Keyword.Constant), - (r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'), - (r'(type)(\s+)', bygroups(Keyword, Text), 'type'), - (r'""".*?"""(?!")', String), - (r'"(\\\\|\\"|[^"])*"', String), - (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), - (r'[fs]"""', String, 'interptriplestring'), # interpolated strings - (r'[fs]"', String, 'interpstring'), # interpolated strings - (r'raw"(\\\\|\\"|[^"])*"', String), # raw strings - # (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator, - # Name.Attribute)), - (idrest, Name), - (r'`[^`]+`', Name), - (r'\[', Operator, 'typeparam'), - (r'[(){};,.#]', Operator), - (op, Operator), - (r'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?', - Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text) - ], - 'class': [ - (u'(%s|%s|`[^`]+`)(\\s*)(\\[)' % (idrest, op), - bygroups(Name.Class, Text, Operator), 'typeparam'), - (r'\s+', Text), - (r'\{', Operator, '#pop'), - (r'\(', Operator, '#pop'), - (r'//.*?\n', Comment.Single, '#pop'), - (u'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'), - ], - 'type': [ - (r'\s+', Text), - (r'<[%:]|>:|[#_]|forSome|type', Keyword), - (u'([,);}]|=>|=|\u21d2)(\\s*)', bygroups(Operator, Text), '#pop'), - (r'[({]', Operator, '#push'), - (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)' % - (idrest, op, idrest, op), - bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')), - (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$' % - (idrest, op, idrest, op), - bygroups(Keyword.Type, Text), '#pop'), - (r'//.*?\n', Comment.Single, '#pop'), - (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) - ], - 'typeparam': [ - (r'[\s,]+', Text), - (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword), - (r'([\])}])', Operator, '#pop'), - (r'[(\[{]', Operator, '#push'), - (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) - ], - 'comment': [ - (r'[^/*]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline) - ], - 'import': [ - (u'(%s|\\.)+' % idrest, Name.Namespace, '#pop') - ], - 'interpstringcommon': [ - (r'[^"$\\]+', String), - (r'\$\$', String), - (r'\$' + letter_letter_digit, String.Interpol), - (r'\$\{', String.Interpol, 'interpbrace'), - (r'\\.', String), - ], - 'interptriplestring': [ - (r'"""(?!")', String, '#pop'), - (r'"', String), - include('interpstringcommon'), - ], - 'interpstring': [ - (r'"', String, '#pop'), - include('interpstringcommon'), - ], - 'interpbrace': [ - (r'\}', String.Interpol, '#pop'), - (r'\{', String.Interpol, '#push'), - include('root'), - ], - } - - -class GosuLexer(RegexLexer): - """ - For Gosu source code. - - .. versionadded:: 1.5 - """ - - name = 'Gosu' - aliases = ['gosu'] - filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark'] - mimetypes = ['text/x-gosu'] - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'root': [ - # method names - (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # modifiers etc. - r'([a-zA-Z_]\w*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'@[a-zA-Z_][\w.]*', Name.Decorator), - (r'(in|as|typeof|statictypeof|typeis|typeas|if|else|foreach|for|' - r'index|while|do|continue|break|return|try|catch|finally|this|' - r'throw|new|switch|case|default|eval|super|outer|classpath|' - r'using)\b', Keyword), - (r'(var|delegate|construct|function|private|internal|protected|' - r'public|abstract|override|final|static|extends|transient|' - r'implements|represents|readonly)\b', Keyword.Declaration), - (r'(property\s+)(get|set)?', Keyword.Declaration), - (r'(boolean|byte|char|double|float|int|long|short|void|block)\b', - Keyword.Type), - (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), - (r'(true|false|null|NaN|Infinity)\b', Keyword.Constant), - (r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_]\w*)', - bygroups(Keyword.Declaration, Text, Name.Class)), - (r'(uses)(\s+)([\w.]+\*?)', - bygroups(Keyword.Namespace, Text, Name.Namespace)), - (r'"', String, 'string'), - (r'(\??[.#])([a-zA-Z_]\w*)', - bygroups(Operator, Name.Attribute)), - (r'(:)([a-zA-Z_]\w*)', - bygroups(Operator, Name.Attribute)), - (r'[a-zA-Z_$]\w*', Name), - (r'and|or|not|[\\~^*!%&\[\](){}<>|+=:;,./?-]', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'[0-9]+', Number.Integer), - (r'\n', Text) - ], - 'templateText': [ - (r'(\\<)|(\\\$)', String), - (r'(<%@\s+)(extends|params)', - bygroups(Operator, Name.Decorator), 'stringTemplate'), - (r'<%!--.*?--%>', Comment.Multiline), - (r'(<%)|(<%=)', Operator, 'stringTemplate'), - (r'\$\{', Operator, 'stringTemplateShorthand'), - (r'.', String) - ], - 'string': [ - (r'"', String, '#pop'), - include('templateText') - ], - 'stringTemplate': [ - (r'"', String, 'string'), - (r'%>', Operator, '#pop'), - include('root') - ], - 'stringTemplateShorthand': [ - (r'"', String, 'string'), - (r'\{', Operator, 'stringTemplateShorthand'), - (r'\}', Operator, '#pop'), - include('root') - ], - } - - -class GosuTemplateLexer(Lexer): - """ - For Gosu templates. - - .. versionadded:: 1.5 - """ - - name = 'Gosu Template' - aliases = ['gst'] - filenames = ['*.gst'] - mimetypes = ['text/x-gosu-template'] - - def get_tokens_unprocessed(self, text): - lexer = GosuLexer() - stack = ['templateText'] - for item in lexer.get_tokens_unprocessed(text, stack): - yield item - - -class GroovyLexer(RegexLexer): - """ - For `Groovy `_ source code. - - .. versionadded:: 1.5 - """ - - name = 'Groovy' - aliases = ['groovy'] - filenames = ['*.groovy'] - mimetypes = ['text/x-groovy'] - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'root': [ - # Groovy allows a file to start with a shebang - (r'#!(.*?)$', Comment.Preproc, 'base'), - default('base'), - ], - 'base': [ - # method names - (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments - r'([a-zA-Z_]\w*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'@[a-zA-Z_][\w.]*', Name.Decorator), - (r'(assert|break|case|catch|continue|default|do|else|finally|for|' - r'if|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b', - Keyword), - (r'(abstract|const|enum|extends|final|implements|native|private|' - r'protected|public|static|strictfp|super|synchronized|throws|' - r'transient|volatile)\b', Keyword.Declaration), - (r'(def|boolean|byte|char|double|float|int|long|short|void)\b', - Keyword.Type), - (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), - (r'(true|false|null)\b', Keyword.Constant), - (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), - 'class'), - (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'""".*?"""', String.Double), - (r"'''.*?'''", String.Single), - (r'"(\\\\|\\"|[^"])*"', String.Double), - (r"'(\\\\|\\'|[^'])*'", String.Single), - (r'\$/((?!/\$).)*/\$', String), - (r'/(\\\\|\\"|[^/])*/', String), - (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), - (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), - (r'[a-zA-Z_]\w*:', Name.Label), - (r'[a-zA-Z_$]\w*', Name), - (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text) - ], - 'class': [ - (r'[a-zA-Z_]\w*', Name.Class, '#pop') - ], - 'import': [ - (r'[\w.]+\*?', Name.Namespace, '#pop') - ], - } - - def analyse_text(text): - return shebang_matches(text, r'groovy') - - -class IokeLexer(RegexLexer): - """ - For `Ioke `_ (a strongly typed, dynamic, - prototype based programming language) source. - - .. versionadded:: 1.4 - """ - name = 'Ioke' - filenames = ['*.ik'] - aliases = ['ioke', 'ik'] - mimetypes = ['text/x-iokesrc'] - tokens = { - 'interpolatableText': [ - (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}' - r'|\\[0-3]?[0-7]?[0-7])', String.Escape), - (r'#\{', Punctuation, 'textInterpolationRoot') - ], - - 'text': [ - (r'(?>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|' - r'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|' - r'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|' - r'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|' - r'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|' - r'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|' - u'\\?|#|\u2260|\u2218|\u2208|\u2209)', Operator), - (r'(and|nand|or|xor|nor|return|import)(?![\w!?])', - Operator), - - # Punctuation - (r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|\{|\})', Punctuation), - - # kinds - (r'[A-Z][\w!:?]*', Name.Class), - - # default cellnames - (r'[a-z_][\w!:?]*', Name) - ] - } - - -class ClojureLexer(RegexLexer): - """ - Lexer for `Clojure `_ source code. - - .. versionadded:: 0.11 - """ - name = 'Clojure' - aliases = ['clojure', 'clj'] - filenames = ['*.clj'] - mimetypes = ['text/x-clojure', 'application/x-clojure'] - - special_forms = ( - '.', 'def', 'do', 'fn', 'if', 'let', 'new', 'quote', 'var', 'loop' - ) - - # It's safe to consider 'ns' a declaration thing because it defines a new - # namespace. - declarations = ( - 'def-', 'defn', 'defn-', 'defmacro', 'defmulti', 'defmethod', - 'defstruct', 'defonce', 'declare', 'definline', 'definterface', - 'defprotocol', 'defrecord', 'deftype', 'defproject', 'ns' - ) - - builtins = ( - '*', '+', '-', '->', '/', '<', '<=', '=', '==', '>', '>=', '..', - 'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns', - 'alter', 'and', 'append-child', 'apply', 'array-map', 'aset', - 'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float', - 'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await', - 'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or', - 'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?', - 'butlast', 'byte', 'cast', 'char', 'children', 'class', - 'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator', - 'complement', 'concat', 'conj', 'cons', 'constantly', 'cond', 'if-not', - 'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct', - 'cycle', 'dec', 'deref', 'difference', 'disj', 'dissoc', 'distinct', - 'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto', - 'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure', - 'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find', - 'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush', 'for', - 'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get', - 'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import', - 'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right', - 'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave', - 'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys', - 'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left', - 'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file', - 'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1', - 'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat', - 'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min', - 'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next', - 'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports', - 'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers', - 'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial', - 'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str', - 'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy', - 'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find', - 're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq', - 'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem', - 'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys', - 'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq', - 'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq', - 'second', 'select', 'select-keys', 'send', 'send-off', 'seq', - 'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort', - 'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set', - 'special-symbol?', 'split-at', 'split-with', 'str', 'string?', - 'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?', - 'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array', - 'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy', - 'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip', - 'vector?', 'when', 'when-first', 'when-let', 'when-not', - 'with-local-vars', 'with-meta', 'with-open', 'with-out-str', - 'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper') - - # valid names for identifiers - # well, names can only not consist fully of numbers - # but this should be good enough for now - - # TODO / should divide keywords/symbols into namespace/rest - # but that's hard, so just pretend / is part of the name - valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+' - - tokens = { - 'root': [ - # the comments - always starting with semicolon - # and going to the end of the line - (r';.*$', Comment.Single), - - # whitespaces - usually not relevant - (r'[,\s]+', Text), - - # numbers - (r'-?\d+\.\d+', Number.Float), - (r'-?\d+', Number.Integer), - (r'0x-?[abcdef\d]+', Number.Hex), - - # strings, symbols and characters - (r'"(\\\\|\\"|[^"])*"', String), - (r"'" + valid_name, String.Symbol), - (r"\\(.|[a-z]+)", String.Char), - - # keywords - (r'::?#?' + valid_name, String.Symbol), - - # special operators - (r'~@|[`\'#^~&@]', Operator), - - # highlight the special forms - (words(special_forms, suffix=' '), Keyword), - - # Technically, only the special forms are 'keywords'. The problem - # is that only treating them as keywords means that things like - # 'defn' and 'ns' need to be highlighted as builtins. This is ugly - # and weird for most styles. So, as a compromise we're going to - # highlight them as Keyword.Declarations. - (words(declarations, suffix=' '), Keyword.Declaration), - - # highlight the builtins - (words(builtins, suffix=' '), Name.Builtin), - - # the remaining functions - (r'(?<=\()' + valid_name, Name.Function), - - # find the remaining variables - (valid_name, Name.Variable), - - # Clojure accepts vector notation - (r'(\[|\])', Punctuation), - - # Clojure accepts map notation - (r'(\{|\})', Punctuation), - - # the famous parentheses! - (r'(\(|\))', Punctuation), - ], - } - - -class ClojureScriptLexer(ClojureLexer): - """ - Lexer for `ClojureScript `_ - source code. - - .. versionadded:: 2.0 - """ - name = 'ClojureScript' - aliases = ['clojurescript', 'cljs'] - filenames = ['*.cljs'] - mimetypes = ['text/x-clojurescript', 'application/x-clojurescript'] - - -class TeaLangLexer(RegexLexer): - """ - For `Tea `_ source code. Only used within a - TeaTemplateLexer. - - .. versionadded:: 1.5 - """ - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'root': [ - # method names - (r'^(\s*(?:[a-zA-Z_][\w\.\[\]]*\s+)+?)' # return arguments - r'([a-zA-Z_]\w*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'@[a-zA-Z_][\w\.]*', Name.Decorator), - (r'(and|break|else|foreach|if|in|not|or|reverse)\b', - Keyword), - (r'(as|call|define)\b', Keyword.Declaration), - (r'(true|false|null)\b', Keyword.Constant), - (r'(template)(\s+)', bygroups(Keyword.Declaration, Text), 'template'), - (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'"(\\\\|\\"|[^"])*"', String), - (r'\'(\\\\|\\\'|[^\'])*\'', String), - (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), - (r'[a-zA-Z_]\w*:', Name.Label), - (r'[a-zA-Z_\$]\w*', Name), - (r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text) - ], - 'template': [ - (r'[a-zA-Z_]\w*', Name.Class, '#pop') - ], - 'import': [ - (r'[\w.]+\*?', Name.Namespace, '#pop') - ], - } - - -class CeylonLexer(RegexLexer): - """ - For `Ceylon `_ source code. - - .. versionadded:: 1.6 - """ - - name = 'Ceylon' - aliases = ['ceylon'] - filenames = ['*.ceylon'] - mimetypes = ['text/x-ceylon'] - - flags = re.MULTILINE | re.DOTALL - - #: optional Comment or Whitespace - _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' - - tokens = { - 'root': [ - # method names - (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments - r'([a-zA-Z_]\w*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*', Comment.Multiline, 'comment'), - (r'(variable|shared|abstract|doc|by|formal|actual|late|native)', - Name.Decorator), - (r'(break|case|catch|continue|default|else|finally|for|in|' - r'variable|if|return|switch|this|throw|try|while|is|exists|dynamic|' - r'nonempty|then|outer|assert)\b', Keyword), - (r'(abstracts|extends|satisfies|adapts|' - r'super|given|of|out|assign|' - r'transient|volatile)\b', Keyword.Declaration), - (r'(function|value|void)\b', - Keyword.Type), - (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), - (r'(true|false|null)\b', Keyword.Constant), - (r'(class|interface|object|alias)(\s+)', - bygroups(Keyword.Declaration, Text), 'class'), - (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'"(\\\\|\\"|[^"])*"', String), - (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char), - (r'".*``.*``.*"', String.Interpol), - (r'(\.)([a-z_]\w*)', - bygroups(Operator, Name.Attribute)), - (r'[a-zA-Z_]\w*:', Name.Label), - (r'[a-zA-Z_]\w*', Name), - (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), - (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), - (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', - Number.Float), - (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), - (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', - Number.Float), - (r'#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+', Number.Hex), - (r'#[0-9a-fA-F]+', Number.Hex), - (r'\$([01]{4})(_[01]{4})+', Number.Bin), - (r'\$[01]+', Number.Bin), - (r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer), - (r'[0-9]+[kMGTP]?', Number.Integer), - (r'\n', Text) - ], - 'class': [ - (r'[A-Za-z_]\w*', Name.Class, '#pop') - ], - 'import': [ - (r'[a-z][\w.]*', - Name.Namespace, '#pop') - ], - 'comment': [ - (r'[^*/]', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline) - ], - } - - -class KotlinLexer(RegexLexer): - """ - For `Kotlin `_ - source code. - - .. versionadded:: 1.5 - """ - - name = 'Kotlin' - aliases = ['kotlin'] - filenames = ['*.kt'] - mimetypes = ['text/x-kotlin'] - - flags = re.MULTILINE | re.DOTALL | re.UNICODE - - kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + - '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', - 'Mn', 'Mc') + ']*') - kt_id = '(' + kt_name + '|`' + kt_name + '`)' - - tokens = { - 'root': [ - (r'^\s*\[.*?\]', Name.Attribute), - (r'[^\S\n]+', Text), - (r'\\\n', Text), # line continuation - (r'//.*?\n', Comment.Single), - (r'/[*].*?[*]/', Comment.Multiline), - (r'\n', Text), - (r'::|!!|\?[:.]', Operator), - (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), - (r'[{}]', Punctuation), - (r'@"(""|[^"])*"', String), - (r'"(\\\\|\\"|[^"\n])*["\n]', String), - (r"'\\.'|'[^\\]'", String.Char), - (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|" - r"0[xX][0-9a-fA-F]+[Ll]?", Number), - (r'(class)(\s+)(object)', bygroups(Keyword, Text, Keyword)), - (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'), - (r'(package|import)(\s+)', bygroups(Keyword, Text), 'package'), - (r'(val|var)(\s+)', bygroups(Keyword, Text), 'property'), - (r'(fun)(\s+)', bygroups(Keyword, Text), 'function'), - (r'(abstract|annotation|as|break|by|catch|class|continue|do|else|' - r'enum|false|final|finally|for|fun|get|if|import|in|inner|' - r'internal|is|null|object|open|out|override|package|private|' - r'protected|public|reified|return|set|super|this|throw|trait|' - r'true|try|type|val|var|vararg|when|where|while|This)\b', Keyword), - (kt_id, Name), - ], - 'package': [ - (r'\S+', Name.Namespace, '#pop') - ], - 'class': [ - (kt_id, Name.Class, '#pop') - ], - 'property': [ - (kt_id, Name.Property, '#pop') - ], - 'function': [ - (kt_id, Name.Function, '#pop') - ], - } - - -class XtendLexer(RegexLexer): - """ - For `Xtend `_ source code. - - .. versionadded:: 1.6 - """ - - name = 'Xtend' - aliases = ['xtend'] - filenames = ['*.xtend'] - mimetypes = ['text/x-xtend'] - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'root': [ - # method names - (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments - r'([a-zA-Z_$][\w$]*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'@[a-zA-Z_][\w.]*', Name.Decorator), - (r'(assert|break|case|catch|continue|default|do|else|finally|for|' - r'if|goto|instanceof|new|return|switch|this|throw|try|while|IF|' - r'ELSE|ELSEIF|ENDIF|FOR|ENDFOR|SEPARATOR|BEFORE|AFTER)\b', - Keyword), - (r'(def|abstract|const|enum|extends|final|implements|native|private|' - r'protected|public|static|strictfp|super|synchronized|throws|' - r'transient|volatile)\b', Keyword.Declaration), - (r'(boolean|byte|char|double|float|int|long|short|void)\b', - Keyword.Type), - (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), - (r'(true|false|null)\b', Keyword.Constant), - (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), - 'class'), - (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r"(''')", String, 'template'), - (u'(\u00BB)', String, 'template'), - (r'"(\\\\|\\"|[^"])*"', String), - (r"'(\\\\|\\'|[^'])*'", String), - (r'[a-zA-Z_]\w*:', Name.Label), - (r'[a-zA-Z_$]\w*', Name), - (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text) - ], - 'class': [ - (r'[a-zA-Z_]\w*', Name.Class, '#pop') - ], - 'import': [ - (r'[\w.]+\*?', Name.Namespace, '#pop') - ], - 'template': [ - (r"'''", String, '#pop'), - (u'\u00AB', String, '#pop'), - (r'.', String) - ], - } - - -class PigLexer(RegexLexer): - """ - For `Pig Latin `_ source code. - - .. versionadded:: 2.0 - """ - - name = 'Pig' - aliases = ['pig'] - filenames = ['*.pig'] - mimetypes = ['text/x-pig'] - - flags = re.MULTILINE | re.IGNORECASE - - tokens = { - 'root': [ - (r'\s+', Text), - (r'--.*', Comment), - (r'/\*[\w\W]*?\*/', Comment.Multiline), - (r'\\\n', Text), - (r'\\', Text), - (r'\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'', String), - include('keywords'), - include('types'), - include('builtins'), - include('punct'), - include('operators'), - (r'[0-9]*\.[0-9]+(e[0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-f]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text), - (r'([a-z_]\w*)(\s*)(\()', - bygroups(Name.Function, Text, Punctuation)), - (r'[()#:]', Text), - (r'[^(:#\'")\s]+', Text), - (r'\S+\s+', Text) # TODO: make tests pass without \s+ - ], - 'keywords': [ - (r'(assert|and|any|all|arrange|as|asc|bag|by|cache|CASE|cat|cd|cp|' - r'%declare|%default|define|dense|desc|describe|distinct|du|dump|' - r'eval|exex|explain|filter|flatten|foreach|full|generate|group|' - r'help|if|illustrate|import|inner|input|into|is|join|kill|left|' - r'limit|load|ls|map|matches|mkdir|mv|not|null|onschema|or|order|' - r'outer|output|parallel|pig|pwd|quit|register|returns|right|rm|' - r'rmf|rollup|run|sample|set|ship|split|stderr|stdin|stdout|store|' - r'stream|through|union|using|void)\b', Keyword) - ], - 'builtins': [ - (r'(AVG|BinStorage|cogroup|CONCAT|copyFromLocal|copyToLocal|COUNT|' - r'cross|DIFF|MAX|MIN|PigDump|PigStorage|SIZE|SUM|TextLoader|' - r'TOKENIZE)\b', Name.Builtin) - ], - 'types': [ - (r'(bytearray|BIGINTEGER|BIGDECIMAL|chararray|datetime|double|float|' - r'int|long|tuple)\b', Keyword.Type) - ], - 'punct': [ - (r'[;(){}\[\]]', Punctuation), - ], - 'operators': [ - (r'[#=,./%+\-?]', Operator), - (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), - (r'(==|<=|<|>=|>|!=)', Operator), - ], - } - - -class GoloLexer(RegexLexer): - """ - For `Golo `_ source code. - - .. versionadded:: 2.0 - """ - - name = 'Golo' - filenames = ['*.golo'] - aliases = ['golo'] - - tokens = { - 'root': [ - (r'[^\S\n]+', Text), - - (r'#.*$', Comment), - - (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|\*|%|/|<=|<|>=|>|=|\.)', - Operator), - (r'(?<=[^-])(-)(?=[^-])', Operator), - - (r'(?<=[^`])(is|isnt|and|or|not|oftype|in|orIfNull)\b', Operator.Word), - (r'[]{}|(),[]', Punctuation), - - (r'(module|import)(\s+)', - bygroups(Keyword.Namespace, Text), - 'modname'), - (r'\b([a-zA-Z_][\w$.]*)(::)', bygroups(Name.Namespace, Punctuation)), - (r'\b([a-zA-Z_][\w$]*(?:\.[a-zA-Z_][\w$]*)+)\b', Name.Namespace), - - (r'(let|var)(\s+)', - bygroups(Keyword.Declaration, Text), - 'varname'), - (r'(struct)(\s+)', - bygroups(Keyword.Declaration, Text), - 'structname'), - (r'(function)(\s+)', - bygroups(Keyword.Declaration, Text), - 'funcname'), - - (r'(null|true|false)\b', Keyword.Constant), - (r'(augment|pimp' - r'|if|else|case|match|return' - r'|case|when|then|otherwise' - r'|while|for|foreach' - r'|try|catch|finally|throw' - r'|local' - r'|continue|break)\b', Keyword), - - (r'(map|array|list|set|vector|tuple)(\[)', - bygroups(Name.Builtin, Punctuation)), - (r'(print|println|readln|raise|fun' - r'|asInterfaceInstance)\b', Name.Builtin), - (r'(`?[a-zA-Z_][\w$]*)(\()', - bygroups(Name.Function, Punctuation)), - - (r'-?[\d_]*\.[\d_]*([eE][+-]?\d[\d_]*)?F?', Number.Float), - (r'0[0-7]+j?', Number.Oct), - (r'0[xX][a-fA-F0-9]+', Number.Hex), - (r'-?\d[\d_]*L', Number.Integer.Long), - (r'-?\d[\d_]*', Number.Integer), - - ('`?[a-zA-Z_][\w$]*', Name), - (r'@[a-zA-Z_][\w$.]*', Name.Decorator), - - (r'"""', String, combined('stringescape', 'triplestring')), - (r'"', String, combined('stringescape', 'doublestring')), - (r"'", String, combined('stringescape', 'singlestring')), - (r'----((.|\n)*?)----', String.Doc) - - ], - - 'funcname': [ - (r'`?[a-zA-Z_][\w$]*', Name.Function, '#pop'), - ], - 'modname': [ - (r'[a-zA-Z_][\w$.]*\*?', Name.Namespace, '#pop') - ], - 'structname': [ - (r'`?[\w.]+\*?', Name.Class, '#pop') - ], - 'varname': [ - (r'`?[a-zA-Z_][\w$]*', Name.Variable, '#pop'), - ], - 'string': [ - (r'[^\\\'"\n]+', String), - (r'[\'"\\]', String) - ], - 'stringescape': [ - (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|' - r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape) - ], - 'triplestring': [ - (r'"""', String, '#pop'), - include('string'), - (r'\n', String), - ], - 'doublestring': [ - (r'"', String.Double, '#pop'), - include('string'), - ], - 'singlestring': [ - (r"'", String, '#pop'), - include('string'), - ], - 'operators': [ - (r'[#=,./%+\-?]', Operator), - (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), - (r'(==|<=|<|>=|>|!=)', Operator), - ], - } - - -class JasminLexer(RegexLexer): - """ - For `Jasmin `_ assembly code. - - .. versionadded:: 2.0 - """ - - name = 'Jasmin' - aliases = ['jasmin', 'jasminxt'] - filenames = ['*.j'] - - _whitespace = r' \n\t\r' - _ws = r'(?:[%s]+)' % _whitespace - _separator = r'%s:=' % _whitespace - _break = r'(?=[%s]|$)' % _separator - _name = r'[^%s]+' % _separator - _unqualified_name = r'(?:[^%s.;\[/]+)' % _separator - - tokens = { - 'default': [ - (r'\n', Text, '#pop'), - (r"'", String.Single, ('#pop', 'quote')), - (r'"', String.Double, 'string'), - (r'=', Punctuation), - (r':', Punctuation, 'label'), - (_ws, Text), - (r';.*', Comment.Single), - (r'(\$[-+])?0x-?[\da-fA-F]+%s' % _break, Number.Hex), - (r'(\$[-+]|\+)?-?\d+%s' % _break, Number.Integer), - (r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?[fFdD]?' - r'[\x00-\x08\x0b\x0c\x0e-\x1f]*%s' % _break, Number.Float), - (r'\$%s' % _name, Name.Variable), - - # Directives - (r'\.annotation%s' % _break, Keyword.Reserved, 'annotation'), - (r'(\.attribute|\.bytecode|\.debug|\.deprecated|\.enclosing|' - r'\.interface|\.line|\.signature|\.source|\.stack|\.var|abstract|' - r'annotation|bridge|class|default|enum|field|final|fpstrict|' - r'interface|native|private|protected|public|signature|static|' - r'synchronized|synthetic|transient|varargs|volatile)%s' % _break, - Keyword.Reserved), - (r'\.catch%s' % _break, Keyword.Reserved, 'caught-exception'), - (r'(\.class|\.implements|\.inner|\.super|inner|invisible|' - r'invisibleparam|outer|visible|visibleparam)%s' % _break, - Keyword.Reserved, 'class/convert-dots'), - (r'\.field%s' % _break, Keyword.Reserved, - ('descriptor/convert-dots', 'field')), - (r'(\.end|\.limit|use)%s' % _break, Keyword.Reserved, - 'no-verification'), - (r'\.method%s' % _break, Keyword.Reserved, 'method'), - (r'\.set%s' % _break, Keyword.Reserved, 'var'), - (r'\.throws%s' % _break, Keyword.Reserved, 'exception'), - (r'(from|offset|to|using)%s' % _break, Keyword.Reserved, 'label'), - (r'is%s' % _break, Keyword.Reserved, - ('descriptor/convert-dots', 'var')), - (r'(locals|stack)%s' % _break, Keyword.Reserved, 'verification'), - (r'method%s' % _break, Keyword.Reserved, 'enclosing-method'), - - # Instructions - (words(( - 'aaload', 'aastore', 'aconst_null', 'aload', 'aload_0', 'aload_1', 'aload_2', - 'aload_3', 'aload_w', 'areturn', 'arraylength', 'astore', 'astore_0', 'astore_1', - 'astore_2', 'astore_3', 'astore_w', 'athrow', 'baload', 'bastore', 'bipush', - 'breakpoint', 'caload', 'castore', 'd2f', 'd2i', 'd2l', 'dadd', 'daload', 'dastore', - 'dcmpg', 'dcmpl', 'dconst_0', 'dconst_1', 'ddiv', 'dload', 'dload_0', 'dload_1', - 'dload_2', 'dload_3', 'dload_w', 'dmul', 'dneg', 'drem', 'dreturn', 'dstore', 'dstore_0', - 'dstore_1', 'dstore_2', 'dstore_3', 'dstore_w', 'dsub', 'dup', 'dup2', 'dup2_x1', - 'dup2_x2', 'dup_x1', 'dup_x2', 'f2d', 'f2i', 'f2l', 'fadd', 'faload', 'fastore', 'fcmpg', - 'fcmpl', 'fconst_0', 'fconst_1', 'fconst_2', 'fdiv', 'fload', 'fload_0', 'fload_1', - 'fload_2', 'fload_3', 'fload_w', 'fmul', 'fneg', 'frem', 'freturn', 'fstore', 'fstore_0', - 'fstore_1', 'fstore_2', 'fstore_3', 'fstore_w', 'fsub', 'i2b', 'i2c', 'i2d', 'i2f', 'i2l', - 'i2s', 'iadd', 'iaload', 'iand', 'iastore', 'iconst_0', 'iconst_1', 'iconst_2', - 'iconst_3', 'iconst_4', 'iconst_5', 'iconst_m1', 'idiv', 'iinc', 'iinc_w', 'iload', - 'iload_0', 'iload_1', 'iload_2', 'iload_3', 'iload_w', 'imul', 'ineg', 'int2byte', - 'int2char', 'int2short', 'ior', 'irem', 'ireturn', 'ishl', 'ishr', 'istore', 'istore_0', - 'istore_1', 'istore_2', 'istore_3', 'istore_w', 'isub', 'iushr', 'ixor', 'l2d', 'l2f', - 'l2i', 'ladd', 'laload', 'land', 'lastore', 'lcmp', 'lconst_0', 'lconst_1', 'ldc2_w', - 'ldiv', 'lload', 'lload_0', 'lload_1', 'lload_2', 'lload_3', 'lload_w', 'lmul', 'lneg', - 'lookupswitch', 'lor', 'lrem', 'lreturn', 'lshl', 'lshr', 'lstore', 'lstore_0', - 'lstore_1', 'lstore_2', 'lstore_3', 'lstore_w', 'lsub', 'lushr', 'lxor', - 'monitorenter', 'monitorexit', 'nop', 'pop', 'pop2', 'ret', 'ret_w', 'return', 'saload', - 'sastore', 'sipush', 'swap'), suffix=_break), Keyword.Reserved), - (r'(anewarray|checkcast|instanceof|ldc|ldc_w|new)%s' % _break, - Keyword.Reserved, 'class/no-dots'), - (r'invoke(dynamic|interface|nonvirtual|special|' - r'static|virtual)%s' % _break, Keyword.Reserved, - 'invocation'), - (r'(getfield|putfield)%s' % _break, Keyword.Reserved, - ('descriptor/no-dots', 'field')), - (r'(getstatic|putstatic)%s' % _break, Keyword.Reserved, - ('descriptor/no-dots', 'static')), - (words(( - 'goto', 'goto_w', 'if_acmpeq', 'if_acmpne', 'if_icmpeq', - 'if_icmpge', 'if_icmpgt', 'if_icmple', 'if_icmplt', 'if_icmpne', - 'ifeq', 'ifge', 'ifgt', 'ifle', 'iflt', 'ifne', 'ifnonnull', - 'ifnull', 'jsr', 'jsr_w'), suffix=_break), - Keyword.Reserved, 'label'), - (r'(multianewarray|newarray)%s' % _break, Keyword.Reserved, - 'descriptor/convert-dots'), - (r'tableswitch%s' % _break, Keyword.Reserved, 'table') - ], - 'quote': [ - (r"'", String.Single, '#pop'), - (r'\\u[\da-fA-F]{4}', String.Escape), - (r"[^'\\]+", String.Single) - ], - 'string': [ - (r'"', String.Double, '#pop'), - (r'\\([nrtfb"\'\\]|u[\da-fA-F]{4}|[0-3]?[0-7]{1,2})', - String.Escape), - (r'[^"\\]+', String.Double) - ], - 'root': [ - (r'\n+', Text), - (r"'", String.Single, 'quote'), - include('default'), - (r'(%s)([ \t\r]*)(:)' % _name, - bygroups(Name.Label, Text, Punctuation)), - (_name, String.Other) - ], - 'annotation': [ - (r'\n', Text, ('#pop', 'annotation-body')), - (r'default%s' % _break, Keyword.Reserved, - ('#pop', 'annotation-default')), - include('default') - ], - 'annotation-body': [ - (r'\n+', Text), - (r'\.end%s' % _break, Keyword.Reserved, '#pop'), - include('default'), - (_name, String.Other, ('annotation-items', 'descriptor/no-dots')) - ], - 'annotation-default': [ - (r'\n+', Text), - (r'\.end%s' % _break, Keyword.Reserved, '#pop'), - include('default'), - default(('annotation-items', 'descriptor/no-dots')) - ], - 'annotation-items': [ - (r"'", String.Single, 'quote'), - include('default'), - (_name, String.Other) - ], - 'caught-exception': [ - (r'all%s' % _break, Keyword, '#pop'), - include('exception') - ], - 'class/convert-dots': [ - include('default'), - (r'(L)((?:%s[/.])*)(%s)(;)' % (_unqualified_name, _name), - bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), - '#pop'), - (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), - bygroups(Name.Namespace, Name.Class), '#pop') - ], - 'class/no-dots': [ - include('default'), - (r'\[+', Punctuation, ('#pop', 'descriptor/no-dots')), - (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), - bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), - '#pop'), - (r'((?:%s/)*)(%s)' % (_unqualified_name, _name), - bygroups(Name.Namespace, Name.Class), '#pop') - ], - 'descriptor/convert-dots': [ - include('default'), - (r'\[+', Punctuation), - (r'(L)((?:%s[/.])*)(%s?)(;)' % (_unqualified_name, _name), - bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), - '#pop'), - (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), - default('#pop') - ], - 'descriptor/no-dots': [ - include('default'), - (r'\[+', Punctuation), - (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), - bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), - '#pop'), - (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), - default('#pop') - ], - 'descriptors/convert-dots': [ - (r'\)', Punctuation, '#pop'), - default('descriptor/convert-dots') - ], - 'enclosing-method': [ - (_ws, Text), - (r'(?=[^%s]*\()' % _separator, Text, ('#pop', 'invocation')), - default(('#pop', 'class/convert-dots')) - ], - 'exception': [ - include('default'), - (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), - bygroups(Name.Namespace, Name.Exception), '#pop') - ], - 'field': [ - (r'static%s' % _break, Keyword.Reserved, ('#pop', 'static')), - include('default'), - (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % - (_unqualified_name, _separator, _unqualified_name, _name), - bygroups(Name.Namespace, Name.Class, Name.Variable.Instance), - '#pop') - ], - 'invocation': [ - include('default'), - (r'((?:%s[/.](?=[^%s(]*[/.]))*)(%s[/.])?(%s)(\()' % - (_unqualified_name, _separator, _unqualified_name, _name), - bygroups(Name.Namespace, Name.Class, Name.Function, Punctuation), - ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', - 'descriptor/convert-dots')) - ], - 'label': [ - include('default'), - (_name, Name.Label, '#pop') - ], - 'method': [ - include('default'), - (r'(%s)(\()' % _name, bygroups(Name.Function, Punctuation), - ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', - 'descriptor/convert-dots')) - ], - 'no-verification': [ - (r'(locals|method|stack)%s' % _break, Keyword.Reserved, '#pop'), - include('default') - ], - 'static': [ - include('default'), - (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % - (_unqualified_name, _separator, _unqualified_name, _name), - bygroups(Name.Namespace, Name.Class, Name.Variable.Class), '#pop') - ], - 'table': [ - (r'\n+', Text), - (r'default%s' % _break, Keyword.Reserved, '#pop'), - include('default'), - (_name, Name.Label) - ], - 'var': [ - include('default'), - (_name, Name.Variable, '#pop') - ], - 'verification': [ - include('default'), - (r'(Double|Float|Integer|Long|Null|Top|UninitializedThis)%s' % - _break, Keyword, '#pop'), - (r'Object%s' % _break, Keyword, ('#pop', 'class/no-dots')), - (r'Uninitialized%s' % _break, Keyword, ('#pop', 'label')) - ] - } - - def analyse_text(text): - score = 0 - if re.search(r'^\s*\.class\s', text, re.MULTILINE): - score += 0.5 - if re.search(r'^\s*[a-z]+_[a-z]+\b', text, re.MULTILINE): - score += 0.3 - if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|' - r'inner|interface|limit|set|signature|stack)\b', text, - re.MULTILINE): - score += 0.6 - return score diff --git a/wakatime/packages/py3/pygments/lexers/make.py b/wakatime/packages/py3/pygments/lexers/make.py deleted file mode 100644 index 2e12d9c..0000000 --- a/wakatime/packages/py3/pygments/lexers/make.py +++ /dev/null @@ -1,201 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.make - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Makefiles and similar. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, include, bygroups, \ - do_insertions, using -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Punctuation -from pygments.lexers.shell import BashLexer - -__all__ = ['MakefileLexer', 'BaseMakefileLexer', 'CMakeLexer'] - - -class MakefileLexer(Lexer): - """ - Lexer for BSD and GNU make extensions (lenient enough to handle both in - the same file even). - - *Rewritten in Pygments 0.10.* - """ - - name = 'Makefile' - aliases = ['make', 'makefile', 'mf', 'bsdmake'] - filenames = ['*.mak', '*.mk', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile'] - mimetypes = ['text/x-makefile'] - - r_special = re.compile( - r'^(?:' - # BSD Make - r'\.\s*(include|undef|error|warning|if|else|elif|endif|for|endfor)|' - # GNU Make - r'\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:|vpath)|' - # GNU Automake - r'\s*(if|else|endif))(?=\s)') - r_comment = re.compile(r'^\s*@?#') - - def get_tokens_unprocessed(self, text): - ins = [] - lines = text.splitlines(True) - done = '' - lex = BaseMakefileLexer(**self.options) - backslashflag = False - for line in lines: - if self.r_special.match(line) or backslashflag: - ins.append((len(done), [(0, Comment.Preproc, line)])) - backslashflag = line.strip().endswith('\\') - elif self.r_comment.match(line): - ins.append((len(done), [(0, Comment, line)])) - else: - done += line - for item in do_insertions(ins, lex.get_tokens_unprocessed(done)): - yield item - - def analyse_text(text): - # Many makefiles have $(BIG_CAPS) style variables - if re.search(r'\$\([A-Z_]+\)', text): - return 0.1 - - -class BaseMakefileLexer(RegexLexer): - """ - Lexer for simple Makefiles (no preprocessing). - - .. versionadded:: 0.10 - """ - - name = 'Base Makefile' - aliases = ['basemake'] - filenames = [] - mimetypes = [] - - tokens = { - 'root': [ - # recipes (need to allow spaces because of expandtabs) - (r'^(?:[\t ]+.*\n|\n)+', using(BashLexer)), - # special variables - (r'\$[<@$+%?|*]', Keyword), - (r'\s+', Text), - (r'#.*?\n', Comment), - (r'(export)(\s+)(?=[\w${}\t -]+\n)', - bygroups(Keyword, Text), 'export'), - (r'export\s+', Keyword), - # assignment - (r'([\w${}.-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)', - bygroups(Name.Variable, Text, Operator, Text, using(BashLexer))), - # strings - (r'(?s)"(\\\\|\\.|[^"\\])*"', String.Double), - (r"(?s)'(\\\\|\\.|[^'\\])*'", String.Single), - # targets - (r'([^\n:]+)(:+)([ \t]*)', bygroups(Name.Function, Operator, Text), - 'block-header'), - # expansions - (r'\$\(', Keyword, 'expansion'), - ], - 'expansion': [ - (r'[^$a-zA-Z_)]+', Text), - (r'[a-zA-Z_]+', Name.Variable), - (r'\$', Keyword), - (r'\(', Keyword, '#push'), - (r'\)', Keyword, '#pop'), - ], - 'export': [ - (r'[\w${}-]+', Name.Variable), - (r'\n', Text, '#pop'), - (r'\s+', Text), - ], - 'block-header': [ - (r'[,|]', Punctuation), - (r'#.*?\n', Comment, '#pop'), - (r'\\\n', Text), # line continuation - (r'\$\(', Keyword, 'expansion'), - (r'[a-zA-Z_]+', Name), - (r'\n', Text, '#pop'), - (r'.', Text), - ], - } - - -class CMakeLexer(RegexLexer): - """ - Lexer for `CMake `_ files. - - .. versionadded:: 1.2 - """ - name = 'CMake' - aliases = ['cmake'] - filenames = ['*.cmake', 'CMakeLists.txt'] - mimetypes = ['text/x-cmake'] - - tokens = { - 'root': [ - # (r'(ADD_CUSTOM_COMMAND|ADD_CUSTOM_TARGET|ADD_DEFINITIONS|' - # r'ADD_DEPENDENCIES|ADD_EXECUTABLE|ADD_LIBRARY|ADD_SUBDIRECTORY|' - # r'ADD_TEST|AUX_SOURCE_DIRECTORY|BUILD_COMMAND|BUILD_NAME|' - # r'CMAKE_MINIMUM_REQUIRED|CONFIGURE_FILE|CREATE_TEST_SOURCELIST|' - # r'ELSE|ELSEIF|ENABLE_LANGUAGE|ENABLE_TESTING|ENDFOREACH|' - # r'ENDFUNCTION|ENDIF|ENDMACRO|ENDWHILE|EXEC_PROGRAM|' - # r'EXECUTE_PROCESS|EXPORT_LIBRARY_DEPENDENCIES|FILE|FIND_FILE|' - # r'FIND_LIBRARY|FIND_PACKAGE|FIND_PATH|FIND_PROGRAM|FLTK_WRAP_UI|' - # r'FOREACH|FUNCTION|GET_CMAKE_PROPERTY|GET_DIRECTORY_PROPERTY|' - # r'GET_FILENAME_COMPONENT|GET_SOURCE_FILE_PROPERTY|' - # r'GET_TARGET_PROPERTY|GET_TEST_PROPERTY|IF|INCLUDE|' - # r'INCLUDE_DIRECTORIES|INCLUDE_EXTERNAL_MSPROJECT|' - # r'INCLUDE_REGULAR_EXPRESSION|INSTALL|INSTALL_FILES|' - # r'INSTALL_PROGRAMS|INSTALL_TARGETS|LINK_DIRECTORIES|' - # r'LINK_LIBRARIES|LIST|LOAD_CACHE|LOAD_COMMAND|MACRO|' - # r'MAKE_DIRECTORY|MARK_AS_ADVANCED|MATH|MESSAGE|OPTION|' - # r'OUTPUT_REQUIRED_FILES|PROJECT|QT_WRAP_CPP|QT_WRAP_UI|REMOVE|' - # r'REMOVE_DEFINITIONS|SEPARATE_ARGUMENTS|SET|' - # r'SET_DIRECTORY_PROPERTIES|SET_SOURCE_FILES_PROPERTIES|' - # r'SET_TARGET_PROPERTIES|SET_TESTS_PROPERTIES|SITE_NAME|' - # r'SOURCE_GROUP|STRING|SUBDIR_DEPENDS|SUBDIRS|' - # r'TARGET_LINK_LIBRARIES|TRY_COMPILE|TRY_RUN|UNSET|' - # r'USE_MANGLED_MESA|UTILITY_SOURCE|VARIABLE_REQUIRES|' - # r'VTK_MAKE_INSTANTIATOR|VTK_WRAP_JAVA|VTK_WRAP_PYTHON|' - # r'VTK_WRAP_TCL|WHILE|WRITE_FILE|' - # r'COUNTARGS)\b', Name.Builtin, 'args'), - (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Builtin, Text, - Punctuation), 'args'), - include('keywords'), - include('ws') - ], - 'args': [ - (r'\(', Punctuation, '#push'), - (r'\)', Punctuation, '#pop'), - (r'(\$\{)(.+?)(\})', bygroups(Operator, Name.Variable, Operator)), - (r'(\$<)(.+?)(>)', bygroups(Operator, Name.Variable, Operator)), - (r'(?s)".*?"', String.Double), - (r'\\\S+', String), - (r'[^)$"# \t\n]+', String), - (r'\n', Text), # explicitly legal - include('keywords'), - include('ws') - ], - 'string': [ - - ], - 'keywords': [ - (r'\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|' - r'MSVC70|MSVC71|MSVC80|MSVC90)\b', Keyword), - ], - 'ws': [ - (r'[ \t]+', Text), - (r'#.*\n', Comment), - ] - } - - def analyse_text(text): - exp = r'^ *CMAKE_MINIMUM_REQUIRED *\( *VERSION *\d(\.\d)* *( FATAL_ERROR)? *\) *$' - if re.search(exp, text, flags=re.MULTILINE | re.IGNORECASE): - return 0.8 - return 0.0 diff --git a/wakatime/packages/py3/pygments/lexers/markup.py b/wakatime/packages/py3/pygments/lexers/markup.py deleted file mode 100644 index 69202b0..0000000 --- a/wakatime/packages/py3/pygments/lexers/markup.py +++ /dev/null @@ -1,502 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.markup - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for non-HTML markup languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexers.html import HtmlLexer, XmlLexer -from pygments.lexers.javascript import JavascriptLexer -from pygments.lexers.css import CssLexer - -from pygments.lexer import RegexLexer, DelegatingLexer, include, bygroups, \ - using, this, do_insertions, default, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic, Other -from pygments.util import get_bool_opt, ClassNotFound - -__all__ = ['BBCodeLexer', 'MoinWikiLexer', 'RstLexer', 'TexLexer', 'GroffLexer', - 'MozPreprocHashLexer', 'MozPreprocPercentLexer', - 'MozPreprocXulLexer', 'MozPreprocJavascriptLexer', - 'MozPreprocCssLexer'] - - -class BBCodeLexer(RegexLexer): - """ - A lexer that highlights BBCode(-like) syntax. - - .. versionadded:: 0.6 - """ - - name = 'BBCode' - aliases = ['bbcode'] - mimetypes = ['text/x-bbcode'] - - tokens = { - 'root': [ - (r'[^[]+', Text), - # tag/end tag begin - (r'\[/?\w+', Keyword, 'tag'), - # stray bracket - (r'\[', Text), - ], - 'tag': [ - (r'\s+', Text), - # attribute with value - (r'(\w+)(=)("?[^\s"\]]+"?)', - bygroups(Name.Attribute, Operator, String)), - # tag argument (a la [color=green]) - (r'(=)("?[^\s"\]]+"?)', - bygroups(Operator, String)), - # tag end - (r'\]', Keyword, '#pop'), - ], - } - - -class MoinWikiLexer(RegexLexer): - """ - For MoinMoin (and Trac) Wiki markup. - - .. versionadded:: 0.7 - """ - - name = 'MoinMoin/Trac Wiki markup' - aliases = ['trac-wiki', 'moin'] - filenames = [] - mimetypes = ['text/x-trac-wiki'] - flags = re.MULTILINE | re.IGNORECASE - - tokens = { - 'root': [ - (r'^#.*$', Comment), - (r'(!)(\S+)', bygroups(Keyword, Text)), # Ignore-next - # Titles - (r'^(=+)([^=]+)(=+)(\s*#.+)?$', - bygroups(Generic.Heading, using(this), Generic.Heading, String)), - # Literal code blocks, with optional shebang - (r'(\{\{\{)(\n#!.+)?', bygroups(Name.Builtin, Name.Namespace), 'codeblock'), - (r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting - # Lists - (r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)), - (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)), - # Other Formatting - (r'\[\[\w+.*?\]\]', Keyword), # Macro - (r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])', - bygroups(Keyword, String, Keyword)), # Link - (r'^----+$', Keyword), # Horizontal rules - (r'[^\n\'\[{!_~^,|]+', Text), - (r'\n', Text), - (r'.', Text), - ], - 'codeblock': [ - (r'\}\}\}', Name.Builtin, '#pop'), - # these blocks are allowed to be nested in Trac, but not MoinMoin - (r'\{\{\{', Text, '#push'), - (r'[^{}]+', Comment.Preproc), # slurp boring text - (r'.', Comment.Preproc), # allow loose { or } - ], - } - - -class RstLexer(RegexLexer): - """ - For `reStructuredText `_ markup. - - .. versionadded:: 0.7 - - Additional options accepted: - - `handlecodeblocks` - Highlight the contents of ``.. sourcecode:: language``, - ``.. code:: language`` and ``.. code-block:: language`` - directives with a lexer for the given language (default: - ``True``). - - .. versionadded:: 0.8 - """ - name = 'reStructuredText' - aliases = ['rst', 'rest', 'restructuredtext'] - filenames = ['*.rst', '*.rest'] - mimetypes = ["text/x-rst", "text/prs.fallenstein.rst"] - flags = re.MULTILINE - - def _handle_sourcecode(self, match): - from pygments.lexers import get_lexer_by_name - - # section header - yield match.start(1), Punctuation, match.group(1) - yield match.start(2), Text, match.group(2) - yield match.start(3), Operator.Word, match.group(3) - yield match.start(4), Punctuation, match.group(4) - yield match.start(5), Text, match.group(5) - yield match.start(6), Keyword, match.group(6) - yield match.start(7), Text, match.group(7) - - # lookup lexer if wanted and existing - lexer = None - if self.handlecodeblocks: - try: - lexer = get_lexer_by_name(match.group(6).strip()) - except ClassNotFound: - pass - indention = match.group(8) - indention_size = len(indention) - code = (indention + match.group(9) + match.group(10) + match.group(11)) - - # no lexer for this language. handle it like it was a code block - if lexer is None: - yield match.start(8), String, code - return - - # highlight the lines with the lexer. - ins = [] - codelines = code.splitlines(True) - code = '' - for line in codelines: - if len(line) > indention_size: - ins.append((len(code), [(0, Text, line[:indention_size])])) - code += line[indention_size:] - else: - code += line - for item in do_insertions(ins, lexer.get_tokens_unprocessed(code)): - yield item - - # from docutils.parsers.rst.states - closers = u'\'")]}>\u2019\u201d\xbb!?' - unicode_delimiters = u'\u2010\u2011\u2012\u2013\u2014\u00a0' - end_string_suffix = (r'((?=$)|(?=[-/:.,; \n\x00%s%s]))' - % (re.escape(unicode_delimiters), - re.escape(closers))) - - tokens = { - 'root': [ - # Heading with overline - (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)' - r'(.+)(\n)(\1)(\n)', - bygroups(Generic.Heading, Text, Generic.Heading, - Text, Generic.Heading, Text)), - # Plain heading - (r'^(\S.*)(\n)(={3,}|-{3,}|`{3,}|:{3,}|\.{3,}|\'{3,}|"{3,}|' - r'~{3,}|\^{3,}|_{3,}|\*{3,}|\+{3,}|#{3,})(\n)', - bygroups(Generic.Heading, Text, Generic.Heading, Text)), - # Bulleted lists - (r'^(\s*)([-*+])( .+\n(?:\1 .+\n)*)', - bygroups(Text, Number, using(this, state='inline'))), - # Numbered lists - (r'^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1 .+\n)*)', - bygroups(Text, Number, using(this, state='inline'))), - (r'^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1 .+\n)*)', - bygroups(Text, Number, using(this, state='inline'))), - # Numbered, but keep words at BOL from becoming lists - (r'^(\s*)([A-Z]+\.)( .+\n(?:\1 .+\n)+)', - bygroups(Text, Number, using(this, state='inline'))), - (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1 .+\n)+)', - bygroups(Text, Number, using(this, state='inline'))), - # Line blocks - (r'^(\s*)(\|)( .+\n(?:\| .+\n)*)', - bygroups(Text, Operator, using(this, state='inline'))), - # Sourcecode directives - (r'^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)' - r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)', - _handle_sourcecode), - # A directive - (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', - bygroups(Punctuation, Text, Operator.Word, Punctuation, Text, - using(this, state='inline'))), - # A reference target - (r'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$', - bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))), - # A footnote/citation target - (r'^( *\.\.)(\s*)(\[.+\])(.*?)$', - bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))), - # A substitution def - (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', - bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word, - Punctuation, Text, using(this, state='inline'))), - # Comments - (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc), - # Field list - (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)), - (r'^( *)(:.*?:)([ \t]+)(.*?)$', - bygroups(Text, Name.Class, Text, Name.Function)), - # Definition list - (r'^(\S.*(?)(`__?)', # reference with inline target - bygroups(String, String.Interpol, String)), - (r'`.+?`__?', String), # reference - (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?', - bygroups(Name.Variable, Name.Attribute)), # role - (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)', - bygroups(Name.Attribute, Name.Variable)), # role (content first) - (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis - (r'\*.+?\*', Generic.Emph), # Emphasis - (r'\[.*?\]_', String), # Footnote or citation - (r'<.+?>', Name.Tag), # Hyperlink - (r'[^\\\n\[*`:]+', Text), - (r'.', Text), - ], - 'literal': [ - (r'[^`]+', String), - (r'``' + end_string_suffix, String, '#pop'), - (r'`', String), - ] - } - - def __init__(self, **options): - self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True) - RegexLexer.__init__(self, **options) - - def analyse_text(text): - if text[:2] == '..' and text[2:3] != '.': - return 0.3 - p1 = text.find("\n") - p2 = text.find("\n", p1 + 1) - if (p2 > -1 and # has two lines - p1 * 2 + 1 == p2 and # they are the same length - text[p1+1] in '-=' and # the next line both starts and ends with - text[p1+1] == text[p2-1]): # ...a sufficiently high header - return 0.5 - - -class TexLexer(RegexLexer): - """ - Lexer for the TeX and LaTeX typesetting languages. - """ - - name = 'TeX' - aliases = ['tex', 'latex'] - filenames = ['*.tex', '*.aux', '*.toc'] - mimetypes = ['text/x-tex', 'text/x-latex'] - - tokens = { - 'general': [ - (r'%.*?\n', Comment), - (r'[{}]', Name.Builtin), - (r'[&_^]', Name.Builtin), - ], - 'root': [ - (r'\\\[', String.Backtick, 'displaymath'), - (r'\\\(', String, 'inlinemath'), - (r'\$\$', String.Backtick, 'displaymath'), - (r'\$', String, 'inlinemath'), - (r'\\([a-zA-Z]+|.)', Keyword, 'command'), - (r'\\$', Keyword), - include('general'), - (r'[^\\$%&_^{}]+', Text), - ], - 'math': [ - (r'\\([a-zA-Z]+|.)', Name.Variable), - include('general'), - (r'[0-9]+', Number), - (r'[-=!+*/()\[\]]', Operator), - (r'[^=!+*/()\[\]\\$%&_^{}0-9-]+', Name.Builtin), - ], - 'inlinemath': [ - (r'\\\)', String, '#pop'), - (r'\$', String, '#pop'), - include('math'), - ], - 'displaymath': [ - (r'\\\]', String, '#pop'), - (r'\$\$', String, '#pop'), - (r'\$', Name.Builtin), - include('math'), - ], - 'command': [ - (r'\[.*?\]', Name.Attribute), - (r'\*', Keyword), - default('#pop'), - ], - } - - def analyse_text(text): - for start in ("\\documentclass", "\\input", "\\documentstyle", - "\\relax"): - if text[:len(start)] == start: - return True - - -class GroffLexer(RegexLexer): - """ - Lexer for the (g)roff typesetting language, supporting groff - extensions. Mainly useful for highlighting manpage sources. - - .. versionadded:: 0.6 - """ - - name = 'Groff' - aliases = ['groff', 'nroff', 'man'] - filenames = ['*.[1234567]', '*.man'] - mimetypes = ['application/x-troff', 'text/troff'] - - tokens = { - 'root': [ - (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'), - (r'\.', Punctuation, 'request'), - # Regular characters, slurp till we find a backslash or newline - (r'[^\\\n]+', Text, 'textline'), - default('textline'), - ], - 'textline': [ - include('escapes'), - (r'[^\\\n]+', Text), - (r'\n', Text, '#pop'), - ], - 'escapes': [ - # groff has many ways to write escapes. - (r'\\"[^\n]*', Comment), - (r'\\[fn]\w', String.Escape), - (r'\\\(.{2}', String.Escape), - (r'\\.\[.*\]', String.Escape), - (r'\\.', String.Escape), - (r'\\\n', Text, 'request'), - ], - 'request': [ - (r'\n', Text, '#pop'), - include('escapes'), - (r'"[^\n"]+"', String.Double), - (r'\d+', Number), - (r'\S+', String), - (r'\s+', Text), - ], - } - - def analyse_text(text): - if text[:1] != '.': - return False - if text[:3] == '.\\"': - return True - if text[:4] == '.TH ': - return True - if text[1:3].isalnum() and text[3].isspace(): - return 0.9 - - -class MozPreprocHashLexer(RegexLexer): - """ - Lexer for Mozilla Preprocessor files (with '#' as the marker). - - Other data is left untouched. - - .. versionadded:: 2.0 - """ - name = 'mozhashpreproc' - aliases = [name] - filenames = [] - mimetypes = [] - - tokens = { - 'root': [ - (r'^#', Comment.Preproc, ('expr', 'exprstart')), - (r'.+', Other), - ], - 'exprstart': [ - (r'(literal)(.*)', bygroups(Comment.Preproc, Text), '#pop:2'), - (words(( - 'define', 'undef', 'if', 'ifdef', 'ifndef', 'else', 'elif', - 'elifdef', 'elifndef', 'endif', 'expand', 'filter', 'unfilter', - 'include', 'includesubst', 'error')), - Comment.Preproc, '#pop'), - ], - 'expr': [ - (words(('!', '!=', '==', '&&', '||')), Operator), - (r'(defined)(\()', bygroups(Keyword, Punctuation)), - (r'\)', Punctuation), - (r'[0-9]+', Number.Decimal), - (r'__\w+?__', Name.Variable), - (r'@\w+?@', Name.Class), - (r'\w+', Name), - (r'\n', Text, '#pop'), - (r'\s+', Text), - (r'\S', Punctuation), - ], - } - - -class MozPreprocPercentLexer(MozPreprocHashLexer): - """ - Lexer for Mozilla Preprocessor files (with '%' as the marker). - - Other data is left untouched. - - .. versionadded:: 2.0 - """ - name = 'mozpercentpreproc' - aliases = [name] - filenames = [] - mimetypes = [] - - tokens = { - 'root': [ - (r'^%', Comment.Preproc, ('expr', 'exprstart')), - (r'.+', Other), - ], - } - - -class MozPreprocXulLexer(DelegatingLexer): - """ - Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the - `XmlLexer`. - - .. versionadded:: 2.0 - """ - name = "XUL+mozpreproc" - aliases = ['xul+mozpreproc'] - filenames = ['*.xul.in'] - mimetypes = [] - - def __init__(self, **options): - super(MozPreprocXulLexer, self).__init__( - XmlLexer, MozPreprocHashLexer, **options) - - -class MozPreprocJavascriptLexer(DelegatingLexer): - """ - Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the - `JavascriptLexer`. - - .. versionadded:: 2.0 - """ - name = "Javascript+mozpreproc" - aliases = ['javascript+mozpreproc'] - filenames = ['*.js.in'] - mimetypes = [] - - def __init__(self, **options): - super(MozPreprocJavascriptLexer, self).__init__( - JavascriptLexer, MozPreprocHashLexer, **options) - - -class MozPreprocCssLexer(DelegatingLexer): - """ - Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the - `CssLexer`. - - .. versionadded:: 2.0 - """ - name = "CSS+mozpreproc" - aliases = ['css+mozpreproc'] - filenames = ['*.css.in'] - mimetypes = [] - - def __init__(self, **options): - super(MozPreprocCssLexer, self).__init__( - CssLexer, MozPreprocPercentLexer, **options) - diff --git a/wakatime/packages/py3/pygments/lexers/matlab.py b/wakatime/packages/py3/pygments/lexers/matlab.py deleted file mode 100644 index ec8cbcc..0000000 --- a/wakatime/packages/py3/pygments/lexers/matlab.py +++ /dev/null @@ -1,663 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.matlab - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Matlab and related languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Generic, Whitespace - -from pygments.lexers import _scilab_builtins - -__all__ = ['MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer'] - - -class MatlabLexer(RegexLexer): - """ - For Matlab source code. - - .. versionadded:: 0.10 - """ - name = 'Matlab' - aliases = ['matlab'] - filenames = ['*.m'] - mimetypes = ['text/matlab'] - - # - # These lists are generated automatically. - # Run the following in bash shell: - # - # for f in elfun specfun elmat; do - # echo -n "$f = " - # matlab -nojvm -r "help $f;exit;" | perl -ne \ - # 'push(@c,$1) if /^ (\w+)\s+-/; END {print q{["}.join(q{","},@c).qq{"]\n};}' - # done - # - # elfun: Elementary math functions - # specfun: Special Math functions - # elmat: Elementary matrices and matrix manipulation - # - # taken from Matlab version 7.4.0.336 (R2007a) - # - elfun = ("sin", "sind", "sinh", "asin", "asind", "asinh", "cos", "cosd", "cosh", - "acos", "acosd", "acosh", "tan", "tand", "tanh", "atan", "atand", "atan2", - "atanh", "sec", "secd", "sech", "asec", "asecd", "asech", "csc", "cscd", - "csch", "acsc", "acscd", "acsch", "cot", "cotd", "coth", "acot", "acotd", - "acoth", "hypot", "exp", "expm1", "log", "log1p", "log10", "log2", "pow2", - "realpow", "reallog", "realsqrt", "sqrt", "nthroot", "nextpow2", "abs", - "angle", "complex", "conj", "imag", "real", "unwrap", "isreal", "cplxpair", - "fix", "floor", "ceil", "round", "mod", "rem", "sign") - specfun = ("airy", "besselj", "bessely", "besselh", "besseli", "besselk", "beta", - "betainc", "betaln", "ellipj", "ellipke", "erf", "erfc", "erfcx", - "erfinv", "expint", "gamma", "gammainc", "gammaln", "psi", "legendre", - "cross", "dot", "factor", "isprime", "primes", "gcd", "lcm", "rat", - "rats", "perms", "nchoosek", "factorial", "cart2sph", "cart2pol", - "pol2cart", "sph2cart", "hsv2rgb", "rgb2hsv") - elmat = ("zeros", "ones", "eye", "repmat", "rand", "randn", "linspace", "logspace", - "freqspace", "meshgrid", "accumarray", "size", "length", "ndims", "numel", - "disp", "isempty", "isequal", "isequalwithequalnans", "cat", "reshape", - "diag", "blkdiag", "tril", "triu", "fliplr", "flipud", "flipdim", "rot90", - "find", "end", "sub2ind", "ind2sub", "bsxfun", "ndgrid", "permute", - "ipermute", "shiftdim", "circshift", "squeeze", "isscalar", "isvector", - "ans", "eps", "realmax", "realmin", "pi", "i", "inf", "nan", "isnan", - "isinf", "isfinite", "j", "why", "compan", "gallery", "hadamard", "hankel", - "hilb", "invhilb", "magic", "pascal", "rosser", "toeplitz", "vander", - "wilkinson") - - tokens = { - 'root': [ - # line starting with '!' is sent as a system command. not sure what - # label to use... - (r'^!.*', String.Other), - (r'%\{\s*\n', Comment.Multiline, 'blockcomment'), - (r'%.*$', Comment), - (r'^\s*function', Keyword, 'deffunc'), - - # from 'iskeyword' on version 7.11 (R2010): - (words(( - 'break', 'case', 'catch', 'classdef', 'continue', 'else', 'elseif', - 'end', 'enumerated', 'events', 'for', 'function', 'global', 'if', - 'methods', 'otherwise', 'parfor', 'persistent', 'properties', - 'return', 'spmd', 'switch', 'try', 'while'), suffix=r'\b'), - Keyword), - - ("(" + "|".join(elfun + specfun + elmat) + r')\b', Name.Builtin), - - # line continuation with following comment: - (r'\.\.\..*$', Comment), - - # operators: - (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator), - # operators requiring escape for re: - (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator), - - # punctuation: - (r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation), - (r'=|:|;', Punctuation), - - # quote can be transpose, instead of string: - # (not great, but handles common cases...) - (r'(?<=[\w)\].])\'+', Operator), - - (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float), - (r'\d+[eEf][+-]?[0-9]+', Number.Float), - (r'\d+', Number.Integer), - - (r'(?. - - .. versionadded:: 0.10 - """ - name = 'Matlab session' - aliases = ['matlabsession'] - - def get_tokens_unprocessed(self, text): - mlexer = MatlabLexer(**self.options) - - curcode = '' - insertions = [] - - for match in line_re.finditer(text): - line = match.group() - - if line.startswith('>> '): - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:3])])) - curcode += line[3:] - - elif line.startswith('>>'): - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:2])])) - curcode += line[2:] - - elif line.startswith('???'): - - idx = len(curcode) - - # without is showing error on same line as before...? - # line = "\n" + line - token = (0, Generic.Traceback, line) - insertions.append((idx, [token])) - - else: - if curcode: - for item in do_insertions( - insertions, mlexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - - yield match.start(), Generic.Output, line - - if curcode: # or item: - for item in do_insertions( - insertions, mlexer.get_tokens_unprocessed(curcode)): - yield item - - -class OctaveLexer(RegexLexer): - """ - For GNU Octave source code. - - .. versionadded:: 1.5 - """ - name = 'Octave' - aliases = ['octave'] - filenames = ['*.m'] - mimetypes = ['text/octave'] - - # These lists are generated automatically. - # Run the following in bash shell: - # - # First dump all of the Octave manual into a plain text file: - # - # $ info octave --subnodes -o octave-manual - # - # Now grep through it: - - # for i in \ - # "Built-in Function" "Command" "Function File" \ - # "Loadable Function" "Mapping Function"; - # do - # perl -e '@name = qw('"$i"'); - # print lc($name[0]),"_kw = [\n"'; - # - # perl -n -e 'print "\"$1\",\n" if /-- '"$i"': .* (\w*) \(/;' \ - # octave-manual | sort | uniq ; - # echo "]" ; - # echo; - # done - - # taken from Octave Mercurial changeset 8cc154f45e37 (30-jan-2011) - - builtin_kw = ( - "addlistener", "addpath", "addproperty", "all", - "and", "any", "argnames", "argv", "assignin", - "atexit", "autoload", - "available_graphics_toolkits", "beep_on_error", - "bitand", "bitmax", "bitor", "bitshift", "bitxor", - "cat", "cell", "cellstr", "char", "class", "clc", - "columns", "command_line_path", - "completion_append_char", "completion_matches", - "complex", "confirm_recursive_rmdir", "cputime", - "crash_dumps_octave_core", "ctranspose", "cumprod", - "cumsum", "debug_on_error", "debug_on_interrupt", - "debug_on_warning", "default_save_options", - "dellistener", "diag", "diff", "disp", - "doc_cache_file", "do_string_escapes", "double", - "drawnow", "e", "echo_executing_commands", "eps", - "eq", "errno", "errno_list", "error", "eval", - "evalin", "exec", "exist", "exit", "eye", "false", - "fclear", "fclose", "fcntl", "fdisp", "feof", - "ferror", "feval", "fflush", "fgetl", "fgets", - "fieldnames", "file_in_loadpath", "file_in_path", - "filemarker", "filesep", "find_dir_in_path", - "fixed_point_format", "fnmatch", "fopen", "fork", - "formula", "fprintf", "fputs", "fread", "freport", - "frewind", "fscanf", "fseek", "fskipl", "ftell", - "functions", "fwrite", "ge", "genpath", "get", - "getegid", "getenv", "geteuid", "getgid", - "getpgrp", "getpid", "getppid", "getuid", "glob", - "gt", "gui_mode", "history_control", - "history_file", "history_size", - "history_timestamp_format_string", "home", - "horzcat", "hypot", "ifelse", - "ignore_function_time_stamp", "inferiorto", - "info_file", "info_program", "inline", "input", - "intmax", "intmin", "ipermute", - "is_absolute_filename", "isargout", "isbool", - "iscell", "iscellstr", "ischar", "iscomplex", - "isempty", "isfield", "isfloat", "isglobal", - "ishandle", "isieee", "isindex", "isinteger", - "islogical", "ismatrix", "ismethod", "isnull", - "isnumeric", "isobject", "isreal", - "is_rooted_relative_filename", "issorted", - "isstruct", "isvarname", "kbhit", "keyboard", - "kill", "lasterr", "lasterror", "lastwarn", - "ldivide", "le", "length", "link", "linspace", - "logical", "lstat", "lt", "make_absolute_filename", - "makeinfo_program", "max_recursion_depth", "merge", - "methods", "mfilename", "minus", "mislocked", - "mkdir", "mkfifo", "mkstemp", "mldivide", "mlock", - "mouse_wheel_zoom", "mpower", "mrdivide", "mtimes", - "munlock", "nargin", "nargout", - "native_float_format", "ndims", "ne", "nfields", - "nnz", "norm", "not", "numel", "nzmax", - "octave_config_info", "octave_core_file_limit", - "octave_core_file_name", - "octave_core_file_options", "ones", "or", - "output_max_field_width", "output_precision", - "page_output_immediately", "page_screen_output", - "path", "pathsep", "pause", "pclose", "permute", - "pi", "pipe", "plus", "popen", "power", - "print_empty_dimensions", "printf", - "print_struct_array_contents", "prod", - "program_invocation_name", "program_name", - "putenv", "puts", "pwd", "quit", "rats", "rdivide", - "readdir", "readlink", "read_readline_init_file", - "realmax", "realmin", "rehash", "rename", - "repelems", "re_read_readline_init_file", "reset", - "reshape", "resize", "restoredefaultpath", - "rethrow", "rmdir", "rmfield", "rmpath", "rows", - "save_header_format_string", "save_precision", - "saving_history", "scanf", "set", "setenv", - "shell_cmd", "sighup_dumps_octave_core", - "sigterm_dumps_octave_core", "silent_functions", - "single", "size", "size_equal", "sizemax", - "sizeof", "sleep", "source", "sparse_auto_mutate", - "split_long_rows", "sprintf", "squeeze", "sscanf", - "stat", "stderr", "stdin", "stdout", "strcmp", - "strcmpi", "string_fill_char", "strncmp", - "strncmpi", "struct", "struct_levels_to_print", - "strvcat", "subsasgn", "subsref", "sum", "sumsq", - "superiorto", "suppress_verbose_help_message", - "symlink", "system", "tic", "tilde_expand", - "times", "tmpfile", "tmpnam", "toc", "toupper", - "transpose", "true", "typeinfo", "umask", "uminus", - "uname", "undo_string_escapes", "unlink", "uplus", - "upper", "usage", "usleep", "vec", "vectorize", - "vertcat", "waitpid", "warning", "warranty", - "whos_line_format", "yes_or_no", "zeros", - "inf", "Inf", "nan", "NaN") - - command_kw = ("close", "load", "who", "whos") - - function_kw = ( - "accumarray", "accumdim", "acosd", "acotd", - "acscd", "addtodate", "allchild", "ancestor", - "anova", "arch_fit", "arch_rnd", "arch_test", - "area", "arma_rnd", "arrayfun", "ascii", "asctime", - "asecd", "asind", "assert", "atand", - "autoreg_matrix", "autumn", "axes", "axis", "bar", - "barh", "bartlett", "bartlett_test", "beep", - "betacdf", "betainv", "betapdf", "betarnd", - "bicgstab", "bicubic", "binary", "binocdf", - "binoinv", "binopdf", "binornd", "bitcmp", - "bitget", "bitset", "blackman", "blanks", - "blkdiag", "bone", "box", "brighten", "calendar", - "cast", "cauchy_cdf", "cauchy_inv", "cauchy_pdf", - "cauchy_rnd", "caxis", "celldisp", "center", "cgs", - "chisquare_test_homogeneity", - "chisquare_test_independence", "circshift", "cla", - "clabel", "clf", "clock", "cloglog", "closereq", - "colon", "colorbar", "colormap", "colperm", - "comet", "common_size", "commutation_matrix", - "compan", "compare_versions", "compass", - "computer", "cond", "condest", "contour", - "contourc", "contourf", "contrast", "conv", - "convhull", "cool", "copper", "copyfile", "cor", - "corrcoef", "cor_test", "cosd", "cotd", "cov", - "cplxpair", "cross", "cscd", "cstrcat", "csvread", - "csvwrite", "ctime", "cumtrapz", "curl", "cut", - "cylinder", "date", "datenum", "datestr", - "datetick", "datevec", "dblquad", "deal", - "deblank", "deconv", "delaunay", "delaunayn", - "delete", "demo", "detrend", "diffpara", "diffuse", - "dir", "discrete_cdf", "discrete_inv", - "discrete_pdf", "discrete_rnd", "display", - "divergence", "dlmwrite", "dos", "dsearch", - "dsearchn", "duplication_matrix", "durbinlevinson", - "ellipsoid", "empirical_cdf", "empirical_inv", - "empirical_pdf", "empirical_rnd", "eomday", - "errorbar", "etime", "etreeplot", "example", - "expcdf", "expinv", "expm", "exppdf", "exprnd", - "ezcontour", "ezcontourf", "ezmesh", "ezmeshc", - "ezplot", "ezpolar", "ezsurf", "ezsurfc", "factor", - "factorial", "fail", "fcdf", "feather", "fftconv", - "fftfilt", "fftshift", "figure", "fileattrib", - "fileparts", "fill", "findall", "findobj", - "findstr", "finv", "flag", "flipdim", "fliplr", - "flipud", "fpdf", "fplot", "fractdiff", "freqz", - "freqz_plot", "frnd", "fsolve", - "f_test_regression", "ftp", "fullfile", "fzero", - "gamcdf", "gaminv", "gampdf", "gamrnd", "gca", - "gcbf", "gcbo", "gcf", "genvarname", "geocdf", - "geoinv", "geopdf", "geornd", "getfield", "ginput", - "glpk", "gls", "gplot", "gradient", - "graphics_toolkit", "gray", "grid", "griddata", - "griddatan", "gtext", "gunzip", "gzip", "hadamard", - "hamming", "hankel", "hanning", "hggroup", - "hidden", "hilb", "hist", "histc", "hold", "hot", - "hotelling_test", "housh", "hsv", "hurst", - "hygecdf", "hygeinv", "hygepdf", "hygernd", - "idivide", "ifftshift", "image", "imagesc", - "imfinfo", "imread", "imshow", "imwrite", "index", - "info", "inpolygon", "inputname", "interpft", - "interpn", "intersect", "invhilb", "iqr", "isa", - "isdefinite", "isdir", "is_duplicate_entry", - "isequal", "isequalwithequalnans", "isfigure", - "ishermitian", "ishghandle", "is_leap_year", - "isletter", "ismac", "ismember", "ispc", "isprime", - "isprop", "isscalar", "issquare", "isstrprop", - "issymmetric", "isunix", "is_valid_file_id", - "isvector", "jet", "kendall", - "kolmogorov_smirnov_cdf", - "kolmogorov_smirnov_test", "kruskal_wallis_test", - "krylov", "kurtosis", "laplace_cdf", "laplace_inv", - "laplace_pdf", "laplace_rnd", "legend", "legendre", - "license", "line", "linkprop", "list_primes", - "loadaudio", "loadobj", "logistic_cdf", - "logistic_inv", "logistic_pdf", "logistic_rnd", - "logit", "loglog", "loglogerr", "logm", "logncdf", - "logninv", "lognpdf", "lognrnd", "logspace", - "lookfor", "ls_command", "lsqnonneg", "magic", - "mahalanobis", "manova", "matlabroot", - "mcnemar_test", "mean", "meansq", "median", "menu", - "mesh", "meshc", "meshgrid", "meshz", "mexext", - "mget", "mkpp", "mode", "moment", "movefile", - "mpoles", "mput", "namelengthmax", "nargchk", - "nargoutchk", "nbincdf", "nbininv", "nbinpdf", - "nbinrnd", "nchoosek", "ndgrid", "newplot", "news", - "nonzeros", "normcdf", "normest", "norminv", - "normpdf", "normrnd", "now", "nthroot", "null", - "ocean", "ols", "onenormest", "optimget", - "optimset", "orderfields", "orient", "orth", - "pack", "pareto", "parseparams", "pascal", "patch", - "pathdef", "pcg", "pchip", "pcolor", "pcr", - "peaks", "periodogram", "perl", "perms", "pie", - "pink", "planerot", "playaudio", "plot", - "plotmatrix", "plotyy", "poisscdf", "poissinv", - "poisspdf", "poissrnd", "polar", "poly", - "polyaffine", "polyarea", "polyderiv", "polyfit", - "polygcd", "polyint", "polyout", "polyreduce", - "polyval", "polyvalm", "postpad", "powerset", - "ppder", "ppint", "ppjumps", "ppplot", "ppval", - "pqpnonneg", "prepad", "primes", "print", - "print_usage", "prism", "probit", "qp", "qqplot", - "quadcc", "quadgk", "quadl", "quadv", "quiver", - "qzhess", "rainbow", "randi", "range", "rank", - "ranks", "rat", "reallog", "realpow", "realsqrt", - "record", "rectangle_lw", "rectangle_sw", - "rectint", "refresh", "refreshdata", - "regexptranslate", "repmat", "residue", "ribbon", - "rindex", "roots", "rose", "rosser", "rotdim", - "rref", "run", "run_count", "rundemos", "run_test", - "runtests", "saveas", "saveaudio", "saveobj", - "savepath", "scatter", "secd", "semilogx", - "semilogxerr", "semilogy", "semilogyerr", - "setaudio", "setdiff", "setfield", "setxor", - "shading", "shift", "shiftdim", "sign_test", - "sinc", "sind", "sinetone", "sinewave", "skewness", - "slice", "sombrero", "sortrows", "spaugment", - "spconvert", "spdiags", "spearman", "spectral_adf", - "spectral_xdf", "specular", "speed", "spencer", - "speye", "spfun", "sphere", "spinmap", "spline", - "spones", "sprand", "sprandn", "sprandsym", - "spring", "spstats", "spy", "sqp", "stairs", - "statistics", "std", "stdnormal_cdf", - "stdnormal_inv", "stdnormal_pdf", "stdnormal_rnd", - "stem", "stft", "strcat", "strchr", "strjust", - "strmatch", "strread", "strsplit", "strtok", - "strtrim", "strtrunc", "structfun", "studentize", - "subplot", "subsindex", "subspace", "substr", - "substruct", "summer", "surf", "surface", "surfc", - "surfl", "surfnorm", "svds", "swapbytes", - "sylvester_matrix", "symvar", "synthesis", "table", - "tand", "tar", "tcdf", "tempdir", "tempname", - "test", "text", "textread", "textscan", "tinv", - "title", "toeplitz", "tpdf", "trace", "trapz", - "treelayout", "treeplot", "triangle_lw", - "triangle_sw", "tril", "trimesh", "triplequad", - "triplot", "trisurf", "triu", "trnd", "tsearchn", - "t_test", "t_test_regression", "type", "unidcdf", - "unidinv", "unidpdf", "unidrnd", "unifcdf", - "unifinv", "unifpdf", "unifrnd", "union", "unique", - "unix", "unmkpp", "unpack", "untabify", "untar", - "unwrap", "unzip", "u_test", "validatestring", - "vander", "var", "var_test", "vech", "ver", - "version", "view", "voronoi", "voronoin", - "waitforbuttonpress", "wavread", "wavwrite", - "wblcdf", "wblinv", "wblpdf", "wblrnd", "weekday", - "welch_test", "what", "white", "whitebg", - "wienrnd", "wilcoxon_test", "wilkinson", "winter", - "xlabel", "xlim", "ylabel", "yulewalker", "zip", - "zlabel", "z_test") - - loadable_kw = ( - "airy", "amd", "balance", "besselh", "besseli", - "besselj", "besselk", "bessely", "bitpack", - "bsxfun", "builtin", "ccolamd", "cellfun", - "cellslices", "chol", "choldelete", "cholinsert", - "cholinv", "cholshift", "cholupdate", "colamd", - "colloc", "convhulln", "convn", "csymamd", - "cummax", "cummin", "daspk", "daspk_options", - "dasrt", "dasrt_options", "dassl", "dassl_options", - "dbclear", "dbdown", "dbstack", "dbstatus", - "dbstop", "dbtype", "dbup", "dbwhere", "det", - "dlmread", "dmperm", "dot", "eig", "eigs", - "endgrent", "endpwent", "etree", "fft", "fftn", - "fftw", "filter", "find", "full", "gcd", - "getgrent", "getgrgid", "getgrnam", "getpwent", - "getpwnam", "getpwuid", "getrusage", "givens", - "gmtime", "gnuplot_binary", "hess", "ifft", - "ifftn", "inv", "isdebugmode", "issparse", "kron", - "localtime", "lookup", "lsode", "lsode_options", - "lu", "luinc", "luupdate", "matrix_type", "max", - "min", "mktime", "pinv", "qr", "qrdelete", - "qrinsert", "qrshift", "qrupdate", "quad", - "quad_options", "qz", "rand", "rande", "randg", - "randn", "randp", "randperm", "rcond", "regexp", - "regexpi", "regexprep", "schur", "setgrent", - "setpwent", "sort", "spalloc", "sparse", "spparms", - "sprank", "sqrtm", "strfind", "strftime", - "strptime", "strrep", "svd", "svd_driver", "syl", - "symamd", "symbfact", "symrcm", "time", "tsearch", - "typecast", "urlread", "urlwrite") - - mapping_kw = ( - "abs", "acos", "acosh", "acot", "acoth", "acsc", - "acsch", "angle", "arg", "asec", "asech", "asin", - "asinh", "atan", "atanh", "beta", "betainc", - "betaln", "bincoeff", "cbrt", "ceil", "conj", "cos", - "cosh", "cot", "coth", "csc", "csch", "erf", "erfc", - "erfcx", "erfinv", "exp", "finite", "fix", "floor", - "fmod", "gamma", "gammainc", "gammaln", "imag", - "isalnum", "isalpha", "isascii", "iscntrl", - "isdigit", "isfinite", "isgraph", "isinf", - "islower", "isna", "isnan", "isprint", "ispunct", - "isspace", "isupper", "isxdigit", "lcm", "lgamma", - "log", "lower", "mod", "real", "rem", "round", - "roundb", "sec", "sech", "sign", "sin", "sinh", - "sqrt", "tan", "tanh", "toascii", "tolower", "xor") - - builtin_consts = ( - "EDITOR", "EXEC_PATH", "I", "IMAGE_PATH", "NA", - "OCTAVE_HOME", "OCTAVE_VERSION", "PAGER", - "PAGER_FLAGS", "SEEK_CUR", "SEEK_END", "SEEK_SET", - "SIG", "S_ISBLK", "S_ISCHR", "S_ISDIR", "S_ISFIFO", - "S_ISLNK", "S_ISREG", "S_ISSOCK", "WCONTINUE", - "WCOREDUMP", "WEXITSTATUS", "WIFCONTINUED", - "WIFEXITED", "WIFSIGNALED", "WIFSTOPPED", "WNOHANG", - "WSTOPSIG", "WTERMSIG", "WUNTRACED") - - tokens = { - 'root': [ - # We should look into multiline comments - (r'[%#].*$', Comment), - (r'^\s*function', Keyword, 'deffunc'), - - # from 'iskeyword' on hg changeset 8cc154f45e37 - (words(( - '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef', 'continue', 'do', 'else', - 'elseif', 'end', 'end_try_catch', 'end_unwind_protect', 'endclassdef', - 'endevents', 'endfor', 'endfunction', 'endif', 'endmethods', 'endproperties', - 'endswitch', 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if', 'methods', - 'otherwise', 'persistent', 'properties', 'return', 'set', 'static', 'switch', 'try', - 'until', 'unwind_protect', 'unwind_protect_cleanup', 'while'), suffix=r'\b'), - Keyword), - - (words(builtin_kw + command_kw + function_kw + loadable_kw + mapping_kw, - suffix=r'\b'), Name.Builtin), - - (words(builtin_consts, suffix=r'\b'), Name.Constant), - - # operators in Octave but not Matlab: - (r'-=|!=|!|/=|--', Operator), - # operators: - (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator), - # operators in Octave but not Matlab requiring escape for re: - (r'\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*', Operator), - # operators requiring escape for re: - (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator), - - - # punctuation: - (r'[\[\](){}:@.,]', Punctuation), - (r'=|:|;', Punctuation), - - (r'"[^"]*"', String), - - (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float), - (r'\d+[eEf][+-]?[0-9]+', Number.Float), - (r'\d+', Number.Integer), - - # quote can be transpose, instead of string: - # (not great, but handles common cases...) - (r'(?<=[\w)\].])\'+', Operator), - (r'(?|<=|>=|&&|&|~|\|\|?', Operator), - # operators requiring escape for re: - (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator), - - # punctuation: - (r'[\[\](){}@.,=:;]', Punctuation), - - (r'"[^"]*"', String), - - # quote can be transpose, instead of string: - # (not great, but handles common cases...) - (r'(?<=[\w)\].])\'+', Operator), - (r'(?`_ source code. - - .. versionadded:: 1.1 - """ - name = 'Modelica' - aliases = ['modelica'] - filenames = ['*.mo'] - mimetypes = ['text/x-modelica'] - - flags = re.DOTALL | re.MULTILINE - - _name = r"(?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)" - - tokens = { - 'whitespace': [ - (u'[\\s\ufeff]+', Text), - (r'//[^\n]*\n?', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline) - ], - 'root': [ - include('whitespace'), - (r'"', String.Double, 'string'), - (r'[()\[\]{},;]+', Punctuation), - (r'\.?[*^/+-]|\.|<>|[<>:=]=?', Operator), - (r'\d+(\.?\d*[eE][-+]?\d+|\.\d*)', Number.Float), - (r'\d+', Number.Integer), - (r'(abs|acos|actualStream|array|asin|assert|AssertionLevel|atan|' - r'atan2|backSample|Boolean|cardinality|cat|ceil|change|Clock|' - r'Connections|cos|cosh|cross|delay|diagonal|div|edge|exp|' - r'ExternalObject|fill|floor|getInstanceName|hold|homotopy|' - r'identity|inStream|integer|Integer|interval|inverse|isPresent|' - r'linspace|log|log10|matrix|max|min|mod|ndims|noClock|noEvent|' - r'ones|outerProduct|pre|previous|product|Real|reinit|rem|rooted|' - r'sample|scalar|semiLinear|shiftSample|sign|sin|sinh|size|skew|' - r'smooth|spatialDistribution|sqrt|StateSelect|String|subSample|' - r'sum|superSample|symmetric|tan|tanh|terminal|terminate|time|' - r'transpose|vector|zeros)\b', Name.Builtin), - (r'(algorithm|annotation|break|connect|constant|constrainedby|der|' - r'discrete|each|else|elseif|elsewhen|encapsulated|enumeration|' - r'equation|exit|expandable|extends|external|final|flow|for|if|' - r'import|impure|in|initial|inner|input|loop|nondiscrete|outer|' - r'output|parameter|partial|protected|public|pure|redeclare|' - r'replaceable|return|stream|then|when|while)\b', - Keyword.Reserved), - (r'(and|not|or)\b', Operator.Word), - (r'(block|class|connector|end|function|model|operator|package|' - r'record|type)\b', Keyword.Reserved, 'class'), - (r'(false|true)\b', Keyword.Constant), - (r'within\b', Keyword.Reserved, 'package-prefix'), - (_name, Name) - ], - 'class': [ - include('whitespace'), - (r'(function|record)\b', Keyword.Reserved), - (r'(if|for|when|while)\b', Keyword.Reserved, '#pop'), - (_name, Name.Class, '#pop'), - default('#pop') - ], - 'package-prefix': [ - include('whitespace'), - (_name, Name.Namespace, '#pop'), - default('#pop') - ], - 'string': [ - (r'"', String.Double, '#pop'), - (r'\\[\'"?\\abfnrtv]', String.Escape), - (r'(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))', - using(HtmlLexer)), - (r'<|\\?[^"\\<]+', String.Double) - ] - } - - -class BugsLexer(RegexLexer): - """ - Pygments Lexer for `OpenBugs `_ and WinBugs - models. - - .. versionadded:: 1.6 - """ - - name = 'BUGS' - aliases = ['bugs', 'winbugs', 'openbugs'] - filenames = ['*.bug'] - - _FUNCTIONS = ( - # Scalar functions - 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh', - 'cloglog', 'cos', 'cosh', 'cumulative', 'cut', 'density', 'deviance', - 'equals', 'expr', 'gammap', 'ilogit', 'icloglog', 'integral', 'log', - 'logfact', 'loggam', 'logit', 'max', 'min', 'phi', 'post.p.value', - 'pow', 'prior.p.value', 'probit', 'replicate.post', 'replicate.prior', - 'round', 'sin', 'sinh', 'solution', 'sqrt', 'step', 'tan', 'tanh', - 'trunc', - # Vector functions - 'inprod', 'interp.lin', 'inverse', 'logdet', 'mean', 'eigen.vals', - 'ode', 'prod', 'p.valueM', 'rank', 'ranked', 'replicate.postM', - 'sd', 'sort', 'sum', - # Special - 'D', 'I', 'F', 'T', 'C') - """ OpenBUGS built-in functions - - From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAII - - This also includes - - - T, C, I : Truncation and censoring. - ``T`` and ``C`` are in OpenBUGS. ``I`` in WinBUGS. - - D : ODE - - F : Functional http://www.openbugs.info/Examples/Functionals.html - - """ - - _DISTRIBUTIONS = ('dbern', 'dbin', 'dcat', 'dnegbin', 'dpois', - 'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp', - 'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar', - 'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar', - 'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm', - 'dmt', 'dwish') - """ OpenBUGS built-in distributions - - Functions from - http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI - """ - - tokens = { - 'whitespace': [ - (r"\s+", Text), - ], - 'comments': [ - # Comments - (r'#.*$', Comment.Single), - ], - 'root': [ - # Comments - include('comments'), - include('whitespace'), - # Block start - (r'(model)(\s+)(\{)', - bygroups(Keyword.Namespace, Text, Punctuation)), - # Reserved Words - (r'(for|in)(?![\w.])', Keyword.Reserved), - # Built-in Functions - (r'(%s)(?=\s*\()' - % r'|'.join(_FUNCTIONS + _DISTRIBUTIONS), - Name.Builtin), - # Regular variable names - (r'[A-Za-z][\w.]*', Name), - # Number Literals - (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number), - # Punctuation - (r'\[|\]|\(|\)|:|,|;', Punctuation), - # Assignment operators - # SLexer makes these tokens Operators. - (r'<-|~', Operator), - # Infix and prefix operators - (r'\+|-|\*|/', Operator), - # Block - (r'[{}]', Punctuation), - ] - } - - def analyse_text(text): - if re.search(r"^\s*model\s*{", text, re.M): - return 0.7 - else: - return 0.0 - - -class JagsLexer(RegexLexer): - """ - Pygments Lexer for JAGS. - - .. versionadded:: 1.6 - """ - - name = 'JAGS' - aliases = ['jags'] - filenames = ['*.jag', '*.bug'] - - # JAGS - _FUNCTIONS = ( - 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh', - 'cos', 'cosh', 'cloglog', - 'equals', 'exp', 'icloglog', 'ifelse', 'ilogit', 'log', 'logfact', - 'loggam', 'logit', 'phi', 'pow', 'probit', 'round', 'sin', 'sinh', - 'sqrt', 'step', 'tan', 'tanh', 'trunc', 'inprod', 'interp.lin', - 'logdet', 'max', 'mean', 'min', 'prod', 'sum', 'sd', 'inverse', - 'rank', 'sort', 't', 'acos', 'acosh', 'asin', 'asinh', 'atan', - # Truncation/Censoring (should I include) - 'T', 'I') - # Distributions with density, probability and quartile functions - _DISTRIBUTIONS = tuple('[dpq]%s' % x for x in - ('bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp', - 'df', 'gamma', 'gen.gamma', 'logis', 'lnorm', - 'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib')) - # Other distributions without density and probability - _OTHER_DISTRIBUTIONS = ( - 'dt', 'dunif', 'dbetabin', 'dbern', 'dbin', 'dcat', 'dhyper', - 'ddirch', 'dmnorm', 'dwish', 'dmt', 'dmulti', 'dbinom', 'dchisq', - 'dnbinom', 'dweibull', 'ddirich') - - tokens = { - 'whitespace': [ - (r"\s+", Text), - ], - 'names': [ - # Regular variable names - (r'[a-zA-Z][\w.]*\b', Name), - ], - 'comments': [ - # do not use stateful comments - (r'(?s)/\*.*?\*/', Comment.Multiline), - # Comments - (r'#.*$', Comment.Single), - ], - 'root': [ - # Comments - include('comments'), - include('whitespace'), - # Block start - (r'(model|data)(\s+)(\{)', - bygroups(Keyword.Namespace, Text, Punctuation)), - (r'var(?![\w.])', Keyword.Declaration), - # Reserved Words - (r'(for|in)(?![\w.])', Keyword.Reserved), - # Builtins - # Need to use lookahead because . is a valid char - (r'(%s)(?=\s*\()' % r'|'.join(_FUNCTIONS - + _DISTRIBUTIONS - + _OTHER_DISTRIBUTIONS), - Name.Builtin), - # Names - include('names'), - # Number Literals - (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number), - (r'\[|\]|\(|\)|:|,|;', Punctuation), - # Assignment operators - (r'<-|~', Operator), - # # JAGS includes many more than OpenBUGS - (r'\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%', Operator), - (r'[{}]', Punctuation), - ] - } - - def analyse_text(text): - if re.search(r'^\s*model\s*\{', text, re.M): - if re.search(r'^\s*data\s*\{', text, re.M): - return 0.9 - elif re.search(r'^\s*var', text, re.M): - return 0.9 - else: - return 0.3 - else: - return 0 - - -class StanLexer(RegexLexer): - """Pygments Lexer for Stan models. - - The Stan modeling language is specified in the *Stan Modeling Language - User's Guide and Reference Manual, v2.4.0*, - `pdf `__. - - .. versionadded:: 1.6 - """ - - name = 'Stan' - aliases = ['stan'] - filenames = ['*.stan'] - - tokens = { - 'whitespace': [ - (r"\s+", Text), - ], - 'comments': [ - (r'(?s)/\*.*?\*/', Comment.Multiline), - # Comments - (r'(//|#).*$', Comment.Single), - ], - 'root': [ - # Stan is more restrictive on strings than this regex - (r'"[^"]*"', String), - # Comments - include('comments'), - # block start - include('whitespace'), - # Block start - (r'(%s)(\s*)(\{)' % - r'|'.join(('functions', 'data', r'transformed\s+?data', - 'parameters', r'transformed\s+parameters', - 'model', r'generated\s+quantities')), - bygroups(Keyword.Namespace, Text, Punctuation)), - # Reserved Words - (r'(%s)\b' % r'|'.join(_stan_builtins.KEYWORDS), Keyword), - # Truncation - (r'T(?=\s*\[)', Keyword), - # Data types - (r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type), - # Punctuation - (r"[;:,\[\]()]", Punctuation), - # Builtin - (r'(%s)(?=\s*\()' - % r'|'.join(_stan_builtins.FUNCTIONS - + _stan_builtins.DISTRIBUTIONS), - Name.Builtin), - # Special names ending in __, like lp__ - (r'[A-Za-z]\w*__\b', Name.Builtin.Pseudo), - (r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved), - # Regular variable names - (r'[A-Za-z]\w*\b', Name), - # Real Literals - (r'-?[0-9]+(\.[0-9]+)?[eE]-?[0-9]+', Number.Float), - (r'-?[0-9]*\.[0-9]*', Number.Float), - # Integer Literals - (r'-?[0-9]+', Number.Integer), - # Assignment operators - # SLexer makes these tokens Operators. - (r'<-|~', Operator), - # Infix, prefix and postfix operators (and = ) - (r"\+|-|\.?\*|\.?/|\\|'|\^|==?|!=?|<=?|>=?|\|\||&&", Operator), - # Block delimiters - (r'[{}]', Punctuation), - ] - } - - def analyse_text(text): - if re.search(r'^\s*parameters\s*\{', text, re.M): - return 1.0 - else: - return 0.0 diff --git a/wakatime/packages/py3/pygments/lexers/nimrod.py b/wakatime/packages/py3/pygments/lexers/nimrod.py deleted file mode 100644 index de2eafb..0000000 --- a/wakatime/packages/py3/pygments/lexers/nimrod.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.nimrod - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexer for the Nimrod language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include, default -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error - -__all__ = ['NimrodLexer'] - - -class NimrodLexer(RegexLexer): - """ - For `Nimrod `_ source code. - - .. versionadded:: 1.5 - """ - - name = 'Nimrod' - aliases = ['nimrod', 'nim'] - filenames = ['*.nim', '*.nimrod'] - mimetypes = ['text/x-nimrod'] - - flags = re.MULTILINE | re.IGNORECASE | re.UNICODE - - def underscorize(words): - newWords = [] - new = "" - for word in words: - for ch in word: - new += (ch + "_?") - newWords.append(new) - new = "" - return "|".join(newWords) - - keywords = [ - 'addr', 'and', 'as', 'asm', 'atomic', 'bind', 'block', 'break', - 'case', 'cast', 'const', 'continue', 'converter', 'discard', - 'distinct', 'div', 'elif', 'else', 'end', 'enum', 'except', 'finally', - 'for', 'generic', 'if', 'implies', 'in', 'yield', - 'is', 'isnot', 'iterator', 'lambda', 'let', 'macro', 'method', - 'mod', 'not', 'notin', 'object', 'of', 'or', 'out', 'proc', - 'ptr', 'raise', 'ref', 'return', 'shl', 'shr', 'template', 'try', - 'tuple', 'type', 'when', 'while', 'with', 'without', 'xor' - ] - - keywordsPseudo = [ - 'nil', 'true', 'false' - ] - - opWords = [ - 'and', 'or', 'not', 'xor', 'shl', 'shr', 'div', 'mod', 'in', - 'notin', 'is', 'isnot' - ] - - types = [ - 'int', 'int8', 'int16', 'int32', 'int64', 'float', 'float32', 'float64', - 'bool', 'char', 'range', 'array', 'seq', 'set', 'string' - ] - - tokens = { - 'root': [ - (r'##.*$', String.Doc), - (r'#.*$', Comment), - (r'[*=><+\-/@$~&%!?|\\\[\]]', Operator), - (r'\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;', - Punctuation), - - # Strings - (r'(?:[\w]+)"', String, 'rdqs'), - (r'"""', String, 'tdqs'), - ('"', String, 'dqs'), - - # Char - ("'", String.Char, 'chars'), - - # Keywords - (r'(%s)\b' % underscorize(opWords), Operator.Word), - (r'(p_?r_?o_?c_?\s)(?![(\[\]])', Keyword, 'funcname'), - (r'(%s)\b' % underscorize(keywords), Keyword), - (r'(%s)\b' % underscorize(['from', 'import', 'include']), - Keyword.Namespace), - (r'(v_?a_?r)\b', Keyword.Declaration), - (r'(%s)\b' % underscorize(types), Keyword.Type), - (r'(%s)\b' % underscorize(keywordsPseudo), Keyword.Pseudo), - # Identifiers - (r'\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*', Name), - # Numbers - (r'[0-9][0-9_]*(?=([e.]|\'f(32|64)))', - Number.Float, ('float-suffix', 'float-number')), - (r'0x[a-f0-9][a-f0-9_]*', Number.Hex, 'int-suffix'), - (r'0b[01][01_]*', Number.Bin, 'int-suffix'), - (r'0o[0-7][0-7_]*', Number.Oct, 'int-suffix'), - (r'[0-9][0-9_]*', Number.Integer, 'int-suffix'), - # Whitespace - (r'\s+', Text), - (r'.+$', Error), - ], - 'chars': [ - (r'\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})', String.Escape), - (r"'", String.Char, '#pop'), - (r".", String.Char) - ], - 'strings': [ - (r'(?`_ source. - - .. versionadded:: 2.0 - """ - - name = 'Nit' - aliases = ['nit'] - filenames = ['*.nit'] - tokens = { - 'root': [ - (r'#.*?$', Comment.Single), - (words(( - 'package', 'module', 'import', 'class', 'abstract', 'interface', - 'universal', 'enum', 'end', 'fun', 'type', 'init', 'redef', - 'isa', 'do', 'readable', 'writable', 'var', 'intern', 'extern', - 'public', 'protected', 'private', 'intrude', 'if', 'then', - 'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not', - 'implies', 'return', 'continue', 'break', 'abort', 'assert', - 'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable', - 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'), - Keyword), - (r'[A-Z]\w*', Name.Class), - (r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string - (r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|' - r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt - (r'"""(([^\'\\]|\\.)|\\r|\\n)*((""?)?(\{\{?""?)*\{\{\{\{*)', String), # Start long string - (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(""?)?(\{\{?""?)*\{\{\{\{*', String), # Mid long string - (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(\{\{?)?(""?\{\{?)*""""*', String), # End long string - (r'"(\\.|([^"}{\\]))*"', String), # Simple String - (r'"(\\.|([^"}{\\]))*\{', String), # Start string - (r'\}(\\.|([^"}{\\]))*\{', String), # Mid String - (r'\}(\\.|([^"}{\\]))*"', String), # End String - (r'(\'[^\'\\]\')|(\'\\.\')', String.Char), - (r'[0-9]+', Number.Integer), - (r'[0-9]*.[0-9]+', Number.Float), - (r'0(x|X)[0-9A-Fa-f]+', Number.Hex), - (r'[a-z]\w*', Name), - (r'_\w+', Name.Variable.Instance), - (r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator), - (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation), - (r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit - (r'[\r\n\t ]+', Text), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/nix.py b/wakatime/packages/py3/pygments/lexers/nix.py deleted file mode 100644 index 1bf533d..0000000 --- a/wakatime/packages/py3/pygments/lexers/nix.py +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.nix - ~~~~~~~~~~~~~~~~~~~ - - Lexers for the NixOS Nix language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Literal - -__all__ = ['NixLexer'] - - -class NixLexer(RegexLexer): - """ - For the `Nix language `_. - - .. versionadded:: 2.0 - """ - - name = 'Nix' - aliases = ['nixos', 'nix'] - filenames = ['*.nix'] - mimetypes = ['text/x-nix'] - - flags = re.MULTILINE | re.UNICODE - - keywords = ['rec', 'with', 'let', 'in', 'inherit', 'assert', 'if', - 'else', 'then', '...'] - builtins = ['import', 'abort', 'baseNameOf', 'dirOf', 'isNull', 'builtins', - 'map', 'removeAttrs', 'throw', 'toString', 'derivation'] - operators = ['++', '+', '?', '.', '!', '//', '==', - '!=', '&&', '||', '->', '='] - - punctuations = ["(", ")", "[", "]", ";", "{", "}", ":", ",", "@"] - - tokens = { - 'root': [ - # comments starting with # - (r'#.*$', Comment.Single), - - # multiline comments - (r'/\*', Comment.Multiline, 'comment'), - - # whitespace - (r'\s+', Text), - - # keywords - ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in keywords), Keyword), - - # highlight the builtins - ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in builtins), - Name.Builtin), - - (r'\b(true|false|null)\b', Name.Constant), - - # operators - ('(%s)' % '|'.join(re.escape(entry) for entry in operators), - Operator), - - # word operators - (r'\b(or|and)\b', Operator.Word), - - # punctuations - ('(%s)' % '|'.join(re.escape(entry) for entry in punctuations), Punctuation), - - # integers - (r'[0-9]+', Number.Integer), - - # strings - (r'"', String.Double, 'doublequote'), - (r"''", String.Single, 'singlequote'), - - # paths - (r'[\w.+-]*(\/[\w.+-]+)+', Literal), - (r'\<[\w.+-]+(\/[\w.+-]+)*\>', Literal), - - # urls - (r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+', Literal), - - # names of variables - (r'[\w-]+\s*=', String.Symbol), - (r'[a-zA-Z_][\w\'-]*', Text), - - ], - 'comment': [ - (r'[^/*]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline), - ], - 'singlequote': [ - (r"'''", String.Escape), - (r"''\$\{", String.Escape), - (r"''\n", String.Escape), - (r"''\r", String.Escape), - (r"''\t", String.Escape), - (r"''", String.Single, '#pop'), - (r'\$\{', String.Interpol, 'antiquote'), - (r"[^']", String.Single), - ], - 'doublequote': [ - (r'\\', String.Escape), - (r'\\"', String.Escape), - (r'\\$\{', String.Escape), - (r'"', String.Double, '#pop'), - (r'\$\{', String.Interpol, 'antiquote'), - (r'[^"]', String.Double), - ], - 'antiquote': [ - (r"\}", String.Interpol, '#pop'), - # TODO: we should probably escape also here ''${ \${ - (r"\$\{", String.Interpol, '#push'), - include('root'), - ], - } - - def analyse_text(text): - rv = 0.0 - # TODO: let/in - if re.search(r'import.+?<[^>]+>', text): - rv += 0.4 - if re.search(r'mkDerivation\s+(\(|\{|rec)', text): - rv += 0.4 - if re.search(r'=\s+mkIf\s+', text): - rv += 0.4 - if re.search(r'\{[a-zA-Z,\s]+\}:', text): - rv += 0.1 - return rv diff --git a/wakatime/packages/py3/pygments/lexers/objective.py b/wakatime/packages/py3/pygments/lexers/objective.py deleted file mode 100644 index 4e0ecf0..0000000 --- a/wakatime/packages/py3/pygments/lexers/objective.py +++ /dev/null @@ -1,487 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.objective - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Objective-C family languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include, bygroups, using, this, words, \ - inherit, default -from pygments.token import Text, Keyword, Name, String, Operator, \ - Number, Punctuation, Literal, Comment - -from pygments.lexers.c_cpp import CLexer, CppLexer - -__all__ = ['ObjectiveCLexer', 'ObjectiveCppLexer', 'LogosLexer', 'SwiftLexer'] - - -def objective(baselexer): - """ - Generate a subclass of baselexer that accepts the Objective-C syntax - extensions. - """ - - # Have to be careful not to accidentally match JavaDoc/Doxygen syntax here, - # since that's quite common in ordinary C/C++ files. It's OK to match - # JavaDoc/Doxygen keywords that only apply to Objective-C, mind. - # - # The upshot of this is that we CANNOT match @class or @interface - _oc_keywords = re.compile(r'@(?:end|implementation|protocol)') - - # Matches [ ? identifier ( identifier ? ] | identifier? : ) - # (note the identifier is *optional* when there is a ':'!) - _oc_message = re.compile(r'\[\s*[a-zA-Z_]\w*\s+' - r'(?:[a-zA-Z_]\w*\s*\]|' - r'(?:[a-zA-Z_]\w*)?:)') - - class GeneratedObjectiveCVariant(baselexer): - """ - Implements Objective-C syntax on top of an existing C family lexer. - """ - - tokens = { - 'statements': [ - (r'@"', String, 'string'), - (r'@(YES|NO)', Number), - (r"@'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), - (r'@(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), - (r'@(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'@0x[0-9a-fA-F]+[Ll]?', Number.Hex), - (r'@0[0-7]+[Ll]?', Number.Oct), - (r'@\d+[Ll]?', Number.Integer), - (r'@\(', Literal, 'literal_number'), - (r'@\[', Literal, 'literal_array'), - (r'@\{', Literal, 'literal_dictionary'), - (words(( - '@selector', '@private', '@protected', '@public', '@encode', - '@synchronized', '@try', '@throw', '@catch', '@finally', - '@end', '@property', '@synthesize', '__bridge', '__bridge_transfer', - '__autoreleasing', '__block', '__weak', '__strong', 'weak', 'strong', - 'copy', 'retain', 'assign', 'unsafe_unretained', 'atomic', 'nonatomic', - 'readonly', 'readwrite', 'setter', 'getter', 'typeof', 'in', - 'out', 'inout', 'release', 'class', '@dynamic', '@optional', - '@required', '@autoreleasepool'), suffix=r'\b'), - Keyword), - (words(('id', 'instancetype', 'Class', 'IMP', 'SEL', 'BOOL', - 'IBOutlet', 'IBAction', 'unichar'), suffix=r'\b'), - Keyword.Type), - (r'@(true|false|YES|NO)\n', Name.Builtin), - (r'(YES|NO|nil|self|super)\b', Name.Builtin), - # Carbon types - (r'(Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\b', Keyword.Type), - # Carbon built-ins - (r'(TRUE|FALSE)\b', Name.Builtin), - (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text), - ('#pop', 'oc_classname')), - (r'(@class|@protocol)(\s+)', bygroups(Keyword, Text), - ('#pop', 'oc_forward_classname')), - # @ can also prefix other expressions like @{...} or @(...) - (r'@', Punctuation), - inherit, - ], - 'oc_classname': [ - # interface definition that inherits - ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)', - bygroups(Name.Class, Text, Name.Class, Text, Punctuation), - ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', - bygroups(Name.Class, Text, Name.Class), '#pop'), - # interface definition for a category - ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)', - bygroups(Name.Class, Text, Name.Label, Text, Punctuation), - ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))', - bygroups(Name.Class, Text, Name.Label), '#pop'), - # simple interface / implementation - ('([a-zA-Z$_][\w$]*)(\s*)(\{)', - bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop') - ], - 'oc_forward_classname': [ - ('([a-zA-Z$_][\w$]*)(\s*,\s*)', - bygroups(Name.Class, Text), 'oc_forward_classname'), - ('([a-zA-Z$_][\w$]*)(\s*;?)', - bygroups(Name.Class, Text), '#pop') - ], - 'oc_ivars': [ - include('whitespace'), - include('statements'), - (';', Punctuation), - (r'\{', Punctuation, '#push'), - (r'\}', Punctuation, '#pop'), - ], - 'root': [ - # methods - (r'^([-+])(\s*)' # method marker - r'(\(.*?\))?(\s*)' # return type - r'([a-zA-Z$_][\w$]*:?)', # begin of method name - bygroups(Punctuation, Text, using(this), - Text, Name.Function), - 'method'), - inherit, - ], - 'method': [ - include('whitespace'), - # TODO unsure if ellipses are allowed elsewhere, see - # discussion in Issue 789 - (r',', Punctuation), - (r'\.\.\.', Punctuation), - (r'(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)', - bygroups(using(this), Text, Name.Variable)), - (r'[a-zA-Z$_][\w$]*:', Name.Function), - (';', Punctuation, '#pop'), - (r'\{', Punctuation, 'function'), - default('#pop'), - ], - 'literal_number': [ - (r'\(', Punctuation, 'literal_number_inner'), - (r'\)', Literal, '#pop'), - include('statement'), - ], - 'literal_number_inner': [ - (r'\(', Punctuation, '#push'), - (r'\)', Punctuation, '#pop'), - include('statement'), - ], - 'literal_array': [ - (r'\[', Punctuation, 'literal_array_inner'), - (r'\]', Literal, '#pop'), - include('statement'), - ], - 'literal_array_inner': [ - (r'\[', Punctuation, '#push'), - (r'\]', Punctuation, '#pop'), - include('statement'), - ], - 'literal_dictionary': [ - (r'\}', Literal, '#pop'), - include('statement'), - ], - } - - def analyse_text(text): - if _oc_keywords.search(text): - return 1.0 - elif '@"' in text: # strings - return 0.8 - elif re.search('@[0-9]+', text): - return 0.7 - elif _oc_message.search(text): - return 0.8 - return 0 - - def get_tokens_unprocessed(self, text): - from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \ - COCOA_PROTOCOLS, COCOA_PRIMITIVES - - for index, token, value in \ - baselexer.get_tokens_unprocessed(self, text): - if token is Name or token is Name.Class: - if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \ - or value in COCOA_PRIMITIVES: - token = Name.Builtin.Pseudo - - yield index, token, value - - return GeneratedObjectiveCVariant - - -class ObjectiveCLexer(objective(CLexer)): - """ - For Objective-C source code with preprocessor directives. - """ - - name = 'Objective-C' - aliases = ['objective-c', 'objectivec', 'obj-c', 'objc'] - filenames = ['*.m', '*.h'] - mimetypes = ['text/x-objective-c'] - priority = 0.05 # Lower than C - - -class ObjectiveCppLexer(objective(CppLexer)): - """ - For Objective-C++ source code with preprocessor directives. - """ - - name = 'Objective-C++' - aliases = ['objective-c++', 'objectivec++', 'obj-c++', 'objc++'] - filenames = ['*.mm', '*.hh'] - mimetypes = ['text/x-objective-c++'] - priority = 0.05 # Lower than C++ - - -class LogosLexer(ObjectiveCppLexer): - """ - For Logos + Objective-C source code with preprocessor directives. - - .. versionadded:: 1.6 - """ - - name = 'Logos' - aliases = ['logos'] - filenames = ['*.x', '*.xi', '*.xm', '*.xmi'] - mimetypes = ['text/x-logos'] - priority = 0.25 - - tokens = { - 'statements': [ - (r'(%orig|%log)\b', Keyword), - (r'(%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))', - bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)), - (r'(%init)\b(\()', - bygroups(Keyword, Punctuation), 'logos_init_directive'), - (r'(%init)(?=\s*;)', bygroups(Keyword)), - (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', - bygroups(Keyword, Text, Name.Class), '#pop'), - (r'(%subclass)(\s+)', bygroups(Keyword, Text), - ('#pop', 'logos_classname')), - inherit, - ], - 'logos_init_directive': [ - ('\s+', Text), - (',', Punctuation, ('logos_init_directive', '#pop')), - ('([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)', - bygroups(Name.Class, Text, Punctuation, Text, Text)), - ('([a-zA-Z$_][\w$]*)', Name.Class), - ('\)', Punctuation, '#pop'), - ], - 'logos_classname': [ - ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', - bygroups(Name.Class, Text, Name.Class), '#pop'), - ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop') - ], - 'root': [ - (r'(%subclass)(\s+)', bygroups(Keyword, Text), - 'logos_classname'), - (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', - bygroups(Keyword, Text, Name.Class)), - (r'(%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)', - bygroups(Keyword, Text, Name.Variable, Text, String, Text)), - (r'(%ctor)(\s*)(\{)', bygroups(Keyword, Text, Punctuation), - 'function'), - (r'(%new)(\s*)(\()(\s*.*?\s*)(\))', - bygroups(Keyword, Text, Keyword, String, Keyword)), - (r'(\s*)(%end)(\s*)', bygroups(Text, Keyword, Text)), - inherit, - ], - } - - _logos_keywords = re.compile(r'%(?:hook|ctor|init|c\()') - - def analyse_text(text): - if LogosLexer._logos_keywords.search(text): - return 1.0 - return 0 - -class SwiftLexer(RegexLexer): - """ - For `Swift `_ source. - - .. versionadded:: 2.0 - """ - name = 'Swift' - filenames = ['*.swift'] - aliases = ['swift'] - mimetypes = ['text/x-swift'] - - tokens = { - 'root': [ - # Whitespace and Comments - (r'\n', Text), - (r'\s+', Text), - (r'//', Comment.Single, 'comment-single'), - (r'/\*', Comment.Multiline, 'comment-multi'), - (r'#(if|elseif|else|endif)\b', Comment.Preproc, 'preproc'), - - # Keywords - include('keywords'), - - # Global Types - (r'(Array|AutoreleasingUnsafeMutablePointer|BidirectionalReverseView' - r'|Bit|Bool|CFunctionPointer|COpaquePointer|CVaListPointer' - r'|Character|ClosedInterval|CollectionOfOne|ContiguousArray' - r'|Dictionary|DictionaryGenerator|DictionaryIndex|Double' - r'|EmptyCollection|EmptyGenerator|EnumerateGenerator' - r'|EnumerateSequence|FilterCollectionView' - r'|FilterCollectionViewIndex|FilterGenerator|FilterSequenceView' - r'|Float|Float80|FloatingPointClassification|GeneratorOf' - r'|GeneratorOfOne|GeneratorSequence|HalfOpenInterval|HeapBuffer' - r'|HeapBufferStorage|ImplicitlyUnwrappedOptional|IndexingGenerator' - r'|Int|Int16|Int32|Int64|Int8|LazyBidirectionalCollection' - r'|LazyForwardCollection|LazyRandomAccessCollection' - r'|LazySequence|MapCollectionView|MapSequenceGenerator' - r'|MapSequenceView|MirrorDisposition|ObjectIdentifier|OnHeap' - r'|Optional|PermutationGenerator|QuickLookObject' - r'|RandomAccessReverseView|Range|RangeGenerator|RawByte|Repeat' - r'|ReverseBidirectionalIndex|ReverseRandomAccessIndex|SequenceOf' - r'|SinkOf|Slice|StaticString|StrideThrough|StrideThroughGenerator' - r'|StrideTo|StrideToGenerator|String|UInt|UInt16|UInt32|UInt64' - r'|UInt8|UTF16|UTF32|UTF8|UnicodeDecodingResult|UnicodeScalar' - r'|Unmanaged|UnsafeBufferPointer|UnsafeBufferPointerGenerator' - r'|UnsafeMutableBufferPointer|UnsafeMutablePointer|UnsafePointer' - r'|Zip2|ZipGenerator2' - # Protocols - r'|AbsoluteValuable|AnyObject|ArrayLiteralConvertible' - r'|BidirectionalIndexType|BitwiseOperationsType' - r'|BooleanLiteralConvertible|BooleanType|CVarArgType' - r'|CollectionType|Comparable|DebugPrintable' - r'|DictionaryLiteralConvertible|Equatable' - r'|ExtendedGraphemeClusterLiteralConvertible' - r'|ExtensibleCollectionType|FloatLiteralConvertible' - r'|FloatingPointType|ForwardIndexType|GeneratorType|Hashable' - r'|IntegerArithmeticType|IntegerLiteralConvertible|IntegerType' - r'|IntervalType|MirrorType|MutableCollectionType|MutableSliceable' - r'|NilLiteralConvertible|OutputStreamType|Printable' - r'|RandomAccessIndexType|RangeReplaceableCollectionType' - r'|RawOptionSetType|RawRepresentable|Reflectable|SequenceType' - r'|SignedIntegerType|SignedNumberType|SinkType|Sliceable' - r'|Streamable|Strideable|StringInterpolationConvertible' - r'|StringLiteralConvertible|UnicodeCodecType' - r'|UnicodeScalarLiteralConvertible|UnsignedIntegerType' - r'|_ArrayBufferType|_BidirectionalIndexType|_CocoaStringType' - r'|_CollectionType|_Comparable|_ExtensibleCollectionType' - r'|_ForwardIndexType|_Incrementable|_IntegerArithmeticType' - r'|_IntegerType|_ObjectiveCBridgeable|_RandomAccessIndexType' - r'|_RawOptionSetType|_SequenceType|_Sequence_Type' - r'|_SignedIntegerType|_SignedNumberType|_Sliceable|_Strideable' - r'|_SwiftNSArrayRequiredOverridesType|_SwiftNSArrayType' - r'|_SwiftNSCopyingType|_SwiftNSDictionaryRequiredOverridesType' - r'|_SwiftNSDictionaryType|_SwiftNSEnumeratorType' - r'|_SwiftNSFastEnumerationType|_SwiftNSStringRequiredOverridesType' - r'|_SwiftNSStringType|_UnsignedIntegerType' - # Variables - r'|C_ARGC|C_ARGV|Process' - # Typealiases - r'|Any|AnyClass|BooleanLiteralType|CBool|CChar|CChar16|CChar32' - r'|CDouble|CFloat|CInt|CLong|CLongLong|CShort|CSignedChar' - r'|CUnsignedInt|CUnsignedLong|CUnsignedShort|CWideChar' - r'|ExtendedGraphemeClusterType|Float32|Float64|FloatLiteralType' - r'|IntMax|IntegerLiteralType|StringLiteralType|UIntMax|UWord' - r'|UnicodeScalarType|Void|Word' - # Foundation/Cocoa - r'|NSErrorPointer|NSObjectProtocol|Selector)\b', Name.Builtin), - # Functions - (r'(abs|advance|alignof|alignofValue|assert|assertionFailure' - r'|contains|count|countElements|debugPrint|debugPrintln|distance' - r'|dropFirst|dropLast|dump|enumerate|equal|extend|fatalError' - r'|filter|find|first|getVaList|indices|insert|isEmpty|join|last' - r'|lazy|lexicographicalCompare|map|max|maxElement|min|minElement' - r'|numericCast|overlaps|partition|precondition|preconditionFailure' - r'|prefix|print|println|reduce|reflect|removeAll|removeAtIndex' - r'|removeLast|removeRange|reverse|sizeof|sizeofValue|sort|sorted' - r'|splice|split|startsWith|stride|strideof|strideofValue|suffix' - r'|swap|toDebugString|toString|transcode|underestimateCount' - r'|unsafeAddressOf|unsafeBitCast|unsafeDowncast' - r'|withExtendedLifetime|withUnsafeMutablePointer' - r'|withUnsafeMutablePointers|withUnsafePointer|withUnsafePointers' - r'|withVaList)\b', Name.Builtin.Pseudo), - - # Implicit Block Variables - (r'\$\d+', Name.Variable), - - # Binary Literal - (r'0b[01_]+', Number.Bin), - # Octal Literal - (r'0o[0-7_]+', Number.Oct), - # Hexadecimal Literal - (r'0x[0-9a-fA-F_]+', Number.Hex), - # Decimal Literal - (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|' - r'\.[0-9_]*|[eE][+\-]?[0-9_]+)', Number.Float), - (r'[0-9][0-9_]*', Number.Integer), - # String Literal - (r'"', String, 'string'), - - # Operators and Punctuation - (r'[(){}\[\].,:;=@#`?]|->|[<&?](?=\w)|(?<=\w)[>!?]', Punctuation), - (r'[/=\-+!*%<>&|^?~]+', Operator), - - # Identifier - (r'[a-zA-Z_]\w*', Name) - ], - 'keywords': [ - (r'(break|case|continue|default|do|else|fallthrough|for|if|in' - r'|return|switch|where|while)\b', Keyword), - (r'@availability\([^)]+\)', Keyword.Reserved), - (r'(associativity|convenience|dynamic|didSet|final|get|infix|inout' - r'|lazy|left|mutating|none|nonmutating|optional|override|postfix' - r'|precedence|prefix|Protocol|required|right|set|Type|unowned|weak' - r'|willSet|@(availability|autoclosure|noreturn' - r'|NSApplicationMain|NSCopying|NSManaged|objc' - r'|UIApplicationMain|IBAction|IBDesignable|IBInspectable' - r'|IBOutlet))\b',Keyword.Reserved), - (r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__' - r'|__FILE__|__FUNCTION__|__LINE__|_)\b', Keyword.Constant), - (r'import\b', Keyword.Declaration, 'module'), - (r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)', - bygroups(Keyword.Declaration, Text, Name.Class)), - (r'(func)(\s+)([a-zA-Z_]\w*)', - bygroups(Keyword.Declaration, Text, Name.Function)), - (r'(var|let)(\s+)([a-zA-Z_]\w*)', bygroups(Keyword.Declaration, - Text, Name.Variable)), - (r'(class|deinit|enum|extension|func|import|init|internal|let' - r'|operator|private|protocol|public|static|struct|subscript' - r'|typealias|var)\b', Keyword.Declaration) - ], - 'comment': [ - (r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):', - Comment.Special) - ], - - # Nested - 'comment-single': [ - (r'\n', Text, '#pop'), - include('comment'), - (r'[^\n]', Comment.Single) - ], - 'comment-multi': [ - include('comment'), - (r'[^*/]', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline) - ], - 'module': [ - (r'\n', Text, '#pop'), - (r'[a-zA-Z_]\w*', Name.Class), - include('root') - ], - 'preproc': [ - (r'\n', Text, '#pop'), - include('keywords'), - (r'[A-Za-z]\w*', Comment.Preproc), - include('root') - ], - 'string': [ - (r'\\\(', String.Interpol, 'string-intp'), - (r'"', String, '#pop'), - (r"""\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}""" - r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}""", String.Escape), - (r'[^\\"]+', String), - (r'\\', String) - ], - 'string-intp': [ - (r'\(', String.Interpol, '#push'), - (r'\)', String.Interpol, '#pop'), - include('root') - ] - } - - def get_tokens_unprocessed(self, text): - from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \ - COCOA_PROTOCOLS, COCOA_PRIMITIVES - - for index, token, value in \ - RegexLexer.get_tokens_unprocessed(self, text): - if token is Name or token is Name.Class: - if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \ - or value in COCOA_PRIMITIVES: - token = Name.Builtin.Pseudo - - yield index, token, value diff --git a/wakatime/packages/py3/pygments/lexers/ooc.py b/wakatime/packages/py3/pygments/lexers/ooc.py deleted file mode 100644 index b58d347..0000000 --- a/wakatime/packages/py3/pygments/lexers/ooc.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.ooc - ~~~~~~~~~~~~~~~~~~~ - - Lexers for the Ooc language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer, bygroups, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation - -__all__ = ['OocLexer'] - - -class OocLexer(RegexLexer): - """ - For `Ooc `_ source code - - .. versionadded:: 1.2 - """ - name = 'Ooc' - aliases = ['ooc'] - filenames = ['*.ooc'] - mimetypes = ['text/x-ooc'] - - tokens = { - 'root': [ - (words(( - 'class', 'interface', 'implement', 'abstract', 'extends', 'from', - 'this', 'super', 'new', 'const', 'final', 'static', 'import', - 'use', 'extern', 'inline', 'proto', 'break', 'continue', - 'fallthrough', 'operator', 'if', 'else', 'for', 'while', 'do', - 'switch', 'case', 'as', 'in', 'version', 'return', 'true', - 'false', 'null'), prefix=r'\b', suffix=r'\b'), - Keyword), - (r'include\b', Keyword, 'include'), - (r'(cover)([ \t]+)(from)([ \t]+)(\w+[*@]?)', - bygroups(Keyword, Text, Keyword, Text, Name.Class)), - (r'(func)((?:[ \t]|\\\n)+)(~[a-z_]\w*)', - bygroups(Keyword, Text, Name.Function)), - (r'\bfunc\b', Keyword), - # Note: %= and ^= not listed on http://ooc-lang.org/syntax - (r'//.*', Comment), - (r'(?s)/\*.*?\*/', Comment.Multiline), - (r'(==?|\+=?|-[=>]?|\*=?|/=?|:=|!=?|%=?|\?|>{1,3}=?|<{1,3}=?|\.\.|' - r'&&?|\|\|?|\^=?)', Operator), - (r'(\.)([ \t]*)([a-z]\w*)', bygroups(Operator, Text, - Name.Function)), - (r'[A-Z][A-Z0-9_]+', Name.Constant), - (r'[A-Z]\w*([@*]|\[[ \t]*\])?', Name.Class), - - (r'([a-z]\w*(?:~[a-z]\w*)?)((?:[ \t]|\\\n)*)(?=\()', - bygroups(Name.Function, Text)), - (r'[a-z]\w*', Name.Variable), - - # : introduces types - (r'[:(){}\[\];,]', Punctuation), - - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'0c[0-9]+', Number.Oct), - (r'0b[01]+', Number.Bin), - (r'[0-9_]\.[0-9_]*(?!\.)', Number.Float), - (r'[0-9_]+', Number.Decimal), - - (r'"(?:\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\"])*"', - String.Double), - (r"'(?:\\.|\\[0-9]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", - String.Char), - (r'@', Punctuation), # pointer dereference - (r'\.', Punctuation), # imports or chain operator - - (r'\\[ \t\n]', Text), - (r'[ \t]+', Text), - ], - 'include': [ - (r'[\w/]+', Name), - (r',', Punctuation), - (r'[ \t]', Text), - (r'[;\n]', Text, '#pop'), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/pascal.py b/wakatime/packages/py3/pygments/lexers/pascal.py deleted file mode 100644 index 5487748..0000000 --- a/wakatime/packages/py3/pygments/lexers/pascal.py +++ /dev/null @@ -1,831 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.pascal - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Pascal family languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, include, bygroups, words, \ - using, this, default -from pygments.util import get_bool_opt, get_list_opt -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error -from pygments.scanner import Scanner - -__all__ = ['DelphiLexer', 'Modula2Lexer', 'AdaLexer'] - - -class DelphiLexer(Lexer): - """ - For `Delphi `_ (Borland Object Pascal), - Turbo Pascal and Free Pascal source code. - - Additional options accepted: - - `turbopascal` - Highlight Turbo Pascal specific keywords (default: ``True``). - `delphi` - Highlight Borland Delphi specific keywords (default: ``True``). - `freepascal` - Highlight Free Pascal specific keywords (default: ``True``). - `units` - A list of units that should be considered builtin, supported are - ``System``, ``SysUtils``, ``Classes`` and ``Math``. - Default is to consider all of them builtin. - """ - name = 'Delphi' - aliases = ['delphi', 'pas', 'pascal', 'objectpascal'] - filenames = ['*.pas'] - mimetypes = ['text/x-pascal'] - - TURBO_PASCAL_KEYWORDS = ( - 'absolute', 'and', 'array', 'asm', 'begin', 'break', 'case', - 'const', 'constructor', 'continue', 'destructor', 'div', 'do', - 'downto', 'else', 'end', 'file', 'for', 'function', 'goto', - 'if', 'implementation', 'in', 'inherited', 'inline', 'interface', - 'label', 'mod', 'nil', 'not', 'object', 'of', 'on', 'operator', - 'or', 'packed', 'procedure', 'program', 'record', 'reintroduce', - 'repeat', 'self', 'set', 'shl', 'shr', 'string', 'then', 'to', - 'type', 'unit', 'until', 'uses', 'var', 'while', 'with', 'xor' - ) - - DELPHI_KEYWORDS = ( - 'as', 'class', 'except', 'exports', 'finalization', 'finally', - 'initialization', 'is', 'library', 'on', 'property', 'raise', - 'threadvar', 'try' - ) - - FREE_PASCAL_KEYWORDS = ( - 'dispose', 'exit', 'false', 'new', 'true' - ) - - BLOCK_KEYWORDS = set(( - 'begin', 'class', 'const', 'constructor', 'destructor', 'end', - 'finalization', 'function', 'implementation', 'initialization', - 'label', 'library', 'operator', 'procedure', 'program', 'property', - 'record', 'threadvar', 'type', 'unit', 'uses', 'var' - )) - - FUNCTION_MODIFIERS = set(( - 'alias', 'cdecl', 'export', 'inline', 'interrupt', 'nostackframe', - 'pascal', 'register', 'safecall', 'softfloat', 'stdcall', - 'varargs', 'name', 'dynamic', 'near', 'virtual', 'external', - 'override', 'assembler' - )) - - # XXX: those aren't global. but currently we know no way for defining - # them just for the type context. - DIRECTIVES = set(( - 'absolute', 'abstract', 'assembler', 'cppdecl', 'default', 'far', - 'far16', 'forward', 'index', 'oldfpccall', 'private', 'protected', - 'published', 'public' - )) - - BUILTIN_TYPES = set(( - 'ansichar', 'ansistring', 'bool', 'boolean', 'byte', 'bytebool', - 'cardinal', 'char', 'comp', 'currency', 'double', 'dword', - 'extended', 'int64', 'integer', 'iunknown', 'longbool', 'longint', - 'longword', 'pansichar', 'pansistring', 'pbool', 'pboolean', - 'pbyte', 'pbytearray', 'pcardinal', 'pchar', 'pcomp', 'pcurrency', - 'pdate', 'pdatetime', 'pdouble', 'pdword', 'pextended', 'phandle', - 'pint64', 'pinteger', 'plongint', 'plongword', 'pointer', - 'ppointer', 'pshortint', 'pshortstring', 'psingle', 'psmallint', - 'pstring', 'pvariant', 'pwidechar', 'pwidestring', 'pword', - 'pwordarray', 'pwordbool', 'real', 'real48', 'shortint', - 'shortstring', 'single', 'smallint', 'string', 'tclass', 'tdate', - 'tdatetime', 'textfile', 'thandle', 'tobject', 'ttime', 'variant', - 'widechar', 'widestring', 'word', 'wordbool' - )) - - BUILTIN_UNITS = { - 'System': ( - 'abs', 'acquireexceptionobject', 'addr', 'ansitoutf8', - 'append', 'arctan', 'assert', 'assigned', 'assignfile', - 'beginthread', 'blockread', 'blockwrite', 'break', 'chdir', - 'chr', 'close', 'closefile', 'comptocurrency', 'comptodouble', - 'concat', 'continue', 'copy', 'cos', 'dec', 'delete', - 'dispose', 'doubletocomp', 'endthread', 'enummodules', - 'enumresourcemodules', 'eof', 'eoln', 'erase', 'exceptaddr', - 'exceptobject', 'exclude', 'exit', 'exp', 'filepos', 'filesize', - 'fillchar', 'finalize', 'findclasshinstance', 'findhinstance', - 'findresourcehinstance', 'flush', 'frac', 'freemem', - 'get8087cw', 'getdir', 'getlasterror', 'getmem', - 'getmemorymanager', 'getmodulefilename', 'getvariantmanager', - 'halt', 'hi', 'high', 'inc', 'include', 'initialize', 'insert', - 'int', 'ioresult', 'ismemorymanagerset', 'isvariantmanagerset', - 'length', 'ln', 'lo', 'low', 'mkdir', 'move', 'new', 'odd', - 'olestrtostring', 'olestrtostrvar', 'ord', 'paramcount', - 'paramstr', 'pi', 'pos', 'pred', 'ptr', 'pucs4chars', 'random', - 'randomize', 'read', 'readln', 'reallocmem', - 'releaseexceptionobject', 'rename', 'reset', 'rewrite', 'rmdir', - 'round', 'runerror', 'seek', 'seekeof', 'seekeoln', - 'set8087cw', 'setlength', 'setlinebreakstyle', - 'setmemorymanager', 'setstring', 'settextbuf', - 'setvariantmanager', 'sin', 'sizeof', 'slice', 'sqr', 'sqrt', - 'str', 'stringofchar', 'stringtoolestr', 'stringtowidechar', - 'succ', 'swap', 'trunc', 'truncate', 'typeinfo', - 'ucs4stringtowidestring', 'unicodetoutf8', 'uniquestring', - 'upcase', 'utf8decode', 'utf8encode', 'utf8toansi', - 'utf8tounicode', 'val', 'vararrayredim', 'varclear', - 'widecharlentostring', 'widecharlentostrvar', - 'widechartostring', 'widechartostrvar', - 'widestringtoucs4string', 'write', 'writeln' - ), - 'SysUtils': ( - 'abort', 'addexitproc', 'addterminateproc', 'adjustlinebreaks', - 'allocmem', 'ansicomparefilename', 'ansicomparestr', - 'ansicomparetext', 'ansidequotedstr', 'ansiextractquotedstr', - 'ansilastchar', 'ansilowercase', 'ansilowercasefilename', - 'ansipos', 'ansiquotedstr', 'ansisamestr', 'ansisametext', - 'ansistrcomp', 'ansistricomp', 'ansistrlastchar', 'ansistrlcomp', - 'ansistrlicomp', 'ansistrlower', 'ansistrpos', 'ansistrrscan', - 'ansistrscan', 'ansistrupper', 'ansiuppercase', - 'ansiuppercasefilename', 'appendstr', 'assignstr', 'beep', - 'booltostr', 'bytetocharindex', 'bytetocharlen', 'bytetype', - 'callterminateprocs', 'changefileext', 'charlength', - 'chartobyteindex', 'chartobytelen', 'comparemem', 'comparestr', - 'comparetext', 'createdir', 'createguid', 'currentyear', - 'currtostr', 'currtostrf', 'date', 'datetimetofiledate', - 'datetimetostr', 'datetimetostring', 'datetimetosystemtime', - 'datetimetotimestamp', 'datetostr', 'dayofweek', 'decodedate', - 'decodedatefully', 'decodetime', 'deletefile', 'directoryexists', - 'diskfree', 'disksize', 'disposestr', 'encodedate', 'encodetime', - 'exceptionerrormessage', 'excludetrailingbackslash', - 'excludetrailingpathdelimiter', 'expandfilename', - 'expandfilenamecase', 'expanduncfilename', 'extractfiledir', - 'extractfiledrive', 'extractfileext', 'extractfilename', - 'extractfilepath', 'extractrelativepath', 'extractshortpathname', - 'fileage', 'fileclose', 'filecreate', 'filedatetodatetime', - 'fileexists', 'filegetattr', 'filegetdate', 'fileisreadonly', - 'fileopen', 'fileread', 'filesearch', 'fileseek', 'filesetattr', - 'filesetdate', 'filesetreadonly', 'filewrite', 'finalizepackage', - 'findclose', 'findcmdlineswitch', 'findfirst', 'findnext', - 'floattocurr', 'floattodatetime', 'floattodecimal', 'floattostr', - 'floattostrf', 'floattotext', 'floattotextfmt', 'fmtloadstr', - 'fmtstr', 'forcedirectories', 'format', 'formatbuf', 'formatcurr', - 'formatdatetime', 'formatfloat', 'freeandnil', 'getcurrentdir', - 'getenvironmentvariable', 'getfileversion', 'getformatsettings', - 'getlocaleformatsettings', 'getmodulename', 'getpackagedescription', - 'getpackageinfo', 'gettime', 'guidtostring', 'incamonth', - 'includetrailingbackslash', 'includetrailingpathdelimiter', - 'incmonth', 'initializepackage', 'interlockeddecrement', - 'interlockedexchange', 'interlockedexchangeadd', - 'interlockedincrement', 'inttohex', 'inttostr', 'isdelimiter', - 'isequalguid', 'isleapyear', 'ispathdelimiter', 'isvalidident', - 'languages', 'lastdelimiter', 'loadpackage', 'loadstr', - 'lowercase', 'msecstotimestamp', 'newstr', 'nextcharindex', 'now', - 'outofmemoryerror', 'quotedstr', 'raiselastoserror', - 'raiselastwin32error', 'removedir', 'renamefile', 'replacedate', - 'replacetime', 'safeloadlibrary', 'samefilename', 'sametext', - 'setcurrentdir', 'showexception', 'sleep', 'stralloc', 'strbufsize', - 'strbytetype', 'strcat', 'strcharlength', 'strcomp', 'strcopy', - 'strdispose', 'strecopy', 'strend', 'strfmt', 'stricomp', - 'stringreplace', 'stringtoguid', 'strlcat', 'strlcomp', 'strlcopy', - 'strlen', 'strlfmt', 'strlicomp', 'strlower', 'strmove', 'strnew', - 'strnextchar', 'strpas', 'strpcopy', 'strplcopy', 'strpos', - 'strrscan', 'strscan', 'strtobool', 'strtobooldef', 'strtocurr', - 'strtocurrdef', 'strtodate', 'strtodatedef', 'strtodatetime', - 'strtodatetimedef', 'strtofloat', 'strtofloatdef', 'strtoint', - 'strtoint64', 'strtoint64def', 'strtointdef', 'strtotime', - 'strtotimedef', 'strupper', 'supports', 'syserrormessage', - 'systemtimetodatetime', 'texttofloat', 'time', 'timestamptodatetime', - 'timestamptomsecs', 'timetostr', 'trim', 'trimleft', 'trimright', - 'tryencodedate', 'tryencodetime', 'tryfloattocurr', 'tryfloattodatetime', - 'trystrtobool', 'trystrtocurr', 'trystrtodate', 'trystrtodatetime', - 'trystrtofloat', 'trystrtoint', 'trystrtoint64', 'trystrtotime', - 'unloadpackage', 'uppercase', 'widecomparestr', 'widecomparetext', - 'widefmtstr', 'wideformat', 'wideformatbuf', 'widelowercase', - 'widesamestr', 'widesametext', 'wideuppercase', 'win32check', - 'wraptext' - ), - 'Classes': ( - 'activateclassgroup', 'allocatehwnd', 'bintohex', 'checksynchronize', - 'collectionsequal', 'countgenerations', 'deallocatehwnd', 'equalrect', - 'extractstrings', 'findclass', 'findglobalcomponent', 'getclass', - 'groupdescendantswith', 'hextobin', 'identtoint', - 'initinheritedcomponent', 'inttoident', 'invalidpoint', - 'isuniqueglobalcomponentname', 'linestart', 'objectbinarytotext', - 'objectresourcetotext', 'objecttexttobinary', 'objecttexttoresource', - 'pointsequal', 'readcomponentres', 'readcomponentresex', - 'readcomponentresfile', 'rect', 'registerclass', 'registerclassalias', - 'registerclasses', 'registercomponents', 'registerintegerconsts', - 'registernoicon', 'registernonactivex', 'smallpoint', 'startclassgroup', - 'teststreamformat', 'unregisterclass', 'unregisterclasses', - 'unregisterintegerconsts', 'unregistermoduleclasses', - 'writecomponentresfile' - ), - 'Math': ( - 'arccos', 'arccosh', 'arccot', 'arccoth', 'arccsc', 'arccsch', 'arcsec', - 'arcsech', 'arcsin', 'arcsinh', 'arctan2', 'arctanh', 'ceil', - 'comparevalue', 'cosecant', 'cosh', 'cot', 'cotan', 'coth', 'csc', - 'csch', 'cycletodeg', 'cycletograd', 'cycletorad', 'degtocycle', - 'degtograd', 'degtorad', 'divmod', 'doubledecliningbalance', - 'ensurerange', 'floor', 'frexp', 'futurevalue', 'getexceptionmask', - 'getprecisionmode', 'getroundmode', 'gradtocycle', 'gradtodeg', - 'gradtorad', 'hypot', 'inrange', 'interestpayment', 'interestrate', - 'internalrateofreturn', 'intpower', 'isinfinite', 'isnan', 'iszero', - 'ldexp', 'lnxp1', 'log10', 'log2', 'logn', 'max', 'maxintvalue', - 'maxvalue', 'mean', 'meanandstddev', 'min', 'minintvalue', 'minvalue', - 'momentskewkurtosis', 'netpresentvalue', 'norm', 'numberofperiods', - 'payment', 'periodpayment', 'poly', 'popnstddev', 'popnvariance', - 'power', 'presentvalue', 'radtocycle', 'radtodeg', 'radtograd', - 'randg', 'randomrange', 'roundto', 'samevalue', 'sec', 'secant', - 'sech', 'setexceptionmask', 'setprecisionmode', 'setroundmode', - 'sign', 'simpleroundto', 'sincos', 'sinh', 'slndepreciation', 'stddev', - 'sum', 'sumint', 'sumofsquares', 'sumsandsquares', 'syddepreciation', - 'tan', 'tanh', 'totalvariance', 'variance' - ) - } - - ASM_REGISTERS = set(( - 'ah', 'al', 'ax', 'bh', 'bl', 'bp', 'bx', 'ch', 'cl', 'cr0', - 'cr1', 'cr2', 'cr3', 'cr4', 'cs', 'cx', 'dh', 'di', 'dl', 'dr0', - 'dr1', 'dr2', 'dr3', 'dr4', 'dr5', 'dr6', 'dr7', 'ds', 'dx', - 'eax', 'ebp', 'ebx', 'ecx', 'edi', 'edx', 'es', 'esi', 'esp', - 'fs', 'gs', 'mm0', 'mm1', 'mm2', 'mm3', 'mm4', 'mm5', 'mm6', - 'mm7', 'si', 'sp', 'ss', 'st0', 'st1', 'st2', 'st3', 'st4', 'st5', - 'st6', 'st7', 'xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5', - 'xmm6', 'xmm7' - )) - - ASM_INSTRUCTIONS = set(( - 'aaa', 'aad', 'aam', 'aas', 'adc', 'add', 'and', 'arpl', 'bound', - 'bsf', 'bsr', 'bswap', 'bt', 'btc', 'btr', 'bts', 'call', 'cbw', - 'cdq', 'clc', 'cld', 'cli', 'clts', 'cmc', 'cmova', 'cmovae', - 'cmovb', 'cmovbe', 'cmovc', 'cmovcxz', 'cmove', 'cmovg', - 'cmovge', 'cmovl', 'cmovle', 'cmovna', 'cmovnae', 'cmovnb', - 'cmovnbe', 'cmovnc', 'cmovne', 'cmovng', 'cmovnge', 'cmovnl', - 'cmovnle', 'cmovno', 'cmovnp', 'cmovns', 'cmovnz', 'cmovo', - 'cmovp', 'cmovpe', 'cmovpo', 'cmovs', 'cmovz', 'cmp', 'cmpsb', - 'cmpsd', 'cmpsw', 'cmpxchg', 'cmpxchg486', 'cmpxchg8b', 'cpuid', - 'cwd', 'cwde', 'daa', 'das', 'dec', 'div', 'emms', 'enter', 'hlt', - 'ibts', 'icebp', 'idiv', 'imul', 'in', 'inc', 'insb', 'insd', - 'insw', 'int', 'int01', 'int03', 'int1', 'int3', 'into', 'invd', - 'invlpg', 'iret', 'iretd', 'iretw', 'ja', 'jae', 'jb', 'jbe', - 'jc', 'jcxz', 'jcxz', 'je', 'jecxz', 'jg', 'jge', 'jl', 'jle', - 'jmp', 'jna', 'jnae', 'jnb', 'jnbe', 'jnc', 'jne', 'jng', 'jnge', - 'jnl', 'jnle', 'jno', 'jnp', 'jns', 'jnz', 'jo', 'jp', 'jpe', - 'jpo', 'js', 'jz', 'lahf', 'lar', 'lcall', 'lds', 'lea', 'leave', - 'les', 'lfs', 'lgdt', 'lgs', 'lidt', 'ljmp', 'lldt', 'lmsw', - 'loadall', 'loadall286', 'lock', 'lodsb', 'lodsd', 'lodsw', - 'loop', 'loope', 'loopne', 'loopnz', 'loopz', 'lsl', 'lss', 'ltr', - 'mov', 'movd', 'movq', 'movsb', 'movsd', 'movsw', 'movsx', - 'movzx', 'mul', 'neg', 'nop', 'not', 'or', 'out', 'outsb', 'outsd', - 'outsw', 'pop', 'popa', 'popad', 'popaw', 'popf', 'popfd', 'popfw', - 'push', 'pusha', 'pushad', 'pushaw', 'pushf', 'pushfd', 'pushfw', - 'rcl', 'rcr', 'rdmsr', 'rdpmc', 'rdshr', 'rdtsc', 'rep', 'repe', - 'repne', 'repnz', 'repz', 'ret', 'retf', 'retn', 'rol', 'ror', - 'rsdc', 'rsldt', 'rsm', 'sahf', 'sal', 'salc', 'sar', 'sbb', - 'scasb', 'scasd', 'scasw', 'seta', 'setae', 'setb', 'setbe', - 'setc', 'setcxz', 'sete', 'setg', 'setge', 'setl', 'setle', - 'setna', 'setnae', 'setnb', 'setnbe', 'setnc', 'setne', 'setng', - 'setnge', 'setnl', 'setnle', 'setno', 'setnp', 'setns', 'setnz', - 'seto', 'setp', 'setpe', 'setpo', 'sets', 'setz', 'sgdt', 'shl', - 'shld', 'shr', 'shrd', 'sidt', 'sldt', 'smi', 'smint', 'smintold', - 'smsw', 'stc', 'std', 'sti', 'stosb', 'stosd', 'stosw', 'str', - 'sub', 'svdc', 'svldt', 'svts', 'syscall', 'sysenter', 'sysexit', - 'sysret', 'test', 'ud1', 'ud2', 'umov', 'verr', 'verw', 'wait', - 'wbinvd', 'wrmsr', 'wrshr', 'xadd', 'xbts', 'xchg', 'xlat', - 'xlatb', 'xor' - )) - - def __init__(self, **options): - Lexer.__init__(self, **options) - self.keywords = set() - if get_bool_opt(options, 'turbopascal', True): - self.keywords.update(self.TURBO_PASCAL_KEYWORDS) - if get_bool_opt(options, 'delphi', True): - self.keywords.update(self.DELPHI_KEYWORDS) - if get_bool_opt(options, 'freepascal', True): - self.keywords.update(self.FREE_PASCAL_KEYWORDS) - self.builtins = set() - for unit in get_list_opt(options, 'units', list(self.BUILTIN_UNITS)): - self.builtins.update(self.BUILTIN_UNITS[unit]) - - def get_tokens_unprocessed(self, text): - scanner = Scanner(text, re.DOTALL | re.MULTILINE | re.IGNORECASE) - stack = ['initial'] - in_function_block = False - in_property_block = False - was_dot = False - next_token_is_function = False - next_token_is_property = False - collect_labels = False - block_labels = set() - brace_balance = [0, 0] - - while not scanner.eos: - token = Error - - if stack[-1] == 'initial': - if scanner.scan(r'\s+'): - token = Text - elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'): - if scanner.match.startswith('$'): - token = Comment.Preproc - else: - token = Comment.Multiline - elif scanner.scan(r'//.*?$'): - token = Comment.Single - elif scanner.scan(r'[-+*\/=<>:;,.@\^]'): - token = Operator - # stop label highlighting on next ";" - if collect_labels and scanner.match == ';': - collect_labels = False - elif scanner.scan(r'[\(\)\[\]]+'): - token = Punctuation - # abort function naming ``foo = Function(...)`` - next_token_is_function = False - # if we are in a function block we count the open - # braces because ootherwise it's impossible to - # determine the end of the modifier context - if in_function_block or in_property_block: - if scanner.match == '(': - brace_balance[0] += 1 - elif scanner.match == ')': - brace_balance[0] -= 1 - elif scanner.match == '[': - brace_balance[1] += 1 - elif scanner.match == ']': - brace_balance[1] -= 1 - elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'): - lowercase_name = scanner.match.lower() - if lowercase_name == 'result': - token = Name.Builtin.Pseudo - elif lowercase_name in self.keywords: - token = Keyword - # if we are in a special block and a - # block ending keyword occours (and the parenthesis - # is balanced) we end the current block context - if (in_function_block or in_property_block) and \ - lowercase_name in self.BLOCK_KEYWORDS and \ - brace_balance[0] <= 0 and \ - brace_balance[1] <= 0: - in_function_block = False - in_property_block = False - brace_balance = [0, 0] - block_labels = set() - if lowercase_name in ('label', 'goto'): - collect_labels = True - elif lowercase_name == 'asm': - stack.append('asm') - elif lowercase_name == 'property': - in_property_block = True - next_token_is_property = True - elif lowercase_name in ('procedure', 'operator', - 'function', 'constructor', - 'destructor'): - in_function_block = True - next_token_is_function = True - # we are in a function block and the current name - # is in the set of registered modifiers. highlight - # it as pseudo keyword - elif in_function_block and \ - lowercase_name in self.FUNCTION_MODIFIERS: - token = Keyword.Pseudo - # if we are in a property highlight some more - # modifiers - elif in_property_block and \ - lowercase_name in ('read', 'write'): - token = Keyword.Pseudo - next_token_is_function = True - # if the last iteration set next_token_is_function - # to true we now want this name highlighted as - # function. so do that and reset the state - elif next_token_is_function: - # Look if the next token is a dot. If yes it's - # not a function, but a class name and the - # part after the dot a function name - if scanner.test(r'\s*\.\s*'): - token = Name.Class - # it's not a dot, our job is done - else: - token = Name.Function - next_token_is_function = False - # same for properties - elif next_token_is_property: - token = Name.Property - next_token_is_property = False - # Highlight this token as label and add it - # to the list of known labels - elif collect_labels: - token = Name.Label - block_labels.add(scanner.match.lower()) - # name is in list of known labels - elif lowercase_name in block_labels: - token = Name.Label - elif lowercase_name in self.BUILTIN_TYPES: - token = Keyword.Type - elif lowercase_name in self.DIRECTIVES: - token = Keyword.Pseudo - # builtins are just builtins if the token - # before isn't a dot - elif not was_dot and lowercase_name in self.builtins: - token = Name.Builtin - else: - token = Name - elif scanner.scan(r"'"): - token = String - stack.append('string') - elif scanner.scan(r'\#(\d+|\$[0-9A-Fa-f]+)'): - token = String.Char - elif scanner.scan(r'\$[0-9A-Fa-f]+'): - token = Number.Hex - elif scanner.scan(r'\d+(?![eE]|\.[^.])'): - token = Number.Integer - elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'): - token = Number.Float - else: - # if the stack depth is deeper than once, pop - if len(stack) > 1: - stack.pop() - scanner.get_char() - - elif stack[-1] == 'string': - if scanner.scan(r"''"): - token = String.Escape - elif scanner.scan(r"'"): - token = String - stack.pop() - elif scanner.scan(r"[^']*"): - token = String - else: - scanner.get_char() - stack.pop() - - elif stack[-1] == 'asm': - if scanner.scan(r'\s+'): - token = Text - elif scanner.scan(r'end'): - token = Keyword - stack.pop() - elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'): - if scanner.match.startswith('$'): - token = Comment.Preproc - else: - token = Comment.Multiline - elif scanner.scan(r'//.*?$'): - token = Comment.Single - elif scanner.scan(r"'"): - token = String - stack.append('string') - elif scanner.scan(r'@@[A-Za-z_][A-Za-z_0-9]*'): - token = Name.Label - elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'): - lowercase_name = scanner.match.lower() - if lowercase_name in self.ASM_INSTRUCTIONS: - token = Keyword - elif lowercase_name in self.ASM_REGISTERS: - token = Name.Builtin - else: - token = Name - elif scanner.scan(r'[-+*\/=<>:;,.@\^]+'): - token = Operator - elif scanner.scan(r'[\(\)\[\]]+'): - token = Punctuation - elif scanner.scan(r'\$[0-9A-Fa-f]+'): - token = Number.Hex - elif scanner.scan(r'\d+(?![eE]|\.[^.])'): - token = Number.Integer - elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'): - token = Number.Float - else: - scanner.get_char() - stack.pop() - - # save the dot!!!11 - if scanner.match.strip(): - was_dot = scanner.match == '.' - yield scanner.start_pos, token, scanner.match or '' - - -class Modula2Lexer(RegexLexer): - """ - For `Modula-2 `_ source code. - - Additional options that determine which keywords are highlighted: - - `pim` - Select PIM Modula-2 dialect (default: True). - `iso` - Select ISO Modula-2 dialect (default: False). - `objm2` - Select Objective Modula-2 dialect (default: False). - `gm2ext` - Also highlight GNU extensions (default: False). - - .. versionadded:: 1.3 - """ - name = 'Modula-2' - aliases = ['modula2', 'm2'] - filenames = ['*.def', '*.mod'] - mimetypes = ['text/x-modula2'] - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'whitespace': [ - (r'\n+', Text), # blank lines - (r'\s+', Text), # whitespace - ], - 'identifiers': [ - (r'([a-zA-Z_$][\w$]*)', Name), - ], - 'numliterals': [ - (r'[01]+B', Number.Bin), # binary number (ObjM2) - (r'[0-7]+B', Number.Oct), # octal number (PIM + ISO) - (r'[0-7]+C', Number.Oct), # char code (PIM + ISO) - (r'[0-9A-F]+C', Number.Hex), # char code (ObjM2) - (r'[0-9A-F]+H', Number.Hex), # hexadecimal number - (r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number - (r'[0-9]+\.[0-9]+', Number.Float), # real number - (r'[0-9]+', Number.Integer), # decimal whole number - ], - 'strings': [ - (r"'(\\\\|\\'|[^'])*'", String), # single quoted string - (r'"(\\\\|\\"|[^"])*"', String), # double quoted string - ], - 'operators': [ - (r'[*/+=#~&<>\^-]', Operator), - (r':=', Operator), # assignment - (r'@', Operator), # pointer deref (ISO) - (r'\.\.', Operator), # ellipsis or range - (r'`', Operator), # Smalltalk message (ObjM2) - (r'::', Operator), # type conversion (ObjM2) - ], - 'punctuation': [ - (r'[()\[\]{},.:;|]', Punctuation), - ], - 'comments': [ - (r'//.*?\n', Comment.Single), # ObjM2 - (r'/\*(.*?)\*/', Comment.Multiline), # ObjM2 - (r'\(\*([^$].*?)\*\)', Comment.Multiline), - # TO DO: nesting of (* ... *) comments - ], - 'pragmas': [ - (r'\(\*\$(.*?)\*\)', Comment.Preproc), # PIM - (r'<\*(.*?)\*>', Comment.Preproc), # ISO + ObjM2 - ], - 'root': [ - include('whitespace'), - include('comments'), - include('pragmas'), - include('identifiers'), - include('numliterals'), - include('strings'), - include('operators'), - include('punctuation'), - ] - } - - pim_reserved_words = [ - # 40 reserved words - 'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', - 'DIV', 'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'EXPORT', 'FOR', - 'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD', - 'MODULE', 'NOT', 'OF', 'OR', 'POINTER', 'PROCEDURE', 'QUALIFIED', - 'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE', - 'UNTIL', 'VAR', 'WHILE', 'WITH', - ] - - pim_pervasives = [ - # 31 pervasives - 'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'DEC', - 'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH', 'INC', 'INCL', - 'INTEGER', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW', 'NIL', 'ODD', - 'ORD', 'PROC', 'REAL', 'SIZE', 'TRUE', 'TRUNC', 'VAL', - ] - - iso_reserved_words = [ - # 46 reserved words - 'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV', - 'DO', 'ELSE', 'ELSIF', 'END', 'EXCEPT', 'EXIT', 'EXPORT', 'FINALLY', - 'FOR', 'FORWARD', 'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN', - 'LOOP', 'MOD', 'MODULE', 'NOT', 'OF', 'OR', 'PACKEDSET', 'POINTER', - 'PROCEDURE', 'QUALIFIED', 'RECORD', 'REPEAT', 'REM', 'RETRY', - 'RETURN', 'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE', - 'WITH', - ] - - iso_pervasives = [ - # 42 pervasives - 'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'CMPLX', - 'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH', - 'IM', 'INC', 'INCL', 'INT', 'INTEGER', 'INTERRUPTIBLE', 'LENGTH', - 'LFLOAT', 'LONGCOMPLEX', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW', - 'NIL', 'ODD', 'ORD', 'PROC', 'PROTECTION', 'RE', 'REAL', 'SIZE', - 'TRUE', 'TRUNC', 'UNINTERRUBTIBLE', 'VAL', - ] - - objm2_reserved_words = [ - # base language, 42 reserved words - 'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV', - 'DO', 'ELSE', 'ELSIF', 'END', 'ENUM', 'EXIT', 'FOR', 'FROM', 'IF', - 'IMMUTABLE', 'IMPLEMENTATION', 'IMPORT', 'IN', 'IS', 'LOOP', 'MOD', - 'MODULE', 'NOT', 'OF', 'OPAQUE', 'OR', 'POINTER', 'PROCEDURE', - 'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE', - 'UNTIL', 'VAR', 'VARIADIC', 'WHILE', - # OO extensions, 16 reserved words - 'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD', - 'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC', - 'SUPER', 'TRY', - ] - - objm2_pervasives = [ - # base language, 38 pervasives - 'ABS', 'BITSET', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'DISPOSE', - 'FALSE', 'HALT', 'HIGH', 'INTEGER', 'INRANGE', 'LENGTH', 'LONGCARD', - 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEG', 'NEW', 'NEXTV', 'NIL', - 'OCTET', 'ODD', 'ORD', 'PRED', 'PROC', 'READ', 'REAL', 'SUCC', 'TMAX', - 'TMIN', 'TRUE', 'TSIZE', 'UNICHAR', 'VAL', 'WRITE', 'WRITEF', - # OO extensions, 3 pervasives - 'OBJECT', 'NO', 'YES', - ] - - gnu_reserved_words = [ - # 10 additional reserved words - 'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__', - '__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE', - ] - - gnu_pervasives = [ - # 21 identifiers, actually from pseudo-module SYSTEM - # but we will highlight them as if they were pervasives - 'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16', - 'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96', - 'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64', - 'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW', - ] - - def __init__(self, **options): - self.reserved_words = set() - self.pervasives = set() - # ISO Modula-2 - if get_bool_opt(options, 'iso', False): - self.reserved_words.update(self.iso_reserved_words) - self.pervasives.update(self.iso_pervasives) - # Objective Modula-2 - elif get_bool_opt(options, 'objm2', False): - self.reserved_words.update(self.objm2_reserved_words) - self.pervasives.update(self.objm2_pervasives) - # PIM Modula-2 (DEFAULT) - else: - self.reserved_words.update(self.pim_reserved_words) - self.pervasives.update(self.pim_pervasives) - # GNU extensions - if get_bool_opt(options, 'gm2ext', False): - self.reserved_words.update(self.gnu_reserved_words) - self.pervasives.update(self.gnu_pervasives) - # initialise - RegexLexer.__init__(self, **options) - - def get_tokens_unprocessed(self, text): - for index, token, value in RegexLexer.get_tokens_unprocessed(self, text): - # check for reserved words and pervasives - if token is Name: - if value in self.reserved_words: - token = Keyword.Reserved - elif value in self.pervasives: - token = Keyword.Pervasive - # return result - yield index, token, value - - -class AdaLexer(RegexLexer): - """ - For Ada source code. - - .. versionadded:: 1.3 - """ - - name = 'Ada' - aliases = ['ada', 'ada95', 'ada2005'] - filenames = ['*.adb', '*.ads', '*.ada'] - mimetypes = ['text/x-ada'] - - flags = re.MULTILINE | re.IGNORECASE - - tokens = { - 'root': [ - (r'[^\S\n]+', Text), - (r'--.*?\n', Comment.Single), - (r'[^\S\n]+', Text), - (r'function|procedure|entry', Keyword.Declaration, 'subprogram'), - (r'(subtype|type)(\s+)(\w+)', - bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'), - (r'task|protected', Keyword.Declaration), - (r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)), - (r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'), - (r'(pragma)(\s+)(\w+)', bygroups(Keyword.Reserved, Text, - Comment.Preproc)), - (r'(true|false|null)\b', Keyword.Constant), - (words(( - 'Address', 'Byte', 'Boolean', 'Character', 'Controlled', 'Count', 'Cursor', - 'Duration', 'File_Mode', 'File_Type', 'Float', 'Generator', 'Integer', 'Long_Float', - 'Long_Integer', 'Long_Long_Float', 'Long_Long_Integer', 'Natural', 'Positive', - 'Reference_Type', 'Short_Float', 'Short_Integer', 'Short_Short_Float', - 'Short_Short_Integer', 'String', 'Wide_Character', 'Wide_String'), suffix=r'\b'), - Keyword.Type), - (r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word), - (r'generic|private', Keyword.Declaration), - (r'package', Keyword.Declaration, 'package'), - (r'array\b', Keyword.Reserved, 'array_def'), - (r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), - (r'(\w+)(\s*)(:)(\s*)(constant)', - bygroups(Name.Constant, Text, Punctuation, Text, - Keyword.Reserved)), - (r'<<\w+>>', Name.Label), - (r'(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)', - bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)), - (words(( - 'abort', 'abs', 'abstract', 'accept', 'access', 'aliased', 'all', - 'array', 'at', 'begin', 'body', 'case', 'constant', 'declare', - 'delay', 'delta', 'digits', 'do', 'else', 'elsif', 'end', 'entry', - 'exception', 'exit', 'interface', 'for', 'goto', 'if', 'is', 'limited', - 'loop', 'new', 'null', 'of', 'or', 'others', 'out', 'overriding', - 'pragma', 'protected', 'raise', 'range', 'record', 'renames', 'requeue', - 'return', 'reverse', 'select', 'separate', 'subtype', 'synchronized', - 'task', 'tagged', 'terminate', 'then', 'type', 'until', 'when', - 'while', 'xor'), prefix=r'\b', suffix=r'\b'), - Keyword.Reserved), - (r'"[^"]*"', String), - include('attribute'), - include('numbers'), - (r"'[^']'", String.Character), - (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))), - (r"(<>|=>|:=|[()|:;,.'])", Punctuation), - (r'[*<>+=/&-]', Operator), - (r'\n+', Text), - ], - 'numbers': [ - (r'[0-9_]+#[0-9a-f]+#', Number.Hex), - (r'[0-9_]+\.[0-9_]*', Number.Float), - (r'[0-9_]+', Number.Integer), - ], - 'attribute': [ - (r"(')(\w+)", bygroups(Punctuation, Name.Attribute)), - ], - 'subprogram': [ - (r'\(', Punctuation, ('#pop', 'formal_part')), - (r';', Punctuation, '#pop'), - (r'is\b', Keyword.Reserved, '#pop'), - (r'"[^"]+"|\w+', Name.Function), - include('root'), - ], - 'end': [ - ('(if|case|record|loop|select)', Keyword.Reserved), - ('"[^"]+"|[\w.]+', Name.Function), - ('\s+', Text), - (';', Punctuation, '#pop'), - ], - 'type_def': [ - (r';', Punctuation, '#pop'), - (r'\(', Punctuation, 'formal_part'), - (r'with|and|use', Keyword.Reserved), - (r'array\b', Keyword.Reserved, ('#pop', 'array_def')), - (r'record\b', Keyword.Reserved, ('record_def')), - (r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'), - include('root'), - ], - 'array_def': [ - (r';', Punctuation, '#pop'), - (r'(\w+)(\s+)(range)', bygroups(Keyword.Type, Text, Keyword.Reserved)), - include('root'), - ], - 'record_def': [ - (r'end record', Keyword.Reserved, '#pop'), - include('root'), - ], - 'import': [ - (r'[\w.]+', Name.Namespace, '#pop'), - default('#pop'), - ], - 'formal_part': [ - (r'\)', Punctuation, '#pop'), - (r'\w+', Name.Variable), - (r',|:[^=]', Punctuation), - (r'(in|not|null|out|access)\b', Keyword.Reserved), - include('root'), - ], - 'package': [ - ('body', Keyword.Declaration), - ('is\s+new|renames', Keyword.Reserved), - ('is', Keyword.Reserved, '#pop'), - (';', Punctuation, '#pop'), - ('\(', Punctuation, 'package_instantiation'), - ('([\w.]+)', Name.Class), - include('root'), - ], - 'package_instantiation': [ - (r'("[^"]+"|\w+)(\s+)(=>)', bygroups(Name.Variable, Text, Punctuation)), - (r'[\w.\'"]', Text), - (r'\)', Punctuation, '#pop'), - include('root'), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/perl.py b/wakatime/packages/py3/pygments/lexers/perl.py deleted file mode 100644 index 37ad4cf..0000000 --- a/wakatime/packages/py3/pygments/lexers/perl.py +++ /dev/null @@ -1,614 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.perl - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Perl and related languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \ - using, this, default, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation -from pygments.util import shebang_matches - -__all__ = ['PerlLexer', 'Perl6Lexer'] - - -class PerlLexer(RegexLexer): - """ - For `Perl `_ source code. - """ - - name = 'Perl' - aliases = ['perl', 'pl'] - filenames = ['*.pl', '*.pm', '*.t'] - mimetypes = ['text/x-perl', 'application/x-perl'] - - flags = re.DOTALL | re.MULTILINE - # TODO: give this to a perl guy who knows how to parse perl... - tokens = { - 'balanced-regex': [ - (r'/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', String.Regex, '#pop'), - (r'!(\\\\|\\[^\\]|[^\\!])*![egimosx]*', String.Regex, '#pop'), - (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'), - (r'\{(\\\\|\\[^\\]|[^\\}])*\}[egimosx]*', String.Regex, '#pop'), - (r'<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*', String.Regex, '#pop'), - (r'\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*', String.Regex, '#pop'), - (r'\((\\\\|\\[^\\]|[^\\)])*\)[egimosx]*', String.Regex, '#pop'), - (r'@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*', String.Regex, '#pop'), - (r'%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*', String.Regex, '#pop'), - (r'\$(\\\\|\\[^\\]|[^\\$])*\$[egimosx]*', String.Regex, '#pop'), - ], - 'root': [ - (r'\#.*?$', Comment.Single), - (r'^=[a-zA-Z0-9]+\s+.*?\n=cut', Comment.Multiline), - (words(( - 'case', 'continue', 'do', 'else', 'elsif', 'for', 'foreach', - 'if', 'last', 'my', 'next', 'our', 'redo', 'reset', 'then', - 'unless', 'until', 'while', 'use', 'print', 'new', 'BEGIN', - 'CHECK', 'INIT', 'END', 'return'), suffix=r'\b'), - Keyword), - (r'(format)(\s+)(\w+)(\s*)(=)(\s*\n)', - bygroups(Keyword, Text, Name, Text, Punctuation, Text), 'format'), - (r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word), - # common delimiters - (r's/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', - String.Regex), - (r's!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*', String.Regex), - (r's\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*', String.Regex), - (r's@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*', - String.Regex), - (r's%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*', - String.Regex), - # balanced delimiters - (r's\{(\\\\|\\[^\\]|[^\\}])*\}\s*', String.Regex, 'balanced-regex'), - (r's<(\\\\|\\[^\\]|[^\\>])*>\s*', String.Regex, 'balanced-regex'), - (r's\[(\\\\|\\[^\\]|[^\\\]])*\]\s*', String.Regex, - 'balanced-regex'), - (r's\((\\\\|\\[^\\]|[^\\)])*\)\s*', String.Regex, - 'balanced-regex'), - - (r'm?/(\\\\|\\[^\\]|[^\\/\n])*/[gcimosx]*', String.Regex), - (r'm(?=[/!\\{<\[(@%$])', String.Regex, 'balanced-regex'), - (r'((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*', - String.Regex), - (r'\s+', Text), - (words(( - 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir', - 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect', - 'continue', 'cos', 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die', - 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent', - 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit', 'exp', 'fcntl', - 'fileno', 'flock', 'fork', 'format', 'formline', 'getc', 'getgrent', 'getgrgid', - 'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin', - 'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp', - 'getppid', 'getpriority', 'getprotobyname', 'getprotobynumber', - 'getprotoent', 'getpwent', 'getpwnam', 'getpwuid', 'getservbyname', - 'getservbyport', 'getservent', 'getsockname', 'getsockopt', 'glob', 'gmtime', - 'goto', 'grep', 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill', 'last', - 'lc', 'lcfirst', 'length', 'link', 'listen', 'local', 'localtime', 'log', 'lstat', - 'map', 'mkdir', 'msgctl', 'msgget', 'msgrcv', 'msgsnd', 'my', 'next', 'no', 'oct', 'open', - 'opendir', 'ord', 'our', 'pack', 'package', 'pipe', 'pop', 'pos', 'printf', - 'prototype', 'push', 'quotemeta', 'rand', 'read', 'readdir', - 'readline', 'readlink', 'readpipe', 'recv', 'redo', 'ref', 'rename', 'require', - 'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir', - 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent', 'sethostent', 'setnetent', - 'setpgrp', 'setpriority', 'setprotoent', 'setpwent', 'setservent', - 'setsockopt', 'shift', 'shmctl', 'shmget', 'shmread', 'shmwrite', 'shutdown', - 'sin', 'sleep', 'socket', 'socketpair', 'sort', 'splice', 'split', 'sprintf', 'sqrt', - 'srand', 'stat', 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread', - 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied', 'time', 'times', 'tr', - 'truncate', 'uc', 'ucfirst', 'umask', 'undef', 'unlink', 'unpack', 'unshift', 'untie', - 'utime', 'values', 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write'), suffix=r'\b'), - Name.Builtin), - (r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo), - (r'<<([\'"]?)([a-zA-Z_]\w*)\1;?\n.*?\n\2\n', String), - (r'__END__', Comment.Preproc, 'end-part'), - (r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global), - (r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global), - (r'[$@%#]+', Name.Variable, 'varname'), - (r'0_?[0-7]+(_[0-7]+)*', Number.Oct), - (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex), - (r'0b[01]+(_[01]+)*', Number.Bin), - (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', - Number.Float), - (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float), - (r'\d+(_\d+)*', Number.Integer), - (r"'(\\\\|\\[^\\]|[^'\\])*'", String), - (r'"(\\\\|\\[^\\]|[^"\\])*"', String), - (r'`(\\\\|\\[^\\]|[^`\\])*`', String.Backtick), - (r'<([^\s>]+)>', String.Regex), - (r'(q|qq|qw|qr|qx)\{', String.Other, 'cb-string'), - (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'), - (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'), - (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'), - (r'(q|qq|qw|qr|qx)([\W_])(.|\n)*?\2', String.Other), - (r'package\s+', Keyword, 'modulename'), - (r'sub\s+', Keyword, 'funcname'), - (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|' - r'!~|&&?|\|\||\.{1,3})', Operator), - (r'[-+/*%=<>&^|!\\~]=?', Operator), - (r'[()\[\]:;,<>/?{}]', Punctuation), # yes, there's no shortage - # of punctuation in Perl! - (r'(?=\w)', Name, 'name'), - ], - 'format': [ - (r'\.\n', String.Interpol, '#pop'), - (r'[^\n]*\n', String.Interpol), - ], - 'varname': [ - (r'\s+', Text), - (r'\{', Punctuation, '#pop'), # hash syntax? - (r'\)|,', Punctuation, '#pop'), # argument specifier - (r'\w+::', Name.Namespace), - (r'[\w:]+', Name.Variable, '#pop'), - ], - 'name': [ - (r'\w+::', Name.Namespace), - (r'[\w:]+', Name, '#pop'), - (r'[A-Z_]+(?=\W)', Name.Constant, '#pop'), - (r'(?=\W)', Text, '#pop'), - ], - 'modulename': [ - (r'[a-zA-Z_]\w*', Name.Namespace, '#pop') - ], - 'funcname': [ - (r'[a-zA-Z_]\w*[!?]?', Name.Function), - (r'\s+', Text), - # argument declaration - (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)), - (r';', Punctuation, '#pop'), - (r'.*?\{', Punctuation, '#pop'), - ], - 'cb-string': [ - (r'\\[{}\\]', String.Other), - (r'\\', String.Other), - (r'\{', String.Other, 'cb-string'), - (r'\}', String.Other, '#pop'), - (r'[^{}\\]+', String.Other) - ], - 'rb-string': [ - (r'\\[()\\]', String.Other), - (r'\\', String.Other), - (r'\(', String.Other, 'rb-string'), - (r'\)', String.Other, '#pop'), - (r'[^()]+', String.Other) - ], - 'sb-string': [ - (r'\\[\[\]\\]', String.Other), - (r'\\', String.Other), - (r'\[', String.Other, 'sb-string'), - (r'\]', String.Other, '#pop'), - (r'[^\[\]]+', String.Other) - ], - 'lt-string': [ - (r'\\[<>\\]', String.Other), - (r'\\', String.Other), - (r'\<', String.Other, 'lt-string'), - (r'\>', String.Other, '#pop'), - (r'[^<>]+', String.Other) - ], - 'end-part': [ - (r'.+', Comment.Preproc, '#pop') - ] - } - - def analyse_text(text): - if shebang_matches(text, r'perl'): - return True - if re.search('(?:my|our)\s+[$@%(]', text): - return 0.9 - - -class Perl6Lexer(ExtendedRegexLexer): - """ - For `Perl 6 `_ source code. - - .. versionadded:: 2.0 - """ - - name = 'Perl6' - aliases = ['perl6', 'pl6'] - filenames = ['*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6', - '*.6pm', '*.p6m', '*.pm6', '*.t'] - mimetypes = ['text/x-perl6', 'application/x-perl6'] - flags = re.MULTILINE | re.DOTALL | re.UNICODE - - PERL6_IDENTIFIER_RANGE = "['\w:-]" - - PERL6_KEYWORDS = ( - 'BEGIN', 'CATCH', 'CHECK', 'CONTROL', 'END', 'ENTER', 'FIRST', 'INIT', - 'KEEP', 'LAST', 'LEAVE', 'NEXT', 'POST', 'PRE', 'START', 'TEMP', - 'UNDO', 'as', 'assoc', 'async', 'augment', 'binary', 'break', 'but', - 'cached', 'category', 'class', 'constant', 'contend', 'continue', - 'copy', 'deep', 'default', 'defequiv', 'defer', 'die', 'do', 'else', - 'elsif', 'enum', 'equiv', 'exit', 'export', 'fail', 'fatal', 'for', - 'gather', 'given', 'goto', 'grammar', 'handles', 'has', 'if', 'inline', - 'irs', 'is', 'last', 'leave', 'let', 'lift', 'loop', 'looser', 'macro', - 'make', 'maybe', 'method', 'module', 'multi', 'my', 'next', 'of', - 'ofs', 'only', 'oo', 'ors', 'our', 'package', 'parsed', 'prec', - 'proto', 'readonly', 'redo', 'ref', 'regex', 'reparsed', 'repeat', - 'require', 'required', 'return', 'returns', 'role', 'rule', 'rw', - 'self', 'slang', 'state', 'sub', 'submethod', 'subset', 'supersede', - 'take', 'temp', 'tighter', 'token', 'trusts', 'try', 'unary', - 'unless', 'until', 'use', 'warn', 'when', 'where', 'while', 'will', - ) - - PERL6_BUILTINS = ( - 'ACCEPTS', 'HOW', 'REJECTS', 'VAR', 'WHAT', 'WHENCE', 'WHERE', 'WHICH', - 'WHO', 'abs', 'acos', 'acosec', 'acosech', 'acosh', 'acotan', 'acotanh', - 'all', 'any', 'approx', 'arity', 'asec', 'asech', 'asin', 'asinh', - 'assuming', 'atan', 'atan2', 'atanh', 'attr', 'bless', 'body', 'by', - 'bytes', 'caller', 'callsame', 'callwith', 'can', 'capitalize', 'cat', - 'ceiling', 'chars', 'chmod', 'chomp', 'chop', 'chr', 'chroot', - 'circumfix', 'cis', 'classify', 'clone', 'close', 'cmp_ok', 'codes', - 'comb', 'connect', 'contains', 'context', 'cos', 'cosec', 'cosech', - 'cosh', 'cotan', 'cotanh', 'count', 'defined', 'delete', 'diag', - 'dies_ok', 'does', 'e', 'each', 'eager', 'elems', 'end', 'eof', 'eval', - 'eval_dies_ok', 'eval_elsewhere', 'eval_lives_ok', 'evalfile', 'exists', - 'exp', 'first', 'flip', 'floor', 'flunk', 'flush', 'fmt', 'force_todo', - 'fork', 'from', 'getc', 'gethost', 'getlogin', 'getpeername', 'getpw', - 'gmtime', 'graphs', 'grep', 'hints', 'hyper', 'im', 'index', 'infix', - 'invert', 'is_approx', 'is_deeply', 'isa', 'isa_ok', 'isnt', 'iterator', - 'join', 'key', 'keys', 'kill', 'kv', 'lastcall', 'lazy', 'lc', 'lcfirst', - 'like', 'lines', 'link', 'lives_ok', 'localtime', 'log', 'log10', 'map', - 'max', 'min', 'minmax', 'name', 'new', 'nextsame', 'nextwith', 'nfc', - 'nfd', 'nfkc', 'nfkd', 'nok_error', 'nonce', 'none', 'normalize', 'not', - 'nothing', 'ok', 'once', 'one', 'open', 'opendir', 'operator', 'ord', - 'p5chomp', 'p5chop', 'pack', 'pair', 'pairs', 'pass', 'perl', 'pi', - 'pick', 'plan', 'plan_ok', 'polar', 'pop', 'pos', 'postcircumfix', - 'postfix', 'pred', 'prefix', 'print', 'printf', 'push', 'quasi', - 'quotemeta', 'rand', 're', 'read', 'readdir', 'readline', 'reduce', - 'reverse', 'rewind', 'rewinddir', 'rindex', 'roots', 'round', - 'roundrobin', 'run', 'runinstead', 'sameaccent', 'samecase', 'say', - 'sec', 'sech', 'sech', 'seek', 'shape', 'shift', 'sign', 'signature', - 'sin', 'sinh', 'skip', 'skip_rest', 'sleep', 'slurp', 'sort', 'splice', - 'split', 'sprintf', 'sqrt', 'srand', 'strand', 'subst', 'substr', 'succ', - 'sum', 'symlink', 'tan', 'tanh', 'throws_ok', 'time', 'times', 'to', - 'todo', 'trim', 'trim_end', 'trim_start', 'true', 'truncate', 'uc', - 'ucfirst', 'undef', 'undefine', 'uniq', 'unlike', 'unlink', 'unpack', - 'unpolar', 'unshift', 'unwrap', 'use_ok', 'value', 'values', 'vec', - 'version_lt', 'void', 'wait', 'want', 'wrap', 'write', 'zip', - ) - - PERL6_BUILTIN_CLASSES = ( - 'Abstraction', 'Any', 'AnyChar', 'Array', 'Associative', 'Bag', 'Bit', - 'Blob', 'Block', 'Bool', 'Buf', 'Byte', 'Callable', 'Capture', 'Char', 'Class', - 'Code', 'Codepoint', 'Comparator', 'Complex', 'Decreasing', 'Exception', - 'Failure', 'False', 'Grammar', 'Grapheme', 'Hash', 'IO', 'Increasing', - 'Int', 'Junction', 'KeyBag', 'KeyExtractor', 'KeyHash', 'KeySet', - 'KitchenSink', 'List', 'Macro', 'Mapping', 'Match', 'Matcher', 'Method', - 'Module', 'Num', 'Object', 'Ordered', 'Ordering', 'OrderingPair', - 'Package', 'Pair', 'Positional', 'Proxy', 'Range', 'Rat', 'Regex', - 'Role', 'Routine', 'Scalar', 'Seq', 'Set', 'Signature', 'Str', 'StrLen', - 'StrPos', 'Sub', 'Submethod', 'True', 'UInt', 'Undef', 'Version', 'Void', - 'Whatever', 'bit', 'bool', 'buf', 'buf1', 'buf16', 'buf2', 'buf32', - 'buf4', 'buf64', 'buf8', 'complex', 'int', 'int1', 'int16', 'int2', - 'int32', 'int4', 'int64', 'int8', 'num', 'rat', 'rat1', 'rat16', 'rat2', - 'rat32', 'rat4', 'rat64', 'rat8', 'uint', 'uint1', 'uint16', 'uint2', - 'uint32', 'uint4', 'uint64', 'uint8', 'utf16', 'utf32', 'utf8', - ) - - PERL6_OPERATORS = ( - 'X', 'Z', 'after', 'also', 'and', 'andthen', 'before', 'cmp', 'div', - 'eq', 'eqv', 'extra', 'ff', 'fff', 'ge', 'gt', 'le', 'leg', 'lt', 'm', - 'mm', 'mod', 'ne', 'or', 'orelse', 'rx', 's', 'tr', 'x', 'xor', 'xx', - '++', '--', '**', '!', '+', '-', '~', '?', '|', '||', '+^', '~^', '?^', - '^', '*', '/', '%', '%%', '+&', '+<', '+>', '~&', '~<', '~>', '?&', - 'gcd', 'lcm', '+', '-', '+|', '+^', '~|', '~^', '?|', '?^', - '~', '&', '^', 'but', 'does', '<=>', '..', '..^', '^..', '^..^', - '!=', '==', '<', '<=', '>', '>=', '~~', '===', '!eqv', - '&&', '||', '^^', '//', 'min', 'max', '??', '!!', 'ff', 'fff', 'so', - 'not', '<==', '==>', '<<==', '==>>', - ) - - # Perl 6 has a *lot* of possible bracketing characters - # this list was lifted from STD.pm6 (https://github.com/perl6/std) - PERL6_BRACKETS = { - u'\u0028': u'\u0029', u'\u003c': u'\u003e', u'\u005b': u'\u005d', - u'\u007b': u'\u007d', u'\u00ab': u'\u00bb', u'\u0f3a': u'\u0f3b', - u'\u0f3c': u'\u0f3d', u'\u169b': u'\u169c', u'\u2018': u'\u2019', - u'\u201a': u'\u2019', u'\u201b': u'\u2019', u'\u201c': u'\u201d', - u'\u201e': u'\u201d', u'\u201f': u'\u201d', u'\u2039': u'\u203a', - u'\u2045': u'\u2046', u'\u207d': u'\u207e', u'\u208d': u'\u208e', - u'\u2208': u'\u220b', u'\u2209': u'\u220c', u'\u220a': u'\u220d', - u'\u2215': u'\u29f5', u'\u223c': u'\u223d', u'\u2243': u'\u22cd', - u'\u2252': u'\u2253', u'\u2254': u'\u2255', u'\u2264': u'\u2265', - u'\u2266': u'\u2267', u'\u2268': u'\u2269', u'\u226a': u'\u226b', - u'\u226e': u'\u226f', u'\u2270': u'\u2271', u'\u2272': u'\u2273', - u'\u2274': u'\u2275', u'\u2276': u'\u2277', u'\u2278': u'\u2279', - u'\u227a': u'\u227b', u'\u227c': u'\u227d', u'\u227e': u'\u227f', - u'\u2280': u'\u2281', u'\u2282': u'\u2283', u'\u2284': u'\u2285', - u'\u2286': u'\u2287', u'\u2288': u'\u2289', u'\u228a': u'\u228b', - u'\u228f': u'\u2290', u'\u2291': u'\u2292', u'\u2298': u'\u29b8', - u'\u22a2': u'\u22a3', u'\u22a6': u'\u2ade', u'\u22a8': u'\u2ae4', - u'\u22a9': u'\u2ae3', u'\u22ab': u'\u2ae5', u'\u22b0': u'\u22b1', - u'\u22b2': u'\u22b3', u'\u22b4': u'\u22b5', u'\u22b6': u'\u22b7', - u'\u22c9': u'\u22ca', u'\u22cb': u'\u22cc', u'\u22d0': u'\u22d1', - u'\u22d6': u'\u22d7', u'\u22d8': u'\u22d9', u'\u22da': u'\u22db', - u'\u22dc': u'\u22dd', u'\u22de': u'\u22df', u'\u22e0': u'\u22e1', - u'\u22e2': u'\u22e3', u'\u22e4': u'\u22e5', u'\u22e6': u'\u22e7', - u'\u22e8': u'\u22e9', u'\u22ea': u'\u22eb', u'\u22ec': u'\u22ed', - u'\u22f0': u'\u22f1', u'\u22f2': u'\u22fa', u'\u22f3': u'\u22fb', - u'\u22f4': u'\u22fc', u'\u22f6': u'\u22fd', u'\u22f7': u'\u22fe', - u'\u2308': u'\u2309', u'\u230a': u'\u230b', u'\u2329': u'\u232a', - u'\u23b4': u'\u23b5', u'\u2768': u'\u2769', u'\u276a': u'\u276b', - u'\u276c': u'\u276d', u'\u276e': u'\u276f', u'\u2770': u'\u2771', - u'\u2772': u'\u2773', u'\u2774': u'\u2775', u'\u27c3': u'\u27c4', - u'\u27c5': u'\u27c6', u'\u27d5': u'\u27d6', u'\u27dd': u'\u27de', - u'\u27e2': u'\u27e3', u'\u27e4': u'\u27e5', u'\u27e6': u'\u27e7', - u'\u27e8': u'\u27e9', u'\u27ea': u'\u27eb', u'\u2983': u'\u2984', - u'\u2985': u'\u2986', u'\u2987': u'\u2988', u'\u2989': u'\u298a', - u'\u298b': u'\u298c', u'\u298d': u'\u298e', u'\u298f': u'\u2990', - u'\u2991': u'\u2992', u'\u2993': u'\u2994', u'\u2995': u'\u2996', - u'\u2997': u'\u2998', u'\u29c0': u'\u29c1', u'\u29c4': u'\u29c5', - u'\u29cf': u'\u29d0', u'\u29d1': u'\u29d2', u'\u29d4': u'\u29d5', - u'\u29d8': u'\u29d9', u'\u29da': u'\u29db', u'\u29f8': u'\u29f9', - u'\u29fc': u'\u29fd', u'\u2a2b': u'\u2a2c', u'\u2a2d': u'\u2a2e', - u'\u2a34': u'\u2a35', u'\u2a3c': u'\u2a3d', u'\u2a64': u'\u2a65', - u'\u2a79': u'\u2a7a', u'\u2a7d': u'\u2a7e', u'\u2a7f': u'\u2a80', - u'\u2a81': u'\u2a82', u'\u2a83': u'\u2a84', u'\u2a8b': u'\u2a8c', - u'\u2a91': u'\u2a92', u'\u2a93': u'\u2a94', u'\u2a95': u'\u2a96', - u'\u2a97': u'\u2a98', u'\u2a99': u'\u2a9a', u'\u2a9b': u'\u2a9c', - u'\u2aa1': u'\u2aa2', u'\u2aa6': u'\u2aa7', u'\u2aa8': u'\u2aa9', - u'\u2aaa': u'\u2aab', u'\u2aac': u'\u2aad', u'\u2aaf': u'\u2ab0', - u'\u2ab3': u'\u2ab4', u'\u2abb': u'\u2abc', u'\u2abd': u'\u2abe', - u'\u2abf': u'\u2ac0', u'\u2ac1': u'\u2ac2', u'\u2ac3': u'\u2ac4', - u'\u2ac5': u'\u2ac6', u'\u2acd': u'\u2ace', u'\u2acf': u'\u2ad0', - u'\u2ad1': u'\u2ad2', u'\u2ad3': u'\u2ad4', u'\u2ad5': u'\u2ad6', - u'\u2aec': u'\u2aed', u'\u2af7': u'\u2af8', u'\u2af9': u'\u2afa', - u'\u2e02': u'\u2e03', u'\u2e04': u'\u2e05', u'\u2e09': u'\u2e0a', - u'\u2e0c': u'\u2e0d', u'\u2e1c': u'\u2e1d', u'\u2e20': u'\u2e21', - u'\u3008': u'\u3009', u'\u300a': u'\u300b', u'\u300c': u'\u300d', - u'\u300e': u'\u300f', u'\u3010': u'\u3011', u'\u3014': u'\u3015', - u'\u3016': u'\u3017', u'\u3018': u'\u3019', u'\u301a': u'\u301b', - u'\u301d': u'\u301e', u'\ufd3e': u'\ufd3f', u'\ufe17': u'\ufe18', - u'\ufe35': u'\ufe36', u'\ufe37': u'\ufe38', u'\ufe39': u'\ufe3a', - u'\ufe3b': u'\ufe3c', u'\ufe3d': u'\ufe3e', u'\ufe3f': u'\ufe40', - u'\ufe41': u'\ufe42', u'\ufe43': u'\ufe44', u'\ufe47': u'\ufe48', - u'\ufe59': u'\ufe5a', u'\ufe5b': u'\ufe5c', u'\ufe5d': u'\ufe5e', - u'\uff08': u'\uff09', u'\uff1c': u'\uff1e', u'\uff3b': u'\uff3d', - u'\uff5b': u'\uff5d', u'\uff5f': u'\uff60', u'\uff62': u'\uff63', - } - - def _build_word_match(words, boundary_regex_fragment=None, prefix='', suffix=''): - if boundary_regex_fragment is None: - return r'\b(' + prefix + r'|'.join(re.escape(x) for x in words) + \ - suffix + r')\b' - else: - return r'(? 0: - next_open_pos = text.find(opening_chars, search_pos + n_chars) - next_close_pos = text.find(closing_chars, search_pos + n_chars) - - if next_close_pos == -1: - next_close_pos = len(text) - nesting_level = 0 - elif next_open_pos != -1 and next_open_pos < next_close_pos: - nesting_level += 1 - search_pos = next_open_pos - else: # next_close_pos < next_open_pos - nesting_level -= 1 - search_pos = next_close_pos - - end_pos = next_close_pos - - if end_pos < 0: # if we didn't find a closer, just highlight the - # rest of the text in this class - end_pos = len(text) - - if adverbs is not None and re.search(r':to\b', adverbs): - heredoc_terminator = text[match.start('delimiter') + n_chars:end_pos] - end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + - r'\s*$', text[end_pos:], re.MULTILINE) - - if end_heredoc: - end_pos += end_heredoc.end() - else: - end_pos = len(text) - - yield match.start(), token_class, text[match.start():end_pos + n_chars] - context.pos = end_pos + n_chars - - return callback - - def opening_brace_callback(lexer, match, context): - stack = context.stack - - yield match.start(), Text, context.text[match.start():match.end()] - context.pos = match.end() - - # if we encounter an opening brace and we're one level - # below a token state, it means we need to increment - # the nesting level for braces so we know later when - # we should return to the token rules. - if len(stack) > 2 and stack[-2] == 'token': - context.perl6_token_nesting_level += 1 - - def closing_brace_callback(lexer, match, context): - stack = context.stack - - yield match.start(), Text, context.text[match.start():match.end()] - context.pos = match.end() - - # if we encounter a free closing brace and we're one level - # below a token state, it means we need to check the nesting - # level to see if we need to return to the token state. - if len(stack) > 2 and stack[-2] == 'token': - context.perl6_token_nesting_level -= 1 - if context.perl6_token_nesting_level == 0: - stack.pop() - - def embedded_perl6_callback(lexer, match, context): - context.perl6_token_nesting_level = 1 - yield match.start(), Text, context.text[match.start():match.end()] - context.pos = match.end() - context.stack.append('root') - - # If you're modifying these rules, be careful if you need to process '{' or '}' - # characters. We have special logic for processing these characters (due to the fact - # that you can nest Perl 6 code in regex blocks), so if you need to process one of - # them, make sure you also process the corresponding one! - tokens = { - 'common': [ - (r'#[`|=](?P(?P[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)', - brackets_callback(Comment.Multiline)), - (r'#[^\n]*$', Comment.Singleline), - (r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline), - (r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline), - (r'^=.*?\n\s*?\n', Comment.Multiline), - (r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)', - bygroups(Keyword, Name), 'token-sym-brackets'), - (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?', - bygroups(Keyword, Name), 'pre-token'), - # deal with a special case in the Perl 6 grammar (role q { ... }) - (r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text)), - (_build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword), - (_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix='(?::[UD])?'), - Name.Builtin), - (_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin), - # copied from PerlLexer - (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', - Name.Variable), - (r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global), - (r'::\?\w+', Name.Variable.Global), - (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', - Name.Variable.Global), - (r'\$(?:<.*?>)+', Name.Variable), - (r'(?:q|qq|Q)[a-zA-Z]?\s*(?P:[\w\s:]+)?\s*(?P(?P[^0-9a-zA-Z:\s])' - r'(?P=first_char)*)', brackets_callback(String)), - # copied from PerlLexer - (r'0_?[0-7]+(_[0-7]+)*', Number.Oct), - (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex), - (r'0b[01]+(_[01]+)*', Number.Bin), - (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', - Number.Float), - (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float), - (r'\d+(_\d+)*', Number.Integer), - (r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex), - (r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex), - (r'm\w+(?=\()', Name), - (r'(?:m|ms|rx)\s*(?P:[\w\s:]+)?\s*(?P(?P[^\w:\s])' - r'(?P=first_char)*)', brackets_callback(String.Regex)), - (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/', - String.Regex), - (r'<[^\s=].*?\S>', String), - (_build_word_match(PERL6_OPERATORS), Operator), - (r'\w' + PERL6_IDENTIFIER_RANGE + '*', Name), - (r"'(\\\\|\\[^\\]|[^'\\])*'", String), - (r'"(\\\\|\\[^\\]|[^"\\])*"', String), - ], - 'root': [ - include('common'), - (r'\{', opening_brace_callback), - (r'\}', closing_brace_callback), - (r'.+?', Text), - ], - 'pre-token': [ - include('common'), - (r'\{', Text, ('#pop', 'token')), - (r'.+?', Text), - ], - 'token-sym-brackets': [ - (r'(?P(?P[' + ''.join(PERL6_BRACKETS) + '])(?P=first_char)*)', - brackets_callback(Name), ('#pop', 'pre-token')), - default(('#pop', 'pre-token')), - ], - 'token': [ - (r'\}', Text, '#pop'), - (r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(this)), - # make sure that quotes in character classes aren't treated as strings - (r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex), - # make sure that '#' characters in quotes aren't treated as comments - (r"(?my|our)\s+)?(?:module|class|role|enum|grammar)', line) - if class_decl: - if saw_perl_decl or class_decl.group('scope') is not None: - return True - rating = 0.05 - continue - break - - return rating - - def __init__(self, **options): - super(Perl6Lexer, self).__init__(**options) - self.encoding = options.get('encoding', 'utf-8') diff --git a/wakatime/packages/py3/pygments/lexers/prolog.py b/wakatime/packages/py3/pygments/lexers/prolog.py deleted file mode 100644 index 270239d..0000000 --- a/wakatime/packages/py3/pygments/lexers/prolog.py +++ /dev/null @@ -1,306 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.prolog - ~~~~~~~~~~~~~~~~~~~~~~ - - Lexers for Prolog and Prolog-like languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, bygroups -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation - -__all__ = ['PrologLexer', 'LogtalkLexer'] - - -class PrologLexer(RegexLexer): - """ - Lexer for Prolog files. - """ - name = 'Prolog' - aliases = ['prolog'] - filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl'] - mimetypes = ['text/x-prolog'] - - flags = re.UNICODE | re.MULTILINE - - tokens = { - 'root': [ - (r'^#.*', Comment.Single), - (r'/\*', Comment.Multiline, 'nested-comment'), - (r'%.*', Comment.Single), - # character literal - (r'0\'.', String.Char), - (r'0b[01]+', Number.Bin), - (r'0o[0-7]+', Number.Oct), - (r'0x[0-9a-fA-F]+', Number.Hex), - # literal with prepended base - (r'\d\d?\'[a-zA-Z0-9]+', Number.Integer), - (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), - (r'\d+', Number.Integer), - (r'[\[\](){}|.,;!]', Punctuation), - (r':-|-->', Punctuation), - (r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|' - r'\\[0-7]+\\|\\["\nabcefnrstv]|[^\\"])*"', String.Double), - (r"'(?:''|[^'])*'", String.Atom), # quoted atom - # Needs to not be followed by an atom. - # (r'=(?=\s|[a-zA-Z\[])', Operator), - (r'is\b', Operator), - (r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])', - Operator), - (r'(mod|div|not)\b', Operator), - (r'_', Keyword), # The don't-care variable - (r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)), - (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' - u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' - u'(\\s*)(:-|-->)', - bygroups(Name.Function, Text, Operator)), # function defn - (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' - u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' - u'(\\s*)(\\()', - bygroups(Name.Function, Text, Punctuation)), - (u'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' - u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*', - String.Atom), # atom, characters - # This one includes ! - (u'[#&*+\\-./:<=>?@\\\\^~\u00a1-\u00bf\u2010-\u303f]+', - String.Atom), # atom, graphics - (r'[A-Z_]\w*', Name.Variable), - (u'\\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text), - ], - 'nested-comment': [ - (r'\*/', Comment.Multiline, '#pop'), - (r'/\*', Comment.Multiline, '#push'), - (r'[^*/]+', Comment.Multiline), - (r'[*/]', Comment.Multiline), - ], - } - - def analyse_text(text): - return ':-' in text - - -class LogtalkLexer(RegexLexer): - """ - For `Logtalk `_ source code. - - .. versionadded:: 0.10 - """ - - name = 'Logtalk' - aliases = ['logtalk'] - filenames = ['*.lgt', '*.logtalk'] - mimetypes = ['text/x-logtalk'] - - tokens = { - 'root': [ - # Directives - (r'^\s*:-\s', Punctuation, 'directive'), - # Comments - (r'%.*?\n', Comment), - (r'/\*(.|\n)*?\*/', Comment), - # Whitespace - (r'\n', Text), - (r'\s+', Text), - # Numbers - (r"0'.", Number), - (r'0b[01]+', Number.Bin), - (r'0o[0-7]+', Number.Oct), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), - # Variables - (r'([A-Z_]\w*)', Name.Variable), - # Event handlers - (r'(after|before)(?=[(])', Keyword), - # Message forwarding handler - (r'forward(?=[(])', Keyword), - # Execution-context methods - (r'(parameter|this|se(lf|nder))(?=[(])', Keyword), - # Reflection - (r'(current_predicate|predicate_property)(?=[(])', Keyword), - # DCGs and term expansion - (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])', Keyword), - # Entity - (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])', Keyword), - (r'(object|protocol|category)_property(?=[(])', Keyword), - # Entity relations - (r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword), - (r'extends_(object|protocol|category)(?=[(])', Keyword), - (r'imp(lements_protocol|orts_category)(?=[(])', Keyword), - (r'(instantiat|specializ)es_class(?=[(])', Keyword), - # Events - (r'(current_event|(abolish|define)_events)(?=[(])', Keyword), - # Flags - (r'(current|set)_logtalk_flag(?=[(])', Keyword), - # Compiling, loading, and library paths - (r'logtalk_(compile|l(ibrary_path|oad|oad_context)|make)(?=[(])', Keyword), - (r'\blogtalk_make\b', Keyword), - # Database - (r'(clause|retract(all)?)(?=[(])', Keyword), - (r'a(bolish|ssert(a|z))(?=[(])', Keyword), - # Control constructs - (r'(ca(ll|tch)|throw)(?=[(])', Keyword), - (r'(fa(il|lse)|true)\b', Keyword), - # All solutions - (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword), - # Multi-threading meta-predicates - (r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])', Keyword), - # Term unification - (r'(subsumes_term|unify_with_occurs_check)(?=[(])', Keyword), - # Term creation and decomposition - (r'(functor|arg|copy_term|numbervars|term_variables)(?=[(])', Keyword), - # Evaluable functors - (r'(rem|m(ax|in|od)|abs|sign)(?=[(])', Keyword), - (r'float(_(integer|fractional)_part)?(?=[(])', Keyword), - (r'(floor|truncate|round|ceiling)(?=[(])', Keyword), - # Other arithmetic functors - (r'(cos|a(cos|sin|tan)|exp|log|s(in|qrt))(?=[(])', Keyword), - # Term testing - (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|' - r'ground|acyclic_term)(?=[(])', Keyword), - # Term comparison - (r'compare(?=[(])', Keyword), - # Stream selection and control - (r'(curren|se)t_(in|out)put(?=[(])', Keyword), - (r'(open|close)(?=[(])', Keyword), - (r'flush_output(?=[(])', Keyword), - (r'(at_end_of_stream|flush_output)\b', Keyword), - (r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])', Keyword), - # Character and byte input/output - (r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword), - (r'\bnl\b', Keyword), - # Term input/output - (r'read(_term)?(?=[(])', Keyword), - (r'write(q|_(canonical|term))?(?=[(])', Keyword), - (r'(current_)?op(?=[(])', Keyword), - (r'(current_)?char_conversion(?=[(])', Keyword), - # Atomic term processing - (r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword), - (r'(char_code|sub_atom)(?=[(])', Keyword), - (r'number_c(har|ode)s(?=[(])', Keyword), - # Implementation defined hooks functions - (r'(se|curren)t_prolog_flag(?=[(])', Keyword), - (r'\bhalt\b', Keyword), - (r'halt(?=[(])', Keyword), - # Message sending operators - (r'(::|:|\^\^)', Operator), - # External call - (r'[{}]', Keyword), - # Logic and control - (r'(ignore|once)(?=[(])', Keyword), - (r'\brepeat\b', Keyword), - # Sorting - (r'(key)?sort(?=[(])', Keyword), - # Bitwise functors - (r'(>>|<<|/\\|\\\\|\\)', Operator), - # Predicate aliases - (r'\bas\b', Operator), - # Arithemtic evaluation - (r'\bis\b', Keyword), - # Arithemtic comparison - (r'(=:=|=\\=|<|=<|>=|>)', Operator), - # Term creation and decomposition - (r'=\.\.', Operator), - # Term unification - (r'(=|\\=)', Operator), - # Term comparison - (r'(==|\\==|@=<|@<|@>=|@>)', Operator), - # Evaluable functors - (r'(//|[-+*/])', Operator), - (r'\b(e|pi|mod|rem)\b', Operator), - # Other arithemtic functors - (r'\b\*\*\b', Operator), - # DCG rules - (r'-->', Operator), - # Control constructs - (r'([!;]|->)', Operator), - # Logic and control - (r'\\+', Operator), - # Mode operators - (r'[?@]', Operator), - # Existential quantifier - (r'\^', Operator), - # Strings - (r'"(\\\\|\\"|[^"])*"', String), - # Ponctuation - (r'[()\[\],.|]', Text), - # Atoms - (r"[a-z]\w*", Text), - (r"'", String, 'quoted_atom'), - ], - - 'quoted_atom': [ - (r"''", String), - (r"'", String, '#pop'), - (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape), - (r"[^\\'\n]+", String), - (r'\\', String), - ], - - 'directive': [ - # Conditional compilation directives - (r'(el)?if(?=[(])', Keyword, 'root'), - (r'(e(lse|ndif))[.]', Keyword, 'root'), - # Entity directives - (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'), - (r'(end_(category|object|protocol))[.]', Keyword, 'root'), - # Predicate scope directives - (r'(public|protected|private)(?=[(])', Keyword, 'root'), - # Other directives - (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'), - (r'in(clude|itialization|fo)(?=[(])', Keyword, 'root'), - (r'(built_in|dynamic|synchronized|threaded)[.]', Keyword, 'root'), - (r'(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|' - r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'), - (r'op(?=[(])', Keyword, 'root'), - (r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'), - (r'[a-z]\w*(?=[(])', Text, 'root'), - (r'[a-z]\w*[.]', Text, 'root'), - ], - - 'entityrelations': [ - (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])', Keyword), - # Numbers - (r"0'.", Number), - (r'0b[01]+', Number.Bin), - (r'0o[0-7]+', Number.Oct), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), - # Variables - (r'([A-Z_]\w*)', Name.Variable), - # Atoms - (r"[a-z]\w*", Text), - (r"'", String, 'quoted_atom'), - # Strings - (r'"(\\\\|\\"|[^"])*"', String), - # End of entity-opening directive - (r'([)]\.)', Text, 'root'), - # Scope operator - (r'(::)', Operator), - # Ponctuation - (r'[()\[\],.|]', Text), - # Comments - (r'%.*?\n', Comment), - (r'/\*(.|\n)*?\*/', Comment), - # Whitespace - (r'\n', Text), - (r'\s+', Text), - ] - } - - def analyse_text(text): - if ':- object(' in text: - return 1.0 - elif ':- protocol(' in text: - return 1.0 - elif ':- category(' in text: - return 1.0 - elif re.search('^:-\s[a-z]', text, re.M): - return 0.9 - else: - return 0.0 diff --git a/wakatime/packages/py3/pygments/lexers/rdf.py b/wakatime/packages/py3/pygments/lexers/rdf.py deleted file mode 100644 index 292b1ae..0000000 --- a/wakatime/packages/py3/pygments/lexers/rdf.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.rdf - ~~~~~~~~~~~~~~~~~~~ - - Lexers for semantic web and RDF query languages and markup. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, bygroups, default -from pygments.token import Keyword, Punctuation, String, Number, Operator, \ - Whitespace, Name, Literal, Comment, Text - -__all__ = ['SparqlLexer'] - - -class SparqlLexer(RegexLexer): - """ - Lexer for `SPARQL `_ query language. - - .. versionadded:: 2.0 - """ - name = 'SPARQL' - aliases = ['sparql'] - filenames = ['*.rq', '*.sparql'] - mimetypes = ['application/sparql-query'] - - flags = re.IGNORECASE - - tokens = { - 'root': [ - (r'\s+', Whitespace), - (r'(select|construct|describe|ask|where|filter|group\s+by|minus|' - r'distinct|reduced|from named|from|order\s+by|limit|' - r'offset|bindings|load|clear|drop|create|add|move|copy|' - r'insert\s+data|delete\s+data|delete\s+where|delete|insert|' - r'using named|using|graph|default|named|all|optional|service|' - r'silent|bind|union|not in|in|as|a)', Keyword), - (r'(prefix|base)(\s+)([a-z][\w-]*)(\s*)(\:)', - bygroups(Keyword, Whitespace, Name.Namespace, Whitespace, - Punctuation)), - (r'\?[a-z_]\w*', Name.Variable), - (r'<[^>]+>', Name.Label), - (r'([a-z][\w-]*)(\:)([a-z][\w-]*)', - bygroups(Name.Namespace, Punctuation, Name.Tag)), - (r'(str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|' - r'ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|' - r'contains|strstarts|strends|strbefore|strafter|year|month|day|' - r'hours|minutes|seconds|timezone|tz|now|md5|sha1|sha256|sha384|' - r'sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|' - r'isliteral|isnumeric|regex|substr|replace|exists|not exists|' - r'count|sum|min|max|avg|sample|group_concat|separator)\b', - Name.Function), - (r'(true|false)', Literal), - (r'[+\-]?\d*\.\d+', Number.Float), - (r'[+\-]?\d*(:?\.\d+)?E[+\-]?\d+', Number.Float), - (r'[+\-]?\d+', Number.Integer), - (r'(\|\||&&|=|\*|\-|\+|/)', Operator), - (r'[(){}.;,:^]', Punctuation), - (r'#[^\n]+', Comment), - (r'"""', String, 'triple-double-quoted-string'), - (r'"', String, 'single-double-quoted-string'), - (r"'''", String, 'triple-single-quoted-string'), - (r"'", String, 'single-single-quoted-string'), - ], - 'triple-double-quoted-string': [ - (r'"""', String, 'end-of-string'), - (r'[^\\]+', String), - (r'\\', String, 'string-escape'), - ], - 'single-double-quoted-string': [ - (r'"', String, 'end-of-string'), - (r'[^"\\\n]+', String), - (r'\\', String, 'string-escape'), - ], - 'triple-single-quoted-string': [ - (r"'''", String, 'end-of-string'), - (r'[^\\]+', String), - (r'\\', String, 'string-escape'), - ], - 'single-single-quoted-string': [ - (r"'", String, 'end-of-string'), - (r"[^'\\\n]+", String), - (r'\\', String, 'string-escape'), - ], - 'string-escape': [ - (r'.', String, '#pop'), - ], - 'end-of-string': [ - (r'(@)([a-z]+(:?-[a-z0-9]+)*)', - bygroups(Operator, Name.Function), '#pop:2'), - (r'\^\^', Operator, '#pop:2'), - default('#pop:2'), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/resource.py b/wakatime/packages/py3/pygments/lexers/resource.py deleted file mode 100644 index 6a0da2f..0000000 --- a/wakatime/packages/py3/pygments/lexers/resource.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.resource - ~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexer for resource definition files. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, bygroups, words -from pygments.token import Comment, String, Number, Operator, Text, \ - Keyword, Name - -__all__ = ['ResourceLexer'] - - -class ResourceLexer(RegexLexer): - """Lexer for `ICU Resource bundles - `_. - - .. versionadded:: 2.0 - """ - name = 'ResourceBundle' - aliases = ['resource', 'resourcebundle'] - filenames = ['*.txt'] - - _types = (':table', ':array', ':string', ':bin', ':import', ':intvector', - ':int', ':alias') - - flags = re.MULTILINE | re.IGNORECASE - tokens = { - 'root': [ - (r'//.*?$', Comment), - (r'"', String, 'string'), - (r'-?\d+', Number.Integer), - (r'[,{}]', Operator), - (r'([^\s{:]+)(\s*)(%s?)' % '|'.join(_types), - bygroups(Name, Text, Keyword)), - (r'\s+', Text), - (words(_types), Keyword), - ], - 'string': [ - (r'(\\x[0-9a-f]{2}|\\u[0-9a-f]{4}|\\U00[0-9a-f]{6}|' - r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+', String), - (r'\{', String.Escape, 'msgname'), - (r'"', String, '#pop') - ], - 'msgname': [ - (r'([^{},]+)(\s*)', bygroups(Name, String.Escape), ('#pop', 'message')) - ], - 'message': [ - (r'\{', String.Escape, 'msgname'), - (r'\}', String.Escape, '#pop'), - (r'(,)(\s*)([a-z]+)(\s*\})', - bygroups(Operator, String.Escape, Keyword, String.Escape), '#pop'), - (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)', - bygroups(Operator, String.Escape, Keyword, String.Escape, Operator, - String.Escape, Operator.Word, String.Escape, Operator, - String.Escape, Number.Integer, String.Escape), 'choice'), - (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)', - bygroups(Operator, String.Escape, Keyword, String.Escape, Operator, - String.Escape), 'choice'), - (r'\s+', String.Escape) - ], - 'choice': [ - (r'(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)', - bygroups(Operator, Number.Integer, String.Escape), 'message'), - (r'([a-z]+)(\s*\{)', bygroups(Keyword.Type, String.Escape), 'str'), - (r'\}', String.Escape, ('#pop', '#pop')), - (r'\s+', String.Escape) - ], - 'str': [ - (r'\}', String.Escape, '#pop'), - (r'\{', String.Escape, 'msgname'), - (r'[^{}]+', String) - ] - } - - def analyse_text(text): - return text.startswith('root:table') diff --git a/wakatime/packages/py3/pygments/lexers/robotframework.py b/wakatime/packages/py3/pygments/lexers/robotframework.py deleted file mode 100644 index 7b6f556..0000000 --- a/wakatime/packages/py3/pygments/lexers/robotframework.py +++ /dev/null @@ -1,560 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.robotframework - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexer for Robot Framework. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -# Copyright 2012 Nokia Siemens Networks Oyj -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import re - -from pygments.lexer import Lexer -from pygments.token import Token -from pygments.util import text_type - -__all__ = ['RobotFrameworkLexer'] - - -HEADING = Token.Generic.Heading -SETTING = Token.Keyword.Namespace -IMPORT = Token.Name.Namespace -TC_KW_NAME = Token.Generic.Subheading -KEYWORD = Token.Name.Function -ARGUMENT = Token.String -VARIABLE = Token.Name.Variable -COMMENT = Token.Comment -SEPARATOR = Token.Punctuation -SYNTAX = Token.Punctuation -GHERKIN = Token.Generic.Emph -ERROR = Token.Error - - -def normalize(string, remove=''): - string = string.lower() - for char in remove + ' ': - if char in string: - string = string.replace(char, '') - return string - - -class RobotFrameworkLexer(Lexer): - """ - For `Robot Framework `_ test data. - - Supports both space and pipe separated plain text formats. - - .. versionadded:: 1.6 - """ - name = 'RobotFramework' - aliases = ['robotframework'] - filenames = ['*.txt', '*.robot'] - mimetypes = ['text/x-robotframework'] - - def __init__(self, **options): - options['tabsize'] = 2 - options['encoding'] = 'UTF-8' - Lexer.__init__(self, **options) - - def get_tokens_unprocessed(self, text): - row_tokenizer = RowTokenizer() - var_tokenizer = VariableTokenizer() - index = 0 - for row in text.splitlines(): - for value, token in row_tokenizer.tokenize(row): - for value, token in var_tokenizer.tokenize(value, token): - if value: - yield index, token, text_type(value) - index += len(value) - - -class VariableTokenizer(object): - - def tokenize(self, string, token): - var = VariableSplitter(string, identifiers='$@%') - if var.start < 0 or token in (COMMENT, ERROR): - yield string, token - return - for value, token in self._tokenize(var, string, token): - if value: - yield value, token - - def _tokenize(self, var, string, orig_token): - before = string[:var.start] - yield before, orig_token - yield var.identifier + '{', SYNTAX - for value, token in self.tokenize(var.base, VARIABLE): - yield value, token - yield '}', SYNTAX - if var.index: - yield '[', SYNTAX - for value, token in self.tokenize(var.index, VARIABLE): - yield value, token - yield ']', SYNTAX - for value, token in self.tokenize(string[var.end:], orig_token): - yield value, token - - -class RowTokenizer(object): - - def __init__(self): - self._table = UnknownTable() - self._splitter = RowSplitter() - testcases = TestCaseTable() - settings = SettingTable(testcases.set_default_template) - variables = VariableTable() - keywords = KeywordTable() - self._tables = {'settings': settings, 'setting': settings, - 'metadata': settings, - 'variables': variables, 'variable': variables, - 'testcases': testcases, 'testcase': testcases, - 'keywords': keywords, 'keyword': keywords, - 'userkeywords': keywords, 'userkeyword': keywords} - - def tokenize(self, row): - commented = False - heading = False - for index, value in enumerate(self._splitter.split(row)): - # First value, and every second after that, is a separator. - index, separator = divmod(index-1, 2) - if value.startswith('#'): - commented = True - elif index == 0 and value.startswith('*'): - self._table = self._start_table(value) - heading = True - for value, token in self._tokenize(value, index, commented, - separator, heading): - yield value, token - self._table.end_row() - - def _start_table(self, header): - name = normalize(header, remove='*') - return self._tables.get(name, UnknownTable()) - - def _tokenize(self, value, index, commented, separator, heading): - if commented: - yield value, COMMENT - elif separator: - yield value, SEPARATOR - elif heading: - yield value, HEADING - else: - for value, token in self._table.tokenize(value, index): - yield value, token - - -class RowSplitter(object): - _space_splitter = re.compile('( {2,})') - _pipe_splitter = re.compile('((?:^| +)\|(?: +|$))') - - def split(self, row): - splitter = (row.startswith('| ') and self._split_from_pipes - or self._split_from_spaces) - for value in splitter(row): - yield value - yield '\n' - - def _split_from_spaces(self, row): - yield '' # Start with (pseudo)separator similarly as with pipes - for value in self._space_splitter.split(row): - yield value - - def _split_from_pipes(self, row): - _, separator, rest = self._pipe_splitter.split(row, 1) - yield separator - while self._pipe_splitter.search(rest): - cell, separator, rest = self._pipe_splitter.split(rest, 1) - yield cell - yield separator - yield rest - - -class Tokenizer(object): - _tokens = None - - def __init__(self): - self._index = 0 - - def tokenize(self, value): - values_and_tokens = self._tokenize(value, self._index) - self._index += 1 - if isinstance(values_and_tokens, type(Token)): - values_and_tokens = [(value, values_and_tokens)] - return values_and_tokens - - def _tokenize(self, value, index): - index = min(index, len(self._tokens) - 1) - return self._tokens[index] - - def _is_assign(self, value): - if value.endswith('='): - value = value[:-1].strip() - var = VariableSplitter(value, identifiers='$@') - return var.start == 0 and var.end == len(value) - - -class Comment(Tokenizer): - _tokens = (COMMENT,) - - -class Setting(Tokenizer): - _tokens = (SETTING, ARGUMENT) - _keyword_settings = ('suitesetup', 'suiteprecondition', 'suiteteardown', - 'suitepostcondition', 'testsetup', 'testprecondition', - 'testteardown', 'testpostcondition', 'testtemplate') - _import_settings = ('library', 'resource', 'variables') - _other_settings = ('documentation', 'metadata', 'forcetags', 'defaulttags', - 'testtimeout') - _custom_tokenizer = None - - def __init__(self, template_setter=None): - Tokenizer.__init__(self) - self._template_setter = template_setter - - def _tokenize(self, value, index): - if index == 1 and self._template_setter: - self._template_setter(value) - if index == 0: - normalized = normalize(value) - if normalized in self._keyword_settings: - self._custom_tokenizer = KeywordCall(support_assign=False) - elif normalized in self._import_settings: - self._custom_tokenizer = ImportSetting() - elif normalized not in self._other_settings: - return ERROR - elif self._custom_tokenizer: - return self._custom_tokenizer.tokenize(value) - return Tokenizer._tokenize(self, value, index) - - -class ImportSetting(Tokenizer): - _tokens = (IMPORT, ARGUMENT) - - -class TestCaseSetting(Setting): - _keyword_settings = ('setup', 'precondition', 'teardown', 'postcondition', - 'template') - _import_settings = () - _other_settings = ('documentation', 'tags', 'timeout') - - def _tokenize(self, value, index): - if index == 0: - type = Setting._tokenize(self, value[1:-1], index) - return [('[', SYNTAX), (value[1:-1], type), (']', SYNTAX)] - return Setting._tokenize(self, value, index) - - -class KeywordSetting(TestCaseSetting): - _keyword_settings = ('teardown',) - _other_settings = ('documentation', 'arguments', 'return', 'timeout') - - -class Variable(Tokenizer): - _tokens = (SYNTAX, ARGUMENT) - - def _tokenize(self, value, index): - if index == 0 and not self._is_assign(value): - return ERROR - return Tokenizer._tokenize(self, value, index) - - -class KeywordCall(Tokenizer): - _tokens = (KEYWORD, ARGUMENT) - - def __init__(self, support_assign=True): - Tokenizer.__init__(self) - self._keyword_found = not support_assign - self._assigns = 0 - - def _tokenize(self, value, index): - if not self._keyword_found and self._is_assign(value): - self._assigns += 1 - return SYNTAX # VariableTokenizer tokenizes this later. - if self._keyword_found: - return Tokenizer._tokenize(self, value, index - self._assigns) - self._keyword_found = True - return GherkinTokenizer().tokenize(value, KEYWORD) - - -class GherkinTokenizer(object): - _gherkin_prefix = re.compile('^(Given|When|Then|And) ', re.IGNORECASE) - - def tokenize(self, value, token): - match = self._gherkin_prefix.match(value) - if not match: - return [(value, token)] - end = match.end() - return [(value[:end], GHERKIN), (value[end:], token)] - - -class TemplatedKeywordCall(Tokenizer): - _tokens = (ARGUMENT,) - - -class ForLoop(Tokenizer): - - def __init__(self): - Tokenizer.__init__(self) - self._in_arguments = False - - def _tokenize(self, value, index): - token = self._in_arguments and ARGUMENT or SYNTAX - if value.upper() in ('IN', 'IN RANGE'): - self._in_arguments = True - return token - - -class _Table(object): - _tokenizer_class = None - - def __init__(self, prev_tokenizer=None): - self._tokenizer = self._tokenizer_class() - self._prev_tokenizer = prev_tokenizer - self._prev_values_on_row = [] - - def tokenize(self, value, index): - if self._continues(value, index): - self._tokenizer = self._prev_tokenizer - yield value, SYNTAX - else: - for value_and_token in self._tokenize(value, index): - yield value_and_token - self._prev_values_on_row.append(value) - - def _continues(self, value, index): - return value == '...' and all(self._is_empty(t) - for t in self._prev_values_on_row) - - def _is_empty(self, value): - return value in ('', '\\') - - def _tokenize(self, value, index): - return self._tokenizer.tokenize(value) - - def end_row(self): - self.__init__(prev_tokenizer=self._tokenizer) - - -class UnknownTable(_Table): - _tokenizer_class = Comment - - def _continues(self, value, index): - return False - - -class VariableTable(_Table): - _tokenizer_class = Variable - - -class SettingTable(_Table): - _tokenizer_class = Setting - - def __init__(self, template_setter, prev_tokenizer=None): - _Table.__init__(self, prev_tokenizer) - self._template_setter = template_setter - - def _tokenize(self, value, index): - if index == 0 and normalize(value) == 'testtemplate': - self._tokenizer = Setting(self._template_setter) - return _Table._tokenize(self, value, index) - - def end_row(self): - self.__init__(self._template_setter, prev_tokenizer=self._tokenizer) - - -class TestCaseTable(_Table): - _setting_class = TestCaseSetting - _test_template = None - _default_template = None - - @property - def _tokenizer_class(self): - if self._test_template or (self._default_template and - self._test_template is not False): - return TemplatedKeywordCall - return KeywordCall - - def _continues(self, value, index): - return index > 0 and _Table._continues(self, value, index) - - def _tokenize(self, value, index): - if index == 0: - if value: - self._test_template = None - return GherkinTokenizer().tokenize(value, TC_KW_NAME) - if index == 1 and self._is_setting(value): - if self._is_template(value): - self._test_template = False - self._tokenizer = self._setting_class(self.set_test_template) - else: - self._tokenizer = self._setting_class() - if index == 1 and self._is_for_loop(value): - self._tokenizer = ForLoop() - if index == 1 and self._is_empty(value): - return [(value, SYNTAX)] - return _Table._tokenize(self, value, index) - - def _is_setting(self, value): - return value.startswith('[') and value.endswith(']') - - def _is_template(self, value): - return normalize(value) == '[template]' - - def _is_for_loop(self, value): - return value.startswith(':') and normalize(value, remove=':') == 'for' - - def set_test_template(self, template): - self._test_template = self._is_template_set(template) - - def set_default_template(self, template): - self._default_template = self._is_template_set(template) - - def _is_template_set(self, template): - return normalize(template) not in ('', '\\', 'none', '${empty}') - - -class KeywordTable(TestCaseTable): - _tokenizer_class = KeywordCall - _setting_class = KeywordSetting - - def _is_template(self, value): - return False - - -# Following code copied directly from Robot Framework 2.7.5. - -class VariableSplitter: - - def __init__(self, string, identifiers): - self.identifier = None - self.base = None - self.index = None - self.start = -1 - self.end = -1 - self._identifiers = identifiers - self._may_have_internal_variables = False - try: - self._split(string) - except ValueError: - pass - else: - self._finalize() - - def get_replaced_base(self, variables): - if self._may_have_internal_variables: - return variables.replace_string(self.base) - return self.base - - def _finalize(self): - self.identifier = self._variable_chars[0] - self.base = ''.join(self._variable_chars[2:-1]) - self.end = self.start + len(self._variable_chars) - if self._has_list_variable_index(): - self.index = ''.join(self._list_variable_index_chars[1:-1]) - self.end += len(self._list_variable_index_chars) - - def _has_list_variable_index(self): - return self._list_variable_index_chars\ - and self._list_variable_index_chars[-1] == ']' - - def _split(self, string): - start_index, max_index = self._find_variable(string) - self.start = start_index - self._open_curly = 1 - self._state = self._variable_state - self._variable_chars = [string[start_index], '{'] - self._list_variable_index_chars = [] - self._string = string - start_index += 2 - for index, char in enumerate(string[start_index:]): - index += start_index # Giving start to enumerate only in Py 2.6+ - try: - self._state(char, index) - except StopIteration: - return - if index == max_index and not self._scanning_list_variable_index(): - return - - def _scanning_list_variable_index(self): - return self._state in [self._waiting_list_variable_index_state, - self._list_variable_index_state] - - def _find_variable(self, string): - max_end_index = string.rfind('}') - if max_end_index == -1: - raise ValueError('No variable end found') - if self._is_escaped(string, max_end_index): - return self._find_variable(string[:max_end_index]) - start_index = self._find_start_index(string, 1, max_end_index) - if start_index == -1: - raise ValueError('No variable start found') - return start_index, max_end_index - - def _find_start_index(self, string, start, end): - index = string.find('{', start, end) - 1 - if index < 0: - return -1 - if self._start_index_is_ok(string, index): - return index - return self._find_start_index(string, index+2, end) - - def _start_index_is_ok(self, string, index): - return string[index] in self._identifiers\ - and not self._is_escaped(string, index) - - def _is_escaped(self, string, index): - escaped = False - while index > 0 and string[index-1] == '\\': - index -= 1 - escaped = not escaped - return escaped - - def _variable_state(self, char, index): - self._variable_chars.append(char) - if char == '}' and not self._is_escaped(self._string, index): - self._open_curly -= 1 - if self._open_curly == 0: - if not self._is_list_variable(): - raise StopIteration - self._state = self._waiting_list_variable_index_state - elif char in self._identifiers: - self._state = self._internal_variable_start_state - - def _is_list_variable(self): - return self._variable_chars[0] == '@' - - def _internal_variable_start_state(self, char, index): - self._state = self._variable_state - if char == '{': - self._variable_chars.append(char) - self._open_curly += 1 - self._may_have_internal_variables = True - else: - self._variable_state(char, index) - - def _waiting_list_variable_index_state(self, char, index): - if char != '[': - raise StopIteration - self._list_variable_index_chars.append(char) - self._state = self._list_variable_index_state - - def _list_variable_index_state(self, char, index): - self._list_variable_index_chars.append(char) - if char == ']': - raise StopIteration diff --git a/wakatime/packages/py3/pygments/lexers/ruby.py b/wakatime/packages/py3/pygments/lexers/ruby.py deleted file mode 100644 index d346df9..0000000 --- a/wakatime/packages/py3/pygments/lexers/ruby.py +++ /dev/null @@ -1,518 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.ruby - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Ruby and related languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, include, \ - bygroups, default, LexerContext, do_insertions, words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error, Generic -from pygments.util import shebang_matches - -__all__ = ['RubyLexer', 'RubyConsoleLexer', 'FancyLexer'] - -line_re = re.compile('.*?\n') - - -RUBY_OPERATORS = ( - '*', '**', '-', '+', '-@', '+@', '/', '%', '&', '|', '^', '`', '~', - '[]', '[]=', '<<', '>>', '<', '<>', '<=>', '>', '>=', '==', '===' -) - - -class RubyLexer(ExtendedRegexLexer): - """ - For `Ruby `_ source code. - """ - - name = 'Ruby' - aliases = ['rb', 'ruby', 'duby'] - filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', - '*.rbx', '*.duby'] - mimetypes = ['text/x-ruby', 'application/x-ruby'] - - flags = re.DOTALL | re.MULTILINE - - def heredoc_callback(self, match, ctx): - # okay, this is the hardest part of parsing Ruby... - # match: 1 = <<-?, 2 = quote? 3 = name 4 = quote? 5 = rest of line - - start = match.start(1) - yield start, Operator, match.group(1) # <<-? - yield match.start(2), String.Heredoc, match.group(2) # quote ", ', ` - yield match.start(3), Name.Constant, match.group(3) # heredoc name - yield match.start(4), String.Heredoc, match.group(4) # quote again - - heredocstack = ctx.__dict__.setdefault('heredocstack', []) - outermost = not bool(heredocstack) - heredocstack.append((match.group(1) == '<<-', match.group(3))) - - ctx.pos = match.start(5) - ctx.end = match.end(5) - # this may find other heredocs - for i, t, v in self.get_tokens_unprocessed(context=ctx): - yield i, t, v - ctx.pos = match.end() - - if outermost: - # this is the outer heredoc again, now we can process them all - for tolerant, hdname in heredocstack: - lines = [] - for match in line_re.finditer(ctx.text, ctx.pos): - if tolerant: - check = match.group().strip() - else: - check = match.group().rstrip() - if check == hdname: - for amatch in lines: - yield amatch.start(), String.Heredoc, amatch.group() - yield match.start(), Name.Constant, match.group() - ctx.pos = match.end() - break - else: - lines.append(match) - else: - # end of heredoc not found -- error! - for amatch in lines: - yield amatch.start(), Error, amatch.group() - ctx.end = len(ctx.text) - del heredocstack[:] - - def gen_rubystrings_rules(): - def intp_regex_callback(self, match, ctx): - yield match.start(1), String.Regex, match.group(1) # begin - nctx = LexerContext(match.group(3), 0, ['interpolated-regex']) - for i, t, v in self.get_tokens_unprocessed(context=nctx): - yield match.start(3)+i, t, v - yield match.start(4), String.Regex, match.group(4) # end[mixounse]* - ctx.pos = match.end() - - def intp_string_callback(self, match, ctx): - yield match.start(1), String.Other, match.group(1) - nctx = LexerContext(match.group(3), 0, ['interpolated-string']) - for i, t, v in self.get_tokens_unprocessed(context=nctx): - yield match.start(3)+i, t, v - yield match.start(4), String.Other, match.group(4) # end - ctx.pos = match.end() - - states = {} - states['strings'] = [ - # easy ones - (r'\:@{0,2}[a-zA-Z_]\w*[!?]?', String.Symbol), - (words(RUBY_OPERATORS, prefix=r'\:@{0,2}'), String.Symbol), - (r":'(\\\\|\\'|[^'])*'", String.Symbol), - (r"'(\\\\|\\'|[^'])*'", String.Single), - (r':"', String.Symbol, 'simple-sym'), - (r'([a-zA-Z_]\w*)(:)(?!:)', - bygroups(String.Symbol, Punctuation)), # Since Ruby 1.9 - (r'"', String.Double, 'simple-string'), - (r'(?', '<>', 'ab'): - states[name+'-intp-string'] = [ - (r'\\[\\' + bracecc + ']', String.Other), - (lbrace, String.Other, '#push'), - (rbrace, String.Other, '#pop'), - include('string-intp-escaped'), - (r'[\\#' + bracecc + ']', String.Other), - (r'[^\\#' + bracecc + ']+', String.Other), - ] - states['strings'].append((r'%[QWx]?' + lbrace, String.Other, - name+'-intp-string')) - states[name+'-string'] = [ - (r'\\[\\' + bracecc + ']', String.Other), - (lbrace, String.Other, '#push'), - (rbrace, String.Other, '#pop'), - (r'[\\#' + bracecc + ']', String.Other), - (r'[^\\#' + bracecc + ']+', String.Other), - ] - states['strings'].append((r'%[qsw]' + lbrace, String.Other, - name+'-string')) - states[name+'-regex'] = [ - (r'\\[\\' + bracecc + ']', String.Regex), - (lbrace, String.Regex, '#push'), - (rbrace + '[mixounse]*', String.Regex, '#pop'), - include('string-intp'), - (r'[\\#' + bracecc + ']', String.Regex), - (r'[^\\#' + bracecc + ']+', String.Regex), - ] - states['strings'].append((r'%r' + lbrace, String.Regex, - name+'-regex')) - - # these must come after %! - states['strings'] += [ - # %r regex - (r'(%r([\W_]))((?:\\\2|(?!\2).)*)(\2[mixounse]*)', - intp_regex_callback), - # regular fancy strings with qsw - (r'%[qsw]([\W_])((?:\\\1|(?!\1).)*)\1', String.Other), - (r'(%[QWx]([\W_]))((?:\\\2|(?!\2).)*)(\2)', - intp_string_callback), - # special forms of fancy strings after operators or - # in method calls with braces - (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)', - bygroups(Text, String.Other, None)), - # and because of fixed width lookbehinds the whole thing a - # second time for line startings... - (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)', - bygroups(Text, String.Other, None)), - # all regular fancy strings without qsw - (r'(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)', - intp_string_callback), - ] - - return states - - tokens = { - 'root': [ - (r'#.*?$', Comment.Single), - (r'=begin\s.*?\n=end.*?$', Comment.Multiline), - # keywords - (words(( - 'BEGIN', 'END', 'alias', 'begin', 'break', 'case', 'defined?', - 'do', 'else', 'elsif', 'end', 'ensure', 'for', 'if', 'in', 'next', 'redo', - 'rescue', 'raise', 'retry', 'return', 'super', 'then', 'undef', - 'unless', 'until', 'when', 'while', 'yield'), suffix=r'\b'), - Keyword), - # start of function, class and module names - (r'(module)(\s+)([a-zA-Z_]\w*' - r'(?:::[a-zA-Z_]\w*)*)', - bygroups(Keyword, Text, Name.Namespace)), - (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'), - (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'), - (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), - # special methods - (words(( - 'initialize', 'new', 'loop', 'include', 'extend', 'raise', 'attr_reader', - 'attr_writer', 'attr_accessor', 'attr', 'catch', 'throw', 'private', - 'module_function', 'public', 'protected', 'true', 'false', 'nil'), - suffix=r'\b'), - Keyword.Pseudo), - (r'(not|and|or)\b', Operator.Word), - (words(( - 'autoload', 'block_given', 'const_defined', 'eql', 'equal', 'frozen', 'include', - 'instance_of', 'is_a', 'iterator', 'kind_of', 'method_defined', 'nil', - 'private_method_defined', 'protected_method_defined', - 'public_method_defined', 'respond_to', 'tainted'), suffix=r'\?'), - Name.Builtin), - (r'(chomp|chop|exit|gsub|sub)!', Name.Builtin), - (words(( - 'Array', 'Float', 'Integer', 'String', '__id__', '__send__', 'abort', - 'ancestors', 'at_exit', 'autoload', 'binding', 'callcc', 'caller', - 'catch', 'chomp', 'chop', 'class_eval', 'class_variables', - 'clone', 'const_defined?', 'const_get', 'const_missing', 'const_set', - 'constants', 'display', 'dup', 'eval', 'exec', 'exit', 'extend', 'fail', 'fork', - 'format', 'freeze', 'getc', 'gets', 'global_variables', 'gsub', - 'hash', 'id', 'included_modules', 'inspect', 'instance_eval', - 'instance_method', 'instance_methods', - 'instance_variable_get', 'instance_variable_set', 'instance_variables', - 'lambda', 'load', 'local_variables', 'loop', - 'method', 'method_missing', 'methods', 'module_eval', 'name', - 'object_id', 'open', 'p', 'print', 'printf', 'private_class_method', - 'private_instance_methods', - 'private_methods', 'proc', 'protected_instance_methods', - 'protected_methods', 'public_class_method', - 'public_instance_methods', 'public_methods', - 'putc', 'puts', 'raise', 'rand', 'readline', 'readlines', 'require', - 'scan', 'select', 'self', 'send', 'set_trace_func', 'singleton_methods', 'sleep', - 'split', 'sprintf', 'srand', 'sub', 'syscall', 'system', 'taint', - 'test', 'throw', 'to_a', 'to_s', 'trace_var', 'trap', 'untaint', - 'untrace_var', 'warn'), prefix=r'(?~!:])|' - r'(?<=(?:\s|;)when\s)|' - r'(?<=(?:\s|;)or\s)|' - r'(?<=(?:\s|;)and\s)|' - r'(?<=(?:\s|;|\.)index\s)|' - r'(?<=(?:\s|;|\.)scan\s)|' - r'(?<=(?:\s|;|\.)sub\s)|' - r'(?<=(?:\s|;|\.)sub!\s)|' - r'(?<=(?:\s|;|\.)gsub\s)|' - r'(?<=(?:\s|;|\.)gsub!\s)|' - r'(?<=(?:\s|;|\.)match\s)|' - r'(?<=(?:\s|;)if\s)|' - r'(?<=(?:\s|;)elsif\s)|' - r'(?<=^when\s)|' - r'(?<=^index\s)|' - r'(?<=^scan\s)|' - r'(?<=^sub\s)|' - r'(?<=^gsub\s)|' - r'(?<=^sub!\s)|' - r'(?<=^gsub!\s)|' - r'(?<=^match\s)|' - r'(?<=^if\s)|' - r'(?<=^elsif\s)' - r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'), - # multiline regex (in method calls or subscripts) - (r'(?<=\(|,|\[)/', String.Regex, 'multiline-regex'), - # multiline regex (this time the funny no whitespace rule) - (r'(\s+)(/)(?![\s=])', bygroups(Text, String.Regex), - 'multiline-regex'), - # lex numbers and ignore following regular expressions which - # are division operators in fact (grrrr. i hate that. any - # better ideas?) - # since pygments 0.7 we also eat a "?" operator after numbers - # so that the char operator does not work. Chars are not allowed - # there so that you can use the ternary operator. - # stupid example: - # x>=0?n[x]:"" - (r'(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?', - bygroups(Number.Oct, Text, Operator)), - (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', - bygroups(Number.Hex, Text, Operator)), - (r'(0b[01]+(?:_[01]+)*)(\s*)([/?])?', - bygroups(Number.Bin, Text, Operator)), - (r'([\d]+(?:_\d+)*)(\s*)([/?])?', - bygroups(Number.Integer, Text, Operator)), - # Names - (r'@@[a-zA-Z_]\w*', Name.Variable.Class), - (r'@[a-zA-Z_]\w*', Name.Variable.Instance), - (r'\$\w+', Name.Variable.Global), - (r'\$[!@&`\'+~=/\\,;.<>_*$?:"^-]', Name.Variable.Global), - (r'\$-[0adFiIlpvw]', Name.Variable.Global), - (r'::', Operator), - include('strings'), - # chars - (r'\?(\\[MC]-)*' # modifiers - r'(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)' - r'(?!\w)', - String.Char), - (r'[A-Z]\w+', Name.Constant), - # this is needed because ruby attributes can look - # like keywords (class) or like this: ` ?!? - (words(RUBY_OPERATORS, prefix=r'(\.|::)'), - bygroups(Operator, Name.Operator)), - (r'(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])', - bygroups(Operator, Name)), - (r'[a-zA-Z_]\w*[!?]?', Name), - (r'(\[|\]|\*\*|<>?|>=|<=|<=>|=~|={3}|' - r'!~|&&?|\|\||\.{1,3})', Operator), - (r'[-+/*%=<>&!^|~]=?', Operator), - (r'[(){};,/?:\\]', Punctuation), - (r'\s+', Text) - ], - 'funcname': [ - (r'\(', Punctuation, 'defexpr'), - (r'(?:([a-zA-Z_]\w*)(\.))?' - r'([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|' - r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)', - bygroups(Name.Class, Operator, Name.Function), '#pop'), - default('#pop') - ], - 'classname': [ - (r'\(', Punctuation, 'defexpr'), - (r'<<', Operator, '#pop'), - (r'[A-Z_]\w*', Name.Class, '#pop'), - default('#pop') - ], - 'defexpr': [ - (r'(\))(\.|::)?', bygroups(Punctuation, Operator), '#pop'), - (r'\(', Operator, '#push'), - include('root') - ], - 'in-intp': [ - (r'\{', String.Interpol, '#push'), - (r'\}', String.Interpol, '#pop'), - include('root'), - ], - 'string-intp': [ - (r'#\{', String.Interpol, 'in-intp'), - (r'#@@?[a-zA-Z_]\w*', String.Interpol), - (r'#\$[a-zA-Z_]\w*', String.Interpol) - ], - 'string-intp-escaped': [ - include('string-intp'), - (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})', - String.Escape) - ], - 'interpolated-regex': [ - include('string-intp'), - (r'[\\#]', String.Regex), - (r'[^\\#]+', String.Regex), - ], - 'interpolated-string': [ - include('string-intp'), - (r'[\\#]', String.Other), - (r'[^\\#]+', String.Other), - ], - 'multiline-regex': [ - include('string-intp'), - (r'\\\\', String.Regex), - (r'\\/', String.Regex), - (r'[\\#]', String.Regex), - (r'[^\\/#]+', String.Regex), - (r'/[mixounse]*', String.Regex, '#pop'), - ], - 'end-part': [ - (r'.+', Comment.Preproc, '#pop') - ] - } - tokens.update(gen_rubystrings_rules()) - - def analyse_text(text): - return shebang_matches(text, r'ruby(1\.\d)?') - - -class RubyConsoleLexer(Lexer): - """ - For Ruby interactive console (**irb**) output like: - - .. sourcecode:: rbcon - - irb(main):001:0> a = 1 - => 1 - irb(main):002:0> puts a - 1 - => nil - """ - name = 'Ruby irb session' - aliases = ['rbcon', 'irb'] - mimetypes = ['text/x-ruby-shellsession'] - - _prompt_re = re.compile('irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] ' - '|>> |\?> ') - - def get_tokens_unprocessed(self, text): - rblexer = RubyLexer(**self.options) - - curcode = '' - insertions = [] - for match in line_re.finditer(text): - line = match.group() - m = self._prompt_re.match(line) - if m is not None: - end = m.end() - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:end])])) - curcode += line[end:] - else: - if curcode: - for item in do_insertions( - insertions, rblexer.get_tokens_unprocessed(curcode)): - yield item - curcode = '' - insertions = [] - yield match.start(), Generic.Output, line - if curcode: - for item in do_insertions( - insertions, rblexer.get_tokens_unprocessed(curcode)): - yield item - - -class FancyLexer(RegexLexer): - """ - Pygments Lexer For `Fancy `_. - - Fancy is a self-hosted, pure object-oriented, dynamic, - class-based, concurrent general-purpose programming language - running on Rubinius, the Ruby VM. - - .. versionadded:: 1.5 - """ - name = 'Fancy' - filenames = ['*.fy', '*.fancypack'] - aliases = ['fancy', 'fy'] - mimetypes = ['text/x-fancysrc'] - - tokens = { - # copied from PerlLexer: - 'balanced-regex': [ - (r'/(\\\\|\\/|[^/])*/[egimosx]*', String.Regex, '#pop'), - (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'), - (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'), - (r'\{(\\\\|\\\}|[^}])*\}[egimosx]*', String.Regex, '#pop'), - (r'<(\\\\|\\>|[^>])*>[egimosx]*', String.Regex, '#pop'), - (r'\[(\\\\|\\\]|[^\]])*\][egimosx]*', String.Regex, '#pop'), - (r'\((\\\\|\\\)|[^)])*\)[egimosx]*', String.Regex, '#pop'), - (r'@(\\\\|\\@|[^@])*@[egimosx]*', String.Regex, '#pop'), - (r'%(\\\\|\\%|[^%])*%[egimosx]*', String.Regex, '#pop'), - (r'\$(\\\\|\\\$|[^$])*\$[egimosx]*', String.Regex, '#pop'), - ], - 'root': [ - (r'\s+', Text), - - # balanced delimiters (copied from PerlLexer): - (r's\{(\\\\|\\\}|[^}])*\}\s*', String.Regex, 'balanced-regex'), - (r's<(\\\\|\\>|[^>])*>\s*', String.Regex, 'balanced-regex'), - (r's\[(\\\\|\\\]|[^\]])*\]\s*', String.Regex, 'balanced-regex'), - (r's\((\\\\|\\\)|[^)])*\)\s*', String.Regex, 'balanced-regex'), - (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex), - (r'm(?=[/!\\{<\[(@%$])', String.Regex, 'balanced-regex'), - - # Comments - (r'#(.*?)\n', Comment.Single), - # Symbols - (r'\'([^\'\s\[\](){}]+|\[\])', String.Symbol), - # Multi-line DoubleQuotedString - (r'"""(\\\\|\\"|[^"])*"""', String), - # DoubleQuotedString - (r'"(\\\\|\\"|[^"])*"', String), - # keywords - (r'(def|class|try|catch|finally|retry|return|return_local|match|' - r'case|->|=>)\b', Keyword), - # constants - (r'(self|super|nil|false|true)\b', Name.Constant), - (r'[(){};,/?|:\\]', Punctuation), - # names - (words(( - 'Object', 'Array', 'Hash', 'Directory', 'File', 'Class', 'String', - 'Number', 'Enumerable', 'FancyEnumerable', 'Block', 'TrueClass', - 'NilClass', 'FalseClass', 'Tuple', 'Symbol', 'Stack', 'Set', - 'FancySpec', 'Method', 'Package', 'Range'), suffix=r'\b'), - Name.Builtin), - # functions - (r'[a-zA-Z](\w|[-+?!=*/^><%])*:', Name.Function), - # operators, must be below functions - (r'[-+*/~,<>=&!?%^\[\].$]+', Operator), - ('[A-Z]\w*', Name.Constant), - ('@[a-zA-Z_]\w*', Name.Variable.Instance), - ('@@[a-zA-Z_]\w*', Name.Variable.Class), - ('@@?', Operator), - ('[a-zA-Z_]\w*', Name), - # numbers - / checks are necessary to avoid mismarking regexes, - # see comment in RubyLexer - (r'(0[oO]?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?', - bygroups(Number.Oct, Text, Operator)), - (r'(0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', - bygroups(Number.Hex, Text, Operator)), - (r'(0[bB][01]+(?:_[01]+)*)(\s*)([/?])?', - bygroups(Number.Bin, Text, Operator)), - (r'([\d]+(?:_\d+)*)(\s*)([/?])?', - bygroups(Number.Integer, Text, Operator)), - (r'\d+([eE][+-]?[0-9]+)|\d+\.\d+([eE][+-]?[0-9]+)?', Number.Float), - (r'\d+', Number.Integer) - ] - } diff --git a/wakatime/packages/py3/pygments/lexers/rust.py b/wakatime/packages/py3/pygments/lexers/rust.py deleted file mode 100644 index 4447e1d..0000000 --- a/wakatime/packages/py3/pygments/lexers/rust.py +++ /dev/null @@ -1,167 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.rust - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for the Rust language. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from pygments.lexer import RegexLexer, include, bygroups, words, default -from pygments.token import Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Whitespace - -__all__ = ['RustLexer'] - - -class RustLexer(RegexLexer): - """ - Lexer for the Rust programming language (version 0.9). - - .. versionadded:: 1.6 - """ - name = 'Rust' - filenames = ['*.rs'] - aliases = ['rust'] - mimetypes = ['text/x-rustsrc'] - - tokens = { - 'root': [ - # Whitespace and Comments - (r'\n', Whitespace), - (r'\s+', Whitespace), - (r'//[/!](.*?)\n', Comment.Doc), - (r'//(.*?)\n', Comment.Single), - (r'/\*', Comment.Multiline, 'comment'), - - # Lifetime - (r"""'[a-zA-Z_]\w*""", Name.Label), - # Macro parameters - (r"""\$([a-zA-Z_]\w*|\(,?|\),?|,?)""", Comment.Preproc), - # Keywords - (words(( - 'as', 'box', 'break', 'continue', 'do', 'else', 'enum', 'extern', - 'fn', 'for', 'if', 'impl', 'in', 'loop', 'match', 'mut', 'priv', - 'proc', 'pub', 'ref', 'return', 'static', '\'static', 'struct', - 'trait', 'true', 'type', 'unsafe', 'while'), suffix=r'\b'), - Keyword), - (words(('alignof', 'be', 'const', 'offsetof', 'pure', 'sizeof', - 'typeof', 'once', 'unsized', 'yield'), suffix=r'\b'), - Keyword.Reserved), - (r'(mod|use)\b', Keyword.Namespace), - (r'(true|false)\b', Keyword.Constant), - (r'let\b', Keyword.Declaration), - (words(('u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64', 'uint', - 'int', 'f32', 'f64', 'str', 'bool'), suffix=r'\b'), - Keyword.Type), - (r'self\b', Name.Builtin.Pseudo), - # Prelude - (words(( - 'Freeze', 'Pod', 'Send', 'Sized', 'Add', 'Sub', 'Mul', 'Div', 'Rem', 'Neg', 'Not', 'BitAnd', - 'BitOr', 'BitXor', 'Drop', 'Shl', 'Shr', 'Index', 'Option', 'Some', 'None', 'Result', - 'Ok', 'Err', 'from_str', 'range', 'print', 'println', 'Any', 'AnyOwnExt', 'AnyRefExt', - 'AnyMutRefExt', 'Ascii', 'AsciiCast', 'OnwedAsciiCast', 'AsciiStr', - 'IntoBytes', 'Bool', 'ToCStr', 'Char', 'Clone', 'DeepClone', 'Eq', 'ApproxEq', - 'Ord', 'TotalEq', 'Ordering', 'Less', 'Equal', 'Greater', 'Equiv', 'Container', - 'Mutable', 'Map', 'MutableMap', 'Set', 'MutableSet', 'Default', 'FromStr', - 'Hash', 'FromIterator', 'Extendable', 'Iterator', 'DoubleEndedIterator', - 'RandomAccessIterator', 'CloneableIterator', 'OrdIterator', - 'MutableDoubleEndedIterator', 'ExactSize', 'Times', 'Algebraic', - 'Trigonometric', 'Exponential', 'Hyperbolic', 'Bitwise', 'BitCount', - 'Bounded', 'Integer', 'Fractional', 'Real', 'RealExt', 'Num', 'NumCast', - 'CheckedAdd', 'CheckedSub', 'CheckedMul', 'Orderable', 'Signed', - 'Unsigned', 'Round', 'Primitive', 'Int', 'Float', 'ToStrRadix', - 'ToPrimitive', 'FromPrimitive', 'GenericPath', 'Path', 'PosixPath', - 'WindowsPath', 'RawPtr', 'Buffer', 'Writer', 'Reader', 'Seek', - 'SendStr', 'SendStrOwned', 'SendStrStatic', 'IntoSendStr', 'Str', - 'StrVector', 'StrSlice', 'OwnedStr', 'IterBytes', 'ToStr', 'IntoStr', - 'CopyableTuple', 'ImmutableTuple', 'ImmutableEqVector', 'ImmutableTotalOrdVector', - 'ImmutableCopyableVector', 'OwnedVector', 'OwnedCopyableVector', - 'OwnedEqVector', 'MutableVector', 'MutableTotalOrdVector', - 'Vector', 'VectorVector', 'CopyableVector', 'ImmutableVector', - 'Port', 'Chan', 'SharedChan', 'spawn', 'drop'), suffix=r'\b'), - Name.Builtin), - (r'(ImmutableTuple\d+|Tuple\d+)\b', Name.Builtin), - # Borrowed pointer - (r'(&)(\'[A-Za-z_]\w*)?', bygroups(Operator, Name)), - # Labels - (r'\'[A-Za-z_]\w*:', Name.Label), - # Character Literal - (r"""'(\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}""" - r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|.)'""", - String.Char), - # Binary Literal - (r'0b[01_]+', Number.Bin, 'number_lit'), - # Octal Literal - (r'0o[0-7_]+', Number.Oct, 'number_lit'), - # Hexadecimal Literal - (r'0[xX][0-9a-fA-F_]+', Number.Hex, 'number_lit'), - # Decimal Literal - (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|' - r'\.[0-9_]*|[eE][+\-]?[0-9_]+)', Number.Float, 'number_lit'), - (r'[0-9][0-9_]*', Number.Integer, 'number_lit'), - # String Literal - (r'"', String, 'string'), - (r'r(#*)".*?"\1', String.Raw), - - # Operators and Punctuation - (r'[{}()\[\],.;]', Punctuation), - (r'[+\-*/%&|<>^!~@=:?]', Operator), - - # Identifier - (r'[a-zA-Z_]\w*', Name), - - # Attributes - (r'#!?\[', Comment.Preproc, 'attribute['), - # Macros - (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)', - bygroups(Comment.Preproc, Punctuation, Whitespace, Name, - Whitespace, Punctuation), 'macro{'), - (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\()', - bygroups(Comment.Preproc, Punctuation, Whitespace, Name, - Punctuation), 'macro('), - ], - 'comment': [ - (r'[^*/]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline), - ], - 'number_lit': [ - (r'[ui](8|16|32|64)', Keyword, '#pop'), - (r'f(32|64)', Keyword, '#pop'), - default('#pop'), - ], - 'string': [ - (r'"', String, '#pop'), - (r"""\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}""" - r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}""", String.Escape), - (r'[^\\"]+', String), - (r'\\', String), - ], - 'macro{': [ - (r'\{', Operator, '#push'), - (r'\}', Operator, '#pop'), - ], - 'macro(': [ - (r'\(', Operator, '#push'), - (r'\)', Operator, '#pop'), - ], - 'attribute_common': [ - (r'"', String, 'string'), - (r'\[', Comment.Preproc, 'attribute['), - (r'\(', Comment.Preproc, 'attribute('), - ], - 'attribute[': [ - include('attribute_common'), - (r'\];?', Comment.Preproc, '#pop'), - (r'[^"\]]+', Comment.Preproc), - ], - 'attribute(': [ - include('attribute_common'), - (r'\);?', Comment.Preproc, '#pop'), - (r'[^")]+', Comment.Preproc), - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/scripting.py b/wakatime/packages/py3/pygments/lexers/scripting.py deleted file mode 100644 index 678cab2..0000000 --- a/wakatime/packages/py3/pygments/lexers/scripting.py +++ /dev/null @@ -1,923 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.scripting - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lexer for scripting and embedded languages. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import RegexLexer, include, bygroups, default, combined, \ - words -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Punctuation, Error, Whitespace -from pygments.util import get_bool_opt, get_list_opt, iteritems - -__all__ = ['LuaLexer', 'MoonScriptLexer', 'ChaiscriptLexer', 'LSLLexer', - 'AppleScriptLexer', 'RexxLexer', 'MOOCodeLexer', 'HybrisLexer'] - - -class LuaLexer(RegexLexer): - """ - For `Lua `_ source code. - - Additional options accepted: - - `func_name_highlighting` - If given and ``True``, highlight builtin function names - (default: ``True``). - `disabled_modules` - If given, must be a list of module names whose function names - should not be highlighted. By default all modules are highlighted. - - To get a list of allowed modules have a look into the - `_lua_builtins` module: - - .. sourcecode:: pycon - - >>> from pygments.lexers._lua_builtins import MODULES - >>> MODULES.keys() - ['string', 'coroutine', 'modules', 'io', 'basic', ...] - """ - - name = 'Lua' - aliases = ['lua'] - filenames = ['*.lua', '*.wlua'] - mimetypes = ['text/x-lua', 'application/x-lua'] - - tokens = { - 'root': [ - # lua allows a file to start with a shebang - (r'#!(.*?)$', Comment.Preproc), - default('base'), - ], - 'base': [ - (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline), - ('--.*$', Comment.Single), - - (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float), - (r'(?i)\d+e[+-]?\d+', Number.Float), - ('(?i)0x[0-9a-f]*', Number.Hex), - (r'\d+', Number.Integer), - - (r'\n', Text), - (r'[^\S\n]', Text), - # multiline strings - (r'(?s)\[(=*)\[.*?\]\1\]', String), - - (r'(==|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#])', Operator), - (r'[\[\]{}().,:;]', Punctuation), - (r'(and|or|not)\b', Operator.Word), - - ('(break|do|else|elseif|end|for|if|in|repeat|return|then|until|' - r'while)\b', Keyword), - (r'(local)\b', Keyword.Declaration), - (r'(true|false|nil)\b', Keyword.Constant), - - (r'(function)\b', Keyword, 'funcname'), - - (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name), - - ("'", String.Single, combined('stringescape', 'sqs')), - ('"', String.Double, combined('stringescape', 'dqs')) - ], - - 'funcname': [ - (r'\s+', Text), - ('(?:([A-Za-z_]\w*)(\.))?([A-Za-z_]\w*)', - bygroups(Name.Class, Punctuation, Name.Function), '#pop'), - # inline function - ('\(', Punctuation, '#pop'), - ], - - # if I understand correctly, every character is valid in a lua string, - # so this state is only for later corrections - 'string': [ - ('.', String) - ], - - 'stringescape': [ - (r'''\\([abfnrtv\\"']|\d{1,3})''', String.Escape) - ], - - 'sqs': [ - ("'", String, '#pop'), - include('string') - ], - - 'dqs': [ - ('"', String, '#pop'), - include('string') - ] - } - - def __init__(self, **options): - self.func_name_highlighting = get_bool_opt( - options, 'func_name_highlighting', True) - self.disabled_modules = get_list_opt(options, 'disabled_modules', []) - - self._functions = set() - if self.func_name_highlighting: - from pygments.lexers._lua_builtins import MODULES - for mod, func in iteritems(MODULES): - if mod not in self.disabled_modules: - self._functions.update(func) - RegexLexer.__init__(self, **options) - - def get_tokens_unprocessed(self, text): - for index, token, value in \ - RegexLexer.get_tokens_unprocessed(self, text): - if token is Name: - if value in self._functions: - yield index, Name.Builtin, value - continue - elif '.' in value: - a, b = value.split('.') - yield index, Name, a - yield index + len(a), Punctuation, u'.' - yield index + len(a) + 1, Name, b - continue - yield index, token, value - - -class MoonScriptLexer(LuaLexer): - """ - For `MoonScript `_ source code. - - .. versionadded:: 1.5 - """ - - name = "MoonScript" - aliases = ["moon", "moonscript"] - filenames = ["*.moon"] - mimetypes = ['text/x-moonscript', 'application/x-moonscript'] - - tokens = { - 'root': [ - (r'#!(.*?)$', Comment.Preproc), - default('base'), - ], - 'base': [ - ('--.*$', Comment.Single), - (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float), - (r'(?i)\d+e[+-]?\d+', Number.Float), - (r'(?i)0x[0-9a-f]*', Number.Hex), - (r'\d+', Number.Integer), - (r'\n', Text), - (r'[^\S\n]+', Text), - (r'(?s)\[(=*)\[.*?\]\1\]', String), - (r'(->|=>)', Name.Function), - (r':[a-zA-Z_]\w*', Name.Variable), - (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator), - (r'[;,]', Punctuation), - (r'[\[\]{}()]', Keyword.Type), - (r'[a-zA-Z_]\w*:', Name.Variable), - (words(( - 'class', 'extends', 'if', 'then', 'super', 'do', 'with', - 'import', 'export', 'while', 'elseif', 'return', 'for', 'in', - 'from', 'when', 'using', 'else', 'and', 'or', 'not', 'switch', - 'break'), suffix=r'\b'), - Keyword), - (r'(true|false|nil)\b', Keyword.Constant), - (r'(and|or|not)\b', Operator.Word), - (r'(self)\b', Name.Builtin.Pseudo), - (r'@@?([a-zA-Z_]\w*)?', Name.Variable.Class), - (r'[A-Z]\w*', Name.Class), # proper name - (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name), - ("'", String.Single, combined('stringescape', 'sqs')), - ('"', String.Double, combined('stringescape', 'dqs')) - ], - 'stringescape': [ - (r'''\\([abfnrtv\\"']|\d{1,3})''', String.Escape) - ], - 'sqs': [ - ("'", String.Single, '#pop'), - (".", String) - ], - 'dqs': [ - ('"', String.Double, '#pop'), - (".", String) - ] - } - - def get_tokens_unprocessed(self, text): - # set . as Operator instead of Punctuation - for index, token, value in LuaLexer.get_tokens_unprocessed(self, text): - if token == Punctuation and value == ".": - token = Operator - yield index, token, value - - -class ChaiscriptLexer(RegexLexer): - """ - For `ChaiScript `_ source code. - - .. versionadded:: 2.0 - """ - - name = 'ChaiScript' - aliases = ['chai', 'chaiscript'] - filenames = ['*.chai'] - mimetypes = ['text/x-chaiscript', 'application/x-chaiscript'] - - flags = re.DOTALL | re.MULTILINE - - tokens = { - 'commentsandwhitespace': [ - (r'\s+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'^\#.*?\n', Comment.Single) - ], - 'slashstartsregex': [ - include('commentsandwhitespace'), - (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' - r'([gim]+\b|\B)', String.Regex, '#pop'), - (r'(?=/)', Text, ('#pop', 'badregex')), - default('#pop') - ], - 'badregex': [ - (r'\n', Text, '#pop') - ], - 'root': [ - include('commentsandwhitespace'), - (r'\n', Text), - (r'[^\S\n]+', Text), - (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|\.\.' - r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'), - (r'[{(\[;,]', Punctuation, 'slashstartsregex'), - (r'[})\].]', Punctuation), - (r'[=+\-*/]', Operator), - (r'(for|in|while|do|break|return|continue|if|else|' - r'throw|try|catch' - r')\b', Keyword, 'slashstartsregex'), - (r'(var)\b', Keyword.Declaration, 'slashstartsregex'), - (r'(attr|def|fun)\b', Keyword.Reserved), - (r'(true|false)\b', Keyword.Constant), - (r'(eval|throw)\b', Name.Builtin), - (r'`\S+`', Name.Builtin), - (r'[$a-zA-Z_]\w*', Name.Other), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-fA-F]+', Number.Hex), - (r'[0-9]+', Number.Integer), - (r'"', String.Double, 'dqstring'), - (r"'(\\\\|\\'|[^'])*'", String.Single), - ], - 'dqstring': [ - (r'\$\{[^"}]+?\}', String.Interpol), - (r'\$', String.Double), - (r'\\\\', String.Double), - (r'\\"', String.Double), - (r'[^\\"$]+', String.Double), - (r'"', String.Double, '#pop'), - ], - } - - -class LSLLexer(RegexLexer): - """ - For Second Life's Linden Scripting Language source code. - - .. versionadded:: 2.0 - """ - - name = 'LSL' - aliases = ['lsl'] - filenames = ['*.lsl'] - mimetypes = ['text/x-lsl'] - - flags = re.MULTILINE - - lsl_keywords = r'\b(?:do|else|for|if|jump|return|while)\b' - lsl_types = r'\b(?:float|integer|key|list|quaternion|rotation|string|vector)\b' - lsl_states = r'\b(?:(?:state)\s+\w+|default)\b' - lsl_events = r'\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\b' - lsl_functions_builtin = r'\b(?:ll(?:ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|RequestPermissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\b' - lsl_constants_float = r'\b(?:DEG_TO_RAD|PI(?:_BY_TWO)?|RAD_TO_DEG|SQRT2|TWO_PI)\b' - lsl_constants_integer = r'\b(?:JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASSIVE|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_ON_REZ|NAME|DESC|POS|PRIM_EQUIVALENCE|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|ROO?T|VELOCITY|OWNER|GROUP|CREATOR|ATTACHED_POINT|RENDER_WEIGHT|PATHFINDING_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?))|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE|SET_MODE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[A-D]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\b' - lsl_constants_integer_boolean = r'\b(?:FALSE|TRUE)\b' - lsl_constants_rotation = r'\b(?:ZERO_ROTATION)\b' - lsl_constants_string = r'\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\b' - lsl_constants_vector = r'\b(?:TOUCH_INVALID_(?:TEXCOORD|VECTOR)|ZERO_VECTOR)\b' - lsl_invalid_broken = r'\b(?:LAND_(?:LARGE|MEDIUM|SMALL)_BRUSH)\b' - lsl_invalid_deprecated = r'\b(?:ATTACH_[LR]PEC|DATA_RATING|OBJECT_ATTACHMENT_(?:GEOMETRY_BYTES|SURFACE_AREA)|PRIM_(?:CAST_SHADOWS|MATERIAL_LIGHT|TYPE_LEGACY)|PSYS_SRC_(?:INNER|OUTER)ANGLE|VEHICLE_FLAG_NO_FLY_UP|ll(?:Cloud|Make(?:Explosion|Fountain|Smoke|Fire)|RemoteDataSetRegion|Sound(?:Preload)?|XorBase64Strings(?:Correct)?))\b' - lsl_invalid_illegal = r'\b(?:event)\b' - lsl_invalid_unimplemented = r'\b(?:CHARACTER_(?:MAX_ANGULAR_(?:ACCEL|SPEED)|TURN_SPEED_MULTIPLIER)|PERMISSION_(?:CHANGE_(?:JOINTS|PERMISSIONS)|RELEASE_OWNERSHIP|REMAP_CONTROLS)|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|ll(?:CollisionSprite|(?:Stop)?PointAt|(?:(?:Refresh|Set)Prim)URL|(?:Take|Release)Camera|RemoteLoadScript))\b' - lsl_reserved_godmode = r'\b(?:ll(?:GodLikeRezObject|Set(?:Inventory|Object)PermMask))\b' - lsl_reserved_log = r'\b(?:print)\b' - lsl_operators = r'\+\+|\-\-|<<|>>|&&?|\|\|?|\^|~|[!%<>=*+\-/]=?' - - tokens = { - 'root': - [ - (r'//.*?\n', Comment.Single), - (r'/\*', Comment.Multiline, 'comment'), - (r'"', String.Double, 'string'), - (lsl_keywords, Keyword), - (lsl_types, Keyword.Type), - (lsl_states, Name.Class), - (lsl_events, Name.Builtin), - (lsl_functions_builtin, Name.Function), - (lsl_constants_float, Keyword.Constant), - (lsl_constants_integer, Keyword.Constant), - (lsl_constants_integer_boolean, Keyword.Constant), - (lsl_constants_rotation, Keyword.Constant), - (lsl_constants_string, Keyword.Constant), - (lsl_constants_vector, Keyword.Constant), - (lsl_invalid_broken, Error), - (lsl_invalid_deprecated, Error), - (lsl_invalid_illegal, Error), - (lsl_invalid_unimplemented, Error), - (lsl_reserved_godmode, Keyword.Reserved), - (lsl_reserved_log, Keyword.Reserved), - (r'\b([a-zA-Z_]\w*)\b', Name.Variable), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d*', Number.Float), - (r'(\d+\.\d*|\.\d+)', Number.Float), - (r'0[xX][0-9a-fA-F]+', Number.Hex), - (r'\d+', Number.Integer), - (lsl_operators, Operator), - (r':=?', Error), - (r'[,;{}()\[\]]', Punctuation), - (r'\n+', Whitespace), - (r'\s+', Whitespace) - ], - 'comment': - [ - (r'[^*/]+', Comment.Multiline), - (r'/\*', Comment.Multiline, '#push'), - (r'\*/', Comment.Multiline, '#pop'), - (r'[*/]', Comment.Multiline) - ], - 'string': - [ - (r'\\([nt"\\])', String.Escape), - (r'"', String.Double, '#pop'), - (r'\\.', Error), - (r'[^"\\]+', String.Double), - ] - } - - -class AppleScriptLexer(RegexLexer): - """ - For `AppleScript source code - `_, - including `AppleScript Studio - `_. - Contributed by Andreas Amann . - - .. versionadded:: 1.0 - """ - - name = 'AppleScript' - aliases = ['applescript'] - filenames = ['*.applescript'] - - flags = re.MULTILINE | re.DOTALL - - Identifiers = r'[a-zA-Z]\w*' - - # XXX: use words() for all of these - Literals = ('AppleScript', 'current application', 'false', 'linefeed', - 'missing value', 'pi', 'quote', 'result', 'return', 'space', - 'tab', 'text item delimiters', 'true', 'version') - Classes = ('alias ', 'application ', 'boolean ', 'class ', 'constant ', - 'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ', - 'real ', 'record ', 'reference ', 'RGB color ', 'script ', - 'text ', 'unit types', '(?:Unicode )?text', 'string') - BuiltIn = ('attachment', 'attribute run', 'character', 'day', 'month', - 'paragraph', 'word', 'year') - HandlerParams = ('about', 'above', 'against', 'apart from', 'around', - 'aside from', 'at', 'below', 'beneath', 'beside', - 'between', 'for', 'given', 'instead of', 'on', 'onto', - 'out of', 'over', 'since') - Commands = ('ASCII (character|number)', 'activate', 'beep', 'choose URL', - 'choose application', 'choose color', 'choose file( name)?', - 'choose folder', 'choose from list', - 'choose remote application', 'clipboard info', - 'close( access)?', 'copy', 'count', 'current date', 'delay', - 'delete', 'display (alert|dialog)', 'do shell script', - 'duplicate', 'exists', 'get eof', 'get volume settings', - 'info for', 'launch', 'list (disks|folder)', 'load script', - 'log', 'make', 'mount volume', 'new', 'offset', - 'open( (for access|location))?', 'path to', 'print', 'quit', - 'random number', 'read', 'round', 'run( script)?', - 'say', 'scripting components', - 'set (eof|the clipboard to|volume)', 'store script', - 'summarize', 'system attribute', 'system info', - 'the clipboard', 'time to GMT', 'write', 'quoted form') - References = ('(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)', - 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', - 'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back', - 'before', 'behind', 'every', 'front', 'index', 'last', - 'middle', 'some', 'that', 'through', 'thru', 'where', 'whose') - Operators = ("and", "or", "is equal", "equals", "(is )?equal to", "is not", - "isn't", "isn't equal( to)?", "is not equal( to)?", - "doesn't equal", "does not equal", "(is )?greater than", - "comes after", "is not less than or equal( to)?", - "isn't less than or equal( to)?", "(is )?less than", - "comes before", "is not greater than or equal( to)?", - "isn't greater than or equal( to)?", - "(is )?greater than or equal( to)?", "is not less than", - "isn't less than", "does not come before", - "doesn't come before", "(is )?less than or equal( to)?", - "is not greater than", "isn't greater than", - "does not come after", "doesn't come after", "starts? with", - "begins? with", "ends? with", "contains?", "does not contain", - "doesn't contain", "is in", "is contained by", "is not in", - "is not contained by", "isn't contained by", "div", "mod", - "not", "(a )?(ref( to)?|reference to)", "is", "does") - Control = ('considering', 'else', 'error', 'exit', 'from', 'if', - 'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to', - 'try', 'until', 'using terms from', 'while', 'whith', - 'with timeout( of)?', 'with transaction', 'by', 'continue', - 'end', 'its?', 'me', 'my', 'return', 'of', 'as') - Declarations = ('global', 'local', 'prop(erty)?', 'set', 'get') - Reserved = ('but', 'put', 'returning', 'the') - StudioClasses = ('action cell', 'alert reply', 'application', 'box', - 'browser( cell)?', 'bundle', 'button( cell)?', 'cell', - 'clip view', 'color well', 'color-panel', - 'combo box( item)?', 'control', - 'data( (cell|column|item|row|source))?', 'default entry', - 'dialog reply', 'document', 'drag info', 'drawer', - 'event', 'font(-panel)?', 'formatter', - 'image( (cell|view))?', 'matrix', 'menu( item)?', 'item', - 'movie( view)?', 'open-panel', 'outline view', 'panel', - 'pasteboard', 'plugin', 'popup button', - 'progress indicator', 'responder', 'save-panel', - 'scroll view', 'secure text field( cell)?', 'slider', - 'sound', 'split view', 'stepper', 'tab view( item)?', - 'table( (column|header cell|header view|view))', - 'text( (field( cell)?|view))?', 'toolbar( item)?', - 'user-defaults', 'view', 'window') - StudioEvents = ('accept outline drop', 'accept table drop', 'action', - 'activated', 'alert ended', 'awake from nib', 'became key', - 'became main', 'begin editing', 'bounds changed', - 'cell value', 'cell value changed', 'change cell value', - 'change item value', 'changed', 'child of item', - 'choose menu item', 'clicked', 'clicked toolbar item', - 'closed', 'column clicked', 'column moved', - 'column resized', 'conclude drop', 'data representation', - 'deminiaturized', 'dialog ended', 'document nib name', - 'double clicked', 'drag( (entered|exited|updated))?', - 'drop', 'end editing', 'exposed', 'idle', 'item expandable', - 'item value', 'item value changed', 'items changed', - 'keyboard down', 'keyboard up', 'launched', - 'load data representation', 'miniaturized', 'mouse down', - 'mouse dragged', 'mouse entered', 'mouse exited', - 'mouse moved', 'mouse up', 'moved', - 'number of browser rows', 'number of items', - 'number of rows', 'open untitled', 'opened', 'panel ended', - 'parameters updated', 'plugin loaded', 'prepare drop', - 'prepare outline drag', 'prepare outline drop', - 'prepare table drag', 'prepare table drop', - 'read from file', 'resigned active', 'resigned key', - 'resigned main', 'resized( sub views)?', - 'right mouse down', 'right mouse dragged', - 'right mouse up', 'rows changed', 'scroll wheel', - 'selected tab view item', 'selection changed', - 'selection changing', 'should begin editing', - 'should close', 'should collapse item', - 'should end editing', 'should expand item', - 'should open( untitled)?', - 'should quit( after last window closed)?', - 'should select column', 'should select item', - 'should select row', 'should select tab view item', - 'should selection change', 'should zoom', 'shown', - 'update menu item', 'update parameters', - 'update toolbar item', 'was hidden', 'was miniaturized', - 'will become active', 'will close', 'will dismiss', - 'will display browser cell', 'will display cell', - 'will display item cell', 'will display outline cell', - 'will finish launching', 'will hide', 'will miniaturize', - 'will move', 'will open', 'will pop up', 'will quit', - 'will resign active', 'will resize( sub views)?', - 'will select tab view item', 'will show', 'will zoom', - 'write to file', 'zoomed') - StudioCommands = ('animate', 'append', 'call method', 'center', - 'close drawer', 'close panel', 'display', - 'display alert', 'display dialog', 'display panel', 'go', - 'hide', 'highlight', 'increment', 'item for', - 'load image', 'load movie', 'load nib', 'load panel', - 'load sound', 'localized string', 'lock focus', 'log', - 'open drawer', 'path for', 'pause', 'perform action', - 'play', 'register', 'resume', 'scroll', 'select( all)?', - 'show', 'size to fit', 'start', 'step back', - 'step forward', 'stop', 'synchronize', 'unlock focus', - 'update') - StudioProperties = ('accepts arrow key', 'action method', 'active', - 'alignment', 'allowed identifiers', - 'allows branch selection', 'allows column reordering', - 'allows column resizing', 'allows column selection', - 'allows customization', - 'allows editing text attributes', - 'allows empty selection', 'allows mixed state', - 'allows multiple selection', 'allows reordering', - 'allows undo', 'alpha( value)?', 'alternate image', - 'alternate increment value', 'alternate title', - 'animation delay', 'associated file name', - 'associated object', 'auto completes', 'auto display', - 'auto enables items', 'auto repeat', - 'auto resizes( outline column)?', - 'auto save expanded items', 'auto save name', - 'auto save table columns', 'auto saves configuration', - 'auto scroll', 'auto sizes all columns to fit', - 'auto sizes cells', 'background color', 'bezel state', - 'bezel style', 'bezeled', 'border rect', 'border type', - 'bordered', 'bounds( rotation)?', 'box type', - 'button returned', 'button type', - 'can choose directories', 'can choose files', - 'can draw', 'can hide', - 'cell( (background color|size|type))?', 'characters', - 'class', 'click count', 'clicked( data)? column', - 'clicked data item', 'clicked( data)? row', - 'closeable', 'collating', 'color( (mode|panel))', - 'command key down', 'configuration', - 'content(s| (size|view( margins)?))?', 'context', - 'continuous', 'control key down', 'control size', - 'control tint', 'control view', - 'controller visible', 'coordinate system', - 'copies( on scroll)?', 'corner view', 'current cell', - 'current column', 'current( field)? editor', - 'current( menu)? item', 'current row', - 'current tab view item', 'data source', - 'default identifiers', 'delta (x|y|z)', - 'destination window', 'directory', 'display mode', - 'displayed cell', 'document( (edited|rect|view))?', - 'double value', 'dragged column', 'dragged distance', - 'dragged items', 'draws( cell)? background', - 'draws grid', 'dynamically scrolls', 'echos bullets', - 'edge', 'editable', 'edited( data)? column', - 'edited data item', 'edited( data)? row', 'enabled', - 'enclosing scroll view', 'ending page', - 'error handling', 'event number', 'event type', - 'excluded from windows menu', 'executable path', - 'expanded', 'fax number', 'field editor', 'file kind', - 'file name', 'file type', 'first responder', - 'first visible column', 'flipped', 'floating', - 'font( panel)?', 'formatter', 'frameworks path', - 'frontmost', 'gave up', 'grid color', 'has data items', - 'has horizontal ruler', 'has horizontal scroller', - 'has parent data item', 'has resize indicator', - 'has shadow', 'has sub menu', 'has vertical ruler', - 'has vertical scroller', 'header cell', 'header view', - 'hidden', 'hides when deactivated', 'highlights by', - 'horizontal line scroll', 'horizontal page scroll', - 'horizontal ruler view', 'horizontally resizable', - 'icon image', 'id', 'identifier', - 'ignores multiple clicks', - 'image( (alignment|dims when disabled|frame style|scaling))?', - 'imports graphics', 'increment value', - 'indentation per level', 'indeterminate', 'index', - 'integer value', 'intercell spacing', 'item height', - 'key( (code|equivalent( modifier)?|window))?', - 'knob thickness', 'label', 'last( visible)? column', - 'leading offset', 'leaf', 'level', 'line scroll', - 'loaded', 'localized sort', 'location', 'loop mode', - 'main( (bunde|menu|window))?', 'marker follows cell', - 'matrix mode', 'maximum( content)? size', - 'maximum visible columns', - 'menu( form representation)?', 'miniaturizable', - 'miniaturized', 'minimized image', 'minimized title', - 'minimum column width', 'minimum( content)? size', - 'modal', 'modified', 'mouse down state', - 'movie( (controller|file|rect))?', 'muted', 'name', - 'needs display', 'next state', 'next text', - 'number of tick marks', 'only tick mark values', - 'opaque', 'open panel', 'option key down', - 'outline table column', 'page scroll', 'pages across', - 'pages down', 'palette label', 'pane splitter', - 'parent data item', 'parent window', 'pasteboard', - 'path( (names|separator))?', 'playing', - 'plays every frame', 'plays selection only', 'position', - 'preferred edge', 'preferred type', 'pressure', - 'previous text', 'prompt', 'properties', - 'prototype cell', 'pulls down', 'rate', - 'released when closed', 'repeated', - 'requested print time', 'required file type', - 'resizable', 'resized column', 'resource path', - 'returns records', 'reuses columns', 'rich text', - 'roll over', 'row height', 'rulers visible', - 'save panel', 'scripts path', 'scrollable', - 'selectable( identifiers)?', 'selected cell', - 'selected( data)? columns?', 'selected data items?', - 'selected( data)? rows?', 'selected item identifier', - 'selection by rect', 'send action on arrow key', - 'sends action when done editing', 'separates columns', - 'separator item', 'sequence number', 'services menu', - 'shared frameworks path', 'shared support path', - 'sheet', 'shift key down', 'shows alpha', - 'shows state by', 'size( mode)?', - 'smart insert delete enabled', 'sort case sensitivity', - 'sort column', 'sort order', 'sort type', - 'sorted( data rows)?', 'sound', 'source( mask)?', - 'spell checking enabled', 'starting page', 'state', - 'string value', 'sub menu', 'super menu', 'super view', - 'tab key traverses cells', 'tab state', 'tab type', - 'tab view', 'table view', 'tag', 'target( printer)?', - 'text color', 'text container insert', - 'text container origin', 'text returned', - 'tick mark position', 'time stamp', - 'title(d| (cell|font|height|position|rect))?', - 'tool tip', 'toolbar', 'trailing offset', 'transparent', - 'treat packages as directories', 'truncated labels', - 'types', 'unmodified characters', 'update views', - 'use sort indicator', 'user defaults', - 'uses data source', 'uses ruler', - 'uses threaded animation', - 'uses title from previous column', 'value wraps', - 'version', - 'vertical( (line scroll|page scroll|ruler view))?', - 'vertically resizable', 'view', - 'visible( document rect)?', 'volume', 'width', 'window', - 'windows menu', 'wraps', 'zoomable', 'zoomed') - - tokens = { - 'root': [ - (r'\s+', Text), - (u'¬\\n', String.Escape), - (r"'s\s+", Text), # This is a possessive, consider moving - (r'(--|#).*?$', Comment), - (r'\(\*', Comment.Multiline, 'comment'), - (r'[(){}!,.:]', Punctuation), - (u'(«)([^»]+)(»)', - bygroups(Text, Name.Builtin, Text)), - (r'\b((?:considering|ignoring)\s*)' - r'(application responses|case|diacriticals|hyphens|' - r'numeric strings|punctuation|white space)', - bygroups(Keyword, Name.Builtin)), - (u'(-|\\*|\\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\\^)', Operator), - (r"\b(%s)\b" % '|'.join(Operators), Operator.Word), - (r'^(\s*(?:on|end)\s+)' - r'(%s)' % '|'.join(StudioEvents[::-1]), - bygroups(Keyword, Name.Function)), - (r'^(\s*)(in|on|script|to)(\s+)', bygroups(Text, Keyword, Text)), - (r'\b(as )(%s)\b' % '|'.join(Classes), - bygroups(Keyword, Name.Class)), - (r'\b(%s)\b' % '|'.join(Literals), Name.Constant), - (r'\b(%s)\b' % '|'.join(Commands), Name.Builtin), - (r'\b(%s)\b' % '|'.join(Control), Keyword), - (r'\b(%s)\b' % '|'.join(Declarations), Keyword), - (r'\b(%s)\b' % '|'.join(Reserved), Name.Builtin), - (r'\b(%s)s?\b' % '|'.join(BuiltIn), Name.Builtin), - (r'\b(%s)\b' % '|'.join(HandlerParams), Name.Builtin), - (r'\b(%s)\b' % '|'.join(StudioProperties), Name.Attribute), - (r'\b(%s)s?\b' % '|'.join(StudioClasses), Name.Builtin), - (r'\b(%s)\b' % '|'.join(StudioCommands), Name.Builtin), - (r'\b(%s)\b' % '|'.join(References), Name.Builtin), - (r'"(\\\\|\\"|[^"])*"', String.Double), - (r'\b(%s)\b' % Identifiers, Name.Variable), - (r'[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?', Number.Float), - (r'[-+]?\d+', Number.Integer), - ], - 'comment': [ - ('\(\*', Comment.Multiline, '#push'), - ('\*\)', Comment.Multiline, '#pop'), - ('[^*(]+', Comment.Multiline), - ('[*(]', Comment.Multiline), - ], - } - - -class RexxLexer(RegexLexer): - """ - `Rexx `_ is a scripting language available for - a wide range of different platforms with its roots found on mainframe - systems. It is popular for I/O- and data based tasks and can act as glue - language to bind different applications together. - - .. versionadded:: 2.0 - """ - name = 'Rexx' - aliases = ['rexx', 'arexx'] - filenames = ['*.rexx', '*.rex', '*.rx', '*.arexx'] - mimetypes = ['text/x-rexx'] - flags = re.IGNORECASE - - tokens = { - 'root': [ - (r'\s', Whitespace), - (r'/\*', Comment.Multiline, 'comment'), - (r'"', String, 'string_double'), - (r"'", String, 'string_single'), - (r'[0-9]+(\.[0-9]+)?(e[+-]?[0-9])?', Number), - (r'([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b', - bygroups(Name.Function, Whitespace, Operator, Whitespace, - Keyword.Declaration)), - (r'([a-z_]\w*)(\s*)(:)', - bygroups(Name.Label, Whitespace, Operator)), - include('function'), - include('keyword'), - include('operator'), - (r'[a-z_]\w*', Text), - ], - 'function': [ - (words(( - 'abbrev', 'abs', 'address', 'arg', 'b2x', 'bitand', 'bitor', 'bitxor', - 'c2d', 'c2x', 'center', 'charin', 'charout', 'chars', 'compare', - 'condition', 'copies', 'd2c', 'd2x', 'datatype', 'date', 'delstr', - 'delword', 'digits', 'errortext', 'form', 'format', 'fuzz', 'insert', - 'lastpos', 'left', 'length', 'linein', 'lineout', 'lines', 'max', - 'min', 'overlay', 'pos', 'queued', 'random', 'reverse', 'right', 'sign', - 'sourceline', 'space', 'stream', 'strip', 'substr', 'subword', 'symbol', - 'time', 'trace', 'translate', 'trunc', 'value', 'verify', 'word', - 'wordindex', 'wordlength', 'wordpos', 'words', 'x2b', 'x2c', 'x2d', - 'xrange'), suffix=r'(\s*)(\()'), - bygroups(Name.Builtin, Whitespace, Operator)), - ], - 'keyword': [ - (r'(address|arg|by|call|do|drop|else|end|exit|for|forever|if|' - r'interpret|iterate|leave|nop|numeric|off|on|options|parse|' - r'pull|push|queue|return|say|select|signal|to|then|trace|until|' - r'while)\b', Keyword.Reserved), - ], - 'operator': [ - (r'(-|//|/|\(|\)|\*\*|\*|\\<<|\\<|\\==|\\=|\\>>|\\>|\\|\|\||\||' - r'&&|&|%|\+|<<=|<<|<=|<>|<|==|=|><|>=|>>=|>>|>|¬<<|¬<|¬==|¬=|' - r'¬>>|¬>|¬|\.|,)', Operator), - ], - 'string_double': [ - (r'[^"\n]+', String), - (r'""', String), - (r'"', String, '#pop'), - (r'\n', Text, '#pop'), # Stray linefeed also terminates strings. - ], - 'string_single': [ - (r'[^\'\n]', String), - (r'\'\'', String), - (r'\'', String, '#pop'), - (r'\n', Text, '#pop'), # Stray linefeed also terminates strings. - ], - 'comment': [ - (r'[^*]+', Comment.Multiline), - (r'\*/', Comment.Multiline, '#pop'), - (r'\*', Comment.Multiline), - ] - } - - _c = lambda s: re.compile(s, re.MULTILINE) - _ADDRESS_COMMAND_PATTERN = _c(r'^\s*address\s+command\b') - _ADDRESS_PATTERN = _c(r'^\s*address\s+') - _DO_WHILE_PATTERN = _c(r'^\s*do\s+while\b') - _IF_THEN_DO_PATTERN = _c(r'^\s*if\b.+\bthen\s+do\s*$') - _PROCEDURE_PATTERN = _c(r'^\s*([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b') - _ELSE_DO_PATTERN = _c(r'\belse\s+do\s*$') - _PARSE_ARG_PATTERN = _c(r'^\s*parse\s+(upper\s+)?(arg|value)\b') - PATTERNS_AND_WEIGHTS = ( - (_ADDRESS_COMMAND_PATTERN, 0.2), - (_ADDRESS_PATTERN, 0.05), - (_DO_WHILE_PATTERN, 0.1), - (_ELSE_DO_PATTERN, 0.1), - (_IF_THEN_DO_PATTERN, 0.1), - (_PROCEDURE_PATTERN, 0.5), - (_PARSE_ARG_PATTERN, 0.2), - ) - - def analyse_text(text): - """ - Check for inital comment and patterns that distinguish Rexx from other - C-like languages. - """ - if re.search(r'/\*\**\s*rexx', text, re.IGNORECASE): - # Header matches MVS Rexx requirements, this is certainly a Rexx - # script. - return 1.0 - elif text.startswith('/*'): - # Header matches general Rexx requirements; the source code might - # still be any language using C comments such as C++, C# or Java. - lowerText = text.lower() - result = sum(weight - for (pattern, weight) in RexxLexer.PATTERNS_AND_WEIGHTS - if pattern.search(lowerText)) + 0.01 - return min(result, 1.0) - - -class MOOCodeLexer(RegexLexer): - """ - For `MOOCode `_ (the MOO scripting - language). - - .. versionadded:: 0.9 - """ - name = 'MOOCode' - filenames = ['*.moo'] - aliases = ['moocode', 'moo'] - mimetypes = ['text/x-moocode'] - - tokens = { - 'root': [ - # Numbers - (r'(0|[1-9][0-9_]*)', Number.Integer), - # Strings - (r'"(\\\\|\\"|[^"])*"', String), - # exceptions - (r'(E_PERM|E_DIV)', Name.Exception), - # db-refs - (r'((#[-0-9]+)|(\$\w+))', Name.Entity), - # Keywords - (r'\b(if|else|elseif|endif|for|endfor|fork|endfork|while' - r'|endwhile|break|continue|return|try' - r'|except|endtry|finally|in)\b', Keyword), - # builtins - (r'(random|length)', Name.Builtin), - # special variables - (r'(player|caller|this|args)', Name.Variable.Instance), - # skip whitespace - (r'\s+', Text), - (r'\n', Text), - # other operators - (r'([!;=,{}&|:.\[\]@()<>?]+)', Operator), - # function call - (r'(\w+)(\()', bygroups(Name.Function, Operator)), - # variables - (r'(\w+)', Text), - ] - } - - -class HybrisLexer(RegexLexer): - """ - For `Hybris `_ source code. - - .. versionadded:: 1.4 - """ - - name = 'Hybris' - aliases = ['hybris', 'hy'] - filenames = ['*.hy', '*.hyb'] - mimetypes = ['text/x-hybris', 'application/x-hybris'] - - flags = re.MULTILINE | re.DOTALL - - tokens = { - 'root': [ - # method names - (r'^(\s*(?:function|method|operator\s+)+?)' - r'([a-zA-Z_]\w*)' - r'(\s*)(\()', bygroups(Keyword, Name.Function, Text, Operator)), - (r'[^\S\n]+', Text), - (r'//.*?\n', Comment.Single), - (r'/\*.*?\*/', Comment.Multiline), - (r'@[a-zA-Z_][\w.]*', Name.Decorator), - (r'(break|case|catch|next|default|do|else|finally|for|foreach|of|' - r'unless|if|new|return|switch|me|throw|try|while)\b', Keyword), - (r'(extends|private|protected|public|static|throws|function|method|' - r'operator)\b', Keyword.Declaration), - (r'(true|false|null|__FILE__|__LINE__|__VERSION__|__LIB_PATH__|' - r'__INC_PATH__)\b', Keyword.Constant), - (r'(class|struct)(\s+)', - bygroups(Keyword.Declaration, Text), 'class'), - (r'(import|include)(\s+)', - bygroups(Keyword.Namespace, Text), 'import'), - (words(( - 'gc_collect', 'gc_mm_items', 'gc_mm_usage', 'gc_collect_threshold', - 'urlencode', 'urldecode', 'base64encode', 'base64decode', 'sha1', 'crc32', 'sha2', - 'md5', 'md5_file', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'cosh', 'exp', - 'fabs', 'floor', 'fmod', 'log', 'log10', 'pow', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', - 'isint', 'isfloat', 'ischar', 'isstring', 'isarray', 'ismap', 'isalias', 'typeof', - 'sizeof', 'toint', 'tostring', 'fromxml', 'toxml', 'binary', 'pack', 'load', 'eval', - 'var_names', 'var_values', 'user_functions', 'dyn_functions', 'methods', 'call', - 'call_method', 'mknod', 'mkfifo', 'mount', 'umount2', 'umount', 'ticks', 'usleep', - 'sleep', 'time', 'strtime', 'strdate', 'dllopen', 'dlllink', 'dllcall', 'dllcall_argv', - 'dllclose', 'env', 'exec', 'fork', 'getpid', 'wait', 'popen', 'pclose', 'exit', 'kill', - 'pthread_create', 'pthread_create_argv', 'pthread_exit', 'pthread_join', 'pthread_kill', - 'smtp_send', 'http_get', 'http_post', 'http_download', 'socket', 'bind', 'listen', - 'accept', 'getsockname', 'getpeername', 'settimeout', 'connect', 'server', 'recv', - 'send', 'close', 'print', 'println', 'printf', 'input', 'readline', 'serial_open', - 'serial_fcntl', 'serial_get_attr', 'serial_get_ispeed', 'serial_get_ospeed', - 'serial_set_attr', 'serial_set_ispeed', 'serial_set_ospeed', 'serial_write', - 'serial_read', 'serial_close', 'xml_load', 'xml_parse', 'fopen', 'fseek', 'ftell', - 'fsize', 'fread', 'fwrite', 'fgets', 'fclose', 'file', 'readdir', 'pcre_replace', 'size', - 'pop', 'unmap', 'has', 'keys', 'values', 'length', 'find', 'substr', 'replace', 'split', - 'trim', 'remove', 'contains', 'join'), suffix=r'\b'), - Name.Builtin), - (words(( - 'MethodReference', 'Runner', 'Dll', 'Thread', 'Pipe', 'Process', - 'Runnable', 'CGI', 'ClientSocket', 'Socket', 'ServerSocket', - 'File', 'Console', 'Directory', 'Exception'), suffix=r'\b'), - Keyword.Type), - (r'"(\\\\|\\"|[^"])*"', String), - (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char), - (r'(\.)([a-zA-Z_]\w*)', - bygroups(Operator, Name.Attribute)), - (r'[a-zA-Z_]\w*:', Name.Label), - (r'[a-zA-Z_$]\w*', Name), - (r'[~^*!%&\[\](){}<>|+=:;,./?\-@]+', Operator), - (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), - (r'0x[0-9a-f]+', Number.Hex), - (r'[0-9]+L?', Number.Integer), - (r'\n', Text), - ], - 'class': [ - (r'[a-zA-Z_]\w*', Name.Class, '#pop') - ], - 'import': [ - (r'[\w.]+\*?', Name.Namespace, '#pop') - ], - } diff --git a/wakatime/packages/py3/pygments/lexers/shell.py b/wakatime/packages/py3/pygments/lexers/shell.py deleted file mode 100644 index 1bbfd7a..0000000 --- a/wakatime/packages/py3/pygments/lexers/shell.py +++ /dev/null @@ -1,437 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.shell - ~~~~~~~~~~~~~~~~~~~~~ - - Lexers for various shells. - - :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import re - -from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, include -from pygments.token import Punctuation, \ - Text, Comment, Operator, Keyword, Name, String, Number, Generic -from pygments.util import shebang_matches - - -__all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer', - 'PowerShellLexer', 'ShellSessionLexer'] - -line_re = re.compile('.*?\n') - - -class BashLexer(RegexLexer): - """ - Lexer for (ba|k|)sh shell scripts. - - .. versionadded:: 0.6 - """ - - name = 'Bash' - aliases = ['bash', 'sh', 'ksh', 'shell'] - filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', - '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'] - mimetypes = ['application/x-sh', 'application/x-shellscript'] - - tokens = { - 'root': [ - include('basic'), - (r'`', String.Backtick, 'backticks'), - include('data'), - include('interp'), - ], - 'interp': [ - (r'\$\(\(', Keyword, 'math'), - (r'\$\(', Keyword, 'paren'), - (r'\$\{#?', String.Interpol, 'curly'), - (r'\$#?(\w+|.)', Name.Variable), - ], - 'basic': [ - (r'\b(if|fi|else|while|do|done|for|then|return|function|case|' - r'select|continue|until|esac|elif)(\s*)\b', - bygroups(Keyword, Text)), - (r'\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|' - r'complete|declare|dirs|disown|echo|enable|eval|exec|exit|' - r'export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|' - r'local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|' - r'shopt|source|suspend|test|time|times|trap|true|type|typeset|' - r'ulimit|umask|unalias|unset|wait)\s*\b(?!\.)', - Name.Builtin), - (r'#.*\n', Comment), - (r'\\[\w\W]', String.Escape), - (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), - (r'[\[\]{}()=]', Operator), - (r'<<<', Operator), # here-string - (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String), - (r'&&|\|\|', Operator), - ], - 'data': [ - (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"', String.Double), - (r'"', String.Double, 'string'), - (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), - (r"(?s)'.*?'", String.Single), - (r';', Punctuation), - (r'&', Punctuation), - (r'\|', Punctuation), - (r'\s+', Text), - (r'\d+(?= |\Z)', Number), - (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text), - (r'<', Text), - ], - 'string': [ - (r'"', String.Double, '#pop'), - (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double), - include('interp'), - ], - 'curly': [ - (r'\}', String.Interpol, '#pop'), - (r':-', Keyword), - (r'\w+', Name.Variable), - (r'[^}:"\'`$\\]+', Punctuation), - (r':', Punctuation), - include('root'), - ], - 'paren': [ - (r'\)', Keyword, '#pop'), - include('root'), - ], - 'math': [ - (r'\)\)', Keyword, '#pop'), - (r'[-+*/%^|&]|\*\*|\|\|', Operator), - (r'\d+#\d+', Number), - (r'\d+#(?! )', Number), - (r'\d+', Number), - include('root'), - ], - 'backticks': [ - (r'`', String.Backtick, '#pop'), - include('root'), - ], - } - - def analyse_text(text): - if shebang_matches(text, r'(ba|z|)sh'): - return 1 - if text.startswith('$ '): - return 0.2 - - -class BashSessionLexer(Lexer): - """ - Lexer for simplistic shell sessions. - - .. versionadded:: 1.1 - """ - - name = 'Bash Session' - aliases = ['console'] - filenames = ['*.sh-session'] - mimetypes = ['application/x-shell-session'] - - def get_tokens_unprocessed(self, text): - bashlexer = BashLexer(**self.options) - - pos = 0 - curcode = '' - insertions = [] - - for match in line_re.finditer(text): - line = match.group() - m = re.match(r'^((?:\(\S+\))?(?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)' - r'?|\[\S+[@:][^\n]+\].+)[$#%])(.*\n?)' , line) - if m: - # To support output lexers (say diff output), the output - # needs to be broken by prompts whenever the output lexer - # changes. - if not insertions: - pos = match.start() - - insertions.append((len(curcode), - [(0, Generic.Prompt, m.group(1))])) - curcode += m.group(2) - elif line.startswith('>'): - insertions.append((len(curcode), - [(0, Generic.Prompt, line[:1])])) - curcode += line[1:] - else: - if insertions: - toks = bashlexer.get_tokens_unprocessed(curcode) - for i, t, v in do_insertions(insertions, toks): - yield pos+i, t, v - yield match.start(), Generic.Output, line - insertions = [] - curcode = '' - if insertions: - for i, t, v in do_insertions(insertions, - bashlexer.get_tokens_unprocessed(curcode)): - yield pos+i, t, v - - -class ShellSessionLexer(Lexer): - """ - Lexer for shell sessions that works with different command prompts - - .. versionadded:: 1.6 - """ - - name = 'Shell Session' - aliases = ['shell-session'] - filenames = ['*.shell-session'] - mimetypes = ['application/x-sh-session'] - - def get_tokens_unprocessed(self, text): - bashlexer = BashLexer(**self.options) - - pos = 0 - curcode = '' - insertions = [] - - for match in line_re.finditer(text): - line = match.group() - m = re.match(r'^((?:\[?\S+@[^$#%]+\]?\s*)[$#%])(.*\n?)', line) - if m: - # To support output lexers (say diff output), the output - # needs to be broken by prompts whenever the output lexer - # changes. - if not insertions: - pos = match.start() - - insertions.append((len(curcode), - [(0, Generic.Prompt, m.group(1))])) - curcode += m.group(2) - else: - if insertions: - toks = bashlexer.get_tokens_unprocessed(curcode) - for i, t, v in do_insertions(insertions, toks): - yield pos+i, t, v - yield match.start(), Generic.Output, line - insertions = [] - curcode = '' - if insertions: - for i, t, v in do_insertions(insertions, - bashlexer.get_tokens_unprocessed(curcode)): - yield pos+i, t, v - - -class BatchLexer(RegexLexer): - """ - Lexer for the DOS/Windows Batch file format. - - .. versionadded:: 0.7 - """ - name = 'Batchfile' - aliases = ['bat', 'batch', 'dosbatch', 'winbatch'] - filenames = ['*.bat', '*.cmd'] - mimetypes = ['application/x-dos-batch'] - - flags = re.MULTILINE | re.IGNORECASE - - tokens = { - 'root': [ - # Lines can start with @ to prevent echo - (r'^\s*@', Punctuation), - (r'^(\s*)(rem\s.*)$', bygroups(Text, Comment)), - (r'".*?"', String.Double), - (r"'.*?'", String.Single), - # If made more specific, make sure you still allow expansions - # like %~$VAR:zlt - (r'%%?[~$:\w]+%?', Name.Variable), - (r'::.*', Comment), # Technically :: only works at BOL - (r'\b(set)(\s+)(\w+)', bygroups(Keyword, Text, Name.Variable)), - (r'\b(call)(\s+)(:\w+)', bygroups(Keyword, Text, Name.Label)), - (r'\b(goto)(\s+)(\w+)', bygroups(Keyword, Text, Name.Label)), - (r'\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|' - r'setlocal|shift|errorlevel|exist|defined|cmdextversion|' - r'errorlevel|else|cd|md|del|deltree|cls|choice)\b', Keyword), - (r'\b(equ|neq|lss|leq|gtr|geq)\b', Operator), - include('basic'), - (r'.', Text), - ], - 'echo': [ - # Escapes only valid within echo args? - (r'\^\^|\^<|\^>|\^\|', String.Escape), - (r'\n', Text, '#pop'), - include('basic'), - (r'[^\'"^]+', Text), - ], - 'basic': [ - (r'".*?"', String.Double), - (r"'.*?'", String.Single), - (r'`.*?`', String.Backtick), - (r'-?\d+', Number), - (r',', Punctuation), - (r'=', Operator), - (r'/\S+', Name), - (r':\w+', Name.Label), - (r'\w:\w+', Text), - (r'([<>|])(\s*)(\w+)', bygroups(Punctuation, Text, Name)), - ], - } - - -class TcshLexer(RegexLexer): - """ - Lexer for tcsh scripts. - - .. versionadded:: 0.10 - """ - - name = 'Tcsh' - aliases = ['tcsh', 'csh'] - filenames = ['*.tcsh', '*.csh'] - mimetypes = ['application/x-csh'] - - tokens = { - 'root': [ - include('basic'), - (r'\$\(', Keyword, 'paren'), - (r'\$\{#?', Keyword, 'curly'), - (r'`', String.Backtick, 'backticks'), - include('data'), - ], - 'basic': [ - (r'\b(if|endif|else|while|then|foreach|case|default|' - r'continue|goto|breaksw|end|switch|endsw)\s*\b', - Keyword), - (r'\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|' - r'complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|' - r'glob|getspath|hashstat|history|hup|inlib|jobs|kill|' - r'limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|' - r'onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|' - r'set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|' - r'source|stop|suspend|source|suspend|telltc|time|' - r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|' - r'ver|wait|warp|watchlog|where|which)\s*\b', - Name.Builtin), - (r'#.*', Comment), - (r'\\[\w\W]', String.Escape), - (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), - (r'[\[\]{}()=]+', Operator), - (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String), - (r';', Punctuation), - ], - 'data': [ - (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), - (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), - (r'\s+', Text), - (r'[^=\s\[\]{}()$"\'`\\;#]+', Text), - (r'\d+(?= |\Z)', Number), - (r'\$#?(\w+|.)', Name.Variable), - ], - 'curly': [ - (r'\}', Keyword, '#pop'), - (r':-', Keyword), - (r'\w+', Name.Variable), - (r'[^}:"\'`$]+', Punctuation), - (r':', Punctuation), - include('root'), - ], - 'paren': [ - (r'\)', Keyword, '#pop'), - include('root'), - ], - 'backticks': [ - (r'`', String.Backtick, '#pop'), - include('root'), - ], - } - - -class PowerShellLexer(RegexLexer): - """ - For Windows PowerShell code. - - .. versionadded:: 1.5 - """ - name = 'PowerShell' - aliases = ['powershell', 'posh', 'ps1', 'psm1'] - filenames = ['*.ps1','*.psm1'] - mimetypes = ['text/x-powershell'] - - flags = re.DOTALL | re.IGNORECASE | re.MULTILINE - - keywords = ( - 'while validateset validaterange validatepattern validatelength ' - 'validatecount until trap switch return ref process param parameter in ' - 'if global: function foreach for finally filter end elseif else ' - 'dynamicparam do default continue cmdletbinding break begin alias \\? ' - '% #script #private #local #global mandatory parametersetname position ' - 'valuefrompipeline valuefrompipelinebypropertyname ' - 'valuefromremainingarguments helpmessage try catch throw').split() - - operators = ( - 'and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' - 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' - 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' - 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' - 'lt match ne not notcontains notlike notmatch or regex replace ' - 'wildcard').split() - - verbs = ( - 'write where wait use update unregister undo trace test tee take ' - 'suspend stop start split sort skip show set send select scroll resume ' - 'restore restart resolve resize reset rename remove register receive ' - 'read push pop ping out new move measure limit join invoke import ' - 'group get format foreach export expand exit enter enable disconnect ' - 'disable debug cxnew copy convertto convertfrom convert connect ' - 'complete compare clear checkpoint aggregate add').split() - - commenthelp = ( - 'component description example externalhelp forwardhelpcategory ' - 'forwardhelptargetname functionality inputs link ' - 'notes outputs parameter remotehelprunspace role synopsis').split() - - tokens = { - 'root': [ - # we need to count pairs of parentheses for correct highlight - # of '$(...)' blocks in strings - (r'\(', Punctuation, 'child'), - (r'\s+', Text), - (r'^(\s*#[#\s]*)(\.(?:%s))([^\n]*$)' % '|'.join(commenthelp), - bygroups(Comment, String.Doc, Comment)), - (r'#[^\n]*?$', Comment), - (r'(<|<)#', Comment.Multiline, 'multline'), - (r'@"\n', String.Heredoc, 'heredoc-double'), - (r"@'\n.*?\n'@", String.Heredoc), - # escaped syntax - (r'`[\'"$@-]', Punctuation), - (r'"', String.Double, 'string'), - (r"'([^']|'')*'", String.Single), - (r'(\$|@@|@)((global|script|private|env):)?\w+', - Name.Variable), - (r'(%s)\b' % '|'.join(keywords), Keyword), - (r'-(%s)\b' % '|'.join(operators), Operator), - (r'(%s)-[a-z_]\w*\b' % '|'.join(verbs), Name.Builtin), - (r'\[[a-z_\[][\w. `,\[\]]*\]', Name.Constant), # .net [type]s - (r'-[a-z_]\w*', Name), - (r'\w+', Name), - (r'[.,;@{}\[\]$()=+*/\\&%!~?^`|<>-]|::', Punctuation), - ], - 'child': [ - (r'\)', Punctuation, '#pop'), - include('root'), - ], - 'multline': [ - (r'[^#&.]+', Comment.Multiline), - (r'#(>|>)', Comment.Multiline, '#pop'), - (r'\.(%s)' % '|'.join(commenthelp), String.Doc), - (r'[#&.]', Comment.Multiline), - ], - 'string': [ - (r"`[0abfnrtv'\"$`]", String.Escape), - (r'[^$`"]+', String.Double), - (r'\$\(', Punctuation, 'child'), - (r'""', String.Double), - (r'[`$]', String.Double), - (r'"', String.Double, '#pop'), - ], - 'heredoc-double': [ - (r'\n"@', String.Heredoc, '#pop'), - (r'\$\(', Punctuation, 'child'), - (r'[^@\n]+"]', String.Heredoc), - (r".", String.Heredoc), - ] - } diff --git a/wakatime/packages/py3/pygments/lexers/sql.py b/wakatime/packages/py3/pygments/lexers/sql.py deleted file mode 100644 index 98425cd..0000000 --- a/wakatime/packages/py3/pygments/lexers/sql.py +++ /dev/null @@ -1,598 +0,0 @@ -# -*- coding: utf-8 -*- -""" - pygments.lexers.sql - ~~~~~~~~~~~~~~~~~~~ - - Lexers for various SQL dialects and related interactive sessions. - - Postgres specific lexers: - - `PostgresLexer` - A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL - lexer are: - - - keywords and data types list parsed from the PG docs (run the - `_postgres_builtins` module to update them); - - Content of $-strings parsed using a specific lexer, e.g. the content - of a PL/Python function is parsed using the Python lexer; - - parse PG specific constructs: E-strings, $-strings, U&-strings, - different operators and punctuation. - - `PlPgsqlLexer` - A lexer for the PL/pgSQL language. Adds a few specific construct on - top of the PG SQL lexer (such as <