gitlab-pygments.rb 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +2 -0
- data/README.md +91 -0
- data/Rakefile +78 -0
- data/bench.rb +22 -0
- data/cache-lexers.rb +8 -0
- data/lexers +0 -0
- data/lib/pygments/lexer.rb +148 -0
- data/lib/pygments/mentos.py +344 -0
- data/lib/pygments/popen.rb +389 -0
- data/lib/pygments/version.rb +3 -0
- data/lib/pygments.rb +8 -0
- data/pygments.rb.gemspec +24 -0
- data/test/test_data.c +2581 -0
- data/test/test_data.py +514 -0
- data/test/test_data_generated +2582 -0
- data/test/test_pygments.rb +276 -0
- data/vendor/custom_formatters/gitlab.py +171 -0
- data/vendor/custom_lexers/github.py +362 -0
- data/vendor/pygments-main/AUTHORS +115 -0
- data/vendor/pygments-main/CHANGES +762 -0
- data/vendor/pygments-main/LICENSE +25 -0
- data/vendor/pygments-main/MANIFEST.in +6 -0
- data/vendor/pygments-main/Makefile +59 -0
- data/vendor/pygments-main/REVISION +1 -0
- data/vendor/pygments-main/TODO +15 -0
- data/vendor/pygments-main/docs/generate.py +472 -0
- data/vendor/pygments-main/docs/pygmentize.1 +94 -0
- data/vendor/pygments-main/docs/src/api.txt +270 -0
- data/vendor/pygments-main/docs/src/authors.txt +5 -0
- data/vendor/pygments-main/docs/src/changelog.txt +5 -0
- data/vendor/pygments-main/docs/src/cmdline.txt +147 -0
- data/vendor/pygments-main/docs/src/filterdevelopment.txt +70 -0
- data/vendor/pygments-main/docs/src/filters.txt +42 -0
- data/vendor/pygments-main/docs/src/formatterdevelopment.txt +169 -0
- data/vendor/pygments-main/docs/src/formatters.txt +48 -0
- data/vendor/pygments-main/docs/src/index.txt +69 -0
- data/vendor/pygments-main/docs/src/installation.txt +71 -0
- data/vendor/pygments-main/docs/src/integrate.txt +43 -0
- data/vendor/pygments-main/docs/src/lexerdevelopment.txt +551 -0
- data/vendor/pygments-main/docs/src/lexers.txt +67 -0
- data/vendor/pygments-main/docs/src/moinmoin.txt +39 -0
- data/vendor/pygments-main/docs/src/plugins.txt +93 -0
- data/vendor/pygments-main/docs/src/quickstart.txt +202 -0
- data/vendor/pygments-main/docs/src/rstdirective.txt +22 -0
- data/vendor/pygments-main/docs/src/styles.txt +143 -0
- data/vendor/pygments-main/docs/src/tokens.txt +349 -0
- data/vendor/pygments-main/docs/src/unicode.txt +49 -0
- data/vendor/pygments-main/external/markdown-processor.py +67 -0
- data/vendor/pygments-main/external/moin-parser.py +112 -0
- data/vendor/pygments-main/external/pygments.bashcomp +38 -0
- data/vendor/pygments-main/external/rst-directive-old.py +77 -0
- data/vendor/pygments-main/external/rst-directive.py +83 -0
- data/vendor/pygments-main/ez_setup.py +276 -0
- data/vendor/pygments-main/pygmentize +7 -0
- data/vendor/pygments-main/pygments/__init__.py +91 -0
- data/vendor/pygments-main/pygments/cmdline.py +433 -0
- data/vendor/pygments-main/pygments/console.py +74 -0
- data/vendor/pygments-main/pygments/filter.py +74 -0
- data/vendor/pygments-main/pygments/filters/__init__.py +357 -0
- data/vendor/pygments-main/pygments/formatter.py +92 -0
- data/vendor/pygments-main/pygments/formatters/__init__.py +68 -0
- data/vendor/pygments-main/pygments/formatters/_mapping.py +94 -0
- data/vendor/pygments-main/pygments/formatters/bbcode.py +109 -0
- data/vendor/pygments-main/pygments/formatters/gitlab.py +171 -0
- data/vendor/pygments-main/pygments/formatters/html.py +750 -0
- data/vendor/pygments-main/pygments/formatters/img.py +553 -0
- data/vendor/pygments-main/pygments/formatters/latex.py +378 -0
- data/vendor/pygments-main/pygments/formatters/other.py +117 -0
- data/vendor/pygments-main/pygments/formatters/rtf.py +136 -0
- data/vendor/pygments-main/pygments/formatters/svg.py +154 -0
- data/vendor/pygments-main/pygments/formatters/terminal.py +112 -0
- data/vendor/pygments-main/pygments/formatters/terminal256.py +222 -0
- data/vendor/pygments-main/pygments/lexer.py +697 -0
- data/vendor/pygments-main/pygments/lexers/__init__.py +229 -0
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1645 -0
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +232 -0
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +249 -0
- data/vendor/pygments-main/pygments/lexers/_mapping.py +298 -0
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +3787 -0
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +232 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +29 -0
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +3 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +1803 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +360 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +2891 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +636 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +1832 -0
- data/vendor/pygments-main/pygments/lexers/github.py +362 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +356 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +847 -0
- data/vendor/pygments-main/pygments/lexers/math.py +1072 -0
- data/vendor/pygments-main/pygments/lexers/other.py +3339 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +695 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +361 -0
- data/vendor/pygments-main/pygments/lexers/special.py +100 -0
- data/vendor/pygments-main/pygments/lexers/sql.py +559 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +1631 -0
- data/vendor/pygments-main/pygments/lexers/text.py +1753 -0
- data/vendor/pygments-main/pygments/lexers/web.py +2864 -0
- data/vendor/pygments-main/pygments/plugin.py +74 -0
- data/vendor/pygments-main/pygments/scanner.py +104 -0
- data/vendor/pygments-main/pygments/style.py +117 -0
- data/vendor/pygments-main/pygments/styles/__init__.py +70 -0
- data/vendor/pygments-main/pygments/styles/autumn.py +65 -0
- data/vendor/pygments-main/pygments/styles/borland.py +51 -0
- data/vendor/pygments-main/pygments/styles/bw.py +49 -0
- data/vendor/pygments-main/pygments/styles/colorful.py +81 -0
- data/vendor/pygments-main/pygments/styles/default.py +73 -0
- data/vendor/pygments-main/pygments/styles/emacs.py +72 -0
- data/vendor/pygments-main/pygments/styles/friendly.py +72 -0
- data/vendor/pygments-main/pygments/styles/fruity.py +42 -0
- data/vendor/pygments-main/pygments/styles/manni.py +75 -0
- data/vendor/pygments-main/pygments/styles/monokai.py +106 -0
- data/vendor/pygments-main/pygments/styles/murphy.py +80 -0
- data/vendor/pygments-main/pygments/styles/native.py +65 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +75 -0
- data/vendor/pygments-main/pygments/styles/perldoc.py +69 -0
- data/vendor/pygments-main/pygments/styles/rrt.py +33 -0
- data/vendor/pygments-main/pygments/styles/tango.py +141 -0
- data/vendor/pygments-main/pygments/styles/trac.py +63 -0
- data/vendor/pygments-main/pygments/styles/vim.py +63 -0
- data/vendor/pygments-main/pygments/styles/vs.py +38 -0
- data/vendor/pygments-main/pygments/token.py +195 -0
- data/vendor/pygments-main/pygments/unistring.py +130 -0
- data/vendor/pygments-main/pygments/util.py +232 -0
- data/vendor/pygments-main/scripts/check_sources.py +242 -0
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +30 -0
- data/vendor/pygments-main/scripts/epydoc.css +280 -0
- data/vendor/pygments-main/scripts/find_codetags.py +205 -0
- data/vendor/pygments-main/scripts/find_error.py +171 -0
- data/vendor/pygments-main/scripts/get_vimkw.py +43 -0
- data/vendor/pygments-main/scripts/pylintrc +301 -0
- data/vendor/pygments-main/scripts/reindent.py +291 -0
- data/vendor/pygments-main/scripts/vim2pygments.py +933 -0
- data/vendor/pygments-main/setup.cfg +6 -0
- data/vendor/pygments-main/setup.py +88 -0
- data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +37 -0
- data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +869 -0
- data/vendor/pygments-main/tests/dtds/HTML4.dcl +88 -0
- data/vendor/pygments-main/tests/dtds/HTML4.dtd +1092 -0
- data/vendor/pygments-main/tests/dtds/HTML4.soc +9 -0
- data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +195 -0
- data/vendor/pygments-main/tests/dtds/HTMLspec.ent +77 -0
- data/vendor/pygments-main/tests/dtds/HTMLsym.ent +241 -0
- data/vendor/pygments-main/tests/examplefiles/ANTLRv3.g +608 -0
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +209 -0
- data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +102 -0
- data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +611 -0
- data/vendor/pygments-main/tests/examplefiles/Constants.mo +158 -0
- data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +411 -0
- data/vendor/pygments-main/tests/examplefiles/Errors.scala +18 -0
- data/vendor/pygments-main/tests/examplefiles/File.hy +174 -0
- data/vendor/pygments-main/tests/examplefiles/Intro.java +1660 -0
- data/vendor/pygments-main/tests/examplefiles/Makefile +1131 -0
- data/vendor/pygments-main/tests/examplefiles/Object.st +4394 -0
- data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +584 -0
- data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +378 -0
- data/vendor/pygments-main/tests/examplefiles/Sorting.mod +470 -0
- data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +382 -0
- data/vendor/pygments-main/tests/examplefiles/addressbook.proto +30 -0
- data/vendor/pygments-main/tests/examplefiles/antlr_throws +1 -0
- data/vendor/pygments-main/tests/examplefiles/apache2.conf +393 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test.as +143 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test2.as +46 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test3.as +3 -0
- data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +27 -0
- data/vendor/pygments-main/tests/examplefiles/badcase.java +2 -0
- data/vendor/pygments-main/tests/examplefiles/batchfile.bat +49 -0
- data/vendor/pygments-main/tests/examplefiles/boot-9.scm +1557 -0
- data/vendor/pygments-main/tests/examplefiles/cells.ps +515 -0
- data/vendor/pygments-main/tests/examplefiles/ceval.c +2604 -0
- data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +13 -0
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +40 -0
- data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +10 -0
- data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +447 -0
- data/vendor/pygments-main/tests/examplefiles/database.pytb +20 -0
- data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +2461 -0
- data/vendor/pygments-main/tests/examplefiles/demo.ahk +181 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +38 -0
- data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +68 -0
- data/vendor/pygments-main/tests/examplefiles/dwarf.cw +17 -0
- data/vendor/pygments-main/tests/examplefiles/erl_session +10 -0
- data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +1 -0
- data/vendor/pygments-main/tests/examplefiles/evil_regex.js +48 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +2080 -0
- data/vendor/pygments-main/tests/examplefiles/example.cls +15 -0
- data/vendor/pygments-main/tests/examplefiles/example.cpp +2363 -0
- data/vendor/pygments-main/tests/examplefiles/example.gs +106 -0
- data/vendor/pygments-main/tests/examplefiles/example.gst +7 -0
- data/vendor/pygments-main/tests/examplefiles/example.kt +47 -0
- data/vendor/pygments-main/tests/examplefiles/example.lua +250 -0
- data/vendor/pygments-main/tests/examplefiles/example.moo +26 -0
- data/vendor/pygments-main/tests/examplefiles/example.moon +629 -0
- data/vendor/pygments-main/tests/examplefiles/example.nim +1010 -0
- data/vendor/pygments-main/tests/examplefiles/example.ns2 +69 -0
- data/vendor/pygments-main/tests/examplefiles/example.p +34 -0
- data/vendor/pygments-main/tests/examplefiles/example.pas +2708 -0
- data/vendor/pygments-main/tests/examplefiles/example.rb +1852 -0
- data/vendor/pygments-main/tests/examplefiles/example.rhtml +561 -0
- data/vendor/pygments-main/tests/examplefiles/example.sh-session +19 -0
- data/vendor/pygments-main/tests/examplefiles/example.sml +156 -0
- data/vendor/pygments-main/tests/examplefiles/example.snobol +15 -0
- data/vendor/pygments-main/tests/examplefiles/example.tea +34 -0
- data/vendor/pygments-main/tests/examplefiles/example.u +548 -0
- data/vendor/pygments-main/tests/examplefiles/example.weechatlog +9 -0
- data/vendor/pygments-main/tests/examplefiles/example.xhtml +376 -0
- data/vendor/pygments-main/tests/examplefiles/example.yaml +302 -0
- data/vendor/pygments-main/tests/examplefiles/example2.aspx +29 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +363 -0
- data/vendor/pygments-main/tests/examplefiles/example_file.fy +128 -0
- data/vendor/pygments-main/tests/examplefiles/firefox.mak +586 -0
- data/vendor/pygments-main/tests/examplefiles/flipflop.sv +19 -0
- data/vendor/pygments-main/tests/examplefiles/foo.sce +6 -0
- data/vendor/pygments-main/tests/examplefiles/format.ml +1213 -0
- data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +77 -0
- data/vendor/pygments-main/tests/examplefiles/function.mu +1 -0
- data/vendor/pygments-main/tests/examplefiles/functional.rst +1472 -0
- data/vendor/pygments-main/tests/examplefiles/genclass.clj +510 -0
- data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +193 -0
- data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +33 -0
- data/vendor/pygments-main/tests/examplefiles/glsl.frag +7 -0
- data/vendor/pygments-main/tests/examplefiles/glsl.vert +13 -0
- data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +1 -0
- data/vendor/pygments-main/tests/examplefiles/http_request_example +14 -0
- data/vendor/pygments-main/tests/examplefiles/http_response_example +27 -0
- data/vendor/pygments-main/tests/examplefiles/import.hs +4 -0
- data/vendor/pygments-main/tests/examplefiles/intro.ik +24 -0
- data/vendor/pygments-main/tests/examplefiles/ints.php +10 -0
- data/vendor/pygments-main/tests/examplefiles/intsyn.fun +675 -0
- data/vendor/pygments-main/tests/examplefiles/intsyn.sig +286 -0
- data/vendor/pygments-main/tests/examplefiles/irb_heredoc +8 -0
- data/vendor/pygments-main/tests/examplefiles/irc.lsp +214 -0
- data/vendor/pygments-main/tests/examplefiles/java.properties +16 -0
- data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +28 -0
- data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +45 -0
- data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +713 -0
- data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +13 -0
- data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +47 -0
- data/vendor/pygments-main/tests/examplefiles/ltmain.sh +2849 -0
- data/vendor/pygments-main/tests/examplefiles/main.cmake +42 -0
- data/vendor/pygments-main/tests/examplefiles/markdown.lsp +679 -0
- data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +3 -0
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +27 -0
- data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +37 -0
- data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +4 -0
- data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +340 -0
- data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +38 -0
- data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +96 -0
- data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +30 -0
- data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +87 -0
- data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +118 -0
- data/vendor/pygments-main/tests/examplefiles/numbers.c +12 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +25 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +24 -0
- data/vendor/pygments-main/tests/examplefiles/perl_misc +62 -0
- data/vendor/pygments-main/tests/examplefiles/perl_perl5db +998 -0
- data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +120 -0
- data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +856 -0
- data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +567 -0
- data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +1223 -0
- data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +47 -0
- data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +10 -0
- data/vendor/pygments-main/tests/examplefiles/psql_session.txt +122 -0
- data/vendor/pygments-main/tests/examplefiles/py3_test.txt +2 -0
- data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +14 -0
- data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +2 -0
- data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +234 -0
- data/vendor/pygments-main/tests/examplefiles/qsort.prolog +13 -0
- data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +38 -0
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +280 -0
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +2 -0
- data/vendor/pygments-main/tests/examplefiles/regex.js +22 -0
- data/vendor/pygments-main/tests/examplefiles/reversi.lsp +427 -0
- data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +11 -0
- data/vendor/pygments-main/tests/examplefiles/scilab.sci +30 -0
- data/vendor/pygments-main/tests/examplefiles/sibling.prolog +19 -0
- data/vendor/pygments-main/tests/examplefiles/simple.md +747 -0
- data/vendor/pygments-main/tests/examplefiles/smarty_example.html +209 -0
- data/vendor/pygments-main/tests/examplefiles/source.lgt +343 -0
- data/vendor/pygments-main/tests/examplefiles/sources.list +62 -0
- data/vendor/pygments-main/tests/examplefiles/sphere.pov +18 -0
- data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +27 -0
- data/vendor/pygments-main/tests/examplefiles/squid.conf +30 -0
- data/vendor/pygments-main/tests/examplefiles/string.jl +1031 -0
- data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +21 -0
- data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +3 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +119 -0
- data/vendor/pygments-main/tests/examplefiles/test.adb +211 -0
- data/vendor/pygments-main/tests/examplefiles/test.asy +131 -0
- data/vendor/pygments-main/tests/examplefiles/test.awk +121 -0
- data/vendor/pygments-main/tests/examplefiles/test.bas +29 -0
- data/vendor/pygments-main/tests/examplefiles/test.bmx +145 -0
- data/vendor/pygments-main/tests/examplefiles/test.boo +39 -0
- data/vendor/pygments-main/tests/examplefiles/test.bro +250 -0
- data/vendor/pygments-main/tests/examplefiles/test.cs +374 -0
- data/vendor/pygments-main/tests/examplefiles/test.css +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.d +135 -0
- data/vendor/pygments-main/tests/examplefiles/test.dart +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.dtd +89 -0
- data/vendor/pygments-main/tests/examplefiles/test.ec +605 -0
- data/vendor/pygments-main/tests/examplefiles/test.ecl +58 -0
- data/vendor/pygments-main/tests/examplefiles/test.eh +315 -0
- data/vendor/pygments-main/tests/examplefiles/test.erl +169 -0
- data/vendor/pygments-main/tests/examplefiles/test.evoque +33 -0
- data/vendor/pygments-main/tests/examplefiles/test.fan +818 -0
- data/vendor/pygments-main/tests/examplefiles/test.flx +57 -0
- data/vendor/pygments-main/tests/examplefiles/test.gdc +13 -0
- data/vendor/pygments-main/tests/examplefiles/test.groovy +97 -0
- data/vendor/pygments-main/tests/examplefiles/test.html +339 -0
- data/vendor/pygments-main/tests/examplefiles/test.ini +10 -0
- data/vendor/pygments-main/tests/examplefiles/test.java +653 -0
- data/vendor/pygments-main/tests/examplefiles/test.jsp +24 -0
- data/vendor/pygments-main/tests/examplefiles/test.maql +45 -0
- data/vendor/pygments-main/tests/examplefiles/test.mod +374 -0
- data/vendor/pygments-main/tests/examplefiles/test.moo +51 -0
- data/vendor/pygments-main/tests/examplefiles/test.myt +166 -0
- data/vendor/pygments-main/tests/examplefiles/test.nim +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.pas +743 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +505 -0
- data/vendor/pygments-main/tests/examplefiles/test.plot +333 -0
- data/vendor/pygments-main/tests/examplefiles/test.ps1 +108 -0
- data/vendor/pygments-main/tests/examplefiles/test.pypylog +1839 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +94 -0
- data/vendor/pygments-main/tests/examplefiles/test.rb +177 -0
- data/vendor/pygments-main/tests/examplefiles/test.rhtml +43 -0
- data/vendor/pygments-main/tests/examplefiles/test.scaml +8 -0
- data/vendor/pygments-main/tests/examplefiles/test.ssp +12 -0
- data/vendor/pygments-main/tests/examplefiles/test.tcsh +830 -0
- data/vendor/pygments-main/tests/examplefiles/test.vb +407 -0
- data/vendor/pygments-main/tests/examplefiles/test.vhdl +161 -0
- data/vendor/pygments-main/tests/examplefiles/test.xqy +138 -0
- data/vendor/pygments-main/tests/examplefiles/test.xsl +23 -0
- data/vendor/pygments-main/tests/examplefiles/truncated.pytb +15 -0
- data/vendor/pygments-main/tests/examplefiles/type.lisp +1202 -0
- data/vendor/pygments-main/tests/examplefiles/underscore.coffee +603 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.applescript +5 -0
- data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +11 -0
- data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +3 -0
- data/vendor/pygments-main/tests/examplefiles/while.pov +13 -0
- data/vendor/pygments-main/tests/examplefiles/wiki.factor +384 -0
- data/vendor/pygments-main/tests/examplefiles/xml_example +1897 -0
- data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +798 -0
- data/vendor/pygments-main/tests/old_run.py +138 -0
- data/vendor/pygments-main/tests/run.py +48 -0
- data/vendor/pygments-main/tests/support.py +15 -0
- data/vendor/pygments-main/tests/test_basic_api.py +294 -0
- data/vendor/pygments-main/tests/test_clexer.py +31 -0
- data/vendor/pygments-main/tests/test_cmdline.py +105 -0
- data/vendor/pygments-main/tests/test_examplefiles.py +97 -0
- data/vendor/pygments-main/tests/test_html_formatter.py +162 -0
- data/vendor/pygments-main/tests/test_latex_formatter.py +55 -0
- data/vendor/pygments-main/tests/test_perllexer.py +137 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +47 -0
- data/vendor/pygments-main/tests/test_token.py +46 -0
- data/vendor/pygments-main/tests/test_using_api.py +40 -0
- data/vendor/pygments-main/tests/test_util.py +116 -0
- data/vendor/simplejson/.gitignore +10 -0
- data/vendor/simplejson/.travis.yml +5 -0
- data/vendor/simplejson/CHANGES.txt +291 -0
- data/vendor/simplejson/LICENSE.txt +19 -0
- data/vendor/simplejson/MANIFEST.in +5 -0
- data/vendor/simplejson/README.rst +19 -0
- data/vendor/simplejson/conf.py +179 -0
- data/vendor/simplejson/index.rst +628 -0
- data/vendor/simplejson/scripts/make_docs.py +18 -0
- data/vendor/simplejson/setup.py +104 -0
- data/vendor/simplejson/simplejson/__init__.py +510 -0
- data/vendor/simplejson/simplejson/_speedups.c +2745 -0
- data/vendor/simplejson/simplejson/decoder.py +425 -0
- data/vendor/simplejson/simplejson/encoder.py +567 -0
- data/vendor/simplejson/simplejson/ordered_dict.py +119 -0
- data/vendor/simplejson/simplejson/scanner.py +77 -0
- data/vendor/simplejson/simplejson/tests/__init__.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +55 -0
- data/vendor/simplejson/simplejson/tests/test_check_circular.py +30 -0
- data/vendor/simplejson/simplejson/tests/test_decimal.py +66 -0
- data/vendor/simplejson/simplejson/tests/test_decode.py +83 -0
- data/vendor/simplejson/simplejson/tests/test_default.py +9 -0
- data/vendor/simplejson/simplejson/tests/test_dump.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +46 -0
- data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +32 -0
- data/vendor/simplejson/simplejson/tests/test_errors.py +34 -0
- data/vendor/simplejson/simplejson/tests/test_fail.py +91 -0
- data/vendor/simplejson/simplejson/tests/test_float.py +19 -0
- data/vendor/simplejson/simplejson/tests/test_indent.py +86 -0
- data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_namedtuple.py +121 -0
- data/vendor/simplejson/simplejson/tests/test_pass1.py +76 -0
- data/vendor/simplejson/simplejson/tests/test_pass2.py +14 -0
- data/vendor/simplejson/simplejson/tests/test_pass3.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_recursion.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_scanstring.py +117 -0
- data/vendor/simplejson/simplejson/tests/test_separators.py +42 -0
- data/vendor/simplejson/simplejson/tests/test_speedups.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_tuple.py +49 -0
- data/vendor/simplejson/simplejson/tests/test_unicode.py +109 -0
- data/vendor/simplejson/simplejson/tool.py +39 -0
- metadata +492 -0
@@ -0,0 +1,847 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
pygments.lexers.jvm
|
4
|
+
~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
Pygments lexers for JVM languages.
|
7
|
+
|
8
|
+
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
|
9
|
+
:license: BSD, see LICENSE for details.
|
10
|
+
"""
|
11
|
+
|
12
|
+
import re
|
13
|
+
|
14
|
+
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
|
15
|
+
this
|
16
|
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
17
|
+
Number, Punctuation
|
18
|
+
from pygments.util import get_choice_opt
|
19
|
+
from pygments import unistring as uni
|
20
|
+
|
21
|
+
|
22
|
+
__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer',
|
23
|
+
'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'KotlinLexer']
|
24
|
+
|
25
|
+
|
26
|
+
class JavaLexer(RegexLexer):
|
27
|
+
"""
|
28
|
+
For `Java <http://www.sun.com/java/>`_ source code.
|
29
|
+
"""
|
30
|
+
|
31
|
+
name = 'Java'
|
32
|
+
aliases = ['java']
|
33
|
+
filenames = ['*.java']
|
34
|
+
mimetypes = ['text/x-java']
|
35
|
+
|
36
|
+
flags = re.MULTILINE | re.DOTALL
|
37
|
+
|
38
|
+
#: optional Comment or Whitespace
|
39
|
+
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
40
|
+
|
41
|
+
tokens = {
|
42
|
+
'root': [
|
43
|
+
# method names
|
44
|
+
(r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
|
45
|
+
r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
|
46
|
+
r'(\s*)(\()', # signature start
|
47
|
+
bygroups(using(this), Name.Function, Text, Operator)),
|
48
|
+
(r'[^\S\n]+', Text),
|
49
|
+
(r'//.*?\n', Comment.Single),
|
50
|
+
(r'/\*.*?\*/', Comment.Multiline),
|
51
|
+
(r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
|
52
|
+
(r'(assert|break|case|catch|continue|default|do|else|finally|for|'
|
53
|
+
r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b',
|
54
|
+
Keyword),
|
55
|
+
(r'(abstract|const|enum|extends|final|implements|native|private|'
|
56
|
+
r'protected|public|static|strictfp|super|synchronized|throws|'
|
57
|
+
r'transient|volatile)\b', Keyword.Declaration),
|
58
|
+
(r'(boolean|byte|char|double|float|int|long|short|void)\b',
|
59
|
+
Keyword.Type),
|
60
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
|
61
|
+
(r'(true|false|null)\b', Keyword.Constant),
|
62
|
+
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), 'class'),
|
63
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
|
64
|
+
(r'"(\\\\|\\"|[^"])*"', String),
|
65
|
+
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
|
66
|
+
(r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
|
67
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
|
68
|
+
(r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
|
69
|
+
(r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
|
70
|
+
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
71
|
+
(r'0x[0-9a-f]+', Number.Hex),
|
72
|
+
(r'[0-9]+L?', Number.Integer),
|
73
|
+
(r'\n', Text)
|
74
|
+
],
|
75
|
+
'class': [
|
76
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
|
77
|
+
],
|
78
|
+
'import': [
|
79
|
+
(r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
|
80
|
+
],
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
class ScalaLexer(RegexLexer):
|
85
|
+
"""
|
86
|
+
For `Scala <http://www.scala-lang.org>`_ source code.
|
87
|
+
"""
|
88
|
+
|
89
|
+
name = 'Scala'
|
90
|
+
aliases = ['scala']
|
91
|
+
filenames = ['*.scala']
|
92
|
+
mimetypes = ['text/x-scala']
|
93
|
+
|
94
|
+
flags = re.MULTILINE | re.DOTALL
|
95
|
+
|
96
|
+
#: optional Comment or Whitespace
|
97
|
+
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
98
|
+
|
99
|
+
# don't use raw unicode strings!
|
100
|
+
op = u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+'
|
101
|
+
|
102
|
+
letter = u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]'
|
103
|
+
|
104
|
+
upper = u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]'
|
105
|
+
|
106
|
+
idrest = ur'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op)
|
107
|
+
|
108
|
+
tokens = {
|
109
|
+
'root': [
|
110
|
+
# method names
|
111
|
+
(r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'),
|
112
|
+
(ur"'%s" % idrest, Text.Symbol),
|
113
|
+
(r'[^\S\n]+', Text),
|
114
|
+
(r'//.*?\n', Comment.Single),
|
115
|
+
(r'/\*', Comment.Multiline, 'comment'),
|
116
|
+
(ur'@%s' % idrest, Name.Decorator),
|
117
|
+
(ur'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|'
|
118
|
+
ur'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|'
|
119
|
+
ur'lazy|match|new|override|pr(?:ivate|otected)'
|
120
|
+
ur'|re(?:quires|turn)|s(?:ealed|uper)|'
|
121
|
+
ur't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\b|'
|
122
|
+
u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\\b|(?=\\s)|$)', Keyword),
|
123
|
+
(ur':(?!%s)' % op, Keyword, 'type'),
|
124
|
+
(ur'%s%s\b' % (upper, idrest), Name.Class),
|
125
|
+
(r'(true|false|null)\b', Keyword.Constant),
|
126
|
+
(r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'),
|
127
|
+
(r'(type)(\s+)', bygroups(Keyword, Text), 'type'),
|
128
|
+
(r'""".*?"""', String),
|
129
|
+
(r'"(\\\\|\\"|[^"])*"', String),
|
130
|
+
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
|
131
|
+
# (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator,
|
132
|
+
# Name.Attribute)),
|
133
|
+
(idrest, Name),
|
134
|
+
(r'`[^`]+`', Name),
|
135
|
+
(r'\[', Operator, 'typeparam'),
|
136
|
+
(r'[\(\)\{\};,.#]', Operator),
|
137
|
+
(op, Operator),
|
138
|
+
(r'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?',
|
139
|
+
Number.Float),
|
140
|
+
(r'0x[0-9a-f]+', Number.Hex),
|
141
|
+
(r'[0-9]+L?', Number.Integer),
|
142
|
+
(r'\n', Text)
|
143
|
+
],
|
144
|
+
'class': [
|
145
|
+
(ur'(%s|%s|`[^`]+`)(\s*)(\[)' % (idrest, op),
|
146
|
+
bygroups(Name.Class, Text, Operator), 'typeparam'),
|
147
|
+
(r'\s+', Text),
|
148
|
+
(r'{', Operator, '#pop'),
|
149
|
+
(r'\(', Operator, '#pop'),
|
150
|
+
(r'//.*?\n', Comment.Single, '#pop'),
|
151
|
+
(ur'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'),
|
152
|
+
],
|
153
|
+
'type': [
|
154
|
+
(r'\s+', Text),
|
155
|
+
(u'<[%:]|>:|[#_\u21D2]|forSome|type', Keyword),
|
156
|
+
(r'([,\);}]|=>|=)(\s*)', bygroups(Operator, Text), '#pop'),
|
157
|
+
(r'[\(\{]', Operator, '#push'),
|
158
|
+
(ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)(\[)' %
|
159
|
+
(idrest, op, idrest, op),
|
160
|
+
bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')),
|
161
|
+
(ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)$' %
|
162
|
+
(idrest, op, idrest, op),
|
163
|
+
bygroups(Keyword.Type, Text), '#pop'),
|
164
|
+
(r'//.*?\n', Comment.Single, '#pop'),
|
165
|
+
(ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
|
166
|
+
],
|
167
|
+
'typeparam': [
|
168
|
+
(r'[\s,]+', Text),
|
169
|
+
(u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword),
|
170
|
+
(r'([\]\)\}])', Operator, '#pop'),
|
171
|
+
(r'[\(\[\{]', Operator, '#push'),
|
172
|
+
(ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
|
173
|
+
],
|
174
|
+
'comment': [
|
175
|
+
(r'[^/\*]+', Comment.Multiline),
|
176
|
+
(r'/\*', Comment.Multiline, '#push'),
|
177
|
+
(r'\*/', Comment.Multiline, '#pop'),
|
178
|
+
(r'[*/]', Comment.Multiline)
|
179
|
+
],
|
180
|
+
'import': [
|
181
|
+
(ur'(%s|\.)+' % idrest, Name.Namespace, '#pop')
|
182
|
+
],
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
class GosuLexer(RegexLexer):
|
187
|
+
"""
|
188
|
+
For Gosu source code.
|
189
|
+
|
190
|
+
*New in Pygments 1.5.*
|
191
|
+
"""
|
192
|
+
|
193
|
+
name = 'Gosu'
|
194
|
+
aliases = ['gosu']
|
195
|
+
filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark']
|
196
|
+
mimetypes = ['text/x-gosu']
|
197
|
+
|
198
|
+
flags = re.MULTILINE | re.DOTALL
|
199
|
+
|
200
|
+
#: optional Comment or Whitespace
|
201
|
+
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
202
|
+
|
203
|
+
tokens = {
|
204
|
+
'root': [
|
205
|
+
# method names
|
206
|
+
(r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # modifiers etc.
|
207
|
+
r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
|
208
|
+
r'(\s*)(\()', # signature start
|
209
|
+
bygroups(using(this), Name.Function, Text, Operator)),
|
210
|
+
(r'[^\S\n]+', Text),
|
211
|
+
(r'//.*?\n', Comment.Single),
|
212
|
+
(r'/\*.*?\*/', Comment.Multiline),
|
213
|
+
(r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
|
214
|
+
(r'(in|as|typeof|statictypeof|typeis|typeas|if|else|foreach|for|'
|
215
|
+
r'index|while|do|continue|break|return|try|catch|finally|this|'
|
216
|
+
r'throw|new|switch|case|default|eval|super|outer|classpath|'
|
217
|
+
r'using)\b', Keyword),
|
218
|
+
(r'(var|delegate|construct|function|private|internal|protected|'
|
219
|
+
r'public|abstract|override|final|static|extends|transient|'
|
220
|
+
r'implements|represents|readonly)\b', Keyword.Declaration),
|
221
|
+
(r'(property\s+)(get|set|)', Keyword.Declaration),
|
222
|
+
(r'(boolean|byte|char|double|float|int|long|short|void|block)\b',
|
223
|
+
Keyword.Type),
|
224
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
|
225
|
+
(r'(true|false|null|NaN|Infinity)\b', Keyword.Constant),
|
226
|
+
(r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
|
227
|
+
bygroups(Keyword.Declaration, Text, Name.Class)),
|
228
|
+
(r'(uses)(\s+)([a-zA-Z0-9_.]+\*?)',
|
229
|
+
bygroups(Keyword.Namespace, Text, Name.Namespace)),
|
230
|
+
(r'"', String, 'string'),
|
231
|
+
(r'(\??[\.#])([a-zA-Z_][a-zA-Z0-9_]*)',
|
232
|
+
bygroups(Operator, Name.Attribute)),
|
233
|
+
(r'(:)([a-zA-Z_][a-zA-Z0-9_]*)',
|
234
|
+
bygroups(Operator, Name.Attribute)),
|
235
|
+
(r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
|
236
|
+
(r'and|or|not|[\\~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
|
237
|
+
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
238
|
+
(r'[0-9]+', Number.Integer),
|
239
|
+
(r'\n', Text)
|
240
|
+
],
|
241
|
+
'templateText': [
|
242
|
+
(r'(\\<)|(\\\$)', String),
|
243
|
+
(r'(<%@\s+)(extends|params)',
|
244
|
+
bygroups(Operator, Name.Decorator), 'stringTemplate'),
|
245
|
+
(r'<%!--.*?--%>', Comment.Multiline),
|
246
|
+
(r'(<%)|(<%=)', Operator, 'stringTemplate'),
|
247
|
+
(r'\$\{', Operator, 'stringTemplateShorthand'),
|
248
|
+
(r'.', String)
|
249
|
+
],
|
250
|
+
'string': [
|
251
|
+
(r'"', String, '#pop'),
|
252
|
+
include('templateText')
|
253
|
+
],
|
254
|
+
'stringTemplate': [
|
255
|
+
(r'"', String, 'string'),
|
256
|
+
(r'%>', Operator, '#pop'),
|
257
|
+
include('root')
|
258
|
+
],
|
259
|
+
'stringTemplateShorthand': [
|
260
|
+
(r'"', String, 'string'),
|
261
|
+
(r'\{', Operator, 'stringTemplateShorthand'),
|
262
|
+
(r'\}', Operator, '#pop'),
|
263
|
+
include('root')
|
264
|
+
],
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
class GosuTemplateLexer(Lexer):
|
269
|
+
"""
|
270
|
+
For Gosu templates.
|
271
|
+
|
272
|
+
*New in Pygments 1.5.*
|
273
|
+
"""
|
274
|
+
|
275
|
+
name = 'Gosu Template'
|
276
|
+
aliases = ['gst']
|
277
|
+
filenames = ['*.gst']
|
278
|
+
mimetypes = ['text/x-gosu-template']
|
279
|
+
lexer = GosuLexer()
|
280
|
+
|
281
|
+
def get_tokens_unprocessed(self, text):
|
282
|
+
stack = ['templateText']
|
283
|
+
for item in self.lexer.get_tokens_unprocessed(text, stack):
|
284
|
+
yield item
|
285
|
+
|
286
|
+
|
287
|
+
class GroovyLexer(RegexLexer):
|
288
|
+
"""
|
289
|
+
For `Groovy <http://groovy.codehaus.org/>`_ source code.
|
290
|
+
|
291
|
+
*New in Pygments 1.5.*
|
292
|
+
"""
|
293
|
+
|
294
|
+
name = 'Groovy'
|
295
|
+
aliases = ['groovy']
|
296
|
+
filenames = ['*.groovy']
|
297
|
+
mimetypes = ['text/x-groovy']
|
298
|
+
|
299
|
+
flags = re.MULTILINE | re.DOTALL
|
300
|
+
|
301
|
+
#: optional Comment or Whitespace
|
302
|
+
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
303
|
+
|
304
|
+
tokens = {
|
305
|
+
'root': [
|
306
|
+
# method names
|
307
|
+
(r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
|
308
|
+
r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
|
309
|
+
r'(\s*)(\()', # signature start
|
310
|
+
bygroups(using(this), Name.Function, Text, Operator)),
|
311
|
+
(r'[^\S\n]+', Text),
|
312
|
+
(r'//.*?\n', Comment.Single),
|
313
|
+
(r'/\*.*?\*/', Comment.Multiline),
|
314
|
+
(r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
|
315
|
+
(r'(assert|break|case|catch|continue|default|do|else|finally|for|'
|
316
|
+
r'if|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b',
|
317
|
+
Keyword),
|
318
|
+
(r'(abstract|const|enum|extends|final|implements|native|private|'
|
319
|
+
r'protected|public|static|strictfp|super|synchronized|throws|'
|
320
|
+
r'transient|volatile)\b', Keyword.Declaration),
|
321
|
+
(r'(def|boolean|byte|char|double|float|int|long|short|void)\b',
|
322
|
+
Keyword.Type),
|
323
|
+
(r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
|
324
|
+
(r'(true|false|null)\b', Keyword.Constant),
|
325
|
+
(r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text),
|
326
|
+
'class'),
|
327
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
|
328
|
+
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
329
|
+
(r"'(\\\\|\\'|[^'])*'", String.Single),
|
330
|
+
(r'\$/((?!/\$).)*/\$', String),
|
331
|
+
(r'/(\\\\|\\"|[^/])*/', String),
|
332
|
+
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
|
333
|
+
(r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
|
334
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
|
335
|
+
(r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
|
336
|
+
(r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
|
337
|
+
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
338
|
+
(r'0x[0-9a-f]+', Number.Hex),
|
339
|
+
(r'[0-9]+L?', Number.Integer),
|
340
|
+
(r'\n', Text)
|
341
|
+
],
|
342
|
+
'class': [
|
343
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
|
344
|
+
],
|
345
|
+
'import': [
|
346
|
+
(r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
|
347
|
+
],
|
348
|
+
}
|
349
|
+
|
350
|
+
|
351
|
+
class IokeLexer(RegexLexer):
|
352
|
+
"""
|
353
|
+
For `Ioke <http://ioke.org/>`_ (a strongly typed, dynamic,
|
354
|
+
prototype based programming language) source.
|
355
|
+
|
356
|
+
*New in Pygments 1.4.*
|
357
|
+
"""
|
358
|
+
name = 'Ioke'
|
359
|
+
filenames = ['*.ik']
|
360
|
+
aliases = ['ioke', 'ik']
|
361
|
+
mimetypes = ['text/x-iokesrc']
|
362
|
+
tokens = {
|
363
|
+
'interpolatableText': [
|
364
|
+
(r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}'
|
365
|
+
r'|\\[0-3]?[0-7]?[0-7])', String.Escape),
|
366
|
+
(r'#{', Punctuation, 'textInterpolationRoot')
|
367
|
+
],
|
368
|
+
|
369
|
+
'text': [
|
370
|
+
(r'(?<!\\)"', String, '#pop'),
|
371
|
+
include('interpolatableText'),
|
372
|
+
(r'[^"]', String)
|
373
|
+
],
|
374
|
+
|
375
|
+
'documentation': [
|
376
|
+
(r'(?<!\\)"', String.Doc, '#pop'),
|
377
|
+
include('interpolatableText'),
|
378
|
+
(r'[^"]', String.Doc)
|
379
|
+
],
|
380
|
+
|
381
|
+
'textInterpolationRoot': [
|
382
|
+
(r'}', Punctuation, '#pop'),
|
383
|
+
include('root')
|
384
|
+
],
|
385
|
+
|
386
|
+
'slashRegexp': [
|
387
|
+
(r'(?<!\\)/[oxpniums]*', String.Regex, '#pop'),
|
388
|
+
include('interpolatableText'),
|
389
|
+
(r'\\/', String.Regex),
|
390
|
+
(r'[^/]', String.Regex)
|
391
|
+
],
|
392
|
+
|
393
|
+
'squareRegexp': [
|
394
|
+
(r'(?<!\\)][oxpniums]*', String.Regex, '#pop'),
|
395
|
+
include('interpolatableText'),
|
396
|
+
(r'\\]', String.Regex),
|
397
|
+
(r'[^\]]', String.Regex)
|
398
|
+
],
|
399
|
+
|
400
|
+
'squareText': [
|
401
|
+
(r'(?<!\\)]', String, '#pop'),
|
402
|
+
include('interpolatableText'),
|
403
|
+
(r'[^\]]', String)
|
404
|
+
],
|
405
|
+
|
406
|
+
'root': [
|
407
|
+
(r'\n', Text),
|
408
|
+
(r'\s+', Text),
|
409
|
+
|
410
|
+
# Comments
|
411
|
+
(r';(.*?)\n', Comment),
|
412
|
+
(r'\A#!(.*?)\n', Comment),
|
413
|
+
|
414
|
+
#Regexps
|
415
|
+
(r'#/', String.Regex, 'slashRegexp'),
|
416
|
+
(r'#r\[', String.Regex, 'squareRegexp'),
|
417
|
+
|
418
|
+
#Symbols
|
419
|
+
(r':[a-zA-Z0-9_!:?]+', String.Symbol),
|
420
|
+
(r'[a-zA-Z0-9_!:?]+:(?![a-zA-Z0-9_!?])', String.Other),
|
421
|
+
(r':"(\\\\|\\"|[^"])*"', String.Symbol),
|
422
|
+
|
423
|
+
#Documentation
|
424
|
+
(r'((?<=fn\()|(?<=fnx\()|(?<=method\()|(?<=macro\()|(?<=lecro\()'
|
425
|
+
r'|(?<=syntax\()|(?<=dmacro\()|(?<=dlecro\()|(?<=dlecrox\()'
|
426
|
+
r'|(?<=dsyntax\())\s*"', String.Doc, 'documentation'),
|
427
|
+
|
428
|
+
#Text
|
429
|
+
(r'"', String, 'text'),
|
430
|
+
(r'#\[', String, 'squareText'),
|
431
|
+
|
432
|
+
#Mimic
|
433
|
+
(r'[a-zA-Z0-9_][a-zA-Z0-9!?_:]+(?=\s*=.*mimic\s)', Name.Entity),
|
434
|
+
|
435
|
+
#Assignment
|
436
|
+
(r'[a-zA-Z_][a-zA-Z0-9_!:?]*(?=[\s]*[+*/-]?=[^=].*($|\.))',
|
437
|
+
Name.Variable),
|
438
|
+
|
439
|
+
# keywords
|
440
|
+
(r'(break|cond|continue|do|ensure|for|for:dict|for:set|if|let|'
|
441
|
+
r'loop|p:for|p:for:dict|p:for:set|return|unless|until|while|'
|
442
|
+
r'with)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
443
|
+
|
444
|
+
# Origin
|
445
|
+
(r'(eval|mimic|print|println)(?![a-zA-Z0-9!:_?])', Keyword),
|
446
|
+
|
447
|
+
# Base
|
448
|
+
(r'(cell\?|cellNames|cellOwner\?|cellOwner|cells|cell|'
|
449
|
+
r'documentation|hash|identity|mimic|removeCell\!|undefineCell\!)'
|
450
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword),
|
451
|
+
|
452
|
+
# Ground
|
453
|
+
(r'(stackTraceAsText)(?![a-zA-Z0-9!:_?])', Keyword),
|
454
|
+
|
455
|
+
#DefaultBehaviour Literals
|
456
|
+
(r'(dict|list|message|set)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
457
|
+
|
458
|
+
#DefaultBehaviour Case
|
459
|
+
(r'(case|case:and|case:else|case:nand|case:nor|case:not|case:or|'
|
460
|
+
r'case:otherwise|case:xor)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
461
|
+
|
462
|
+
#DefaultBehaviour Reflection
|
463
|
+
(r'(asText|become\!|derive|freeze\!|frozen\?|in\?|is\?|kind\?|'
|
464
|
+
r'mimic\!|mimics|mimics\?|prependMimic\!|removeAllMimics\!|'
|
465
|
+
r'removeMimic\!|same\?|send|thaw\!|uniqueHexId)'
|
466
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword),
|
467
|
+
|
468
|
+
#DefaultBehaviour Aspects
|
469
|
+
(r'(after|around|before)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
470
|
+
|
471
|
+
# DefaultBehaviour
|
472
|
+
(r'(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)'
|
473
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword),
|
474
|
+
(r'(use|destructuring)', Keyword.Reserved),
|
475
|
+
|
476
|
+
#DefaultBehavior BaseBehavior
|
477
|
+
(r'(cell\?|cellOwner\?|cellOwner|cellNames|cells|cell|'
|
478
|
+
r'documentation|identity|removeCell!|undefineCell)'
|
479
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword),
|
480
|
+
|
481
|
+
#DefaultBehavior Internal
|
482
|
+
(r'(internal:compositeRegexp|internal:concatenateText|'
|
483
|
+
r'internal:createDecimal|internal:createNumber|'
|
484
|
+
r'internal:createRegexp|internal:createText)'
|
485
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
486
|
+
|
487
|
+
#DefaultBehaviour Conditions
|
488
|
+
(r'(availableRestarts|bind|error\!|findRestart|handle|'
|
489
|
+
r'invokeRestart|rescue|restart|signal\!|warn\!)'
|
490
|
+
r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
|
491
|
+
|
492
|
+
# constants
|
493
|
+
(r'(nil|false|true)(?![a-zA-Z0-9!:_?])', Name.Constant),
|
494
|
+
|
495
|
+
# names
|
496
|
+
(r'(Arity|Base|Call|Condition|DateTime|Aspects|Pointcut|'
|
497
|
+
r'Assignment|BaseBehavior|Boolean|Case|AndCombiner|Else|'
|
498
|
+
r'NAndCombiner|NOrCombiner|NotCombiner|OrCombiner|XOrCombiner|'
|
499
|
+
r'Conditions|Definitions|FlowControl|Internal|Literals|'
|
500
|
+
r'Reflection|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|'
|
501
|
+
r'FileSystem|Ground|Handler|Hook|IO|IokeGround|Struct|'
|
502
|
+
r'LexicalBlock|LexicalMacro|List|Message|Method|Mixins|'
|
503
|
+
r'NativeMethod|Number|Origin|Pair|Range|Reflector|Regexp Match|'
|
504
|
+
r'Regexp|Rescue|Restart|Runtime|Sequence|Set|Symbol|'
|
505
|
+
r'System|Text|Tuple)(?![a-zA-Z0-9!:_?])', Name.Builtin),
|
506
|
+
|
507
|
+
# functions
|
508
|
+
(ur'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|'
|
509
|
+
ur'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)'
|
510
|
+
ur'(?![a-zA-Z0-9!:_?])', Name.Function),
|
511
|
+
|
512
|
+
# Numbers
|
513
|
+
(r'-?0[xX][0-9a-fA-F]+', Number.Hex),
|
514
|
+
(r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
515
|
+
(r'-?\d+', Number.Integer),
|
516
|
+
|
517
|
+
(r'#\(', Punctuation),
|
518
|
+
|
519
|
+
# Operators
|
520
|
+
(ur'(&&>>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|'
|
521
|
+
ur'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|'
|
522
|
+
ur'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|'
|
523
|
+
ur'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|'
|
524
|
+
ur'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|'
|
525
|
+
ur'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|'
|
526
|
+
ur'\?|#|\u2260|\u2218|\u2208|\u2209)', Operator),
|
527
|
+
(r'(and|nand|or|xor|nor|return|import)(?![a-zA-Z0-9_!?])',
|
528
|
+
Operator),
|
529
|
+
|
530
|
+
# Punctuation
|
531
|
+
(r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|{|})', Punctuation),
|
532
|
+
|
533
|
+
#kinds
|
534
|
+
(r'[A-Z][a-zA-Z0-9_!:?]*', Name.Class),
|
535
|
+
|
536
|
+
#default cellnames
|
537
|
+
(r'[a-z_][a-zA-Z0-9_!:?]*', Name)
|
538
|
+
]
|
539
|
+
}
|
540
|
+
|
541
|
+
|
542
|
+
class ClojureLexer(RegexLexer):
|
543
|
+
"""
|
544
|
+
Lexer for `Clojure <http://clojure.org/>`_ source code.
|
545
|
+
|
546
|
+
*New in Pygments 0.11.*
|
547
|
+
"""
|
548
|
+
name = 'Clojure'
|
549
|
+
aliases = ['clojure', 'clj']
|
550
|
+
filenames = ['*.clj']
|
551
|
+
mimetypes = ['text/x-clojure', 'application/x-clojure']
|
552
|
+
|
553
|
+
special_forms = [
|
554
|
+
'.', 'def', 'do', 'fn', 'if', 'let', 'new', 'quote', 'var', 'loop'
|
555
|
+
]
|
556
|
+
|
557
|
+
# It's safe to consider 'ns' a declaration thing because it defines a new
|
558
|
+
# namespace.
|
559
|
+
declarations = [
|
560
|
+
'def-', 'defn', 'defn-', 'defmacro', 'defmulti', 'defmethod',
|
561
|
+
'defstruct', 'defonce', 'declare', 'definline', 'definterface',
|
562
|
+
'defprotocol', 'defrecord', 'deftype', 'defproject', 'ns'
|
563
|
+
]
|
564
|
+
|
565
|
+
builtins = [
|
566
|
+
'*', '+', '-', '->', '/', '<', '<=', '=', '==', '>', '>=', '..',
|
567
|
+
'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns',
|
568
|
+
'alter', 'and', 'append-child', 'apply', 'array-map', 'aset',
|
569
|
+
'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float',
|
570
|
+
'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await',
|
571
|
+
'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or',
|
572
|
+
'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?',
|
573
|
+
'butlast', 'byte', 'cast', 'char', 'children', 'class',
|
574
|
+
'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator',
|
575
|
+
'complement', 'concat', 'conj', 'cons', 'constantly', 'cond', 'if-not',
|
576
|
+
'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct',
|
577
|
+
'cycle', 'dec', 'deref', 'difference', 'disj', 'dissoc', 'distinct',
|
578
|
+
'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto',
|
579
|
+
'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure',
|
580
|
+
'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find',
|
581
|
+
'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush', 'for',
|
582
|
+
'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get',
|
583
|
+
'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import',
|
584
|
+
'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right',
|
585
|
+
'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave',
|
586
|
+
'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys',
|
587
|
+
'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left',
|
588
|
+
'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file',
|
589
|
+
'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1',
|
590
|
+
'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat',
|
591
|
+
'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min',
|
592
|
+
'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next',
|
593
|
+
'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports',
|
594
|
+
'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers',
|
595
|
+
'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial',
|
596
|
+
'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str',
|
597
|
+
'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy',
|
598
|
+
'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find',
|
599
|
+
're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq',
|
600
|
+
'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem',
|
601
|
+
'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys',
|
602
|
+
'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq',
|
603
|
+
'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq',
|
604
|
+
'second', 'select', 'select-keys', 'send', 'send-off', 'seq',
|
605
|
+
'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort',
|
606
|
+
'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set',
|
607
|
+
'special-symbol?', 'split-at', 'split-with', 'str', 'string?',
|
608
|
+
'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?',
|
609
|
+
'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array',
|
610
|
+
'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy',
|
611
|
+
'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip',
|
612
|
+
'vector?', 'when', 'when-first', 'when-let', 'when-not',
|
613
|
+
'with-local-vars', 'with-meta', 'with-open', 'with-out-str',
|
614
|
+
'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper']
|
615
|
+
|
616
|
+
# valid names for identifiers
|
617
|
+
# well, names can only not consist fully of numbers
|
618
|
+
# but this should be good enough for now
|
619
|
+
|
620
|
+
# TODO / should divide keywords/symbols into namespace/rest
|
621
|
+
# but that's hard, so just pretend / is part of the name
|
622
|
+
valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
|
623
|
+
|
624
|
+
def _multi_escape(entries):
|
625
|
+
return '(%s)' % ('|'.join(re.escape(entry) + ' ' for entry in entries))
|
626
|
+
|
627
|
+
tokens = {
|
628
|
+
'root': [
|
629
|
+
# the comments - always starting with semicolon
|
630
|
+
# and going to the end of the line
|
631
|
+
(r';.*$', Comment.Single),
|
632
|
+
|
633
|
+
# whitespaces - usually not relevant
|
634
|
+
(r'[,\s]+', Text),
|
635
|
+
|
636
|
+
# numbers
|
637
|
+
(r'-?\d+\.\d+', Number.Float),
|
638
|
+
(r'-?\d+', Number.Integer),
|
639
|
+
(r'0x-?[abcdef\d]+', Number.Hex),
|
640
|
+
|
641
|
+
# strings, symbols and characters
|
642
|
+
(r'"(\\\\|\\"|[^"])*"', String),
|
643
|
+
(r"'" + valid_name, String.Symbol),
|
644
|
+
(r"\\(.|[a-z]+)", String.Char),
|
645
|
+
|
646
|
+
# keywords
|
647
|
+
(r':' + valid_name, String.Symbol),
|
648
|
+
|
649
|
+
# special operators
|
650
|
+
(r'~@|[`\'#^~&]', Operator),
|
651
|
+
|
652
|
+
# highlight the special forms
|
653
|
+
(_multi_escape(special_forms), Keyword),
|
654
|
+
|
655
|
+
# Technically, only the special forms are 'keywords'. The problem
|
656
|
+
# is that only treating them as keywords means that things like
|
657
|
+
# 'defn' and 'ns' need to be highlighted as builtins. This is ugly
|
658
|
+
# and weird for most styles. So, as a compromise we're going to
|
659
|
+
# highlight them as Keyword.Declarations.
|
660
|
+
(_multi_escape(declarations), Keyword.Declaration),
|
661
|
+
|
662
|
+
# highlight the builtins
|
663
|
+
(_multi_escape(builtins), Name.Builtin),
|
664
|
+
|
665
|
+
# the remaining functions
|
666
|
+
(r'(?<=\()' + valid_name, Name.Function),
|
667
|
+
|
668
|
+
# find the remaining variables
|
669
|
+
(valid_name, Name.Variable),
|
670
|
+
|
671
|
+
# Clojure accepts vector notation
|
672
|
+
(r'(\[|\])', Punctuation),
|
673
|
+
|
674
|
+
# Clojure accepts map notation
|
675
|
+
(r'(\{|\})', Punctuation),
|
676
|
+
|
677
|
+
# the famous parentheses!
|
678
|
+
(r'(\(|\))', Punctuation),
|
679
|
+
],
|
680
|
+
}
|
681
|
+
|
682
|
+
|
683
|
+
class TeaLangLexer(RegexLexer):
|
684
|
+
"""
|
685
|
+
For `Tea <http://teatrove.org/>`_ source code. Only used within a
|
686
|
+
TeaTemplateLexer.
|
687
|
+
|
688
|
+
*New in Pygments 1.5.*
|
689
|
+
"""
|
690
|
+
|
691
|
+
flags = re.MULTILINE | re.DOTALL
|
692
|
+
|
693
|
+
#: optional Comment or Whitespace
|
694
|
+
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
|
695
|
+
|
696
|
+
tokens = {
|
697
|
+
'root': [
|
698
|
+
# method names
|
699
|
+
(r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
|
700
|
+
r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
|
701
|
+
r'(\s*)(\()', # signature start
|
702
|
+
bygroups(using(this), Name.Function, Text, Operator)),
|
703
|
+
(r'[^\S\n]+', Text),
|
704
|
+
(r'//.*?\n', Comment.Single),
|
705
|
+
(r'/\*.*?\*/', Comment.Multiline),
|
706
|
+
(r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
|
707
|
+
(r'(and|break|else|foreach|if|in|not|or|reverse)\b',
|
708
|
+
Keyword),
|
709
|
+
(r'(as|call|define)\b', Keyword.Declaration),
|
710
|
+
(r'(true|false|null)\b', Keyword.Constant),
|
711
|
+
(r'(template)(\s+)', bygroups(Keyword.Declaration, Text), 'template'),
|
712
|
+
(r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
|
713
|
+
(r'"(\\\\|\\"|[^"])*"', String),
|
714
|
+
(r'\'(\\\\|\\\'|[^\'])*\'', String),
|
715
|
+
(r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
|
716
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
|
717
|
+
(r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
|
718
|
+
(r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator),
|
719
|
+
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
720
|
+
(r'0x[0-9a-f]+', Number.Hex),
|
721
|
+
(r'[0-9]+L?', Number.Integer),
|
722
|
+
(r'\n', Text)
|
723
|
+
],
|
724
|
+
'template': [
|
725
|
+
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
|
726
|
+
],
|
727
|
+
'import': [
|
728
|
+
(r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
|
729
|
+
],
|
730
|
+
}
|
731
|
+
|
732
|
+
|
733
|
+
class KotlinLexer(RegexLexer):
|
734
|
+
"""
|
735
|
+
For `Kotlin <http://confluence.jetbrains.net/display/Kotlin/>`_
|
736
|
+
source code.
|
737
|
+
|
738
|
+
Additional options accepted:
|
739
|
+
|
740
|
+
`unicodelevel`
|
741
|
+
Determines which Unicode characters this lexer allows for identifiers.
|
742
|
+
The possible values are:
|
743
|
+
|
744
|
+
* ``none`` -- only the ASCII letters and numbers are allowed. This
|
745
|
+
is the fastest selection.
|
746
|
+
* ``basic`` -- all Unicode characters from the specification except
|
747
|
+
category ``Lo`` are allowed.
|
748
|
+
* ``full`` -- all Unicode characters as specified in the C# specs
|
749
|
+
are allowed. Note that this means a considerable slowdown since the
|
750
|
+
``Lo`` category has more than 40,000 characters in it!
|
751
|
+
|
752
|
+
The default value is ``basic``.
|
753
|
+
|
754
|
+
*New in Pygments 1.5.*
|
755
|
+
"""
|
756
|
+
|
757
|
+
name = 'Kotlin'
|
758
|
+
aliases = ['kotlin']
|
759
|
+
filenames = ['*.kt']
|
760
|
+
mimetypes = ['text/x-kotlin'] # inferred
|
761
|
+
|
762
|
+
flags = re.MULTILINE | re.DOTALL | re.UNICODE
|
763
|
+
|
764
|
+
# for the range of allowed unicode characters in identifiers,
|
765
|
+
# see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
|
766
|
+
|
767
|
+
def _escape(st):
|
768
|
+
return st.replace(u'\\', ur'\\').replace(u'-', ur'\-').\
|
769
|
+
replace(u'[', ur'\[').replace(u']', ur'\]')
|
770
|
+
|
771
|
+
levels = {
|
772
|
+
'none': '@?[_a-zA-Z][a-zA-Z0-9_]*',
|
773
|
+
'basic': ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' +
|
774
|
+
'[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl +
|
775
|
+
uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'),
|
776
|
+
'full': ('@?(?:_|[^' +
|
777
|
+
_escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl')) + '])'
|
778
|
+
+ '[^' + _escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo',
|
779
|
+
'Nl', 'Nd', 'Pc', 'Cf', 'Mn',
|
780
|
+
'Mc')) + ']*'),
|
781
|
+
}
|
782
|
+
|
783
|
+
tokens = {}
|
784
|
+
token_variants = True
|
785
|
+
|
786
|
+
for levelname, cs_ident in levels.items():
|
787
|
+
tokens[levelname] = {
|
788
|
+
'root': [
|
789
|
+
# method names
|
790
|
+
(r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
|
791
|
+
r'(' + cs_ident + ')' # method name
|
792
|
+
r'(\s*)(\()', # signature start
|
793
|
+
bygroups(using(this), Name.Function, Text, Punctuation)),
|
794
|
+
(r'^\s*\[.*?\]', Name.Attribute),
|
795
|
+
(r'[^\S\n]+', Text),
|
796
|
+
(r'\\\n', Text), # line continuation
|
797
|
+
(r'//.*?\n', Comment.Single),
|
798
|
+
(r'/[*](.|\n)*?[*]/', Comment.Multiline),
|
799
|
+
(r'\n', Text),
|
800
|
+
(r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
|
801
|
+
(r'[{}]', Punctuation),
|
802
|
+
(r'@"(""|[^"])*"', String),
|
803
|
+
(r'"(\\\\|\\"|[^"\n])*["\n]', String),
|
804
|
+
(r"'\\.'|'[^\\]'", String.Char),
|
805
|
+
(r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
|
806
|
+
r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
|
807
|
+
(r'#[ \t]*(if|endif|else|elif|define|undef|'
|
808
|
+
r'line|error|warning|region|endregion|pragma)\b.*?\n',
|
809
|
+
Comment.Preproc),
|
810
|
+
(r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text,
|
811
|
+
Keyword)),
|
812
|
+
(r'(abstract|as|break|catch|'
|
813
|
+
r'fun|continue|default|delegate|'
|
814
|
+
r'do|else|enum|extern|false|finally|'
|
815
|
+
r'fixed|for|goto|if|implicit|in|interface|'
|
816
|
+
r'internal|is|lock|null|'
|
817
|
+
r'out|override|private|protected|public|readonly|'
|
818
|
+
r'ref|return|sealed|sizeof|'
|
819
|
+
r'when|this|throw|true|try|typeof|'
|
820
|
+
r'unchecked|unsafe|virtual|void|while|'
|
821
|
+
r'get|set|new|partial|yield|val|var)\b', Keyword),
|
822
|
+
(r'(global)(::)', bygroups(Keyword, Punctuation)),
|
823
|
+
(r'(bool|byte|char|decimal|double|dynamic|float|int|long|'
|
824
|
+
r'short)\b\??', Keyword.Type),
|
825
|
+
(r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
|
826
|
+
(r'(package|using)(\s+)', bygroups(Keyword, Text), 'package'),
|
827
|
+
(cs_ident, Name),
|
828
|
+
],
|
829
|
+
'class': [
|
830
|
+
(cs_ident, Name.Class, '#pop')
|
831
|
+
],
|
832
|
+
'package': [
|
833
|
+
(r'(?=\()', Text, '#pop'), # using (resource)
|
834
|
+
('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop')
|
835
|
+
]
|
836
|
+
}
|
837
|
+
|
838
|
+
def __init__(self, **options):
|
839
|
+
level = get_choice_opt(options, 'unicodelevel', self.tokens.keys(),
|
840
|
+
'basic')
|
841
|
+
if level not in self._all_tokens:
|
842
|
+
# compile the regexes now
|
843
|
+
self._tokens = self.__class__.process_tokendef(level)
|
844
|
+
else:
|
845
|
+
self._tokens = self._all_tokens[level]
|
846
|
+
|
847
|
+
RegexLexer.__init__(self, **options)
|