pygments.rb 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +40 -0
- data/README.md +3 -0
- data/lexers +0 -0
- data/lib/pygments/popen.rb +3 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/vendor/pygments-main/AUTHORS +20 -1
- data/vendor/pygments-main/CHANGES +55 -3
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/MANIFEST.in +1 -1
- data/vendor/pygments-main/Makefile +5 -8
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/doc/Makefile +153 -0
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
- data/vendor/pygments-main/doc/conf.py +249 -0
- data/vendor/pygments-main/doc/docs/api.rst +316 -0
- data/vendor/pygments-main/doc/docs/authors.rst +4 -0
- data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
- data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
- data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
- data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
- data/vendor/pygments-main/doc/docs/index.rst +66 -0
- data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
- data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
- data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
- data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
- data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
- data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
- data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
- data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
- data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
- data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
- data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
- data/vendor/pygments-main/doc/download.rst +41 -0
- data/vendor/pygments-main/doc/faq.rst +143 -0
- data/vendor/pygments-main/doc/index.rst +53 -0
- data/vendor/pygments-main/doc/languages.rst +151 -0
- data/vendor/pygments-main/doc/make.bat +190 -0
- data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
- data/vendor/pygments-main/external/autopygmentize +65 -48
- data/vendor/pygments-main/external/markdown-processor.py +15 -15
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +2 -3
- data/vendor/pygments-main/ez_setup.py +340 -234
- data/vendor/pygments-main/pygments/__init__.py +4 -4
- data/vendor/pygments-main/pygments/cmdline.py +81 -68
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
- data/vendor/pygments-main/pygments/formatter.py +3 -3
- data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
- data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +44 -26
- data/vendor/pygments-main/pygments/formatters/img.py +21 -14
- data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
- data/vendor/pygments-main/pygments/formatters/other.py +53 -6
- data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
- data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
- data/vendor/pygments-main/pygments/lexer.py +59 -39
- data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
- data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
- data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
- data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
- data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
- data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
- data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
- data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
- data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
- data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
- data/vendor/pygments-main/pygments/lexers/math.py +438 -70
- data/vendor/pygments-main/pygments/lexers/other.py +885 -171
- data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
- data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
- data/vendor/pygments-main/pygments/lexers/special.py +7 -8
- data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
- data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
- data/vendor/pygments-main/pygments/lexers/text.py +208 -46
- data/vendor/pygments-main/pygments/lexers/web.py +729 -264
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/sphinxext.py +153 -0
- data/vendor/pygments-main/pygments/style.py +3 -2
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +29 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
- data/vendor/pygments-main/pygments/token.py +4 -1
- data/vendor/pygments-main/pygments/unistring.py +6 -5
- data/vendor/pygments-main/pygments/util.py +35 -21
- data/vendor/pygments-main/scripts/check_sources.py +28 -44
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
- data/vendor/pygments-main/scripts/find_codetags.py +27 -19
- data/vendor/pygments-main/scripts/find_error.py +16 -13
- data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
- data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
- data/vendor/pygments-main/setup.py +19 -19
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
- data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
- data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
- data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
- data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
- data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
- data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
- data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
- data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
- data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
- data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
- data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
- data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
- data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
- data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
- data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
- data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
- data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
- data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
- data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
- data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
- data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
- data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
- data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
- data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
- data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
- data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
- data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
- data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
- data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
- data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
- data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
- data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
- data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
- data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
- data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
- data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
- data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
- data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
- data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
- data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
- data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
- data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
- data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
- data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
- data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
- data/vendor/pygments-main/tests/run.py +14 -19
- data/vendor/pygments-main/tests/string_asserts.py +22 -0
- data/vendor/pygments-main/tests/test_basic_api.py +28 -14
- data/vendor/pygments-main/tests/test_cfm.py +46 -0
- data/vendor/pygments-main/tests/test_clexer.py +208 -3
- data/vendor/pygments-main/tests/test_cmdline.py +6 -5
- data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
- data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
- data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
- data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
- data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
- data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
- data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
- data/vendor/pygments-main/tests/test_token.py +3 -3
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +1 -1
- metadata +138 -51
- data/vendor/pygments-main/docs/generate.py +0 -472
- data/vendor/pygments-main/docs/src/api.txt +0 -270
- data/vendor/pygments-main/docs/src/authors.txt +0 -5
- data/vendor/pygments-main/docs/src/changelog.txt +0 -5
- data/vendor/pygments-main/docs/src/index.txt +0 -69
- data/vendor/pygments-main/docs/src/installation.txt +0 -71
- data/vendor/pygments-main/external/rst-directive-old.py +0 -77
- data/vendor/pygments-main/scripts/reindent.py +0 -291
- data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
- data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Lexers for parser generators.
|
7
7
|
|
8
|
-
:copyright: Copyright 2006-
|
8
|
+
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
|
9
9
|
:license: BSD, see LICENSE for details.
|
10
10
|
"""
|
11
11
|
|
@@ -38,7 +38,7 @@ class RagelLexer(RegexLexer):
|
|
38
38
|
fragments of Ragel. For ``.rl`` files, use RagelEmbeddedLexer instead
|
39
39
|
(or one of the language-specific subclasses).
|
40
40
|
|
41
|
-
|
41
|
+
.. versionadded:: 1.1
|
42
42
|
"""
|
43
43
|
|
44
44
|
name = 'Ragel'
|
@@ -102,7 +102,7 @@ class RagelLexer(RegexLexer):
|
|
102
102
|
'host': [
|
103
103
|
(r'(' + r'|'.join(( # keep host code in largest possible chunks
|
104
104
|
r'[^{}\'"/#]+', # exclude unsafe characters
|
105
|
-
r'[^\\]
|
105
|
+
r'[^\\]\\[{}]', # allow escaped { or }
|
106
106
|
|
107
107
|
# strings and comments may safely contain unsafe characters
|
108
108
|
r'"(\\\\|\\"|[^"])*"', # double quote string
|
@@ -132,7 +132,7 @@ class RagelEmbeddedLexer(RegexLexer):
|
|
132
132
|
This will only highlight Ragel statements. If you want host language
|
133
133
|
highlighting then call the language-specific Ragel lexer.
|
134
134
|
|
135
|
-
|
135
|
+
.. versionadded:: 1.1
|
136
136
|
"""
|
137
137
|
|
138
138
|
name = 'Embedded Ragel'
|
@@ -173,7 +173,7 @@ class RagelEmbeddedLexer(RegexLexer):
|
|
173
173
|
r'[^}\'"\[/#]', # exclude unsafe characters
|
174
174
|
r'}(?=[^%]|$)', # } is okay as long as it's not followed by %
|
175
175
|
r'}%(?=[^%]|$)', # ...well, one %'s okay, just not two...
|
176
|
-
r'[^\\]
|
176
|
+
r'[^\\]\\[{}]', # ...and } is okay if it's escaped
|
177
177
|
|
178
178
|
# allow / if it's preceded with one of these symbols
|
179
179
|
# (ragel EOF actions)
|
@@ -205,14 +205,14 @@ class RagelEmbeddedLexer(RegexLexer):
|
|
205
205
|
}
|
206
206
|
|
207
207
|
def analyse_text(text):
|
208
|
-
return '@LANG: indep' in text
|
208
|
+
return '@LANG: indep' in text
|
209
209
|
|
210
210
|
|
211
211
|
class RagelRubyLexer(DelegatingLexer):
|
212
212
|
"""
|
213
213
|
A lexer for `Ragel`_ in a Ruby host file.
|
214
214
|
|
215
|
-
|
215
|
+
.. versionadded:: 1.1
|
216
216
|
"""
|
217
217
|
|
218
218
|
name = 'Ragel in Ruby Host'
|
@@ -231,7 +231,7 @@ class RagelCLexer(DelegatingLexer):
|
|
231
231
|
"""
|
232
232
|
A lexer for `Ragel`_ in a C host file.
|
233
233
|
|
234
|
-
|
234
|
+
.. versionadded:: 1.1
|
235
235
|
"""
|
236
236
|
|
237
237
|
name = 'Ragel in C Host'
|
@@ -250,7 +250,7 @@ class RagelDLexer(DelegatingLexer):
|
|
250
250
|
"""
|
251
251
|
A lexer for `Ragel`_ in a D host file.
|
252
252
|
|
253
|
-
|
253
|
+
.. versionadded:: 1.1
|
254
254
|
"""
|
255
255
|
|
256
256
|
name = 'Ragel in D Host'
|
@@ -268,7 +268,7 @@ class RagelCppLexer(DelegatingLexer):
|
|
268
268
|
"""
|
269
269
|
A lexer for `Ragel`_ in a CPP host file.
|
270
270
|
|
271
|
-
|
271
|
+
.. versionadded:: 1.1
|
272
272
|
"""
|
273
273
|
|
274
274
|
name = 'Ragel in CPP Host'
|
@@ -286,7 +286,7 @@ class RagelObjectiveCLexer(DelegatingLexer):
|
|
286
286
|
"""
|
287
287
|
A lexer for `Ragel`_ in an Objective C host file.
|
288
288
|
|
289
|
-
|
289
|
+
.. versionadded:: 1.1
|
290
290
|
"""
|
291
291
|
|
292
292
|
name = 'Ragel in Objective C Host'
|
@@ -306,7 +306,7 @@ class RagelJavaLexer(DelegatingLexer):
|
|
306
306
|
"""
|
307
307
|
A lexer for `Ragel`_ in a Java host file.
|
308
308
|
|
309
|
-
|
309
|
+
.. versionadded:: 1.1
|
310
310
|
"""
|
311
311
|
|
312
312
|
name = 'Ragel in Java Host'
|
@@ -327,7 +327,7 @@ class AntlrLexer(RegexLexer):
|
|
327
327
|
Should not be called directly, instead
|
328
328
|
use DelegatingLexer for your target language.
|
329
329
|
|
330
|
-
|
330
|
+
.. versionadded:: 1.1
|
331
331
|
|
332
332
|
.. _ANTLR: http://www.antlr.org/
|
333
333
|
"""
|
@@ -524,7 +524,7 @@ class AntlrLexer(RegexLexer):
|
|
524
524
|
# """
|
525
525
|
# ANTLR with C Target
|
526
526
|
#
|
527
|
-
#
|
527
|
+
# .. versionadded:: 1.1
|
528
528
|
# """
|
529
529
|
#
|
530
530
|
# name = 'ANTLR With C Target'
|
@@ -541,7 +541,7 @@ class AntlrCppLexer(DelegatingLexer):
|
|
541
541
|
"""
|
542
542
|
`ANTLR`_ with CPP Target
|
543
543
|
|
544
|
-
|
544
|
+
.. versionadded:: 1.1
|
545
545
|
"""
|
546
546
|
|
547
547
|
name = 'ANTLR With CPP Target'
|
@@ -560,7 +560,7 @@ class AntlrObjectiveCLexer(DelegatingLexer):
|
|
560
560
|
"""
|
561
561
|
`ANTLR`_ with Objective-C Target
|
562
562
|
|
563
|
-
|
563
|
+
.. versionadded:: 1.1
|
564
564
|
"""
|
565
565
|
|
566
566
|
name = 'ANTLR With ObjectiveC Target'
|
@@ -580,7 +580,7 @@ class AntlrCSharpLexer(DelegatingLexer):
|
|
580
580
|
"""
|
581
581
|
`ANTLR`_ with C# Target
|
582
582
|
|
583
|
-
|
583
|
+
.. versionadded:: 1.1
|
584
584
|
"""
|
585
585
|
|
586
586
|
name = 'ANTLR With C# Target'
|
@@ -600,7 +600,7 @@ class AntlrPythonLexer(DelegatingLexer):
|
|
600
600
|
"""
|
601
601
|
`ANTLR`_ with Python Target
|
602
602
|
|
603
|
-
|
603
|
+
.. versionadded:: 1.1
|
604
604
|
"""
|
605
605
|
|
606
606
|
name = 'ANTLR With Python Target'
|
@@ -620,7 +620,7 @@ class AntlrJavaLexer(DelegatingLexer):
|
|
620
620
|
"""
|
621
621
|
`ANTLR`_ with Java Target
|
622
622
|
|
623
|
-
|
623
|
+
.. versionadded:: 1.
|
624
624
|
"""
|
625
625
|
|
626
626
|
name = 'ANTLR With Java Target'
|
@@ -640,7 +640,7 @@ class AntlrRubyLexer(DelegatingLexer):
|
|
640
640
|
"""
|
641
641
|
`ANTLR`_ with Ruby Target
|
642
642
|
|
643
|
-
|
643
|
+
.. versionadded:: 1.1
|
644
644
|
"""
|
645
645
|
|
646
646
|
name = 'ANTLR With Ruby Target'
|
@@ -660,7 +660,7 @@ class AntlrPerlLexer(DelegatingLexer):
|
|
660
660
|
"""
|
661
661
|
`ANTLR`_ with Perl Target
|
662
662
|
|
663
|
-
|
663
|
+
.. versionadded:: 1.1
|
664
664
|
"""
|
665
665
|
|
666
666
|
name = 'ANTLR With Perl Target'
|
@@ -680,7 +680,7 @@ class AntlrActionScriptLexer(DelegatingLexer):
|
|
680
680
|
"""
|
681
681
|
`ANTLR`_ with ActionScript Target
|
682
682
|
|
683
|
-
|
683
|
+
.. versionadded:: 1.1
|
684
684
|
"""
|
685
685
|
|
686
686
|
name = 'ANTLR With ActionScript Target'
|
@@ -700,7 +700,7 @@ class TreetopBaseLexer(RegexLexer):
|
|
700
700
|
A base lexer for `Treetop <http://treetop.rubyforge.org/>`_ grammars.
|
701
701
|
Not for direct use; use TreetopLexer instead.
|
702
702
|
|
703
|
-
|
703
|
+
.. versionadded:: 1.6
|
704
704
|
"""
|
705
705
|
|
706
706
|
tokens = {
|
@@ -767,7 +767,7 @@ class TreetopLexer(DelegatingLexer):
|
|
767
767
|
"""
|
768
768
|
A lexer for `Treetop <http://treetop.rubyforge.org/>`_ grammars.
|
769
769
|
|
770
|
-
|
770
|
+
.. versionadded:: 1.6
|
771
771
|
"""
|
772
772
|
|
773
773
|
name = 'Treetop'
|
@@ -0,0 +1,157 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
pygments.lexers.qbasic
|
4
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
Simple lexer for Microsoft QBasic source code.
|
7
|
+
|
8
|
+
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
|
9
|
+
:license: BSD, see LICENSE for details.
|
10
|
+
"""
|
11
|
+
|
12
|
+
import re
|
13
|
+
|
14
|
+
from pygments.lexer import RegexLexer, include, bygroups
|
15
|
+
from pygments.token import Text, Name, Comment, String, Keyword, Punctuation, \
|
16
|
+
Number, Operator
|
17
|
+
|
18
|
+
__all__ = ['QBasicLexer']
|
19
|
+
|
20
|
+
|
21
|
+
class QBasicLexer(RegexLexer):
|
22
|
+
"""
|
23
|
+
For
|
24
|
+
`QBasic <http://en.wikipedia.org/wiki/QBasic>`_
|
25
|
+
source code.
|
26
|
+
"""
|
27
|
+
|
28
|
+
name = 'QBasic'
|
29
|
+
aliases = ['qbasic', 'basic']
|
30
|
+
filenames = ['*.BAS', '*.bas']
|
31
|
+
mimetypes = ['text/basic']
|
32
|
+
|
33
|
+
declarations = ['DATA', 'LET']
|
34
|
+
|
35
|
+
functions = [
|
36
|
+
'ABS', 'ASC', 'ATN', 'CDBL', 'CHR$', 'CINT', 'CLNG',
|
37
|
+
'COMMAND$', 'COS', 'CSNG', 'CSRLIN', 'CVD', 'CVDMBF', 'CVI',
|
38
|
+
'CVL', 'CVS', 'CVSMBF', 'DATE$', 'ENVIRON$', 'EOF', 'ERDEV',
|
39
|
+
'ERDEV$', 'ERL', 'ERR', 'EXP', 'FILEATTR', 'FIX', 'FRE',
|
40
|
+
'FREEFILE', 'HEX$', 'INKEY$', 'INP', 'INPUT$', 'INSTR', 'INT',
|
41
|
+
'IOCTL$', 'LBOUND', 'LCASE$', 'LEFT$', 'LEN', 'LOC', 'LOF',
|
42
|
+
'LOG', 'LPOS', 'LTRIM$', 'MID$', 'MKD$', 'MKDMBF$', 'MKI$',
|
43
|
+
'MKL$', 'MKS$', 'MKSMBF$', 'OCT$', 'PEEK', 'PEN', 'PLAY',
|
44
|
+
'PMAP', 'POINT', 'POS', 'RIGHT$', 'RND', 'RTRIM$', 'SADD',
|
45
|
+
'SCREEN', 'SEEK', 'SETMEM', 'SGN', 'SIN', 'SPACE$', 'SPC',
|
46
|
+
'SQR', 'STICK', 'STR$', 'STRIG', 'STRING$', 'TAB', 'TAN',
|
47
|
+
'TIME$', 'TIMER', 'UBOUND', 'UCASE$', 'VAL', 'VARPTR',
|
48
|
+
'VARPTR$', 'VARSEG'
|
49
|
+
]
|
50
|
+
|
51
|
+
metacommands = ['$DYNAMIC', '$INCLUDE', '$STATIC']
|
52
|
+
|
53
|
+
operators = ['AND', 'EQV', 'IMP', 'NOT', 'OR', 'XOR']
|
54
|
+
|
55
|
+
statements = [
|
56
|
+
'BEEP', 'BLOAD', 'BSAVE', 'CALL', 'CALL ABSOLUTE',
|
57
|
+
'CALL INTERRUPT', 'CALLS', 'CHAIN', 'CHDIR', 'CIRCLE', 'CLEAR',
|
58
|
+
'CLOSE', 'CLS', 'COLOR', 'COM', 'COMMON', 'CONST', 'DATA',
|
59
|
+
'DATE$', 'DECLARE', 'DEF FN', 'DEF SEG', 'DEFDBL', 'DEFINT',
|
60
|
+
'DEFLNG', 'DEFSNG', 'DEFSTR', 'DEF', 'DIM', 'DO', 'LOOP',
|
61
|
+
'DRAW', 'END', 'ENVIRON', 'ERASE', 'ERROR', 'EXIT', 'FIELD',
|
62
|
+
'FILES', 'FOR', 'NEXT', 'FUNCTION', 'GET', 'GOSUB', 'GOTO',
|
63
|
+
'IF', 'THEN', 'INPUT', 'INPUT #', 'IOCTL', 'KEY', 'KEY',
|
64
|
+
'KILL', 'LET', 'LINE', 'LINE INPUT', 'LINE INPUT #', 'LOCATE',
|
65
|
+
'LOCK', 'UNLOCK', 'LPRINT', 'LSET', 'MID$', 'MKDIR', 'NAME',
|
66
|
+
'ON COM', 'ON ERROR', 'ON KEY', 'ON PEN', 'ON PLAY',
|
67
|
+
'ON STRIG', 'ON TIMER', 'ON UEVENT', 'ON', 'OPEN', 'OPEN COM',
|
68
|
+
'OPTION BASE', 'OUT', 'PAINT', 'PALETTE', 'PCOPY', 'PEN',
|
69
|
+
'PLAY', 'POKE', 'PRESET', 'PRINT', 'PRINT #', 'PRINT USING',
|
70
|
+
'PSET', 'PUT', 'PUT', 'RANDOMIZE', 'READ', 'REDIM', 'REM',
|
71
|
+
'RESET', 'RESTORE', 'RESUME', 'RETURN', 'RMDIR', 'RSET', 'RUN',
|
72
|
+
'SCREEN', 'SEEK', 'SELECT CASE', 'SHARED', 'SHELL', 'SLEEP',
|
73
|
+
'SOUND', 'STATIC', 'STOP', 'STRIG', 'SUB', 'SWAP', 'SYSTEM',
|
74
|
+
'TIME$', 'TIMER', 'TROFF', 'TRON', 'TYPE', 'UEVENT', 'UNLOCK',
|
75
|
+
'VIEW', 'WAIT', 'WHILE', 'WEND', 'WIDTH', 'WINDOW', 'WRITE'
|
76
|
+
]
|
77
|
+
|
78
|
+
keywords = [
|
79
|
+
'ACCESS', 'ALIAS', 'ANY', 'APPEND', 'AS', 'BASE', 'BINARY',
|
80
|
+
'BYVAL', 'CASE', 'CDECL', 'DOUBLE', 'ELSE', 'ELSEIF', 'ENDIF',
|
81
|
+
'INTEGER', 'IS', 'LIST', 'LOCAL', 'LONG', 'LOOP', 'MOD',
|
82
|
+
'NEXT', 'OFF', 'ON', 'OUTPUT', 'RANDOM', 'SIGNAL', 'SINGLE',
|
83
|
+
'STEP', 'STRING', 'THEN', 'TO', 'UNTIL', 'USING', 'WEND'
|
84
|
+
]
|
85
|
+
|
86
|
+
tokens = {
|
87
|
+
'root': [
|
88
|
+
(r'\n+', Text),
|
89
|
+
(r'\s+', Text.Whitespace),
|
90
|
+
(r'^(\s*)(\d*)(\s*)(REM .*)$',
|
91
|
+
bygroups(Text.Whitespace, Name.Label, Text.Whitespace,
|
92
|
+
Comment.Single)),
|
93
|
+
(r'^(\s*)(\d+)(\s*)',
|
94
|
+
bygroups(Text.Whitespace, Name.Label, Text.Whitespace)),
|
95
|
+
(r'(?=[\s]*)(\w+)(?=[\s]*=)', Name.Variable.Global),
|
96
|
+
(r'(?=[^"]*)\'.*$', Comment.Single),
|
97
|
+
(r'"[^\n\"]*"', String.Double),
|
98
|
+
(r'(END)(\s+)(FUNCTION|IF|SELECT|SUB)',
|
99
|
+
bygroups(Keyword.Reserved, Text.Whitespace, Keyword.Reserved)),
|
100
|
+
(r'(DECLARE)(\s+)([A-Z]+)(\s+)(\S+)',
|
101
|
+
bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable,
|
102
|
+
Text.Whitespace, Name)),
|
103
|
+
(r'(DIM)(\s+)(SHARED)(\s+)([^\s\(]+)',
|
104
|
+
bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable,
|
105
|
+
Text.Whitespace, Name.Variable.Global)),
|
106
|
+
(r'(DIM)(\s+)([^\s\(]+)',
|
107
|
+
bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable.Global)),
|
108
|
+
(r'^(\s*)([a-zA-Z_]+)(\s*)(\=)',
|
109
|
+
bygroups(Text.Whitespace, Name.Variable.Global, Text.Whitespace,
|
110
|
+
Operator)),
|
111
|
+
(r'(GOTO|GOSUB)(\s+)(\w+\:?)',
|
112
|
+
bygroups(Keyword.Reserved, Text.Whitespace, Name.Label)),
|
113
|
+
(r'(SUB)(\s+)(\w+\:?)',
|
114
|
+
bygroups(Keyword.Reserved, Text.Whitespace, Name.Label)),
|
115
|
+
include('declarations'),
|
116
|
+
include('functions'),
|
117
|
+
include('metacommands'),
|
118
|
+
include('operators'),
|
119
|
+
include('statements'),
|
120
|
+
include('keywords'),
|
121
|
+
(r'[a-zA-Z_]\w*[\$@#&!]', Name.Variable.Global),
|
122
|
+
(r'[a-zA-Z_]\w*\:', Name.Label),
|
123
|
+
(r'\-?\d*\.\d+[@|#]?', Number.Float),
|
124
|
+
(r'\-?\d+[@|#]', Number.Float),
|
125
|
+
(r'\-?\d+#?', Number.Integer.Long),
|
126
|
+
(r'\-?\d+#?', Number.Integer),
|
127
|
+
(r'!=|==|:=|\.=|<<|>>|[-~+/\\*%=<>&^|?:!.]', Operator),
|
128
|
+
(r'[\[\]{}(),;]', Punctuation),
|
129
|
+
(r'[\w]+', Name.Variable.Global),
|
130
|
+
],
|
131
|
+
# can't use regular \b because of X$()
|
132
|
+
'declarations': [
|
133
|
+
(r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, declarations)),
|
134
|
+
Keyword.Declaration),
|
135
|
+
],
|
136
|
+
'functions': [
|
137
|
+
(r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, functions)),
|
138
|
+
Keyword.Reserved),
|
139
|
+
],
|
140
|
+
'metacommands': [
|
141
|
+
(r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, metacommands)),
|
142
|
+
Keyword.Constant),
|
143
|
+
],
|
144
|
+
'operators': [
|
145
|
+
(r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, operators)), Operator.Word),
|
146
|
+
],
|
147
|
+
'statements': [
|
148
|
+
(r'\b(%s)\b' % '|'.join(map(re.escape, statements)),
|
149
|
+
Keyword.Reserved),
|
150
|
+
],
|
151
|
+
'keywords': [
|
152
|
+
(r'\b(%s)\b' % '|'.join(keywords), Keyword),
|
153
|
+
],
|
154
|
+
}
|
155
|
+
|
156
|
+
def analyse_text(text):
|
157
|
+
return 0.2
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
pygments.lexers.rdf
|
4
|
+
~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
Lexers for semantic web and RDF query languages and markup.
|
7
|
+
|
8
|
+
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
|
9
|
+
:license: BSD, see LICENSE for details.
|
10
|
+
"""
|
11
|
+
|
12
|
+
import re
|
13
|
+
|
14
|
+
from pygments.lexer import RegexLexer, bygroups, default
|
15
|
+
from pygments.token import Keyword, Punctuation, String, Number, Operator, \
|
16
|
+
Whitespace, Name, Literal, Comment, Text
|
17
|
+
|
18
|
+
__all__ = ['SparqlLexer']
|
19
|
+
|
20
|
+
|
21
|
+
class SparqlLexer(RegexLexer):
|
22
|
+
"""
|
23
|
+
Lexer for `SPARQL <http://www.w3.org/TR/rdf-sparql-query/>`_ query language.
|
24
|
+
|
25
|
+
.. versionadded:: 2.0
|
26
|
+
"""
|
27
|
+
name = 'SPARQL'
|
28
|
+
aliases = ['sparql']
|
29
|
+
filenames = ['*.rq', '*.sparql']
|
30
|
+
mimetypes = ['application/sparql-query']
|
31
|
+
|
32
|
+
flags = re.IGNORECASE
|
33
|
+
|
34
|
+
tokens = {
|
35
|
+
'root': [
|
36
|
+
(r'\s+', Whitespace),
|
37
|
+
(r'(select|construct|describe|ask|where|filter|group\s+by|minus|'
|
38
|
+
r'distinct|reduced|from named|from|order\s+by|limit|'
|
39
|
+
r'offset|bindings|load|clear|drop|create|add|move|copy|'
|
40
|
+
r'insert\s+data|delete\s+data|delete\s+where|delete|insert|'
|
41
|
+
r'using named|using|graph|default|named|all|optional|service|'
|
42
|
+
r'silent|bind|union|not in|in|as|a)', Keyword),
|
43
|
+
(r'(prefix|base)(\s+)([a-z][a-z\d_\-]*)(\s*)(\:)',
|
44
|
+
bygroups(Keyword, Whitespace, Name.Namespace, Whitespace,
|
45
|
+
Punctuation)),
|
46
|
+
(r'\?[a-z_][a-z\d_]*', Name.Variable),
|
47
|
+
(r'<[^>]+>', Name.Label),
|
48
|
+
(r'([a-z][a-z\d_\-]*)(\:)([a-z][a-z\d_\-]*)',
|
49
|
+
bygroups(Name.Namespace, Punctuation, Name.Tag)),
|
50
|
+
(r'(str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|'
|
51
|
+
r'ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|'
|
52
|
+
r'contains|strstarts|strends|strbefore|strafter|year|month|day|'
|
53
|
+
r'hours|minutes|seconds|timezone|tz|now|md5|sha1|sha256|sha384|'
|
54
|
+
r'sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|'
|
55
|
+
r'isliteral|isnumeric|regex|substr|replace|exists|not exists|'
|
56
|
+
r'count|sum|min|max|avg|sample|group_concat|separator)\b',
|
57
|
+
Name.Function),
|
58
|
+
(r'(true|false)', Literal),
|
59
|
+
(r'[+\-]?\d*\.\d+', Number.Float),
|
60
|
+
(r'[+\-]?\d*(:?\.\d+)?[eE][+\-]?\d+', Number.Float),
|
61
|
+
(r'[+\-]?\d+', Number.Integer),
|
62
|
+
(r'(\|\||&&|=|\*|\-|\+|/)', Operator),
|
63
|
+
(r'[(){}.;,:^]', Punctuation),
|
64
|
+
(r'#[^\n]+', Comment),
|
65
|
+
(r'"""', String, 'triple-double-quoted-string'),
|
66
|
+
(r'"', String, 'single-double-quoted-string'),
|
67
|
+
(r"'''", String, 'triple-single-quoted-string'),
|
68
|
+
(r"'", String, 'single-single-quoted-string'),
|
69
|
+
],
|
70
|
+
'triple-double-quoted-string': [
|
71
|
+
(r'"""', String, 'end-of-string'),
|
72
|
+
(r'[^\\]+', String),
|
73
|
+
(r'\\', String, 'string-escape'),
|
74
|
+
],
|
75
|
+
'single-double-quoted-string': [
|
76
|
+
(r'"', String, 'end-of-string'),
|
77
|
+
(r'[^"\\\n]+', String),
|
78
|
+
(r'\\', String, 'string-escape'),
|
79
|
+
],
|
80
|
+
'triple-single-quoted-string': [
|
81
|
+
(r"'''", String, 'end-of-string'),
|
82
|
+
(r'[^\\]+', String),
|
83
|
+
(r'\\', String, 'string-escape'),
|
84
|
+
],
|
85
|
+
'single-single-quoted-string': [
|
86
|
+
(r"'", String, 'end-of-string'),
|
87
|
+
(r"[^'\\\n]+", String),
|
88
|
+
(r'\\', String, 'string-escape'),
|
89
|
+
],
|
90
|
+
'string-escape': [
|
91
|
+
(r'.', String, '#pop'),
|
92
|
+
],
|
93
|
+
'end-of-string': [
|
94
|
+
(r'(@)([a-z]+(:?-[a-z0-9]+)*)',
|
95
|
+
bygroups(Operator, Name.Function), '#pop:2'),
|
96
|
+
(r'\^\^', Operator, '#pop:2'),
|
97
|
+
default('#pop:2'),
|
98
|
+
],
|
99
|
+
}
|