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.
Files changed (267) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +3 -0
  4. data/lexers +0 -0
  5. data/lib/pygments/popen.rb +3 -2
  6. data/lib/pygments/version.rb +1 -1
  7. data/pygments.rb.gemspec +2 -1
  8. data/vendor/pygments-main/AUTHORS +20 -1
  9. data/vendor/pygments-main/CHANGES +55 -3
  10. data/vendor/pygments-main/LICENSE +1 -1
  11. data/vendor/pygments-main/MANIFEST.in +1 -1
  12. data/vendor/pygments-main/Makefile +5 -8
  13. data/vendor/pygments-main/REVISION +1 -1
  14. data/vendor/pygments-main/doc/Makefile +153 -0
  15. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  16. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  17. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  18. data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
  19. data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
  20. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
  21. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  22. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  23. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  24. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  25. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  26. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
  27. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
  28. data/vendor/pygments-main/doc/conf.py +249 -0
  29. data/vendor/pygments-main/doc/docs/api.rst +316 -0
  30. data/vendor/pygments-main/doc/docs/authors.rst +4 -0
  31. data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
  32. data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
  33. data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
  34. data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
  35. data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
  36. data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
  37. data/vendor/pygments-main/doc/docs/index.rst +66 -0
  38. data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
  39. data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
  40. data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
  41. data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
  42. data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
  43. data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
  44. data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
  45. data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
  46. data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
  47. data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
  48. data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
  49. data/vendor/pygments-main/doc/download.rst +41 -0
  50. data/vendor/pygments-main/doc/faq.rst +143 -0
  51. data/vendor/pygments-main/doc/index.rst +53 -0
  52. data/vendor/pygments-main/doc/languages.rst +151 -0
  53. data/vendor/pygments-main/doc/make.bat +190 -0
  54. data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
  55. data/vendor/pygments-main/external/autopygmentize +65 -48
  56. data/vendor/pygments-main/external/markdown-processor.py +15 -15
  57. data/vendor/pygments-main/external/moin-parser.py +1 -1
  58. data/vendor/pygments-main/external/rst-directive.py +2 -3
  59. data/vendor/pygments-main/ez_setup.py +340 -234
  60. data/vendor/pygments-main/pygments/__init__.py +4 -4
  61. data/vendor/pygments-main/pygments/cmdline.py +81 -68
  62. data/vendor/pygments-main/pygments/console.py +1 -1
  63. data/vendor/pygments-main/pygments/filter.py +1 -1
  64. data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
  65. data/vendor/pygments-main/pygments/formatter.py +3 -3
  66. data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
  67. data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
  68. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  69. data/vendor/pygments-main/pygments/formatters/html.py +44 -26
  70. data/vendor/pygments-main/pygments/formatters/img.py +21 -14
  71. data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
  72. data/vendor/pygments-main/pygments/formatters/other.py +53 -6
  73. data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
  74. data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
  75. data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
  76. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
  77. data/vendor/pygments-main/pygments/lexer.py +59 -39
  78. data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
  79. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
  80. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
  81. data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
  82. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
  83. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
  84. data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
  85. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
  86. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
  87. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
  88. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
  89. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
  90. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
  91. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
  92. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
  93. data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
  94. data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
  96. data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
  97. data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
  98. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  99. data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
  100. data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
  101. data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
  102. data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
  103. data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
  104. data/vendor/pygments-main/pygments/lexers/math.py +438 -70
  105. data/vendor/pygments-main/pygments/lexers/other.py +885 -171
  106. data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
  107. data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
  108. data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
  109. data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
  110. data/vendor/pygments-main/pygments/lexers/special.py +7 -8
  111. data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
  112. data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
  113. data/vendor/pygments-main/pygments/lexers/text.py +208 -46
  114. data/vendor/pygments-main/pygments/lexers/web.py +729 -264
  115. data/vendor/pygments-main/pygments/modeline.py +1 -1
  116. data/vendor/pygments-main/pygments/plugin.py +1 -1
  117. data/vendor/pygments-main/pygments/scanner.py +1 -1
  118. data/vendor/pygments-main/pygments/sphinxext.py +153 -0
  119. data/vendor/pygments-main/pygments/style.py +3 -2
  120. data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
  121. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  122. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  123. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  124. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  125. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  126. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  127. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  128. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  129. data/vendor/pygments-main/pygments/styles/igor.py +29 -0
  130. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  131. data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
  132. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  133. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  134. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
  135. data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
  136. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  137. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  138. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  139. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  140. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  141. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  142. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  143. data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
  144. data/vendor/pygments-main/pygments/token.py +4 -1
  145. data/vendor/pygments-main/pygments/unistring.py +6 -5
  146. data/vendor/pygments-main/pygments/util.py +35 -21
  147. data/vendor/pygments-main/scripts/check_sources.py +28 -44
  148. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
  149. data/vendor/pygments-main/scripts/find_codetags.py +27 -19
  150. data/vendor/pygments-main/scripts/find_error.py +16 -13
  151. data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
  152. data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
  153. data/vendor/pygments-main/setup.py +19 -19
  154. data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
  155. data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
  156. data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
  157. data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
  158. data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
  159. data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
  160. data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
  161. data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
  162. data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
  163. data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
  164. data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
  165. data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
  166. data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
  167. data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
  168. data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
  169. data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
  170. data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
  171. data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
  172. data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
  173. data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
  174. data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
  175. data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
  176. data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
  177. data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
  178. data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
  179. data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
  180. data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
  181. data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
  182. data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
  183. data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
  184. data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
  185. data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
  186. data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
  187. data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
  188. data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
  189. data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
  190. data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
  191. data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
  192. data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
  193. data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
  194. data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
  195. data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
  196. data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
  197. data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
  198. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
  199. data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
  200. data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
  201. data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
  202. data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
  203. data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
  204. data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
  205. data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
  206. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
  207. data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
  208. data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
  209. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
  210. data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
  211. data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
  212. data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
  213. data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
  214. data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
  215. data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
  216. data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
  217. data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
  218. data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
  219. data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
  220. data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
  221. data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
  222. data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
  223. data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
  224. data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
  225. data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
  226. data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
  227. data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
  228. data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
  229. data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
  230. data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
  231. data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
  232. data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
  233. data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
  234. data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
  235. data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
  236. data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
  237. data/vendor/pygments-main/tests/run.py +14 -19
  238. data/vendor/pygments-main/tests/string_asserts.py +22 -0
  239. data/vendor/pygments-main/tests/test_basic_api.py +28 -14
  240. data/vendor/pygments-main/tests/test_cfm.py +46 -0
  241. data/vendor/pygments-main/tests/test_clexer.py +208 -3
  242. data/vendor/pygments-main/tests/test_cmdline.py +6 -5
  243. data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
  244. data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
  245. data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
  246. data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
  247. data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
  248. data/vendor/pygments-main/tests/test_perllexer.py +1 -1
  249. data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
  250. data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
  251. data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
  252. data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
  253. data/vendor/pygments-main/tests/test_token.py +3 -3
  254. data/vendor/pygments-main/tests/test_using_api.py +1 -1
  255. data/vendor/pygments-main/tests/test_util.py +1 -1
  256. metadata +138 -51
  257. data/vendor/pygments-main/docs/generate.py +0 -472
  258. data/vendor/pygments-main/docs/src/api.txt +0 -270
  259. data/vendor/pygments-main/docs/src/authors.txt +0 -5
  260. data/vendor/pygments-main/docs/src/changelog.txt +0 -5
  261. data/vendor/pygments-main/docs/src/index.txt +0 -69
  262. data/vendor/pygments-main/docs/src/installation.txt +0 -71
  263. data/vendor/pygments-main/external/rst-directive-old.py +0 -77
  264. data/vendor/pygments-main/scripts/reindent.py +0 -291
  265. data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
  266. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
  267. 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-2013 by the Pygments team, see AUTHORS.
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
- import urllib
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(fetch(DATATYPES_URL))
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(fetch(KEYWORDS_URL))
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-2013 by the Pygments team, see AUTHORS.
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
- *New in Pygments 1.6.*
61
+ .. versionadded:: 1.6
61
62
  """
62
63
  name = 'RobotFramework'
63
- aliases = ['RobotFramework', 'robotframework']
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, unicode(value)
81
+ yield index, token, text_type(value)
81
82
  index += len(value)
82
83
 
83
84
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Builtin list for the ScilabLexer.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -8,10 +8,12 @@
8
8
 
9
9
  Do not edit the FUNCTIONS list by hand.
10
10
 
11
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
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
- import urllib
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 = urllib.urlopen('http://docs.sourcemod.net/api/index.php')
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 = urllib.urlopen('http://docs.sourcemod.net/api/SMfuncs.js')
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 '> Downloading function index for SourceMod %s' % version
1065
+ print('> Downloading function index for SourceMod %s' % version)
1061
1066
  functions = get_sm_functions()
1062
- print '> %d functions found:' % len(functions)
1067
+ print('> %d functions found:' % len(functions))
1063
1068
 
1064
1069
  functionlist = []
1065
1070
  for full_function_name in functions:
1066
- print '>> %s' % full_function_name
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 2013 by the Pygments team, see AUTHORS.
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', 'lower', 'lp__', 'print', 'upper', 'while']
13
+ KEYWORDS = ['else', 'for', 'if', 'in', 'lp__', 'print', 'while']
14
14
 
15
- TYPES = [ 'corr_matrix',
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