pygments.rb 1.1.1 → 2.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (383) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +13 -0
  3. data/.github/workflows/ci.yml +28 -0
  4. data/.github/workflows/release.yml +24 -0
  5. data/.gitignore +5 -5
  6. data/CHANGELOG.adoc +123 -0
  7. data/Gemfile +3 -1
  8. data/LICENSE +1 -1
  9. data/README.adoc +161 -0
  10. data/Rakefile +13 -19
  11. data/bench.rb +8 -7
  12. data/cache-lexers.rb +3 -2
  13. data/lexers +0 -0
  14. data/lib/pygments.rb +10 -11
  15. data/lib/pygments/lexer.rb +5 -5
  16. data/lib/pygments/mentos.py +23 -66
  17. data/lib/pygments/popen.rb +155 -204
  18. data/lib/pygments/version.rb +2 -2
  19. data/pygments.rb.gemspec +11 -9
  20. data/test/test_pygments.rb +54 -87
  21. data/vendor/pygments-main/{AUTHORS → Pygments-2.7.3.dist-info/AUTHORS} +23 -3
  22. data/vendor/pygments-main/Pygments-2.7.3.dist-info/INSTALLER +1 -0
  23. data/vendor/pygments-main/{LICENSE → Pygments-2.7.3.dist-info/LICENSE} +1 -1
  24. data/vendor/pygments-main/Pygments-2.7.3.dist-info/METADATA +49 -0
  25. data/vendor/pygments-main/Pygments-2.7.3.dist-info/RECORD +482 -0
  26. data/vendor/pygments-main/Pygments-2.7.3.dist-info/REQUESTED +0 -0
  27. data/vendor/pygments-main/Pygments-2.7.3.dist-info/WHEEL +5 -0
  28. data/vendor/pygments-main/Pygments-2.7.3.dist-info/entry_points.txt +3 -0
  29. data/vendor/pygments-main/Pygments-2.7.3.dist-info/top_level.txt +1 -0
  30. data/vendor/pygments-main/bin/pygmentize +8 -0
  31. data/vendor/pygments-main/pygments/__init__.py +6 -11
  32. data/vendor/pygments-main/pygments/__main__.py +18 -0
  33. data/vendor/pygments-main/pygments/cmdline.py +94 -41
  34. data/vendor/pygments-main/pygments/console.py +6 -9
  35. data/vendor/pygments-main/pygments/filter.py +4 -6
  36. data/vendor/pygments-main/pygments/filters/__init__.py +609 -21
  37. data/vendor/pygments-main/pygments/formatter.py +4 -4
  38. data/vendor/pygments-main/pygments/formatters/__init__.py +42 -6
  39. data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -3
  40. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  41. data/vendor/pygments-main/pygments/formatters/html.py +223 -135
  42. data/vendor/pygments-main/pygments/formatters/img.py +102 -38
  43. data/vendor/pygments-main/pygments/formatters/irc.py +39 -39
  44. data/vendor/pygments-main/pygments/formatters/latex.py +56 -26
  45. data/vendor/pygments-main/pygments/formatters/other.py +12 -8
  46. data/vendor/pygments-main/pygments/formatters/rtf.py +29 -29
  47. data/vendor/pygments-main/pygments/formatters/svg.py +38 -4
  48. data/vendor/pygments-main/pygments/formatters/terminal.py +25 -31
  49. data/vendor/pygments-main/pygments/formatters/terminal256.py +22 -12
  50. data/vendor/pygments-main/pygments/lexer.py +41 -39
  51. data/vendor/pygments-main/pygments/lexers/__init__.py +62 -15
  52. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +5 -5
  53. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +15 -15
  54. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +11 -12
  55. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1717 -1338
  56. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +8 -1
  57. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +2 -4
  58. data/vendor/pygments-main/pygments/lexers/_mapping.py +79 -33
  59. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +2 -2
  60. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +1282 -0
  61. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  62. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +17 -20
  63. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +73 -16
  64. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +2 -2
  65. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1 -3
  66. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +151 -125
  67. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +6 -4
  68. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  69. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +113 -0
  70. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +280 -0
  71. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  72. data/vendor/pygments-main/pygments/lexers/actionscript.py +8 -3
  73. data/vendor/pygments-main/pygments/lexers/agile.py +1 -1
  74. data/vendor/pygments-main/pygments/lexers/algebra.py +20 -1
  75. data/vendor/pygments-main/pygments/lexers/ambient.py +1 -1
  76. data/vendor/pygments-main/pygments/lexers/ampl.py +3 -3
  77. data/vendor/pygments-main/pygments/lexers/apl.py +15 -15
  78. data/vendor/pygments-main/pygments/lexers/archetype.py +3 -3
  79. data/vendor/pygments-main/pygments/lexers/arrow.py +117 -0
  80. data/vendor/pygments-main/pygments/lexers/asm.py +445 -70
  81. data/vendor/pygments-main/pygments/lexers/automation.py +3 -3
  82. data/vendor/pygments-main/pygments/lexers/bare.py +104 -0
  83. data/vendor/pygments-main/pygments/lexers/basic.py +166 -4
  84. data/vendor/pygments-main/pygments/lexers/bibtex.py +13 -9
  85. data/vendor/pygments-main/pygments/lexers/boa.py +102 -0
  86. data/vendor/pygments-main/pygments/lexers/business.py +69 -36
  87. data/vendor/pygments-main/pygments/lexers/c_cpp.py +137 -45
  88. data/vendor/pygments-main/pygments/lexers/c_like.py +68 -43
  89. data/vendor/pygments-main/pygments/lexers/capnproto.py +20 -21
  90. data/vendor/pygments-main/pygments/lexers/chapel.py +25 -14
  91. data/vendor/pygments-main/pygments/lexers/clean.py +135 -244
  92. data/vendor/pygments-main/pygments/lexers/compiled.py +1 -1
  93. data/vendor/pygments-main/pygments/lexers/configs.py +188 -37
  94. data/vendor/pygments-main/pygments/lexers/console.py +1 -1
  95. data/vendor/pygments-main/pygments/lexers/crystal.py +31 -23
  96. data/vendor/pygments-main/pygments/lexers/csound.py +288 -187
  97. data/vendor/pygments-main/pygments/lexers/css.py +18 -16
  98. data/vendor/pygments-main/pygments/lexers/d.py +10 -5
  99. data/vendor/pygments-main/pygments/lexers/dalvik.py +1 -1
  100. data/vendor/pygments-main/pygments/lexers/data.py +240 -97
  101. data/vendor/pygments-main/pygments/lexers/devicetree.py +109 -0
  102. data/vendor/pygments-main/pygments/lexers/diff.py +4 -4
  103. data/vendor/pygments-main/pygments/lexers/dotnet.py +40 -24
  104. data/vendor/pygments-main/pygments/lexers/dsls.py +147 -65
  105. data/vendor/pygments-main/pygments/lexers/dylan.py +16 -18
  106. data/vendor/pygments-main/pygments/lexers/ecl.py +16 -2
  107. data/vendor/pygments-main/pygments/lexers/eiffel.py +1 -1
  108. data/vendor/pygments-main/pygments/lexers/elm.py +5 -5
  109. data/vendor/pygments-main/pygments/lexers/email.py +151 -0
  110. data/vendor/pygments-main/pygments/lexers/erlang.py +29 -32
  111. data/vendor/pygments-main/pygments/lexers/esoteric.py +54 -25
  112. data/vendor/pygments-main/pygments/lexers/ezhil.py +24 -15
  113. data/vendor/pygments-main/pygments/lexers/factor.py +1 -1
  114. data/vendor/pygments-main/pygments/lexers/fantom.py +1 -1
  115. data/vendor/pygments-main/pygments/lexers/felix.py +1 -1
  116. data/vendor/pygments-main/pygments/lexers/floscript.py +83 -0
  117. data/vendor/pygments-main/pygments/lexers/forth.py +41 -40
  118. data/vendor/pygments-main/pygments/lexers/fortran.py +5 -4
  119. data/vendor/pygments-main/pygments/lexers/foxpro.py +2 -2
  120. data/vendor/pygments-main/pygments/lexers/freefem.py +898 -0
  121. data/vendor/pygments-main/pygments/lexers/functional.py +1 -1
  122. data/vendor/pygments-main/pygments/lexers/gdscript.py +346 -0
  123. data/vendor/pygments-main/pygments/lexers/go.py +1 -1
  124. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +63 -6
  125. data/vendor/pygments-main/pygments/lexers/graph.py +14 -9
  126. data/vendor/pygments-main/pygments/lexers/graphics.py +272 -25
  127. data/vendor/pygments-main/pygments/lexers/haskell.py +52 -22
  128. data/vendor/pygments-main/pygments/lexers/haxe.py +6 -6
  129. data/vendor/pygments-main/pygments/lexers/hdl.py +176 -86
  130. data/vendor/pygments-main/pygments/lexers/hexdump.py +18 -12
  131. data/vendor/pygments-main/pygments/lexers/html.py +31 -19
  132. data/vendor/pygments-main/pygments/lexers/idl.py +20 -9
  133. data/vendor/pygments-main/pygments/lexers/igor.py +244 -112
  134. data/vendor/pygments-main/pygments/lexers/inferno.py +2 -2
  135. data/vendor/pygments-main/pygments/lexers/installers.py +1 -1
  136. data/vendor/pygments-main/pygments/lexers/int_fiction.py +40 -15
  137. data/vendor/pygments-main/pygments/lexers/iolang.py +2 -2
  138. data/vendor/pygments-main/pygments/lexers/j.py +3 -3
  139. data/vendor/pygments-main/pygments/lexers/javascript.py +100 -66
  140. data/vendor/pygments-main/pygments/lexers/julia.py +46 -48
  141. data/vendor/pygments-main/pygments/lexers/jvm.py +265 -165
  142. data/vendor/pygments-main/pygments/lexers/lisp.py +882 -804
  143. data/vendor/pygments-main/pygments/lexers/make.py +10 -6
  144. data/vendor/pygments-main/pygments/lexers/markup.py +213 -43
  145. data/vendor/pygments-main/pygments/lexers/math.py +1 -1
  146. data/vendor/pygments-main/pygments/lexers/matlab.py +98 -41
  147. data/vendor/pygments-main/pygments/lexers/mime.py +226 -0
  148. data/vendor/pygments-main/pygments/lexers/ml.py +198 -9
  149. data/vendor/pygments-main/pygments/lexers/modeling.py +26 -18
  150. data/vendor/pygments-main/pygments/lexers/modula2.py +25 -6
  151. data/vendor/pygments-main/pygments/lexers/monte.py +4 -3
  152. data/vendor/pygments-main/pygments/lexers/mosel.py +448 -0
  153. data/vendor/pygments-main/pygments/lexers/ncl.py +85 -244
  154. data/vendor/pygments-main/pygments/lexers/nimrod.py +4 -4
  155. data/vendor/pygments-main/pygments/lexers/nit.py +1 -1
  156. data/vendor/pygments-main/pygments/lexers/nix.py +1 -1
  157. data/vendor/pygments-main/pygments/lexers/oberon.py +17 -1
  158. data/vendor/pygments-main/pygments/lexers/objective.py +16 -16
  159. data/vendor/pygments-main/pygments/lexers/ooc.py +1 -1
  160. data/vendor/pygments-main/pygments/lexers/other.py +1 -1
  161. data/vendor/pygments-main/pygments/lexers/parasail.py +1 -1
  162. data/vendor/pygments-main/pygments/lexers/parsers.py +23 -58
  163. data/vendor/pygments-main/pygments/lexers/pascal.py +23 -23
  164. data/vendor/pygments-main/pygments/lexers/pawn.py +30 -24
  165. data/vendor/pygments-main/pygments/lexers/perl.py +276 -160
  166. data/vendor/pygments-main/pygments/lexers/php.py +64 -10
  167. data/vendor/pygments-main/pygments/lexers/pointless.py +71 -0
  168. data/vendor/pygments-main/pygments/lexers/pony.py +94 -0
  169. data/vendor/pygments-main/pygments/lexers/praat.py +38 -30
  170. data/vendor/pygments-main/pygments/lexers/prolog.py +36 -36
  171. data/vendor/pygments-main/pygments/lexers/promql.py +183 -0
  172. data/vendor/pygments-main/pygments/lexers/python.py +439 -226
  173. data/vendor/pygments-main/pygments/lexers/qvt.py +6 -6
  174. data/vendor/pygments-main/pygments/lexers/r.py +13 -275
  175. data/vendor/pygments-main/pygments/lexers/rdf.py +232 -39
  176. data/vendor/pygments-main/pygments/lexers/rebol.py +8 -8
  177. data/vendor/pygments-main/pygments/lexers/resource.py +2 -2
  178. data/vendor/pygments-main/pygments/lexers/ride.py +139 -0
  179. data/vendor/pygments-main/pygments/lexers/rnc.py +1 -1
  180. data/vendor/pygments-main/pygments/lexers/roboconf.py +1 -1
  181. data/vendor/pygments-main/pygments/lexers/robotframework.py +23 -31
  182. data/vendor/pygments-main/pygments/lexers/ruby.py +22 -24
  183. data/vendor/pygments-main/pygments/lexers/rust.py +86 -71
  184. data/vendor/pygments-main/pygments/lexers/sas.py +7 -7
  185. data/vendor/pygments-main/pygments/lexers/scdoc.py +83 -0
  186. data/vendor/pygments-main/pygments/lexers/scripting.py +75 -13
  187. data/vendor/pygments-main/pygments/lexers/sgf.py +61 -0
  188. data/vendor/pygments-main/pygments/lexers/shell.py +175 -51
  189. data/vendor/pygments-main/pygments/lexers/sieve.py +69 -0
  190. data/vendor/pygments-main/pygments/lexers/slash.py +185 -0
  191. data/vendor/pygments-main/pygments/lexers/smalltalk.py +2 -2
  192. data/vendor/pygments-main/pygments/lexers/smv.py +30 -26
  193. data/vendor/pygments-main/pygments/lexers/snobol.py +1 -1
  194. data/vendor/pygments-main/pygments/lexers/solidity.py +92 -0
  195. data/vendor/pygments-main/pygments/lexers/special.py +5 -3
  196. data/vendor/pygments-main/pygments/lexers/sql.py +333 -177
  197. data/vendor/pygments-main/pygments/lexers/stata.py +107 -42
  198. data/vendor/pygments-main/pygments/lexers/supercollider.py +6 -1
  199. data/vendor/pygments-main/pygments/lexers/tcl.py +1 -1
  200. data/vendor/pygments-main/pygments/lexers/templates.py +144 -132
  201. data/vendor/pygments-main/pygments/lexers/teraterm.py +335 -0
  202. data/vendor/pygments-main/pygments/lexers/testing.py +6 -6
  203. data/vendor/pygments-main/pygments/lexers/text.py +2 -1
  204. data/vendor/pygments-main/pygments/lexers/textedit.py +4 -4
  205. data/vendor/pygments-main/pygments/lexers/textfmts.py +146 -13
  206. data/vendor/pygments-main/pygments/lexers/theorem.py +69 -53
  207. data/vendor/pygments-main/pygments/lexers/tnt.py +263 -0
  208. data/vendor/pygments-main/pygments/lexers/trafficscript.py +1 -1
  209. data/vendor/pygments-main/pygments/lexers/typoscript.py +8 -14
  210. data/vendor/pygments-main/pygments/lexers/unicon.py +412 -0
  211. data/vendor/pygments-main/pygments/lexers/urbi.py +14 -1
  212. data/vendor/pygments-main/pygments/lexers/usd.py +90 -0
  213. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  214. data/vendor/pygments-main/pygments/lexers/verification.py +15 -12
  215. data/vendor/pygments-main/pygments/lexers/web.py +1 -1
  216. data/vendor/pygments-main/pygments/lexers/webidl.py +299 -0
  217. data/vendor/pygments-main/pygments/lexers/webmisc.py +50 -38
  218. data/vendor/pygments-main/pygments/lexers/whiley.py +11 -12
  219. data/vendor/pygments-main/pygments/lexers/x10.py +1 -1
  220. data/vendor/pygments-main/pygments/lexers/xorg.py +37 -0
  221. data/vendor/pygments-main/pygments/lexers/yang.py +104 -0
  222. data/vendor/pygments-main/pygments/lexers/zig.py +124 -0
  223. data/vendor/pygments-main/pygments/modeline.py +6 -5
  224. data/vendor/pygments-main/pygments/plugin.py +14 -18
  225. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  226. data/vendor/pygments-main/pygments/scanner.py +2 -2
  227. data/vendor/pygments-main/pygments/sphinxext.py +2 -4
  228. data/vendor/pygments-main/pygments/style.py +61 -24
  229. data/vendor/pygments-main/pygments/styles/__init__.py +13 -5
  230. data/vendor/pygments-main/pygments/styles/abap.py +29 -0
  231. data/vendor/pygments-main/pygments/styles/algol.py +1 -1
  232. data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -1
  233. data/vendor/pygments-main/pygments/styles/arduino.py +2 -2
  234. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  235. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  236. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  237. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  238. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  239. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  240. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  241. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  242. data/vendor/pygments-main/pygments/styles/igor.py +1 -1
  243. data/vendor/pygments-main/pygments/styles/inkpot.py +67 -0
  244. data/vendor/pygments-main/pygments/styles/lovelace.py +1 -1
  245. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  246. data/vendor/pygments-main/pygments/styles/monokai.py +4 -3
  247. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  248. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  249. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
  250. data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
  251. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  252. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  253. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +89 -0
  254. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  255. data/vendor/pygments-main/pygments/styles/sas.py +3 -0
  256. data/vendor/pygments-main/pygments/styles/solarized.py +134 -0
  257. data/vendor/pygments-main/pygments/styles/stata_dark.py +41 -0
  258. data/vendor/pygments-main/pygments/styles/stata_light.py +39 -0
  259. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  260. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  261. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  262. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  263. data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
  264. data/vendor/pygments-main/pygments/token.py +1 -1
  265. data/vendor/pygments-main/pygments/unistring.py +47 -108
  266. data/vendor/pygments-main/pygments/util.py +19 -95
  267. metadata +72 -138
  268. data/CHANGELOG.md +0 -94
  269. data/README.md +0 -121
  270. data/circle.yml +0 -20
  271. data/test/test_data.c +0 -2581
  272. data/test/test_data.py +0 -514
  273. data/test/test_data_generated +0 -2582
  274. data/vendor/custom_lexers/github.py +0 -565
  275. data/vendor/pygments-main/CHANGES +0 -1163
  276. data/vendor/pygments-main/MANIFEST.in +0 -6
  277. data/vendor/pygments-main/Makefile +0 -65
  278. data/vendor/pygments-main/README.rst +0 -39
  279. data/vendor/pygments-main/REVISION +0 -1
  280. data/vendor/pygments-main/TODO +0 -12
  281. data/vendor/pygments-main/doc/Makefile +0 -153
  282. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  283. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  284. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  285. data/vendor/pygments-main/doc/_templates/docssidebar.html +0 -3
  286. data/vendor/pygments-main/doc/_templates/indexsidebar.html +0 -25
  287. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +0 -98
  288. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  289. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  290. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  291. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  292. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  293. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +0 -401
  294. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +0 -15
  295. data/vendor/pygments-main/doc/conf.py +0 -241
  296. data/vendor/pygments-main/doc/docs/api.rst +0 -331
  297. data/vendor/pygments-main/doc/docs/authors.rst +0 -4
  298. data/vendor/pygments-main/doc/docs/changelog.rst +0 -1
  299. data/vendor/pygments-main/doc/docs/cmdline.rst +0 -149
  300. data/vendor/pygments-main/doc/docs/filterdevelopment.rst +0 -71
  301. data/vendor/pygments-main/doc/docs/filters.rst +0 -41
  302. data/vendor/pygments-main/doc/docs/formatterdevelopment.rst +0 -169
  303. data/vendor/pygments-main/doc/docs/formatters.rst +0 -48
  304. data/vendor/pygments-main/doc/docs/index.rst +0 -66
  305. data/vendor/pygments-main/doc/docs/integrate.rst +0 -40
  306. data/vendor/pygments-main/doc/docs/java.rst +0 -70
  307. data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +0 -689
  308. data/vendor/pygments-main/doc/docs/lexers.rst +0 -69
  309. data/vendor/pygments-main/doc/docs/moinmoin.rst +0 -39
  310. data/vendor/pygments-main/doc/docs/plugins.rst +0 -93
  311. data/vendor/pygments-main/doc/docs/quickstart.rst +0 -205
  312. data/vendor/pygments-main/doc/docs/rstdirective.rst +0 -22
  313. data/vendor/pygments-main/doc/docs/styles.rst +0 -201
  314. data/vendor/pygments-main/doc/docs/tokens.rst +0 -372
  315. data/vendor/pygments-main/doc/docs/unicode.rst +0 -58
  316. data/vendor/pygments-main/doc/download.rst +0 -41
  317. data/vendor/pygments-main/doc/faq.rst +0 -139
  318. data/vendor/pygments-main/doc/index.rst +0 -54
  319. data/vendor/pygments-main/doc/languages.rst +0 -154
  320. data/vendor/pygments-main/doc/make.bat +0 -190
  321. data/vendor/pygments-main/doc/pygmentize.1 +0 -94
  322. data/vendor/pygments-main/external/autopygmentize +0 -84
  323. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +0 -162
  324. data/vendor/pygments-main/external/markdown-processor.py +0 -67
  325. data/vendor/pygments-main/external/moin-parser.py +0 -112
  326. data/vendor/pygments-main/external/pygments.bashcomp +0 -38
  327. data/vendor/pygments-main/external/rst-directive.py +0 -82
  328. data/vendor/pygments-main/pygmentize +0 -8
  329. data/vendor/pygments-main/pygments/lexers/github.py +0 -565
  330. data/vendor/pygments-main/pygments/styles/stata.py +0 -37
  331. data/vendor/pygments-main/requirements.txt +0 -5
  332. data/vendor/pygments-main/scripts/check_sources.py +0 -211
  333. data/vendor/pygments-main/scripts/debug_lexer.py +0 -246
  334. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +0 -33
  335. data/vendor/pygments-main/scripts/epydoc.css +0 -280
  336. data/vendor/pygments-main/scripts/find_error.py +0 -1
  337. data/vendor/pygments-main/scripts/get_vimkw.py +0 -74
  338. data/vendor/pygments-main/scripts/pylintrc +0 -301
  339. data/vendor/pygments-main/scripts/vim2pygments.py +0 -935
  340. data/vendor/pygments-main/setup.cfg +0 -10
  341. data/vendor/pygments-main/setup.py +0 -77
  342. data/vendor/pygments-main/tox.ini +0 -7
  343. data/vendor/simplejson/.gitignore +0 -10
  344. data/vendor/simplejson/.travis.yml +0 -5
  345. data/vendor/simplejson/CHANGES.txt +0 -291
  346. data/vendor/simplejson/LICENSE.txt +0 -19
  347. data/vendor/simplejson/MANIFEST.in +0 -5
  348. data/vendor/simplejson/README.rst +0 -19
  349. data/vendor/simplejson/conf.py +0 -179
  350. data/vendor/simplejson/index.rst +0 -628
  351. data/vendor/simplejson/scripts/make_docs.py +0 -18
  352. data/vendor/simplejson/setup.py +0 -104
  353. data/vendor/simplejson/simplejson/__init__.py +0 -510
  354. data/vendor/simplejson/simplejson/_speedups.c +0 -2745
  355. data/vendor/simplejson/simplejson/decoder.py +0 -425
  356. data/vendor/simplejson/simplejson/encoder.py +0 -567
  357. data/vendor/simplejson/simplejson/ordered_dict.py +0 -119
  358. data/vendor/simplejson/simplejson/scanner.py +0 -77
  359. data/vendor/simplejson/simplejson/tests/__init__.py +0 -67
  360. data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +0 -55
  361. data/vendor/simplejson/simplejson/tests/test_check_circular.py +0 -30
  362. data/vendor/simplejson/simplejson/tests/test_decimal.py +0 -66
  363. data/vendor/simplejson/simplejson/tests/test_decode.py +0 -83
  364. data/vendor/simplejson/simplejson/tests/test_default.py +0 -9
  365. data/vendor/simplejson/simplejson/tests/test_dump.py +0 -67
  366. data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +0 -46
  367. data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +0 -32
  368. data/vendor/simplejson/simplejson/tests/test_errors.py +0 -34
  369. data/vendor/simplejson/simplejson/tests/test_fail.py +0 -91
  370. data/vendor/simplejson/simplejson/tests/test_float.py +0 -19
  371. data/vendor/simplejson/simplejson/tests/test_indent.py +0 -86
  372. data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +0 -20
  373. data/vendor/simplejson/simplejson/tests/test_namedtuple.py +0 -121
  374. data/vendor/simplejson/simplejson/tests/test_pass1.py +0 -76
  375. data/vendor/simplejson/simplejson/tests/test_pass2.py +0 -14
  376. data/vendor/simplejson/simplejson/tests/test_pass3.py +0 -20
  377. data/vendor/simplejson/simplejson/tests/test_recursion.py +0 -67
  378. data/vendor/simplejson/simplejson/tests/test_scanstring.py +0 -117
  379. data/vendor/simplejson/simplejson/tests/test_separators.py +0 -42
  380. data/vendor/simplejson/simplejson/tests/test_speedups.py +0 -20
  381. data/vendor/simplejson/simplejson/tests/test_tuple.py +0 -49
  382. data/vendor/simplejson/simplejson/tests/test_unicode.py +0 -109
  383. data/vendor/simplejson/simplejson/tool.py +0 -39
@@ -1,15 +0,0 @@
1
- [theme]
2
- inherit = basic
3
- stylesheet = pygments14.css
4
- pygments_style = friendly
5
-
6
- [options]
7
- green = #66b55e
8
- darkgreen = #36852e
9
- darkgray = #666666
10
- border = #66b55e
11
- yellow = #f4cd00
12
- darkyellow = #d4ad00
13
- lightyellow = #fffbe3
14
- background = #f9f9f9
15
- font = PT Sans
@@ -1,241 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Pygments documentation build configuration file
4
- #
5
-
6
- import sys, os
7
-
8
- # If extensions (or modules to document with autodoc) are in another directory,
9
- # add these directories to sys.path here. If the directory is relative to the
10
- # documentation root, use os.path.abspath to make it absolute, like shown here.
11
- sys.path.insert(0, os.path.abspath('..'))
12
-
13
- import pygments
14
-
15
- # -- General configuration -----------------------------------------------------
16
-
17
- # If your documentation needs a minimal Sphinx version, state it here.
18
- #needs_sphinx = '1.0'
19
-
20
- # Add any Sphinx extension module names here, as strings. They can be extensions
21
- # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
22
- extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments.sphinxext']
23
-
24
- # Add any paths that contain templates here, relative to this directory.
25
- templates_path = ['_templates']
26
-
27
- # The suffix of source filenames.
28
- source_suffix = '.rst'
29
-
30
- # The encoding of source files.
31
- #source_encoding = 'utf-8-sig'
32
-
33
- # The master toctree document.
34
- master_doc = 'index'
35
-
36
- # General information about the project.
37
- project = u'Pygments'
38
- copyright = u'2015, Georg Brandl'
39
-
40
- # The version info for the project you're documenting, acts as replacement for
41
- # |version| and |release|, also used in various other places throughout the
42
- # built documents.
43
- #
44
- # The short X.Y version.
45
- version = pygments.__version__
46
- # The full version, including alpha/beta/rc tags.
47
- release = version
48
-
49
- # The language for content autogenerated by Sphinx. Refer to documentation
50
- # for a list of supported languages.
51
- #language = None
52
-
53
- # There are two options for replacing |today|: either, you set today to some
54
- # non-false value, then it is used:
55
- #today = ''
56
- # Else, today_fmt is used as the format for a strftime call.
57
- #today_fmt = '%B %d, %Y'
58
-
59
- # List of patterns, relative to source directory, that match files and
60
- # directories to ignore when looking for source files.
61
- exclude_patterns = ['_build']
62
-
63
- # The reST default role (used for this markup: `text`) to use for all documents.
64
- #default_role = None
65
-
66
- # If true, '()' will be appended to :func: etc. cross-reference text.
67
- #add_function_parentheses = True
68
-
69
- # If true, the current module name will be prepended to all description
70
- # unit titles (such as .. function::).
71
- #add_module_names = True
72
-
73
- # If true, sectionauthor and moduleauthor directives will be shown in the
74
- # output. They are ignored by default.
75
- #show_authors = False
76
-
77
- # The name of the Pygments (syntax highlighting) style to use.
78
- #pygments_style = 'sphinx'
79
-
80
- # A list of ignored prefixes for module index sorting.
81
- #modindex_common_prefix = []
82
-
83
-
84
- # -- Options for HTML output ---------------------------------------------------
85
-
86
- # The theme to use for HTML and HTML Help pages. See the documentation for
87
- # a list of builtin themes.
88
- html_theme = 'pygments14'
89
-
90
- # Theme options are theme-specific and customize the look and feel of a theme
91
- # further. For a list of options available for each theme, see the
92
- # documentation.
93
- #html_theme_options = {}
94
-
95
- # Add any paths that contain custom themes here, relative to this directory.
96
- html_theme_path = ['_themes']
97
-
98
- # The name for this set of Sphinx documents. If None, it defaults to
99
- # "<project> v<release> documentation".
100
- #html_title = None
101
-
102
- # A shorter title for the navigation bar. Default is the same as html_title.
103
- #html_short_title = None
104
-
105
- # The name of an image file (relative to this directory) to place at the top
106
- # of the sidebar.
107
- #html_logo = None
108
-
109
- # The name of an image file (within the static path) to use as favicon of the
110
- # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
111
- # pixels large.
112
- html_favicon = '_static/favicon.ico'
113
-
114
- # Add any paths that contain custom static files (such as style sheets) here,
115
- # relative to this directory. They are copied after the builtin static files,
116
- # so a file named "default.css" will overwrite the builtin "default.css".
117
- html_static_path = ['_static']
118
-
119
- # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
120
- # using the given strftime format.
121
- #html_last_updated_fmt = '%b %d, %Y'
122
-
123
- # If true, SmartyPants will be used to convert quotes and dashes to
124
- # typographically correct entities.
125
- #html_use_smartypants = True
126
-
127
- # Custom sidebar templates, maps document names to template names.
128
- html_sidebars = {'index': 'indexsidebar.html',
129
- 'docs/*': 'docssidebar.html'}
130
-
131
- # Additional templates that should be rendered to pages, maps page names to
132
- # template names.
133
- #html_additional_pages = {}
134
-
135
- # If false, no module index is generated.
136
- #html_domain_indices = True
137
-
138
- # If false, no index is generated.
139
- #html_use_index = True
140
-
141
- # If true, the index is split into individual pages for each letter.
142
- #html_split_index = False
143
-
144
- # If true, links to the reST sources are added to the pages.
145
- #html_show_sourcelink = True
146
-
147
- # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
148
- #html_show_sphinx = True
149
-
150
- # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
151
- #html_show_copyright = True
152
-
153
- # If true, an OpenSearch description file will be output, and all pages will
154
- # contain a <link> tag referring to it. The value of this option must be the
155
- # base URL from which the finished HTML is served.
156
- #html_use_opensearch = ''
157
-
158
- # This is the file name suffix for HTML files (e.g. ".xhtml").
159
- #html_file_suffix = None
160
-
161
- # Output file base name for HTML help builder.
162
- htmlhelp_basename = 'Pygmentsdoc'
163
-
164
-
165
- # -- Options for LaTeX output --------------------------------------------------
166
-
167
- latex_elements = {
168
- # The paper size ('letterpaper' or 'a4paper').
169
- #'papersize': 'letterpaper',
170
-
171
- # The font size ('10pt', '11pt' or '12pt').
172
- #'pointsize': '10pt',
173
-
174
- # Additional stuff for the LaTeX preamble.
175
- #'preamble': '',
176
- }
177
-
178
- # Grouping the document tree into LaTeX files. List of tuples
179
- # (source start file, target name, title, author, documentclass [howto/manual]).
180
- latex_documents = [
181
- ('index', 'Pygments.tex', u'Pygments Documentation',
182
- u'Georg Brandl', 'manual'),
183
- ]
184
-
185
- # The name of an image file (relative to this directory) to place at the top of
186
- # the title page.
187
- #latex_logo = None
188
-
189
- # For "manual" documents, if this is true, then toplevel headings are parts,
190
- # not chapters.
191
- #latex_use_parts = False
192
-
193
- # If true, show page references after internal links.
194
- #latex_show_pagerefs = False
195
-
196
- # If true, show URL addresses after external links.
197
- #latex_show_urls = False
198
-
199
- # Documents to append as an appendix to all manuals.
200
- #latex_appendices = []
201
-
202
- # If false, no module index is generated.
203
- #latex_domain_indices = True
204
-
205
-
206
- # -- Options for manual page output --------------------------------------------
207
-
208
- # One entry per manual page. List of tuples
209
- # (source start file, name, description, authors, manual section).
210
- man_pages = [
211
- ('index', 'pygments', u'Pygments Documentation',
212
- [u'Georg Brandl'], 1)
213
- ]
214
-
215
- # If true, show URL addresses after external links.
216
- #man_show_urls = False
217
-
218
-
219
- # -- Options for Texinfo output ------------------------------------------------
220
-
221
- # Grouping the document tree into Texinfo files. List of tuples
222
- # (source start file, target name, title, author,
223
- # dir menu entry, description, category)
224
- texinfo_documents = [
225
- ('index', 'Pygments', u'Pygments Documentation',
226
- u'Georg Brandl', 'Pygments', 'One line description of project.',
227
- 'Miscellaneous'),
228
- ]
229
-
230
- # Documents to append as an appendix to all manuals.
231
- #texinfo_appendices = []
232
-
233
- # If false, no module index is generated.
234
- #texinfo_domain_indices = True
235
-
236
- # How to display URL addresses: 'footnote', 'no', or 'inline'.
237
- #texinfo_show_urls = 'footnote'
238
-
239
-
240
- # Example configuration for intersphinx: refer to the Python standard library.
241
- #intersphinx_mapping = {'http://docs.python.org/': None}
@@ -1,331 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- =====================
4
- The full Pygments API
5
- =====================
6
-
7
- This page describes the Pygments API.
8
-
9
- High-level API
10
- ==============
11
-
12
- .. module:: pygments
13
-
14
- Functions from the :mod:`pygments` module:
15
-
16
- .. function:: lex(code, lexer)
17
-
18
- Lex `code` with the `lexer` (must be a `Lexer` instance)
19
- and return an iterable of tokens. Currently, this only calls
20
- `lexer.get_tokens()`.
21
-
22
- .. function:: format(tokens, formatter, outfile=None)
23
-
24
- Format a token stream (iterable of tokens) `tokens` with the
25
- `formatter` (must be a `Formatter` instance). The result is
26
- written to `outfile`, or if that is ``None``, returned as a
27
- string.
28
-
29
- .. function:: highlight(code, lexer, formatter, outfile=None)
30
-
31
- This is the most high-level highlighting function.
32
- It combines `lex` and `format` in one function.
33
-
34
-
35
- .. module:: pygments.lexers
36
-
37
- Functions from :mod:`pygments.lexers`:
38
-
39
- .. function:: get_lexer_by_name(alias, **options)
40
-
41
- Return an instance of a `Lexer` subclass that has `alias` in its
42
- aliases list. The lexer is given the `options` at its
43
- instantiation.
44
-
45
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
46
- found.
47
-
48
- .. function:: get_lexer_for_filename(fn, **options)
49
-
50
- Return a `Lexer` subclass instance that has a filename pattern
51
- matching `fn`. The lexer is given the `options` at its
52
- instantiation.
53
-
54
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename
55
- is found.
56
-
57
- .. function:: get_lexer_for_mimetype(mime, **options)
58
-
59
- Return a `Lexer` subclass instance that has `mime` in its mimetype
60
- list. The lexer is given the `options` at its instantiation.
61
-
62
- Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype
63
- is found.
64
-
65
- .. function:: guess_lexer(text, **options)
66
-
67
- Return a `Lexer` subclass instance that's guessed from the text in
68
- `text`. For that, the :meth:`.analyse_text()` method of every known lexer
69
- class is called with the text as argument, and the lexer which returned the
70
- highest value will be instantiated and returned.
71
-
72
- :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
73
- handle the content.
74
-
75
- .. function:: guess_lexer_for_filename(filename, text, **options)
76
-
77
- As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames`
78
- or `alias_filenames` that matches `filename` are taken into consideration.
79
-
80
- :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
81
- handle the content.
82
-
83
- .. function:: get_all_lexers()
84
-
85
- Return an iterable over all registered lexers, yielding tuples in the
86
- format::
87
-
88
- (longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
89
-
90
- .. versionadded:: 0.6
91
-
92
- .. function:: find_lexer_class_by_name(alias)
93
-
94
- Return the `Lexer` subclass that has `alias` in its aliases list, without
95
- instantiating it.
96
-
97
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
98
- found.
99
-
100
- .. versionadded:: 2.2
101
-
102
- .. function:: find_lexer_class(name)
103
-
104
- Return the `Lexer` subclass that with the *name* attribute as given by
105
- the *name* argument.
106
-
107
-
108
- .. module:: pygments.formatters
109
-
110
- Functions from :mod:`pygments.formatters`:
111
-
112
- .. function:: get_formatter_by_name(alias, **options)
113
-
114
- Return an instance of a :class:`.Formatter` subclass that has `alias` in its
115
- aliases list. The formatter is given the `options` at its instantiation.
116
-
117
- Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that
118
- alias is found.
119
-
120
- .. function:: get_formatter_for_filename(fn, **options)
121
-
122
- Return a :class:`.Formatter` subclass instance that has a filename pattern
123
- matching `fn`. The formatter is given the `options` at its instantiation.
124
-
125
- Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename
126
- is found.
127
-
128
-
129
- .. module:: pygments.styles
130
-
131
- Functions from :mod:`pygments.styles`:
132
-
133
- .. function:: get_style_by_name(name)
134
-
135
- Return a style class by its short name. The names of the builtin styles
136
- are listed in :data:`pygments.styles.STYLE_MAP`.
137
-
138
- Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
139
- found.
140
-
141
- .. function:: get_all_styles()
142
-
143
- Return an iterable over all registered styles, yielding their names.
144
-
145
- .. versionadded:: 0.6
146
-
147
-
148
- .. module:: pygments.lexer
149
-
150
- Lexers
151
- ======
152
-
153
- The base lexer class from which all lexers are derived is:
154
-
155
- .. class:: Lexer(**options)
156
-
157
- The constructor takes a \*\*keywords dictionary of options.
158
- Every subclass must first process its own options and then call
159
- the `Lexer` constructor, since it processes the `stripnl`,
160
- `stripall` and `tabsize` options.
161
-
162
- An example looks like this:
163
-
164
- .. sourcecode:: python
165
-
166
- def __init__(self, **options):
167
- self.compress = options.get('compress', '')
168
- Lexer.__init__(self, **options)
169
-
170
- As these options must all be specifiable as strings (due to the
171
- command line usage), there are various utility functions
172
- available to help with that, see `Option processing`_.
173
-
174
- .. method:: get_tokens(text)
175
-
176
- This method is the basic interface of a lexer. It is called by
177
- the `highlight()` function. It must process the text and return an
178
- iterable of ``(tokentype, value)`` pairs from `text`.
179
-
180
- Normally, you don't need to override this method. The default
181
- implementation processes the `stripnl`, `stripall` and `tabsize`
182
- options and then yields all tokens from `get_tokens_unprocessed()`,
183
- with the ``index`` dropped.
184
-
185
- .. method:: get_tokens_unprocessed(text)
186
-
187
- This method should process the text and return an iterable of
188
- ``(index, tokentype, value)`` tuples where ``index`` is the starting
189
- position of the token within the input text.
190
-
191
- This method must be overridden by subclasses.
192
-
193
- .. staticmethod:: analyse_text(text)
194
-
195
- A static method which is called for lexer guessing. It should analyse
196
- the text and return a float in the range from ``0.0`` to ``1.0``.
197
- If it returns ``0.0``, the lexer will not be selected as the most
198
- probable one, if it returns ``1.0``, it will be selected immediately.
199
-
200
- .. note:: You don't have to add ``@staticmethod`` to the definition of
201
- this method, this will be taken care of by the Lexer's metaclass.
202
-
203
- For a list of known tokens have a look at the :doc:`tokens` page.
204
-
205
- A lexer also can have the following attributes (in fact, they are mandatory
206
- except `alias_filenames`) that are used by the builtin lookup mechanism.
207
-
208
- .. attribute:: name
209
-
210
- Full name for the lexer, in human-readable form.
211
-
212
- .. attribute:: aliases
213
-
214
- A list of short, unique identifiers that can be used to lookup
215
- the lexer from a list, e.g. using `get_lexer_by_name()`.
216
-
217
- .. attribute:: filenames
218
-
219
- A list of `fnmatch` patterns that match filenames which contain
220
- content for this lexer. The patterns in this list should be unique among
221
- all lexers.
222
-
223
- .. attribute:: alias_filenames
224
-
225
- A list of `fnmatch` patterns that match filenames which may or may not
226
- contain content for this lexer. This list is used by the
227
- :func:`.guess_lexer_for_filename()` function, to determine which lexers
228
- are then included in guessing the correct one. That means that
229
- e.g. every lexer for HTML and a template language should include
230
- ``\*.html`` in this list.
231
-
232
- .. attribute:: mimetypes
233
-
234
- A list of MIME types for content that can be lexed with this
235
- lexer.
236
-
237
-
238
- .. module:: pygments.formatter
239
-
240
- Formatters
241
- ==========
242
-
243
- A formatter is derived from this class:
244
-
245
-
246
- .. class:: Formatter(**options)
247
-
248
- As with lexers, this constructor processes options and then must call the
249
- base class :meth:`__init__`.
250
-
251
- The :class:`Formatter` class recognizes the options `style`, `full` and
252
- `title`. It is up to the formatter class whether it uses them.
253
-
254
- .. method:: get_style_defs(arg='')
255
-
256
- This method must return statements or declarations suitable to define
257
- the current style for subsequent highlighted text (e.g. CSS classes
258
- in the `HTMLFormatter`).
259
-
260
- The optional argument `arg` can be used to modify the generation and
261
- is formatter dependent (it is standardized because it can be given on
262
- the command line).
263
-
264
- This method is called by the ``-S`` :doc:`command-line option <cmdline>`,
265
- the `arg` is then given by the ``-a`` option.
266
-
267
- .. method:: format(tokensource, outfile)
268
-
269
- This method must format the tokens from the `tokensource` iterable and
270
- write the formatted version to the file object `outfile`.
271
-
272
- Formatter options can control how exactly the tokens are converted.
273
-
274
- .. versionadded:: 0.7
275
- A formatter must have the following attributes that are used by the
276
- builtin lookup mechanism.
277
-
278
- .. attribute:: name
279
-
280
- Full name for the formatter, in human-readable form.
281
-
282
- .. attribute:: aliases
283
-
284
- A list of short, unique identifiers that can be used to lookup
285
- the formatter from a list, e.g. using :func:`.get_formatter_by_name()`.
286
-
287
- .. attribute:: filenames
288
-
289
- A list of :mod:`fnmatch` patterns that match filenames for which this
290
- formatter can produce output. The patterns in this list should be unique
291
- among all formatters.
292
-
293
-
294
- .. module:: pygments.util
295
-
296
- Option processing
297
- =================
298
-
299
- The :mod:`pygments.util` module has some utility functions usable for option
300
- processing:
301
-
302
- .. exception:: OptionError
303
-
304
- This exception will be raised by all option processing functions if
305
- the type or value of the argument is not correct.
306
-
307
- .. function:: get_bool_opt(options, optname, default=None)
308
-
309
- Interpret the key `optname` from the dictionary `options` as a boolean and
310
- return it. Return `default` if `optname` is not in `options`.
311
-
312
- The valid string values for ``True`` are ``1``, ``yes``, ``true`` and
313
- ``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off``
314
- (matched case-insensitively).
315
-
316
- .. function:: get_int_opt(options, optname, default=None)
317
-
318
- As :func:`get_bool_opt`, but interpret the value as an integer.
319
-
320
- .. function:: get_list_opt(options, optname, default=None)
321
-
322
- If the key `optname` from the dictionary `options` is a string,
323
- split it at whitespace and return it. If it is already a list
324
- or a tuple, it is returned as a list.
325
-
326
- .. function:: get_choice_opt(options, optname, allowed, default=None)
327
-
328
- If the key `optname` from the dictionary is not in the sequence
329
- `allowed`, raise an error, otherwise return it.
330
-
331
- .. versionadded:: 0.8