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,12 +5,15 @@
|
|
5
5
|
|
6
6
|
Self-updating data files for PostgreSQL lexer.
|
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
|
|
12
12
|
import re
|
13
|
-
|
13
|
+
try:
|
14
|
+
from urllib import urlopen
|
15
|
+
except ImportError:
|
16
|
+
from urllib.request import urlopen
|
14
17
|
|
15
18
|
# One man's constant is another man's variable.
|
16
19
|
SOURCE_URL = 'https://github.com/postgres/postgres/raw/master'
|
@@ -18,11 +21,11 @@ KEYWORDS_URL = SOURCE_URL + '/doc/src/sgml/keywords.sgml'
|
|
18
21
|
DATATYPES_URL = SOURCE_URL + '/doc/src/sgml/datatype.sgml'
|
19
22
|
|
20
23
|
def update_myself():
|
21
|
-
data_file = list(
|
24
|
+
data_file = list(urlopen(DATATYPES_URL))
|
22
25
|
datatypes = parse_datatypes(data_file)
|
23
26
|
pseudos = parse_pseudos(data_file)
|
24
27
|
|
25
|
-
keywords = parse_keywords(
|
28
|
+
keywords = parse_keywords(urlopen(KEYWORDS_URL))
|
26
29
|
update_consts(__file__, 'DATATYPES', datatypes)
|
27
30
|
update_consts(__file__, 'PSEUDO_TYPES', pseudos)
|
28
31
|
update_consts(__file__, 'KEYWORDS', keywords)
|
@@ -96,9 +99,6 @@ def parse_pseudos(f):
|
|
96
99
|
|
97
100
|
return dt
|
98
101
|
|
99
|
-
def fetch(url):
|
100
|
-
return urllib.urlopen(url)
|
101
|
-
|
102
102
|
def update_consts(filename, constname, content):
|
103
103
|
f = open(filename)
|
104
104
|
lines = f.readlines()
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Lexer for Robot Framework.
|
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
|
|
@@ -27,6 +27,7 @@ import re
|
|
27
27
|
|
28
28
|
from pygments.lexer import Lexer
|
29
29
|
from pygments.token import Token
|
30
|
+
from pygments.util import text_type
|
30
31
|
|
31
32
|
|
32
33
|
HEADING = Token.Generic.Heading
|
@@ -57,10 +58,10 @@ class RobotFrameworkLexer(Lexer):
|
|
57
58
|
|
58
59
|
Supports both space and pipe separated plain text formats.
|
59
60
|
|
60
|
-
|
61
|
+
.. versionadded:: 1.6
|
61
62
|
"""
|
62
63
|
name = 'RobotFramework'
|
63
|
-
aliases = ['
|
64
|
+
aliases = ['robotframework']
|
64
65
|
filenames = ['*.txt', '*.robot']
|
65
66
|
mimetypes = ['text/x-robotframework']
|
66
67
|
|
@@ -77,7 +78,7 @@ class RobotFrameworkLexer(Lexer):
|
|
77
78
|
for value, token in row_tokenizer.tokenize(row):
|
78
79
|
for value, token in var_tokenizer.tokenize(value, token):
|
79
80
|
if value:
|
80
|
-
yield index, token,
|
81
|
+
yield index, token, text_type(value)
|
81
82
|
index += len(value)
|
82
83
|
|
83
84
|
|
@@ -8,10 +8,12 @@
|
|
8
8
|
|
9
9
|
Do not edit the FUNCTIONS list by hand.
|
10
10
|
|
11
|
-
:copyright: Copyright 2006-
|
11
|
+
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
|
12
12
|
:license: BSD, see LICENSE for details.
|
13
13
|
"""
|
14
14
|
|
15
|
+
from __future__ import print_function
|
16
|
+
|
15
17
|
FUNCTIONS = ['TopMenuHandler',
|
16
18
|
'CreateTopMenu',
|
17
19
|
'LoadTopMenuConfig',
|
@@ -1012,7 +1014,10 @@ if __name__ == '__main__':
|
|
1012
1014
|
import pprint
|
1013
1015
|
import re
|
1014
1016
|
import sys
|
1015
|
-
|
1017
|
+
try:
|
1018
|
+
from urllib import urlopen
|
1019
|
+
except ImportError:
|
1020
|
+
from urllib.request import urlopen
|
1016
1021
|
|
1017
1022
|
# urllib ends up wanting to import a module called 'math' -- if
|
1018
1023
|
# pygments/lexers is in the path, this ends badly.
|
@@ -1021,7 +1026,7 @@ if __name__ == '__main__':
|
|
1021
1026
|
del sys.path[i]
|
1022
1027
|
|
1023
1028
|
def get_version():
|
1024
|
-
f =
|
1029
|
+
f = urlopen('http://docs.sourcemod.net/api/index.php')
|
1025
1030
|
r = re.compile(r'SourceMod v\.<b>([\d\.]+)</td>')
|
1026
1031
|
for line in f:
|
1027
1032
|
m = r.search(line)
|
@@ -1029,7 +1034,7 @@ if __name__ == '__main__':
|
|
1029
1034
|
return m.groups()[0]
|
1030
1035
|
|
1031
1036
|
def get_sm_functions():
|
1032
|
-
f =
|
1037
|
+
f = urlopen('http://docs.sourcemod.net/api/SMfuncs.js')
|
1033
1038
|
r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);')
|
1034
1039
|
functions = []
|
1035
1040
|
for line in f:
|
@@ -1057,13 +1062,13 @@ if __name__ == '__main__':
|
|
1057
1062
|
|
1058
1063
|
def run():
|
1059
1064
|
version = get_version()
|
1060
|
-
print
|
1065
|
+
print('> Downloading function index for SourceMod %s' % version)
|
1061
1066
|
functions = get_sm_functions()
|
1062
|
-
print
|
1067
|
+
print('> %d functions found:' % len(functions))
|
1063
1068
|
|
1064
1069
|
functionlist = []
|
1065
1070
|
for full_function_name in functions:
|
1066
|
-
print
|
1071
|
+
print('>> %s' % full_function_name)
|
1067
1072
|
functionlist.append(full_function_name)
|
1068
1073
|
|
1069
1074
|
regenerate(__file__, functionlist)
|
@@ -1,18 +1,19 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
"""
|
3
|
-
pygments.lexers._stan_builtins
|
4
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
3
|
+
pygments.lexers._stan_builtins
|
4
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
5
5
|
|
6
|
-
This file contains the names of functions for Stan used by
|
7
|
-
``pygments.lexers.math.StanLexer.
|
6
|
+
This file contains the names of functions for Stan used by
|
7
|
+
``pygments.lexers.math.StanLexer``. These builtins are from Stan language v2.2.0.
|
8
8
|
|
9
|
-
:copyright: Copyright
|
10
|
-
:license: BSD, see LICENSE for details.
|
9
|
+
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
|
10
|
+
:license: BSD, see LICENSE for details.
|
11
11
|
"""
|
12
12
|
|
13
|
-
KEYWORDS = ['else', 'for', 'if', 'in', '
|
13
|
+
KEYWORDS = ['else', 'for', 'if', 'in', 'lp__', 'print', 'while']
|
14
14
|
|
15
|
-
TYPES = [ '
|
15
|
+
TYPES = [ 'cholesky_factor_cov',
|
16
|
+
'corr_matrix',
|
16
17
|
'cov_matrix',
|
17
18
|
'int',
|
18
19
|
'matrix',
|
@@ -34,35 +35,53 @@ FUNCTIONS = [ 'Phi',
|
|
34
35
|
'atan',
|
35
36
|
'atan2',
|
36
37
|
'atanh',
|
38
|
+
'bernoulli_ccdf_log',
|
37
39
|
'bernoulli_cdf',
|
40
|
+
'bernoulli_cdf_log',
|
38
41
|
'bernoulli_log',
|
39
42
|
'bernoulli_logit_log',
|
40
43
|
'bernoulli_rng',
|
44
|
+
'bessel_first_kind',
|
45
|
+
'bessel_second_kind',
|
46
|
+
'beta_binomial_ccdf_log',
|
41
47
|
'beta_binomial_cdf',
|
48
|
+
'beta_binomial_cdf_log',
|
42
49
|
'beta_binomial_log',
|
43
50
|
'beta_binomial_rng',
|
51
|
+
'beta_ccdf_log',
|
44
52
|
'beta_cdf',
|
53
|
+
'beta_cdf_log',
|
45
54
|
'beta_log',
|
46
55
|
'beta_rng',
|
47
56
|
'binary_log_loss',
|
57
|
+
'binomial_ccdf_log',
|
48
58
|
'binomial_cdf',
|
59
|
+
'binomial_cdf_log',
|
49
60
|
'binomial_coefficient_log',
|
50
61
|
'binomial_log',
|
51
62
|
'binomial_logit_log',
|
52
63
|
'binomial_rng',
|
53
64
|
'block',
|
54
65
|
'categorical_log',
|
66
|
+
'categorical_logit_log',
|
55
67
|
'categorical_rng',
|
68
|
+
'cauchy_ccdf_log',
|
56
69
|
'cauchy_cdf',
|
70
|
+
'cauchy_cdf_log',
|
57
71
|
'cauchy_log',
|
58
72
|
'cauchy_rng',
|
59
73
|
'cbrt',
|
60
74
|
'ceil',
|
75
|
+
'chi_square_ccdf_log',
|
76
|
+
'chi_square_cdf',
|
77
|
+
'chi_square_cdf_log',
|
61
78
|
'chi_square_log',
|
62
79
|
'chi_square_rng',
|
63
80
|
'cholesky_decompose',
|
64
81
|
'col',
|
65
82
|
'cols',
|
83
|
+
'columns_dot_product',
|
84
|
+
'columns_dot_self',
|
66
85
|
'cos',
|
67
86
|
'cosh',
|
68
87
|
'crossprod',
|
@@ -72,157 +91,232 @@ FUNCTIONS = [ 'Phi',
|
|
72
91
|
'diag_post_multiply',
|
73
92
|
'diag_pre_multiply',
|
74
93
|
'diagonal',
|
94
|
+
'digamma',
|
75
95
|
'dims',
|
76
96
|
'dirichlet_log',
|
77
97
|
'dirichlet_rng',
|
98
|
+
'distance',
|
78
99
|
'dot_product',
|
79
100
|
'dot_self',
|
101
|
+
'double_exponential_ccdf_log',
|
102
|
+
'double_exponential_cdf',
|
103
|
+
'double_exponential_cdf_log',
|
80
104
|
'double_exponential_log',
|
81
105
|
'double_exponential_rng',
|
82
106
|
'e',
|
83
107
|
'eigenvalues_sym',
|
84
108
|
'eigenvectors_sym',
|
85
|
-
'epsilon',
|
86
109
|
'erf',
|
87
110
|
'erfc',
|
88
111
|
'exp',
|
89
112
|
'exp2',
|
113
|
+
'exp_mod_normal_ccdf_log',
|
90
114
|
'exp_mod_normal_cdf',
|
115
|
+
'exp_mod_normal_cdf_log',
|
91
116
|
'exp_mod_normal_log',
|
92
117
|
'exp_mod_normal_rng',
|
93
118
|
'expm1',
|
119
|
+
'exponential_ccdf_log',
|
94
120
|
'exponential_cdf',
|
121
|
+
'exponential_cdf_log',
|
95
122
|
'exponential_log',
|
96
123
|
'exponential_rng',
|
97
124
|
'fabs',
|
125
|
+
'falling_factorial',
|
98
126
|
'fdim',
|
99
127
|
'floor',
|
100
128
|
'fma',
|
101
129
|
'fmax',
|
102
130
|
'fmin',
|
103
131
|
'fmod',
|
132
|
+
'gamma_ccdf_log',
|
133
|
+
'gamma_cdf',
|
134
|
+
'gamma_cdf_log',
|
104
135
|
'gamma_log',
|
136
|
+
'gamma_p',
|
137
|
+
'gamma_q',
|
105
138
|
'gamma_rng',
|
139
|
+
'gaussian_dlm_obs_log',
|
140
|
+
'gumbel_ccdf_log',
|
106
141
|
'gumbel_cdf',
|
142
|
+
'gumbel_cdf_log',
|
107
143
|
'gumbel_log',
|
108
144
|
'gumbel_rng',
|
145
|
+
'head',
|
109
146
|
'hypergeometric_log',
|
110
147
|
'hypergeometric_rng',
|
111
148
|
'hypot',
|
112
149
|
'if_else',
|
150
|
+
'increment_log_prob',
|
113
151
|
'int_step',
|
152
|
+
'inv',
|
153
|
+
'inv_chi_square_ccdf_log',
|
114
154
|
'inv_chi_square_cdf',
|
155
|
+
'inv_chi_square_cdf_log',
|
115
156
|
'inv_chi_square_log',
|
116
157
|
'inv_chi_square_rng',
|
117
158
|
'inv_cloglog',
|
159
|
+
'inv_gamma_ccdf_log',
|
118
160
|
'inv_gamma_cdf',
|
161
|
+
'inv_gamma_cdf_log',
|
119
162
|
'inv_gamma_log',
|
120
163
|
'inv_gamma_rng',
|
121
164
|
'inv_logit',
|
165
|
+
'inv_sqrt',
|
166
|
+
'inv_square',
|
122
167
|
'inv_wishart_log',
|
123
168
|
'inv_wishart_rng',
|
124
169
|
'inverse',
|
170
|
+
'inverse_spd',
|
125
171
|
'lbeta',
|
126
172
|
'lgamma',
|
127
|
-
'lkj_corr_cholesky_log',
|
128
|
-
'lkj_corr_cholesky_rng',
|
129
173
|
'lkj_corr_log',
|
130
174
|
'lkj_corr_rng',
|
131
|
-
'lkj_cov_log',
|
132
175
|
'lmgamma',
|
133
176
|
'log',
|
134
177
|
'log10',
|
135
178
|
'log1m',
|
179
|
+
'log1m_exp',
|
136
180
|
'log1m_inv_logit',
|
137
181
|
'log1p',
|
138
182
|
'log1p_exp',
|
139
183
|
'log2',
|
140
184
|
'log_determinant',
|
185
|
+
'log_diff_exp',
|
186
|
+
'log_falling_factorial',
|
141
187
|
'log_inv_logit',
|
188
|
+
'log_rising_factorial',
|
189
|
+
'log_softmax',
|
142
190
|
'log_sum_exp',
|
191
|
+
'logistic_ccdf_log',
|
143
192
|
'logistic_cdf',
|
193
|
+
'logistic_cdf_log',
|
144
194
|
'logistic_log',
|
145
195
|
'logistic_rng',
|
146
196
|
'logit',
|
197
|
+
'lognormal_ccdf_log',
|
147
198
|
'lognormal_cdf',
|
199
|
+
'lognormal_cdf_log',
|
148
200
|
'lognormal_log',
|
149
201
|
'lognormal_rng',
|
202
|
+
'machine_precision',
|
150
203
|
'max',
|
151
204
|
'mdivide_left_tri_low',
|
152
205
|
'mdivide_right_tri_low',
|
153
206
|
'mean',
|
154
207
|
'min',
|
208
|
+
'modified_bessel_first_kind',
|
209
|
+
'modified_bessel_second_kind',
|
155
210
|
'multi_normal_cholesky_log',
|
156
211
|
'multi_normal_log',
|
157
212
|
'multi_normal_prec_log',
|
158
213
|
'multi_normal_rng',
|
159
214
|
'multi_student_t_log',
|
160
215
|
'multi_student_t_rng',
|
161
|
-
'multinomial_cdf',
|
162
216
|
'multinomial_log',
|
163
217
|
'multinomial_rng',
|
164
218
|
'multiply_log',
|
165
219
|
'multiply_lower_tri_self_transpose',
|
220
|
+
'neg_binomial_ccdf_log',
|
166
221
|
'neg_binomial_cdf',
|
222
|
+
'neg_binomial_cdf_log',
|
167
223
|
'neg_binomial_log',
|
168
224
|
'neg_binomial_rng',
|
169
|
-
'negative_epsilon',
|
170
225
|
'negative_infinity',
|
226
|
+
'normal_ccdf_log',
|
171
227
|
'normal_cdf',
|
228
|
+
'normal_cdf_log',
|
172
229
|
'normal_log',
|
173
230
|
'normal_rng',
|
174
231
|
'not_a_number',
|
175
232
|
'ordered_logistic_log',
|
176
233
|
'ordered_logistic_rng',
|
177
234
|
'owens_t',
|
235
|
+
'pareto_ccdf_log',
|
178
236
|
'pareto_cdf',
|
237
|
+
'pareto_cdf_log',
|
179
238
|
'pareto_log',
|
180
239
|
'pareto_rng',
|
181
240
|
'pi',
|
241
|
+
'poisson_ccdf_log',
|
182
242
|
'poisson_cdf',
|
243
|
+
'poisson_cdf_log',
|
183
244
|
'poisson_log',
|
184
245
|
'poisson_log_log',
|
185
246
|
'poisson_rng',
|
186
247
|
'positive_infinity',
|
187
248
|
'pow',
|
188
249
|
'prod',
|
250
|
+
'quad_form',
|
251
|
+
'rank',
|
252
|
+
'rayleigh_ccdf_log',
|
253
|
+
'rayleigh_cdf',
|
254
|
+
'rayleigh_cdf_log',
|
255
|
+
'rayleigh_log',
|
256
|
+
'rayleigh_rng',
|
189
257
|
'rep_array',
|
190
258
|
'rep_matrix',
|
191
259
|
'rep_row_vector',
|
192
260
|
'rep_vector',
|
261
|
+
'rising_factorial',
|
193
262
|
'round',
|
194
263
|
'row',
|
195
264
|
'rows',
|
265
|
+
'rows_dot_product',
|
266
|
+
'rows_dot_self',
|
267
|
+
'scaled_inv_chi_square_ccdf_log',
|
196
268
|
'scaled_inv_chi_square_cdf',
|
269
|
+
'scaled_inv_chi_square_cdf_log',
|
197
270
|
'scaled_inv_chi_square_log',
|
198
271
|
'scaled_inv_chi_square_rng',
|
199
272
|
'sd',
|
273
|
+
'segment',
|
200
274
|
'sin',
|
201
275
|
'singular_values',
|
202
276
|
'sinh',
|
203
277
|
'size',
|
278
|
+
'skew_normal_ccdf_log',
|
204
279
|
'skew_normal_cdf',
|
280
|
+
'skew_normal_cdf_log',
|
205
281
|
'skew_normal_log',
|
206
282
|
'skew_normal_rng',
|
207
283
|
'softmax',
|
284
|
+
'sort_asc',
|
285
|
+
'sort_desc',
|
208
286
|
'sqrt',
|
209
287
|
'sqrt2',
|
210
288
|
'square',
|
289
|
+
'squared_distance',
|
211
290
|
'step',
|
291
|
+
'student_t_ccdf_log',
|
212
292
|
'student_t_cdf',
|
293
|
+
'student_t_cdf_log',
|
213
294
|
'student_t_log',
|
214
295
|
'student_t_rng',
|
296
|
+
'sub_col',
|
297
|
+
'sub_row',
|
215
298
|
'sum',
|
299
|
+
'tail',
|
216
300
|
'tan',
|
217
301
|
'tanh',
|
218
302
|
'tcrossprod',
|
219
303
|
'tgamma',
|
304
|
+
'to_vector',
|
220
305
|
'trace',
|
306
|
+
'trace_gen_quad_form',
|
307
|
+
'trace_quad_form',
|
308
|
+
'trigamma',
|
221
309
|
'trunc',
|
310
|
+
'uniform_ccdf_log',
|
311
|
+
'uniform_cdf',
|
312
|
+
'uniform_cdf_log',
|
222
313
|
'uniform_log',
|
223
314
|
'uniform_rng',
|
224
315
|
'variance',
|
316
|
+
'von_mises_log',
|
317
|
+
'weibull_ccdf_log',
|
225
318
|
'weibull_cdf',
|
319
|
+
'weibull_cdf_log',
|
226
320
|
'weibull_log',
|
227
321
|
'weibull_rng',
|
228
322
|
'wishart_log',
|
@@ -233,9 +327,9 @@ DISTRIBUTIONS = [ 'bernoulli',
|
|
233
327
|
'beta',
|
234
328
|
'beta_binomial',
|
235
329
|
'binomial',
|
236
|
-
'binomial_coefficient',
|
237
330
|
'binomial_logit',
|
238
331
|
'categorical',
|
332
|
+
'categorical_logit',
|
239
333
|
'cauchy',
|
240
334
|
'chi_square',
|
241
335
|
'dirichlet',
|
@@ -243,14 +337,13 @@ DISTRIBUTIONS = [ 'bernoulli',
|
|
243
337
|
'exp_mod_normal',
|
244
338
|
'exponential',
|
245
339
|
'gamma',
|
340
|
+
'gaussian_dlm_obs',
|
246
341
|
'gumbel',
|
247
342
|
'hypergeometric',
|
248
343
|
'inv_chi_square',
|
249
344
|
'inv_gamma',
|
250
345
|
'inv_wishart',
|
251
346
|
'lkj_corr',
|
252
|
-
'lkj_corr_cholesky',
|
253
|
-
'lkj_cov',
|
254
347
|
'logistic',
|
255
348
|
'lognormal',
|
256
349
|
'multi_normal',
|
@@ -258,17 +351,18 @@ DISTRIBUTIONS = [ 'bernoulli',
|
|
258
351
|
'multi_normal_prec',
|
259
352
|
'multi_student_t',
|
260
353
|
'multinomial',
|
261
|
-
'multiply',
|
262
354
|
'neg_binomial',
|
263
355
|
'normal',
|
264
356
|
'ordered_logistic',
|
265
357
|
'pareto',
|
266
358
|
'poisson',
|
267
359
|
'poisson_log',
|
360
|
+
'rayleigh',
|
268
361
|
'scaled_inv_chi_square',
|
269
362
|
'skew_normal',
|
270
363
|
'student_t',
|
271
364
|
'uniform',
|
365
|
+
'von_mises',
|
272
366
|
'weibull',
|
273
367
|
'wishart']
|
274
368
|
|