gitlab-pygments.rb 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (399) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +2 -0
  3. data/README.md +91 -0
  4. data/Rakefile +78 -0
  5. data/bench.rb +22 -0
  6. data/cache-lexers.rb +8 -0
  7. data/lexers +0 -0
  8. data/lib/pygments/lexer.rb +148 -0
  9. data/lib/pygments/mentos.py +344 -0
  10. data/lib/pygments/popen.rb +389 -0
  11. data/lib/pygments/version.rb +3 -0
  12. data/lib/pygments.rb +8 -0
  13. data/pygments.rb.gemspec +24 -0
  14. data/test/test_data.c +2581 -0
  15. data/test/test_data.py +514 -0
  16. data/test/test_data_generated +2582 -0
  17. data/test/test_pygments.rb +276 -0
  18. data/vendor/custom_formatters/gitlab.py +171 -0
  19. data/vendor/custom_lexers/github.py +362 -0
  20. data/vendor/pygments-main/AUTHORS +115 -0
  21. data/vendor/pygments-main/CHANGES +762 -0
  22. data/vendor/pygments-main/LICENSE +25 -0
  23. data/vendor/pygments-main/MANIFEST.in +6 -0
  24. data/vendor/pygments-main/Makefile +59 -0
  25. data/vendor/pygments-main/REVISION +1 -0
  26. data/vendor/pygments-main/TODO +15 -0
  27. data/vendor/pygments-main/docs/generate.py +472 -0
  28. data/vendor/pygments-main/docs/pygmentize.1 +94 -0
  29. data/vendor/pygments-main/docs/src/api.txt +270 -0
  30. data/vendor/pygments-main/docs/src/authors.txt +5 -0
  31. data/vendor/pygments-main/docs/src/changelog.txt +5 -0
  32. data/vendor/pygments-main/docs/src/cmdline.txt +147 -0
  33. data/vendor/pygments-main/docs/src/filterdevelopment.txt +70 -0
  34. data/vendor/pygments-main/docs/src/filters.txt +42 -0
  35. data/vendor/pygments-main/docs/src/formatterdevelopment.txt +169 -0
  36. data/vendor/pygments-main/docs/src/formatters.txt +48 -0
  37. data/vendor/pygments-main/docs/src/index.txt +69 -0
  38. data/vendor/pygments-main/docs/src/installation.txt +71 -0
  39. data/vendor/pygments-main/docs/src/integrate.txt +43 -0
  40. data/vendor/pygments-main/docs/src/lexerdevelopment.txt +551 -0
  41. data/vendor/pygments-main/docs/src/lexers.txt +67 -0
  42. data/vendor/pygments-main/docs/src/moinmoin.txt +39 -0
  43. data/vendor/pygments-main/docs/src/plugins.txt +93 -0
  44. data/vendor/pygments-main/docs/src/quickstart.txt +202 -0
  45. data/vendor/pygments-main/docs/src/rstdirective.txt +22 -0
  46. data/vendor/pygments-main/docs/src/styles.txt +143 -0
  47. data/vendor/pygments-main/docs/src/tokens.txt +349 -0
  48. data/vendor/pygments-main/docs/src/unicode.txt +49 -0
  49. data/vendor/pygments-main/external/markdown-processor.py +67 -0
  50. data/vendor/pygments-main/external/moin-parser.py +112 -0
  51. data/vendor/pygments-main/external/pygments.bashcomp +38 -0
  52. data/vendor/pygments-main/external/rst-directive-old.py +77 -0
  53. data/vendor/pygments-main/external/rst-directive.py +83 -0
  54. data/vendor/pygments-main/ez_setup.py +276 -0
  55. data/vendor/pygments-main/pygmentize +7 -0
  56. data/vendor/pygments-main/pygments/__init__.py +91 -0
  57. data/vendor/pygments-main/pygments/cmdline.py +433 -0
  58. data/vendor/pygments-main/pygments/console.py +74 -0
  59. data/vendor/pygments-main/pygments/filter.py +74 -0
  60. data/vendor/pygments-main/pygments/filters/__init__.py +357 -0
  61. data/vendor/pygments-main/pygments/formatter.py +92 -0
  62. data/vendor/pygments-main/pygments/formatters/__init__.py +68 -0
  63. data/vendor/pygments-main/pygments/formatters/_mapping.py +94 -0
  64. data/vendor/pygments-main/pygments/formatters/bbcode.py +109 -0
  65. data/vendor/pygments-main/pygments/formatters/gitlab.py +171 -0
  66. data/vendor/pygments-main/pygments/formatters/html.py +750 -0
  67. data/vendor/pygments-main/pygments/formatters/img.py +553 -0
  68. data/vendor/pygments-main/pygments/formatters/latex.py +378 -0
  69. data/vendor/pygments-main/pygments/formatters/other.py +117 -0
  70. data/vendor/pygments-main/pygments/formatters/rtf.py +136 -0
  71. data/vendor/pygments-main/pygments/formatters/svg.py +154 -0
  72. data/vendor/pygments-main/pygments/formatters/terminal.py +112 -0
  73. data/vendor/pygments-main/pygments/formatters/terminal256.py +222 -0
  74. data/vendor/pygments-main/pygments/lexer.py +697 -0
  75. data/vendor/pygments-main/pygments/lexers/__init__.py +229 -0
  76. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1645 -0
  77. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +232 -0
  78. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +249 -0
  79. data/vendor/pygments-main/pygments/lexers/_mapping.py +298 -0
  80. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +3787 -0
  81. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +232 -0
  82. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +29 -0
  83. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +3 -0
  84. data/vendor/pygments-main/pygments/lexers/agile.py +1803 -0
  85. data/vendor/pygments-main/pygments/lexers/asm.py +360 -0
  86. data/vendor/pygments-main/pygments/lexers/compiled.py +2891 -0
  87. data/vendor/pygments-main/pygments/lexers/dotnet.py +636 -0
  88. data/vendor/pygments-main/pygments/lexers/functional.py +1832 -0
  89. data/vendor/pygments-main/pygments/lexers/github.py +362 -0
  90. data/vendor/pygments-main/pygments/lexers/hdl.py +356 -0
  91. data/vendor/pygments-main/pygments/lexers/jvm.py +847 -0
  92. data/vendor/pygments-main/pygments/lexers/math.py +1072 -0
  93. data/vendor/pygments-main/pygments/lexers/other.py +3339 -0
  94. data/vendor/pygments-main/pygments/lexers/parsers.py +695 -0
  95. data/vendor/pygments-main/pygments/lexers/shell.py +361 -0
  96. data/vendor/pygments-main/pygments/lexers/special.py +100 -0
  97. data/vendor/pygments-main/pygments/lexers/sql.py +559 -0
  98. data/vendor/pygments-main/pygments/lexers/templates.py +1631 -0
  99. data/vendor/pygments-main/pygments/lexers/text.py +1753 -0
  100. data/vendor/pygments-main/pygments/lexers/web.py +2864 -0
  101. data/vendor/pygments-main/pygments/plugin.py +74 -0
  102. data/vendor/pygments-main/pygments/scanner.py +104 -0
  103. data/vendor/pygments-main/pygments/style.py +117 -0
  104. data/vendor/pygments-main/pygments/styles/__init__.py +70 -0
  105. data/vendor/pygments-main/pygments/styles/autumn.py +65 -0
  106. data/vendor/pygments-main/pygments/styles/borland.py +51 -0
  107. data/vendor/pygments-main/pygments/styles/bw.py +49 -0
  108. data/vendor/pygments-main/pygments/styles/colorful.py +81 -0
  109. data/vendor/pygments-main/pygments/styles/default.py +73 -0
  110. data/vendor/pygments-main/pygments/styles/emacs.py +72 -0
  111. data/vendor/pygments-main/pygments/styles/friendly.py +72 -0
  112. data/vendor/pygments-main/pygments/styles/fruity.py +42 -0
  113. data/vendor/pygments-main/pygments/styles/manni.py +75 -0
  114. data/vendor/pygments-main/pygments/styles/monokai.py +106 -0
  115. data/vendor/pygments-main/pygments/styles/murphy.py +80 -0
  116. data/vendor/pygments-main/pygments/styles/native.py +65 -0
  117. data/vendor/pygments-main/pygments/styles/pastie.py +75 -0
  118. data/vendor/pygments-main/pygments/styles/perldoc.py +69 -0
  119. data/vendor/pygments-main/pygments/styles/rrt.py +33 -0
  120. data/vendor/pygments-main/pygments/styles/tango.py +141 -0
  121. data/vendor/pygments-main/pygments/styles/trac.py +63 -0
  122. data/vendor/pygments-main/pygments/styles/vim.py +63 -0
  123. data/vendor/pygments-main/pygments/styles/vs.py +38 -0
  124. data/vendor/pygments-main/pygments/token.py +195 -0
  125. data/vendor/pygments-main/pygments/unistring.py +130 -0
  126. data/vendor/pygments-main/pygments/util.py +232 -0
  127. data/vendor/pygments-main/scripts/check_sources.py +242 -0
  128. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +30 -0
  129. data/vendor/pygments-main/scripts/epydoc.css +280 -0
  130. data/vendor/pygments-main/scripts/find_codetags.py +205 -0
  131. data/vendor/pygments-main/scripts/find_error.py +171 -0
  132. data/vendor/pygments-main/scripts/get_vimkw.py +43 -0
  133. data/vendor/pygments-main/scripts/pylintrc +301 -0
  134. data/vendor/pygments-main/scripts/reindent.py +291 -0
  135. data/vendor/pygments-main/scripts/vim2pygments.py +933 -0
  136. data/vendor/pygments-main/setup.cfg +6 -0
  137. data/vendor/pygments-main/setup.py +88 -0
  138. data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +37 -0
  139. data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +869 -0
  140. data/vendor/pygments-main/tests/dtds/HTML4.dcl +88 -0
  141. data/vendor/pygments-main/tests/dtds/HTML4.dtd +1092 -0
  142. data/vendor/pygments-main/tests/dtds/HTML4.soc +9 -0
  143. data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +195 -0
  144. data/vendor/pygments-main/tests/dtds/HTMLspec.ent +77 -0
  145. data/vendor/pygments-main/tests/dtds/HTMLsym.ent +241 -0
  146. data/vendor/pygments-main/tests/examplefiles/ANTLRv3.g +608 -0
  147. data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +209 -0
  148. data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +102 -0
  149. data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +611 -0
  150. data/vendor/pygments-main/tests/examplefiles/Constants.mo +158 -0
  151. data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +411 -0
  152. data/vendor/pygments-main/tests/examplefiles/Errors.scala +18 -0
  153. data/vendor/pygments-main/tests/examplefiles/File.hy +174 -0
  154. data/vendor/pygments-main/tests/examplefiles/Intro.java +1660 -0
  155. data/vendor/pygments-main/tests/examplefiles/Makefile +1131 -0
  156. data/vendor/pygments-main/tests/examplefiles/Object.st +4394 -0
  157. data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +584 -0
  158. data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +378 -0
  159. data/vendor/pygments-main/tests/examplefiles/Sorting.mod +470 -0
  160. data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +382 -0
  161. data/vendor/pygments-main/tests/examplefiles/addressbook.proto +30 -0
  162. data/vendor/pygments-main/tests/examplefiles/antlr_throws +1 -0
  163. data/vendor/pygments-main/tests/examplefiles/apache2.conf +393 -0
  164. data/vendor/pygments-main/tests/examplefiles/as3_test.as +143 -0
  165. data/vendor/pygments-main/tests/examplefiles/as3_test2.as +46 -0
  166. data/vendor/pygments-main/tests/examplefiles/as3_test3.as +3 -0
  167. data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +27 -0
  168. data/vendor/pygments-main/tests/examplefiles/badcase.java +2 -0
  169. data/vendor/pygments-main/tests/examplefiles/batchfile.bat +49 -0
  170. data/vendor/pygments-main/tests/examplefiles/boot-9.scm +1557 -0
  171. data/vendor/pygments-main/tests/examplefiles/cells.ps +515 -0
  172. data/vendor/pygments-main/tests/examplefiles/ceval.c +2604 -0
  173. data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +13 -0
  174. data/vendor/pygments-main/tests/examplefiles/classes.dylan +40 -0
  175. data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +10 -0
  176. data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +447 -0
  177. data/vendor/pygments-main/tests/examplefiles/database.pytb +20 -0
  178. data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +2461 -0
  179. data/vendor/pygments-main/tests/examplefiles/demo.ahk +181 -0
  180. data/vendor/pygments-main/tests/examplefiles/demo.cfm +38 -0
  181. data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +68 -0
  182. data/vendor/pygments-main/tests/examplefiles/dwarf.cw +17 -0
  183. data/vendor/pygments-main/tests/examplefiles/erl_session +10 -0
  184. data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +1 -0
  185. data/vendor/pygments-main/tests/examplefiles/evil_regex.js +48 -0
  186. data/vendor/pygments-main/tests/examplefiles/example.c +2080 -0
  187. data/vendor/pygments-main/tests/examplefiles/example.cls +15 -0
  188. data/vendor/pygments-main/tests/examplefiles/example.cpp +2363 -0
  189. data/vendor/pygments-main/tests/examplefiles/example.gs +106 -0
  190. data/vendor/pygments-main/tests/examplefiles/example.gst +7 -0
  191. data/vendor/pygments-main/tests/examplefiles/example.kt +47 -0
  192. data/vendor/pygments-main/tests/examplefiles/example.lua +250 -0
  193. data/vendor/pygments-main/tests/examplefiles/example.moo +26 -0
  194. data/vendor/pygments-main/tests/examplefiles/example.moon +629 -0
  195. data/vendor/pygments-main/tests/examplefiles/example.nim +1010 -0
  196. data/vendor/pygments-main/tests/examplefiles/example.ns2 +69 -0
  197. data/vendor/pygments-main/tests/examplefiles/example.p +34 -0
  198. data/vendor/pygments-main/tests/examplefiles/example.pas +2708 -0
  199. data/vendor/pygments-main/tests/examplefiles/example.rb +1852 -0
  200. data/vendor/pygments-main/tests/examplefiles/example.rhtml +561 -0
  201. data/vendor/pygments-main/tests/examplefiles/example.sh-session +19 -0
  202. data/vendor/pygments-main/tests/examplefiles/example.sml +156 -0
  203. data/vendor/pygments-main/tests/examplefiles/example.snobol +15 -0
  204. data/vendor/pygments-main/tests/examplefiles/example.tea +34 -0
  205. data/vendor/pygments-main/tests/examplefiles/example.u +548 -0
  206. data/vendor/pygments-main/tests/examplefiles/example.weechatlog +9 -0
  207. data/vendor/pygments-main/tests/examplefiles/example.xhtml +376 -0
  208. data/vendor/pygments-main/tests/examplefiles/example.yaml +302 -0
  209. data/vendor/pygments-main/tests/examplefiles/example2.aspx +29 -0
  210. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +363 -0
  211. data/vendor/pygments-main/tests/examplefiles/example_file.fy +128 -0
  212. data/vendor/pygments-main/tests/examplefiles/firefox.mak +586 -0
  213. data/vendor/pygments-main/tests/examplefiles/flipflop.sv +19 -0
  214. data/vendor/pygments-main/tests/examplefiles/foo.sce +6 -0
  215. data/vendor/pygments-main/tests/examplefiles/format.ml +1213 -0
  216. data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +77 -0
  217. data/vendor/pygments-main/tests/examplefiles/function.mu +1 -0
  218. data/vendor/pygments-main/tests/examplefiles/functional.rst +1472 -0
  219. data/vendor/pygments-main/tests/examplefiles/genclass.clj +510 -0
  220. data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +193 -0
  221. data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +33 -0
  222. data/vendor/pygments-main/tests/examplefiles/glsl.frag +7 -0
  223. data/vendor/pygments-main/tests/examplefiles/glsl.vert +13 -0
  224. data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +1 -0
  225. data/vendor/pygments-main/tests/examplefiles/http_request_example +14 -0
  226. data/vendor/pygments-main/tests/examplefiles/http_response_example +27 -0
  227. data/vendor/pygments-main/tests/examplefiles/import.hs +4 -0
  228. data/vendor/pygments-main/tests/examplefiles/intro.ik +24 -0
  229. data/vendor/pygments-main/tests/examplefiles/ints.php +10 -0
  230. data/vendor/pygments-main/tests/examplefiles/intsyn.fun +675 -0
  231. data/vendor/pygments-main/tests/examplefiles/intsyn.sig +286 -0
  232. data/vendor/pygments-main/tests/examplefiles/irb_heredoc +8 -0
  233. data/vendor/pygments-main/tests/examplefiles/irc.lsp +214 -0
  234. data/vendor/pygments-main/tests/examplefiles/java.properties +16 -0
  235. data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +28 -0
  236. data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +45 -0
  237. data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +713 -0
  238. data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +13 -0
  239. data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +47 -0
  240. data/vendor/pygments-main/tests/examplefiles/ltmain.sh +2849 -0
  241. data/vendor/pygments-main/tests/examplefiles/main.cmake +42 -0
  242. data/vendor/pygments-main/tests/examplefiles/markdown.lsp +679 -0
  243. data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +3 -0
  244. data/vendor/pygments-main/tests/examplefiles/matlab_sample +27 -0
  245. data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +37 -0
  246. data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +4 -0
  247. data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +340 -0
  248. data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +38 -0
  249. data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +96 -0
  250. data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +30 -0
  251. data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +87 -0
  252. data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +118 -0
  253. data/vendor/pygments-main/tests/examplefiles/numbers.c +12 -0
  254. data/vendor/pygments-main/tests/examplefiles/objc_example.m +25 -0
  255. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +24 -0
  256. data/vendor/pygments-main/tests/examplefiles/perl_misc +62 -0
  257. data/vendor/pygments-main/tests/examplefiles/perl_perl5db +998 -0
  258. data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +120 -0
  259. data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +856 -0
  260. data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +567 -0
  261. data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +1223 -0
  262. data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +47 -0
  263. data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +10 -0
  264. data/vendor/pygments-main/tests/examplefiles/psql_session.txt +122 -0
  265. data/vendor/pygments-main/tests/examplefiles/py3_test.txt +2 -0
  266. data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +14 -0
  267. data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +2 -0
  268. data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +234 -0
  269. data/vendor/pygments-main/tests/examplefiles/qsort.prolog +13 -0
  270. data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +38 -0
  271. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +280 -0
  272. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +2 -0
  273. data/vendor/pygments-main/tests/examplefiles/regex.js +22 -0
  274. data/vendor/pygments-main/tests/examplefiles/reversi.lsp +427 -0
  275. data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +11 -0
  276. data/vendor/pygments-main/tests/examplefiles/scilab.sci +30 -0
  277. data/vendor/pygments-main/tests/examplefiles/sibling.prolog +19 -0
  278. data/vendor/pygments-main/tests/examplefiles/simple.md +747 -0
  279. data/vendor/pygments-main/tests/examplefiles/smarty_example.html +209 -0
  280. data/vendor/pygments-main/tests/examplefiles/source.lgt +343 -0
  281. data/vendor/pygments-main/tests/examplefiles/sources.list +62 -0
  282. data/vendor/pygments-main/tests/examplefiles/sphere.pov +18 -0
  283. data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +27 -0
  284. data/vendor/pygments-main/tests/examplefiles/squid.conf +30 -0
  285. data/vendor/pygments-main/tests/examplefiles/string.jl +1031 -0
  286. data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +21 -0
  287. data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +3 -0
  288. data/vendor/pygments-main/tests/examplefiles/test.R +119 -0
  289. data/vendor/pygments-main/tests/examplefiles/test.adb +211 -0
  290. data/vendor/pygments-main/tests/examplefiles/test.asy +131 -0
  291. data/vendor/pygments-main/tests/examplefiles/test.awk +121 -0
  292. data/vendor/pygments-main/tests/examplefiles/test.bas +29 -0
  293. data/vendor/pygments-main/tests/examplefiles/test.bmx +145 -0
  294. data/vendor/pygments-main/tests/examplefiles/test.boo +39 -0
  295. data/vendor/pygments-main/tests/examplefiles/test.bro +250 -0
  296. data/vendor/pygments-main/tests/examplefiles/test.cs +374 -0
  297. data/vendor/pygments-main/tests/examplefiles/test.css +54 -0
  298. data/vendor/pygments-main/tests/examplefiles/test.d +135 -0
  299. data/vendor/pygments-main/tests/examplefiles/test.dart +23 -0
  300. data/vendor/pygments-main/tests/examplefiles/test.dtd +89 -0
  301. data/vendor/pygments-main/tests/examplefiles/test.ec +605 -0
  302. data/vendor/pygments-main/tests/examplefiles/test.ecl +58 -0
  303. data/vendor/pygments-main/tests/examplefiles/test.eh +315 -0
  304. data/vendor/pygments-main/tests/examplefiles/test.erl +169 -0
  305. data/vendor/pygments-main/tests/examplefiles/test.evoque +33 -0
  306. data/vendor/pygments-main/tests/examplefiles/test.fan +818 -0
  307. data/vendor/pygments-main/tests/examplefiles/test.flx +57 -0
  308. data/vendor/pygments-main/tests/examplefiles/test.gdc +13 -0
  309. data/vendor/pygments-main/tests/examplefiles/test.groovy +97 -0
  310. data/vendor/pygments-main/tests/examplefiles/test.html +339 -0
  311. data/vendor/pygments-main/tests/examplefiles/test.ini +10 -0
  312. data/vendor/pygments-main/tests/examplefiles/test.java +653 -0
  313. data/vendor/pygments-main/tests/examplefiles/test.jsp +24 -0
  314. data/vendor/pygments-main/tests/examplefiles/test.maql +45 -0
  315. data/vendor/pygments-main/tests/examplefiles/test.mod +374 -0
  316. data/vendor/pygments-main/tests/examplefiles/test.moo +51 -0
  317. data/vendor/pygments-main/tests/examplefiles/test.myt +166 -0
  318. data/vendor/pygments-main/tests/examplefiles/test.nim +93 -0
  319. data/vendor/pygments-main/tests/examplefiles/test.pas +743 -0
  320. data/vendor/pygments-main/tests/examplefiles/test.php +505 -0
  321. data/vendor/pygments-main/tests/examplefiles/test.plot +333 -0
  322. data/vendor/pygments-main/tests/examplefiles/test.ps1 +108 -0
  323. data/vendor/pygments-main/tests/examplefiles/test.pypylog +1839 -0
  324. data/vendor/pygments-main/tests/examplefiles/test.r3 +94 -0
  325. data/vendor/pygments-main/tests/examplefiles/test.rb +177 -0
  326. data/vendor/pygments-main/tests/examplefiles/test.rhtml +43 -0
  327. data/vendor/pygments-main/tests/examplefiles/test.scaml +8 -0
  328. data/vendor/pygments-main/tests/examplefiles/test.ssp +12 -0
  329. data/vendor/pygments-main/tests/examplefiles/test.tcsh +830 -0
  330. data/vendor/pygments-main/tests/examplefiles/test.vb +407 -0
  331. data/vendor/pygments-main/tests/examplefiles/test.vhdl +161 -0
  332. data/vendor/pygments-main/tests/examplefiles/test.xqy +138 -0
  333. data/vendor/pygments-main/tests/examplefiles/test.xsl +23 -0
  334. data/vendor/pygments-main/tests/examplefiles/truncated.pytb +15 -0
  335. data/vendor/pygments-main/tests/examplefiles/type.lisp +1202 -0
  336. data/vendor/pygments-main/tests/examplefiles/underscore.coffee +603 -0
  337. data/vendor/pygments-main/tests/examplefiles/unicode.applescript +5 -0
  338. data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +11 -0
  339. data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +3 -0
  340. data/vendor/pygments-main/tests/examplefiles/while.pov +13 -0
  341. data/vendor/pygments-main/tests/examplefiles/wiki.factor +384 -0
  342. data/vendor/pygments-main/tests/examplefiles/xml_example +1897 -0
  343. data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +798 -0
  344. data/vendor/pygments-main/tests/old_run.py +138 -0
  345. data/vendor/pygments-main/tests/run.py +48 -0
  346. data/vendor/pygments-main/tests/support.py +15 -0
  347. data/vendor/pygments-main/tests/test_basic_api.py +294 -0
  348. data/vendor/pygments-main/tests/test_clexer.py +31 -0
  349. data/vendor/pygments-main/tests/test_cmdline.py +105 -0
  350. data/vendor/pygments-main/tests/test_examplefiles.py +97 -0
  351. data/vendor/pygments-main/tests/test_html_formatter.py +162 -0
  352. data/vendor/pygments-main/tests/test_latex_formatter.py +55 -0
  353. data/vendor/pygments-main/tests/test_perllexer.py +137 -0
  354. data/vendor/pygments-main/tests/test_regexlexer.py +47 -0
  355. data/vendor/pygments-main/tests/test_token.py +46 -0
  356. data/vendor/pygments-main/tests/test_using_api.py +40 -0
  357. data/vendor/pygments-main/tests/test_util.py +116 -0
  358. data/vendor/simplejson/.gitignore +10 -0
  359. data/vendor/simplejson/.travis.yml +5 -0
  360. data/vendor/simplejson/CHANGES.txt +291 -0
  361. data/vendor/simplejson/LICENSE.txt +19 -0
  362. data/vendor/simplejson/MANIFEST.in +5 -0
  363. data/vendor/simplejson/README.rst +19 -0
  364. data/vendor/simplejson/conf.py +179 -0
  365. data/vendor/simplejson/index.rst +628 -0
  366. data/vendor/simplejson/scripts/make_docs.py +18 -0
  367. data/vendor/simplejson/setup.py +104 -0
  368. data/vendor/simplejson/simplejson/__init__.py +510 -0
  369. data/vendor/simplejson/simplejson/_speedups.c +2745 -0
  370. data/vendor/simplejson/simplejson/decoder.py +425 -0
  371. data/vendor/simplejson/simplejson/encoder.py +567 -0
  372. data/vendor/simplejson/simplejson/ordered_dict.py +119 -0
  373. data/vendor/simplejson/simplejson/scanner.py +77 -0
  374. data/vendor/simplejson/simplejson/tests/__init__.py +67 -0
  375. data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +55 -0
  376. data/vendor/simplejson/simplejson/tests/test_check_circular.py +30 -0
  377. data/vendor/simplejson/simplejson/tests/test_decimal.py +66 -0
  378. data/vendor/simplejson/simplejson/tests/test_decode.py +83 -0
  379. data/vendor/simplejson/simplejson/tests/test_default.py +9 -0
  380. data/vendor/simplejson/simplejson/tests/test_dump.py +67 -0
  381. data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +46 -0
  382. data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +32 -0
  383. data/vendor/simplejson/simplejson/tests/test_errors.py +34 -0
  384. data/vendor/simplejson/simplejson/tests/test_fail.py +91 -0
  385. data/vendor/simplejson/simplejson/tests/test_float.py +19 -0
  386. data/vendor/simplejson/simplejson/tests/test_indent.py +86 -0
  387. data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +20 -0
  388. data/vendor/simplejson/simplejson/tests/test_namedtuple.py +121 -0
  389. data/vendor/simplejson/simplejson/tests/test_pass1.py +76 -0
  390. data/vendor/simplejson/simplejson/tests/test_pass2.py +14 -0
  391. data/vendor/simplejson/simplejson/tests/test_pass3.py +20 -0
  392. data/vendor/simplejson/simplejson/tests/test_recursion.py +67 -0
  393. data/vendor/simplejson/simplejson/tests/test_scanstring.py +117 -0
  394. data/vendor/simplejson/simplejson/tests/test_separators.py +42 -0
  395. data/vendor/simplejson/simplejson/tests/test_speedups.py +20 -0
  396. data/vendor/simplejson/simplejson/tests/test_tuple.py +49 -0
  397. data/vendor/simplejson/simplejson/tests/test_unicode.py +109 -0
  398. data/vendor/simplejson/simplejson/tool.py +39 -0
  399. metadata +492 -0
@@ -0,0 +1,232 @@
1
+ """
2
+ pygments.lexers._postgres_builtins
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Self-updating data files for PostgreSQL lexer.
6
+
7
+ :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import re
12
+ import urllib
13
+
14
+ # One man's constant is another man's variable.
15
+ SOURCE_URL = 'https://github.com/postgres/postgres/raw/master'
16
+ KEYWORDS_URL = SOURCE_URL + '/doc/src/sgml/keywords.sgml'
17
+ DATATYPES_URL = SOURCE_URL + '/doc/src/sgml/datatype.sgml'
18
+
19
+ def update_myself():
20
+ data_file = list(fetch(DATATYPES_URL))
21
+ datatypes = parse_datatypes(data_file)
22
+ pseudos = parse_pseudos(data_file)
23
+
24
+ keywords = parse_keywords(fetch(KEYWORDS_URL))
25
+ update_consts(__file__, 'DATATYPES', datatypes)
26
+ update_consts(__file__, 'PSEUDO_TYPES', pseudos)
27
+ update_consts(__file__, 'KEYWORDS', keywords)
28
+
29
+ def parse_keywords(f):
30
+ kw = []
31
+ for m in re.finditer(
32
+ r'\s*<entry><token>([^<]+)</token></entry>\s*'
33
+ r'<entry>([^<]+)</entry>', f.read()):
34
+ kw.append(m.group(1))
35
+
36
+ if not kw:
37
+ raise ValueError('no keyword found')
38
+
39
+ kw.sort()
40
+ return kw
41
+
42
+ def parse_datatypes(f):
43
+ dt = set()
44
+ re_entry = re.compile('\s*<entry><type>([^<]+)</type></entry>')
45
+ for line in f:
46
+ if '<sect1' in line:
47
+ break
48
+ if '<entry><type>' not in line:
49
+ continue
50
+
51
+ # Parse a string such as
52
+ # time [ (<replaceable>p</replaceable>) ] [ without time zone ]
53
+ # into types "time" and "without time zone"
54
+
55
+ # remove all the tags
56
+ line = re.sub("<replaceable>[^<]+</replaceable>", "", line)
57
+ line = re.sub("<[^>]+>", "", line)
58
+
59
+ # Drop the parts containing braces
60
+ for tmp in [ t for tmp in line.split('[') for t in tmp.split(']') if "(" not in t ]:
61
+ for t in tmp.split(','):
62
+ t = t.strip()
63
+ if not t: continue
64
+ dt.add(" ".join(t.split()))
65
+
66
+ dt = list(dt)
67
+ dt.sort()
68
+ return dt
69
+
70
+ def parse_pseudos(f):
71
+ dt = []
72
+ re_start = re.compile(r'\s*<table id="datatype-pseudotypes-table">')
73
+ re_entry = re.compile(r'\s*<entry><type>([^<]+)</></entry>')
74
+ re_end = re.compile(r'\s*</table>')
75
+
76
+ f = iter(f)
77
+ for line in f:
78
+ if re_start.match(line) is not None:
79
+ break
80
+ else:
81
+ raise ValueError('pseudo datatypes table not found')
82
+
83
+ for line in f:
84
+ m = re_entry.match(line)
85
+ if m is not None:
86
+ dt.append(m.group(1))
87
+
88
+ if re_end.match(line) is not None:
89
+ break
90
+ else:
91
+ raise ValueError('end of pseudo datatypes table not found')
92
+
93
+ if not dt:
94
+ raise ValueError('pseudo datatypes not found')
95
+
96
+ return dt
97
+
98
+ def fetch(url):
99
+ return urllib.urlopen(url)
100
+
101
+ def update_consts(filename, constname, content):
102
+ f = open(filename)
103
+ lines = f.readlines()
104
+ f.close()
105
+
106
+ # Line to start/end inserting
107
+ re_start = re.compile(r'^%s\s*=\s*\[\s*$' % constname)
108
+ re_end = re.compile(r'^\s*\]\s*$')
109
+ start = [ n for n, l in enumerate(lines) if re_start.match(l) ]
110
+ if not start:
111
+ raise ValueError("couldn't find line containing '%s = ['" % constname)
112
+ if len(start) > 1:
113
+ raise ValueError("too many lines containing '%s = ['" % constname)
114
+ start = start[0] + 1
115
+
116
+ end = [ n for n, l in enumerate(lines) if n >= start and re_end.match(l) ]
117
+ if not end:
118
+ raise ValueError("couldn't find line containing ']' after %s " % constname)
119
+ end = end[0]
120
+
121
+ # Pack the new content in lines not too long
122
+ content = [repr(item) for item in content ]
123
+ new_lines = [[]]
124
+ for item in content:
125
+ if sum(map(len, new_lines[-1])) + 2 * len(new_lines[-1]) + len(item) + 4 > 75:
126
+ new_lines.append([])
127
+ new_lines[-1].append(item)
128
+
129
+ lines[start:end] = [ " %s,\n" % ", ".join(items) for items in new_lines ]
130
+
131
+ f = open(filename, 'w')
132
+ f.write(''.join(lines))
133
+ f.close()
134
+
135
+
136
+ # Autogenerated: please edit them if you like wasting your time.
137
+
138
+ KEYWORDS = [
139
+ 'ABORT', 'ABSOLUTE', 'ACCESS', 'ACTION', 'ADD', 'ADMIN', 'AFTER',
140
+ 'AGGREGATE', 'ALL', 'ALSO', 'ALTER', 'ALWAYS', 'ANALYSE', 'ANALYZE',
141
+ 'AND', 'ANY', 'ARRAY', 'AS', 'ASC', 'ASSERTION', 'ASSIGNMENT',
142
+ 'ASYMMETRIC', 'AT', 'ATTRIBUTE', 'AUTHORIZATION', 'BACKWARD', 'BEFORE',
143
+ 'BEGIN', 'BETWEEN', 'BIGINT', 'BINARY', 'BIT', 'BOOLEAN', 'BOTH', 'BY',
144
+ 'CACHE', 'CALLED', 'CASCADE', 'CASCADED', 'CASE', 'CAST', 'CATALOG',
145
+ 'CHAIN', 'CHAR', 'CHARACTER', 'CHARACTERISTICS', 'CHECK', 'CHECKPOINT',
146
+ 'CLASS', 'CLOSE', 'CLUSTER', 'COALESCE', 'COLLATE', 'COLLATION',
147
+ 'COLUMN', 'COMMENT', 'COMMENTS', 'COMMIT', 'COMMITTED', 'CONCURRENTLY',
148
+ 'CONFIGURATION', 'CONNECTION', 'CONSTRAINT', 'CONSTRAINTS', 'CONTENT',
149
+ 'CONTINUE', 'CONVERSION', 'COPY', 'COST', 'CREATE', 'CROSS', 'CSV',
150
+ 'CURRENT', 'CURRENT_CATALOG', 'CURRENT_DATE', 'CURRENT_ROLE',
151
+ 'CURRENT_SCHEMA', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
152
+ 'CURSOR', 'CYCLE', 'DATA', 'DATABASE', 'DAY', 'DEALLOCATE', 'DEC',
153
+ 'DECIMAL', 'DECLARE', 'DEFAULT', 'DEFAULTS', 'DEFERRABLE', 'DEFERRED',
154
+ 'DEFINER', 'DELETE', 'DELIMITER', 'DELIMITERS', 'DESC', 'DICTIONARY',
155
+ 'DISABLE', 'DISCARD', 'DISTINCT', 'DO', 'DOCUMENT', 'DOMAIN', 'DOUBLE',
156
+ 'DROP', 'EACH', 'ELSE', 'ENABLE', 'ENCODING', 'ENCRYPTED', 'END',
157
+ 'ENUM', 'ESCAPE', 'EXCEPT', 'EXCLUDE', 'EXCLUDING', 'EXCLUSIVE',
158
+ 'EXECUTE', 'EXISTS', 'EXPLAIN', 'EXTENSION', 'EXTERNAL', 'EXTRACT',
159
+ 'FALSE', 'FAMILY', 'FETCH', 'FIRST', 'FLOAT', 'FOLLOWING', 'FOR',
160
+ 'FORCE', 'FOREIGN', 'FORWARD', 'FREEZE', 'FROM', 'FULL', 'FUNCTION',
161
+ 'FUNCTIONS', 'GLOBAL', 'GRANT', 'GRANTED', 'GREATEST', 'GROUP',
162
+ 'HANDLER', 'HAVING', 'HEADER', 'HOLD', 'HOUR', 'IDENTITY', 'IF',
163
+ 'ILIKE', 'IMMEDIATE', 'IMMUTABLE', 'IMPLICIT', 'IN', 'INCLUDING',
164
+ 'INCREMENT', 'INDEX', 'INDEXES', 'INHERIT', 'INHERITS', 'INITIALLY',
165
+ 'INLINE', 'INNER', 'INOUT', 'INPUT', 'INSENSITIVE', 'INSERT', 'INSTEAD',
166
+ 'INT', 'INTEGER', 'INTERSECT', 'INTERVAL', 'INTO', 'INVOKER', 'IS',
167
+ 'ISNULL', 'ISOLATION', 'JOIN', 'KEY', 'LABEL', 'LANGUAGE', 'LARGE',
168
+ 'LAST', 'LC_COLLATE', 'LC_CTYPE', 'LEADING', 'LEAST', 'LEFT', 'LEVEL',
169
+ 'LIKE', 'LIMIT', 'LISTEN', 'LOAD', 'LOCAL', 'LOCALTIME',
170
+ 'LOCALTIMESTAMP', 'LOCATION', 'LOCK', 'MAPPING', 'MATCH', 'MAXVALUE',
171
+ 'MINUTE', 'MINVALUE', 'MODE', 'MONTH', 'MOVE', 'NAME', 'NAMES',
172
+ 'NATIONAL', 'NATURAL', 'NCHAR', 'NEXT', 'NO', 'NONE', 'NOT', 'NOTHING',
173
+ 'NOTIFY', 'NOTNULL', 'NOWAIT', 'NULL', 'NULLIF', 'NULLS', 'NUMERIC',
174
+ 'OBJECT', 'OF', 'OFF', 'OFFSET', 'OIDS', 'ON', 'ONLY', 'OPERATOR',
175
+ 'OPTION', 'OPTIONS', 'OR', 'ORDER', 'OUT', 'OUTER', 'OVER', 'OVERLAPS',
176
+ 'OVERLAY', 'OWNED', 'OWNER', 'PARSER', 'PARTIAL', 'PARTITION',
177
+ 'PASSING', 'PASSWORD', 'PLACING', 'PLANS', 'POSITION', 'PRECEDING',
178
+ 'PRECISION', 'PREPARE', 'PREPARED', 'PRESERVE', 'PRIMARY', 'PRIOR',
179
+ 'PRIVILEGES', 'PROCEDURAL', 'PROCEDURE', 'QUOTE', 'RANGE', 'READ',
180
+ 'REAL', 'REASSIGN', 'RECHECK', 'RECURSIVE', 'REF', 'REFERENCES',
181
+ 'REINDEX', 'RELATIVE', 'RELEASE', 'RENAME', 'REPEATABLE', 'REPLACE',
182
+ 'REPLICA', 'RESET', 'RESTART', 'RESTRICT', 'RETURNING', 'RETURNS',
183
+ 'REVOKE', 'RIGHT', 'ROLE', 'ROLLBACK', 'ROW', 'ROWS', 'RULE',
184
+ 'SAVEPOINT', 'SCHEMA', 'SCROLL', 'SEARCH', 'SECOND', 'SECURITY',
185
+ 'SELECT', 'SEQUENCE', 'SEQUENCES', 'SERIALIZABLE', 'SERVER', 'SESSION',
186
+ 'SESSION_USER', 'SET', 'SETOF', 'SHARE', 'SHOW', 'SIMILAR', 'SIMPLE',
187
+ 'SMALLINT', 'SOME', 'STABLE', 'STANDALONE', 'START', 'STATEMENT',
188
+ 'STATISTICS', 'STDIN', 'STDOUT', 'STORAGE', 'STRICT', 'STRIP',
189
+ 'SUBSTRING', 'SYMMETRIC', 'SYSID', 'SYSTEM', 'TABLE', 'TABLES',
190
+ 'TABLESPACE', 'TEMP', 'TEMPLATE', 'TEMPORARY', 'TEXT', 'THEN', 'TIME',
191
+ 'TIMESTAMP', 'TO', 'TRAILING', 'TRANSACTION', 'TREAT', 'TRIGGER',
192
+ 'TRIM', 'TRUE', 'TRUNCATE', 'TRUSTED', 'TYPE', 'UNBOUNDED',
193
+ 'UNCOMMITTED', 'UNENCRYPTED', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLISTEN',
194
+ 'UNLOGGED', 'UNTIL', 'UPDATE', 'USER', 'USING', 'VACUUM', 'VALID',
195
+ 'VALIDATE', 'VALIDATOR', 'VALUE', 'VALUES', 'VARCHAR', 'VARIADIC',
196
+ 'VARYING', 'VERBOSE', 'VERSION', 'VIEW', 'VOLATILE', 'WHEN', 'WHERE',
197
+ 'WHITESPACE', 'WINDOW', 'WITH', 'WITHOUT', 'WORK', 'WRAPPER', 'WRITE',
198
+ 'XML', 'XMLATTRIBUTES', 'XMLCONCAT', 'XMLELEMENT', 'XMLEXISTS',
199
+ 'XMLFOREST', 'XMLPARSE', 'XMLPI', 'XMLROOT', 'XMLSERIALIZE', 'YEAR',
200
+ 'YES', 'ZONE',
201
+ ]
202
+
203
+ DATATYPES = [
204
+ 'bigint', 'bigserial', 'bit', 'bit varying', 'bool', 'boolean', 'box',
205
+ 'bytea', 'char', 'character', 'character varying', 'cidr', 'circle',
206
+ 'date', 'decimal', 'double precision', 'float4', 'float8', 'inet',
207
+ 'int', 'int2', 'int4', 'int8', 'integer', 'interval', 'json', 'line',
208
+ 'lseg', 'macaddr', 'money', 'numeric', 'path', 'point', 'polygon',
209
+ 'real', 'serial', 'serial2', 'serial4', 'serial8', 'smallint',
210
+ 'smallserial', 'text', 'time', 'timestamp', 'timestamptz', 'timetz',
211
+ 'tsquery', 'tsvector', 'txid_snapshot', 'uuid', 'varbit', 'varchar',
212
+ 'with time zone', 'without time zone', 'xml',
213
+ ]
214
+
215
+ PSEUDO_TYPES = [
216
+ 'any', 'anyelement', 'anyarray', 'anynonarray', 'anyenum', 'anyrange',
217
+ 'cstring', 'internal', 'language_handler', 'fdw_handler', 'record',
218
+ 'trigger', 'void', 'opaque',
219
+ ]
220
+
221
+ # Remove 'trigger' from types
222
+ PSEUDO_TYPES = sorted(set(PSEUDO_TYPES) - set(map(str.lower, KEYWORDS)))
223
+
224
+ PLPGSQL_KEYWORDS = [
225
+ 'ALIAS', 'CONSTANT', 'DIAGNOSTICS', 'ELSIF', 'EXCEPTION', 'EXIT',
226
+ 'FOREACH', 'GET', 'LOOP', 'NOTICE', 'OPEN', 'PERFORM', 'QUERY', 'RAISE',
227
+ 'RETURN', 'REVERSE', 'SQLSTATE', 'WHILE',
228
+ ]
229
+
230
+ if __name__ == '__main__':
231
+ update_myself()
232
+
@@ -0,0 +1,29 @@
1
+ # These lists are generated automatically.
2
+ # Run the following in a Scilab script:
3
+ #
4
+ # varType=["functions", "commands", "macros", "variables" ];
5
+ # fd = mopen('list.txt','wt');
6
+ #
7
+ # for j=1:size(varType,"*")
8
+ # myStr="";
9
+ # a=completion("",varType(j));
10
+ # myStr=varType(j)+"_kw = [";
11
+ # for i=1:size(a,"*")
12
+ # myStr = myStr + """" + a(i) + """";
13
+ # if size(a,"*") <> i then
14
+ # myStr = myStr + ","; end
15
+ # end
16
+ # myStr = myStr + "]";
17
+ # mputl(myStr,fd);
18
+ # end
19
+ # mclose(fd);
20
+ #
21
+ # Then replace "$" by "\\$" manually.
22
+
23
+ functions_kw = ["%XMLAttr_6","%XMLAttr_e","%XMLAttr_i_XMLElem","%XMLAttr_length","%XMLAttr_p","%XMLAttr_size","%XMLDoc_6","%XMLDoc_e","%XMLDoc_i_XMLList","%XMLDoc_p","%XMLElem_6","%XMLElem_e","%XMLElem_i_XMLDoc","%XMLElem_i_XMLElem","%XMLElem_i_XMLList","%XMLElem_p","%XMLList_6","%XMLList_e","%XMLList_i_XMLElem","%XMLList_i_XMLList","%XMLList_length","%XMLList_p","%XMLList_size","%XMLNs_6","%XMLNs_e","%XMLNs_i_XMLElem","%XMLNs_p","%XMLSet_6","%XMLSet_e","%XMLSet_length","%XMLSet_p","%XMLSet_size","%XMLValid_p","%b_i_XMLList","%c_i_XMLAttr","%c_i_XMLDoc","%c_i_XMLElem","%c_i_XMLList","%ce_i_XMLList","%fptr_i_XMLList","%h_i_XMLList","%hm_i_XMLList","%i_abs","%i_cumprod","%i_cumsum","%i_diag","%i_i_XMLList","%i_matrix","%i_max","%i_maxi","%i_min","%i_mini","%i_mput","%i_p","%i_prod","%i_sum","%i_tril","%i_triu","%ip_i_XMLList","%l_i_XMLList","%lss_i_XMLList","%mc_i_XMLList","%msp_full","%msp_i_XMLList","%msp_spget","%p_i_XMLList","%ptr_i_XMLList","%r_i_XMLList","%s_i_XMLList","%sp_i_XMLList","%spb_i_XMLList","%st_i_XMLList","Calendar","ClipBoard","Matplot","Matplot1","PlaySound","TCL_DeleteInterp","TCL_DoOneEvent","TCL_EvalFile","TCL_EvalStr","TCL_ExistArray","TCL_ExistInterp","TCL_ExistVar","TCL_GetVar","TCL_GetVersion","TCL_SetVar","TCL_UnsetVar","TCL_UpVar","_","_code2str","_str2code","about","abs","acos","addcb","addf","addhistory","addinter","amell","and","argn","arl2_ius","ascii","asin","atan","backslash","balanc","banner","base2dec","basename","bdiag","beep","besselh","besseli","besselj","besselk","bessely","beta","bezout","bfinit","blkfc1i","blkslvi","bool2s","browsehistory","browsevar","bsplin3val","buildDocv2","buildouttb","bvode","c_link","calerf","call","callblk","captions","cd","cdfbet","cdfbin","cdfchi","cdfchn","cdff","cdffnc","cdfgam","cdfnbn","cdfnor","cdfpoi","cdft","ceil","champ","champ1","chdir","chol","clc","clean","clear","clear_pixmap","clearfun","clearglobal","closeEditor","closeXcos","code2str","coeff","comp","completion","conj","contour2di","contr","conv2","convstr","copy","copyfile","corr","cos","coserror","createdir","cshep2d","ctree2","ctree3","ctree4","cumprod","cumsum","curblock","curblockc","dasrt","dassl","data2sig","debug","dec2base","deff","definedfields","degree","delbpt","delete","deletefile","delip","delmenu","det","dgettext","dhinf","diag","diary","diffobjs","disp","dispbpt","displayhistory","disposefftwlibrary","dlgamma","dnaupd","dneupd","double","draw","drawaxis","drawlater","drawnow","dsaupd","dsearch","dseupd","duplicate","editor","editvar","emptystr","end_scicosim","ereduc","errcatch","errclear","error","eval_cshep2d","exec","execstr","exists","exit","exp","expm","exportUI","export_to_hdf5","eye","fadj2sp","fec","feval","fft","fftw","fftw_flags","fftw_forget_wisdom","fftwlibraryisloaded","file","filebrowser","fileext","fileinfo","fileparts","filesep","find","findBD","findfiles","floor","format","fort","fprintfMat","freq","frexp","fromc","fromjava","fscanfMat","fsolve","fstair","full","fullpath","funcprot","funptr","gamma","gammaln","geom3d","get","get_absolute_file_path","get_fftw_wisdom","getblocklabel","getcallbackobject","getdate","getdebuginfo","getdefaultlanguage","getdrives","getdynlibext","getenv","getfield","gethistory","gethistoryfile","getinstalledlookandfeels","getio","getlanguage","getlongpathname","getlookandfeel","getmd5","getmemory","getmodules","getos","getpid","getrelativefilename","getscicosvars","getscilabmode","getshortpathname","gettext","getvariablesonstack","getversion","glist","global","glue","grand","grayplot","grep","gsort","gstacksize","havewindow","helpbrowser","hess","hinf","historymanager","historysize","host","iconvert","iconvert","ieee","ilib_verbose","imag","impl","import_from_hdf5","imult","inpnvi","int","int16","int2d","int32","int3d","int8","interp","interp2d","interp3d","intg","intppty","inttype","inv","is_handle_valid","isalphanum","isascii","isdef","isdigit","isdir","isequal","isequalbitwise","iserror","isfile","isglobal","isletter","isreal","iswaitingforinput","javaclasspath","javalibrarypath","kron","lasterror","ldiv","ldivf","legendre","length","lib","librarieslist","libraryinfo","linear_interpn","lines","link","linmeq","list","load","loadScicos","loadfftwlibrary","loadhistory","log","log1p","lsq","lsq_splin","lsqrsolve","lsslist","lstcat","lstsize","ltitr","lu","ludel","lufact","luget","lusolve","macr2lst","macr2tree","matfile_close","matfile_listvar","matfile_open","matfile_varreadnext","matfile_varwrite","matrix","max","maxfiles","mclearerr","mclose","meof","merror","messagebox","mfprintf","mfscanf","mget","mgeti","mgetl","mgetstr","min","mlist","mode","model2blk","mopen","move","movefile","mprintf","mput","mputl","mputstr","mscanf","mseek","msprintf","msscanf","mtell","mtlb_mode","mtlb_sparse","mucomp","mulf","nearfloat","newaxes","newest","newfun","nnz","notify","number_properties","ode","odedc","ones","opentk","optim","or","ordmmd","parallel_concurrency","parallel_run","param3d","param3d1","part","pathconvert","pathsep","phase_simulation","plot2d","plot2d1","plot2d2","plot2d3","plot2d4","plot3d","plot3d1","pointer_xproperty","poly","ppol","pppdiv","predef","print","printf","printfigure","printsetupbox","prod","progressionbar","prompt","pwd","qld","qp_solve","qr","raise_window","rand","rankqr","rat","rcond","rdivf","read","read4b","readb","readgateway","readmps","real","realtime","realtimeinit","regexp","relocate_handle","remez","removedir","removelinehistory","res_with_prec","resethistory","residu","resume","return","ricc","ricc_old","rlist","roots","rotate_axes","round","rpem","rtitr","rubberbox","save","saveafterncommands","saveconsecutivecommands","savehistory","schur","sci_haltscicos","sci_tree2","sci_tree3","sci_tree4","sciargs","scicos_debug","scicos_debug_count","scicos_time","scicosim","scinotes","sctree","semidef","set","set_blockerror","set_fftw_wisdom","set_xproperty","setbpt","setdefaultlanguage","setenv","setfield","sethistoryfile","setlanguage","setlookandfeel","setmenu","sfact","sfinit","show_pixmap","show_window","showalluimenushandles","sident","sig2data","sign","simp","simp_mode","sin","size","slash","sleep","sorder","sparse","spchol","spcompack","spec","spget","splin","splin2d","splin3d","spones","sprintf","sqrt","stacksize","str2code","strcat","strchr","strcmp","strcspn","strindex","string","stringbox","stripblanks","strncpy","strrchr","strrev","strsplit","strspn","strstr","strsubst","strtod","strtok","subf","sum","svd","swap_handles","symfcti","syredi","system_getproperty","system_setproperty","ta2lpd","tan","taucs_chdel","taucs_chfact","taucs_chget","taucs_chinfo","taucs_chsolve","tempname","testmatrix","timer","tlist","tohome","tokens","toolbar","toprint","tr_zer","tril","triu","type","typename","uiDisplayTree","uicontextmenu","uicontrol","uigetcolor","uigetdir","uigetfile","uigetfont","uimenu","uint16","uint32","uint8","uipopup","uiputfile","uiwait","ulink","umf_ludel","umf_lufact","umf_luget","umf_luinfo","umf_lusolve","umfpack","unglue","unix","unsetmenu","unzoom","updatebrowsevar","usecanvas","user","var2vec","varn","vec2var","waitbar","warnBlockByUID","warning","what","where","whereis","who","winsid","with_embedded_jre","with_module","writb","write","write4b","x_choose","x_choose_modeless","x_dialog","x_mdialog","xarc","xarcs","xarrows","xchange","xchoicesi","xclick","xcos","xcosAddToolsMenu","xcosConfigureXmlFile","xcosDiagramToScilab","xcosPalCategoryAdd","xcosPalDelete","xcosPalDisable","xcosPalEnable","xcosPalGenerateIcon","xcosPalLoad","xcosPalMove","xcosUpdateBlock","xdel","xfarc","xfarcs","xfpoly","xfpolys","xfrect","xget","xgetech","xgetmouse","xgraduate","xgrid","xlfont","xls_open","xls_read","xmlAddNs","xmlAsNumber","xmlAsText","xmlDTD","xmlDelete","xmlDocument","xmlDump","xmlElement","xmlFormat","xmlGetNsByHref","xmlGetNsByPrefix","xmlGetOpenDocs","xmlIsValidObject","xmlNs","xmlRead","xmlReadStr","xmlRelaxNG","xmlRemove","xmlSchema","xmlSetAttributes","xmlValidate","xmlWrite","xmlXPath","xname","xpause","xpoly","xpolys","xrect","xrects","xs2bmp","xs2eps","xs2gif","xs2jpg","xs2pdf","xs2png","xs2ppm","xs2ps","xs2svg","xsegs","xset","xsetech","xstring","xstringb","xtitle","zeros","znaupd","zneupd","zoom_rect"]
24
+
25
+ commands_kw = ["abort","apropos","break","case","catch","clc","clear","continue","do","else","elseif","end","endfunction","exit","for","function","help","if","pause","pwd","quit","resume","return","select","then","try","what","while","who"]
26
+
27
+ macros_kw = ["%0_i_st","%3d_i_h","%Block_xcosUpdateBlock","%TNELDER_p","%TNELDER_string","%TNMPLOT_p","%TNMPLOT_string","%TOPTIM_p","%TOPTIM_string","%TSIMPLEX_p","%TSIMPLEX_string","%_gsort","%_strsplit","%ar_p","%asn","%b_a_b","%b_a_s","%b_c_s","%b_c_spb","%b_cumprod","%b_cumsum","%b_d_s","%b_diag","%b_e","%b_f_s","%b_f_spb","%b_g_s","%b_g_spb","%b_h_s","%b_h_spb","%b_i_b","%b_i_ce","%b_i_h","%b_i_hm","%b_i_s","%b_i_sp","%b_i_spb","%b_i_st","%b_iconvert","%b_l_b","%b_l_s","%b_m_b","%b_m_s","%b_matrix","%b_n_hm","%b_o_hm","%b_p_s","%b_prod","%b_r_b","%b_r_s","%b_s_b","%b_s_s","%b_string","%b_sum","%b_tril","%b_triu","%b_x_b","%b_x_s","%c_a_c","%c_b_c","%c_b_s","%c_diag","%c_e","%c_eye","%c_f_s","%c_i_c","%c_i_ce","%c_i_h","%c_i_hm","%c_i_lss","%c_i_r","%c_i_s","%c_i_st","%c_matrix","%c_n_l","%c_n_st","%c_o_l","%c_o_st","%c_ones","%c_rand","%c_tril","%c_triu","%cblock_c_cblock","%cblock_c_s","%cblock_e","%cblock_f_cblock","%cblock_p","%cblock_size","%ce_6","%ce_c_ce","%ce_e","%ce_f_ce","%ce_i_ce","%ce_i_s","%ce_i_st","%ce_matrix","%ce_p","%ce_size","%ce_string","%ce_t","%champdat_i_h","%choose","%diagram_xcos","%dir_p","%fptr_i_st","%grayplot_i_h","%h_i_st","%hm_1_hm","%hm_1_s","%hm_2_hm","%hm_2_s","%hm_3_hm","%hm_3_s","%hm_4_hm","%hm_4_s","%hm_5","%hm_a_hm","%hm_a_r","%hm_a_s","%hm_abs","%hm_and","%hm_bool2s","%hm_c_hm","%hm_ceil","%hm_conj","%hm_cos","%hm_cumprod","%hm_cumsum","%hm_d_hm","%hm_d_s","%hm_degree","%hm_e","%hm_exp","%hm_f_hm","%hm_fft","%hm_find","%hm_floor","%hm_g_hm","%hm_h_hm","%hm_i_b","%hm_i_ce","%hm_i_hm","%hm_i_i","%hm_i_p","%hm_i_r","%hm_i_s","%hm_i_st","%hm_iconvert","%hm_imag","%hm_int","%hm_isnan","%hm_isreal","%hm_j_hm","%hm_j_s","%hm_k_hm","%hm_k_s","%hm_log","%hm_m_p","%hm_m_r","%hm_m_s","%hm_matrix","%hm_maxi","%hm_mean","%hm_median","%hm_mini","%hm_n_b","%hm_n_c","%hm_n_hm","%hm_n_i","%hm_n_p","%hm_n_s","%hm_o_b","%hm_o_c","%hm_o_hm","%hm_o_i","%hm_o_p","%hm_o_s","%hm_ones","%hm_or","%hm_p","%hm_prod","%hm_q_hm","%hm_r_s","%hm_rand","%hm_real","%hm_round","%hm_s","%hm_s_hm","%hm_s_r","%hm_s_s","%hm_sign","%hm_sin","%hm_size","%hm_sqrt","%hm_st_deviation","%hm_string","%hm_sum","%hm_x_hm","%hm_x_p","%hm_x_s","%hm_zeros","%i_1_s","%i_2_s","%i_3_s","%i_4_s","%i_Matplot","%i_a_i","%i_a_s","%i_and","%i_ascii","%i_b_s","%i_bezout","%i_champ","%i_champ1","%i_contour","%i_contour2d","%i_d_i","%i_d_s","%i_e","%i_fft","%i_g_i","%i_gcd","%i_h_i","%i_i_ce","%i_i_h","%i_i_hm","%i_i_i","%i_i_s","%i_i_st","%i_j_i","%i_j_s","%i_l_s","%i_lcm","%i_length","%i_m_i","%i_m_s","%i_mfprintf","%i_mprintf","%i_msprintf","%i_n_s","%i_o_s","%i_or","%i_p_i","%i_p_s","%i_plot2d","%i_plot2d1","%i_plot2d2","%i_q_s","%i_r_i","%i_r_s","%i_round","%i_s_i","%i_s_s","%i_sign","%i_string","%i_x_i","%i_x_s","%ip_a_s","%ip_i_st","%ip_m_s","%ip_n_ip","%ip_o_ip","%ip_p","%ip_s_s","%ip_string","%k","%l_i_h","%l_i_s","%l_i_st","%l_isequal","%l_n_c","%l_n_l","%l_n_m","%l_n_p","%l_n_s","%l_n_st","%l_o_c","%l_o_l","%l_o_m","%l_o_p","%l_o_s","%l_o_st","%lss_a_lss","%lss_a_p","%lss_a_r","%lss_a_s","%lss_c_lss","%lss_c_p","%lss_c_r","%lss_c_s","%lss_e","%lss_eye","%lss_f_lss","%lss_f_p","%lss_f_r","%lss_f_s","%lss_i_ce","%lss_i_lss","%lss_i_p","%lss_i_r","%lss_i_s","%lss_i_st","%lss_inv","%lss_l_lss","%lss_l_p","%lss_l_r","%lss_l_s","%lss_m_lss","%lss_m_p","%lss_m_r","%lss_m_s","%lss_n_lss","%lss_n_p","%lss_n_r","%lss_n_s","%lss_norm","%lss_o_lss","%lss_o_p","%lss_o_r","%lss_o_s","%lss_ones","%lss_r_lss","%lss_r_p","%lss_r_r","%lss_r_s","%lss_rand","%lss_s","%lss_s_lss","%lss_s_p","%lss_s_r","%lss_s_s","%lss_size","%lss_t","%lss_v_lss","%lss_v_p","%lss_v_r","%lss_v_s","%lt_i_s","%m_n_l","%m_o_l","%mc_i_h","%mc_i_s","%mc_i_st","%mc_n_st","%mc_o_st","%mc_string","%mps_p","%mps_string","%msp_a_s","%msp_abs","%msp_e","%msp_find","%msp_i_s","%msp_i_st","%msp_length","%msp_m_s","%msp_maxi","%msp_n_msp","%msp_nnz","%msp_o_msp","%msp_p","%msp_sparse","%msp_spones","%msp_t","%p_a_lss","%p_a_r","%p_c_lss","%p_c_r","%p_cumprod","%p_cumsum","%p_d_p","%p_d_r","%p_d_s","%p_det","%p_e","%p_f_lss","%p_f_r","%p_i_ce","%p_i_h","%p_i_hm","%p_i_lss","%p_i_p","%p_i_r","%p_i_s","%p_i_st","%p_inv","%p_j_s","%p_k_p","%p_k_r","%p_k_s","%p_l_lss","%p_l_p","%p_l_r","%p_l_s","%p_m_hm","%p_m_lss","%p_m_r","%p_matrix","%p_n_l","%p_n_lss","%p_n_r","%p_o_l","%p_o_lss","%p_o_r","%p_o_sp","%p_p_s","%p_prod","%p_q_p","%p_q_r","%p_q_s","%p_r_lss","%p_r_p","%p_r_r","%p_r_s","%p_s_lss","%p_s_r","%p_simp","%p_string","%p_sum","%p_v_lss","%p_v_p","%p_v_r","%p_v_s","%p_x_hm","%p_x_r","%p_y_p","%p_y_r","%p_y_s","%p_z_p","%p_z_r","%p_z_s","%r_a_hm","%r_a_lss","%r_a_p","%r_a_r","%r_a_s","%r_c_lss","%r_c_p","%r_c_r","%r_c_s","%r_clean","%r_cumprod","%r_d_p","%r_d_r","%r_d_s","%r_det","%r_diag","%r_e","%r_eye","%r_f_lss","%r_f_p","%r_f_r","%r_f_s","%r_i_ce","%r_i_hm","%r_i_lss","%r_i_p","%r_i_r","%r_i_s","%r_i_st","%r_inv","%r_j_s","%r_k_p","%r_k_r","%r_k_s","%r_l_lss","%r_l_p","%r_l_r","%r_l_s","%r_m_hm","%r_m_lss","%r_m_p","%r_m_r","%r_m_s","%r_matrix","%r_n_lss","%r_n_p","%r_n_r","%r_n_s","%r_norm","%r_o_lss","%r_o_p","%r_o_r","%r_o_s","%r_ones","%r_p","%r_p_s","%r_prod","%r_q_p","%r_q_r","%r_q_s","%r_r_lss","%r_r_p","%r_r_r","%r_r_s","%r_rand","%r_s","%r_s_hm","%r_s_lss","%r_s_p","%r_s_r","%r_s_s","%r_simp","%r_size","%r_string","%r_sum","%r_t","%r_tril","%r_triu","%r_v_lss","%r_v_p","%r_v_r","%r_v_s","%r_x_p","%r_x_r","%r_x_s","%r_y_p","%r_y_r","%r_y_s","%r_z_p","%r_z_r","%r_z_s","%s_1_hm","%s_1_i","%s_2_hm","%s_2_i","%s_3_hm","%s_3_i","%s_4_hm","%s_4_i","%s_5","%s_a_b","%s_a_hm","%s_a_i","%s_a_ip","%s_a_lss","%s_a_msp","%s_a_r","%s_a_sp","%s_and","%s_b_i","%s_b_s","%s_c_b","%s_c_cblock","%s_c_lss","%s_c_r","%s_c_sp","%s_d_b","%s_d_i","%s_d_p","%s_d_r","%s_d_sp","%s_e","%s_f_b","%s_f_cblock","%s_f_lss","%s_f_r","%s_f_sp","%s_g_b","%s_g_s","%s_h_b","%s_h_s","%s_i_b","%s_i_c","%s_i_ce","%s_i_h","%s_i_hm","%s_i_i","%s_i_lss","%s_i_p","%s_i_r","%s_i_s","%s_i_sp","%s_i_spb","%s_i_st","%s_j_i","%s_k_hm","%s_k_p","%s_k_r","%s_k_sp","%s_l_b","%s_l_hm","%s_l_i","%s_l_lss","%s_l_p","%s_l_r","%s_l_s","%s_l_sp","%s_m_b","%s_m_hm","%s_m_i","%s_m_ip","%s_m_lss","%s_m_msp","%s_m_r","%s_matrix","%s_n_hm","%s_n_i","%s_n_l","%s_n_lss","%s_n_r","%s_n_st","%s_o_hm","%s_o_i","%s_o_l","%s_o_lss","%s_o_r","%s_o_st","%s_or","%s_p_b","%s_p_i","%s_pow","%s_q_hm","%s_q_i","%s_q_p","%s_q_r","%s_q_sp","%s_r_b","%s_r_i","%s_r_lss","%s_r_p","%s_r_r","%s_r_s","%s_r_sp","%s_s_b","%s_s_hm","%s_s_i","%s_s_ip","%s_s_lss","%s_s_r","%s_s_sp","%s_simp","%s_v_lss","%s_v_p","%s_v_r","%s_v_s","%s_x_b","%s_x_hm","%s_x_i","%s_x_r","%s_y_p","%s_y_r","%s_y_sp","%s_z_p","%s_z_r","%s_z_sp","%sn","%sp_a_s","%sp_a_sp","%sp_and","%sp_c_s","%sp_ceil","%sp_cos","%sp_cumprod","%sp_cumsum","%sp_d_s","%sp_d_sp","%sp_diag","%sp_e","%sp_exp","%sp_f_s","%sp_floor","%sp_gsort","%sp_i_ce","%sp_i_h","%sp_i_s","%sp_i_sp","%sp_i_st","%sp_int","%sp_inv","%sp_k_s","%sp_k_sp","%sp_l_s","%sp_l_sp","%sp_length","%sp_norm","%sp_or","%sp_p_s","%sp_prod","%sp_q_s","%sp_q_sp","%sp_r_s","%sp_r_sp","%sp_round","%sp_s_s","%sp_s_sp","%sp_sin","%sp_sqrt","%sp_string","%sp_sum","%sp_tril","%sp_triu","%sp_y_s","%sp_y_sp","%sp_z_s","%sp_z_sp","%spb_and","%spb_c_b","%spb_cumprod","%spb_cumsum","%spb_diag","%spb_e","%spb_f_b","%spb_g_b","%spb_g_spb","%spb_h_b","%spb_h_spb","%spb_i_b","%spb_i_ce","%spb_i_h","%spb_i_st","%spb_or","%spb_prod","%spb_sum","%spb_tril","%spb_triu","%st_6","%st_c_st","%st_e","%st_f_st","%st_i_b","%st_i_c","%st_i_fptr","%st_i_h","%st_i_i","%st_i_ip","%st_i_lss","%st_i_msp","%st_i_p","%st_i_r","%st_i_s","%st_i_sp","%st_i_spb","%st_i_st","%st_matrix","%st_n_c","%st_n_l","%st_n_mc","%st_n_p","%st_n_s","%st_o_c","%st_o_l","%st_o_mc","%st_o_p","%st_o_s","%st_o_tl","%st_p","%st_size","%st_string","%st_t","%ticks_i_h","%xls_e","%xls_p","%xlssheet_e","%xlssheet_p","%xlssheet_size","%xlssheet_string","DominationRank","G_make","IsAScalar","NDcost","OS_Version","PlotSparse","ReadHBSparse","ReadmiMatrix","TCL_CreateSlave","WritemiMatrix","abcd","abinv","accept_func_default","accept_func_vfsa","acf","acosd","acosh","acoshm","acosm","acot","acotd","acoth","acsc","acscd","acsch","add_demo","add_help_chapter","add_module_help_chapter","add_param","add_profiling","adj2sp","aff2ab","ana_style","analpf","analyze","aplat","apropos","arhnk","arl2","arma2p","armac","armax","armax1","arobasestring2strings","arsimul","ascii2string","asciimat","asec","asecd","asech","asind","asinh","asinhm","asinm","assert_checkalmostequal","assert_checkequal","assert_checkerror","assert_checkfalse","assert_checkfilesequal","assert_checktrue","assert_comparecomplex","assert_computedigits","assert_cond2reltol","assert_cond2reqdigits","assert_generror","atand","atanh","atanhm","atanm","atomsAutoload","atomsAutoloadAdd","atomsAutoloadDel","atomsAutoloadList","atomsCategoryList","atomsCheckModule","atomsDepTreeShow","atomsGetConfig","atomsGetInstalled","atomsGetLoaded","atomsGetLoadedPath","atomsInstall","atomsIsInstalled","atomsIsLoaded","atomsList","atomsLoad","atomsRemove","atomsRepositoryAdd","atomsRepositoryDel","atomsRepositoryList","atomsRestoreConfig","atomsSaveConfig","atomsSearch","atomsSetConfig","atomsShow","atomsSystemInit","atomsSystemUpdate","atomsTest","atomsUpdate","atomsVersion","augment","auread","auwrite","balreal","bench_run","bilin","bilt","bin2dec","binomial","bitand","bitcmp","bitget","bitor","bitset","bitxor","black","blanks","bloc2exp","bloc2ss","block_parameter_error","bode","bstap","buttmag","bvodeS","bytecode","bytecodewalk","cainv","calendar","calfrq","canon","casc","cat","cat_code","cb_m2sci_gui","ccontrg","cell","cell2mat","cellstr","center","cepstrum","cfspec","char","chart","cheb1mag","cheb2mag","check_gateways","check_help","check_modules_xml","check_versions","chepol","chfact","chsolve","classmarkov","clean_help","clock","cls2dls","cmb_lin","cmndred","cmoment","coding_ga_binary","coding_ga_identity","coff","coffg","colcomp","colcompr","colinout","colregul","companion","complex","compute_initial_temp","cond","cond2sp","condestsp","config","configure_msifort","configure_msvc","cont_frm","cont_mat","contrss","conv","convert_to_float","convertindex","convol","convol2d","copfac","correl","cosd","cosh","coshm","cosm","cotd","cotg","coth","cothm","covar","createfun","createstruct","crossover_ga_binary","crossover_ga_default","csc","cscd","csch","csgn","csim","cspect","ctr_gram","czt","dae","daeoptions","damp","datafit","date","datenum","datevec","dbphi","dcf","ddp","dec2bin","dec2hex","dec2oct","del_help_chapter","del_module_help_chapter","demo_begin","demo_choose","demo_compiler","demo_end","demo_file_choice","demo_folder_choice","demo_function_choice","demo_gui","demo_mdialog","demo_message","demo_run","demo_viewCode","denom","derivat","derivative","des2ss","des2tf","detectmsifort64tools","detectmsvc64tools","determ","detr","detrend","devtools_run_builder","dft","dhnorm","diff","diophant","dir","dirname","dispfiles","dllinfo","dscr","dsimul","dt_ility","dtsi","edit","edit_error","eigenmarkov","ell1mag","enlarge_shape","entropy","eomday","epred","eqfir","eqiir","equil","equil1","erf","erfc","erfcx","erfinv","etime","eval","evans","evstr","expression2code","extract_help_examples","factor","factorial","factors","faurre","ffilt","fft2","fftshift","fieldnames","filt_sinc","filter","findABCD","findAC","findBDK","findR","find_freq","find_links","find_scicos_version","findm","findmsifortcompiler","findmsvccompiler","findx0BD","firstnonsingleton","fit_dat","fix","fixedpointgcd","flipdim","flts","fminsearch","format_txt","fourplan","fprintf","frep2tf","freson","frfit","frmag","fscanf","fseek_origin","fsfirlin","fspec","fspecg","fstabst","ftest","ftuneq","fullfile","fullrf","fullrfk","fun2string","g_margin","gainplot","gamitg","gcare","gcd","gencompilationflags_unix","generateBlockImage","generateBlockImages","generic_i_ce","generic_i_h","generic_i_hm","generic_i_s","generic_i_st","genlib","genlib_old","genmarkov","geomean","getDiagramVersion","getModelicaPath","get_file_path","get_function_path","get_param","get_profile","get_scicos_version","getd","getscilabkeywords","getshell","gettklib","gfare","gfrancis","givens","glever","gmres","group","gschur","gspec","gtild","h2norm","h_cl","h_inf","h_inf_st","h_norm","hallchart","halt","hank","hankelsv","harmean","haveacompiler","head_comments","help","help_from_sci","help_skeleton","hermit","hex2dec","hilb","hilbert","horner","householder","hrmt","htrianr","hypermat","ifft","iir","iirgroup","iirlp","iirmod","ilib_build","ilib_compile","ilib_for_link","ilib_gen_Make","ilib_gen_Make_unix","ilib_gen_cleaner","ilib_gen_gateway","ilib_gen_loader","ilib_include_flag","ilib_mex_build","im_inv","importScicosDiagram","importScicosPal","importXcosDiagram","imrep2ss","ind2sub","inistate","init_ga_default","init_param","initial_scicos_tables","input","instruction2code","intc","intdec","integrate","interp1","interpln","intersect","intl","intsplin","inttrap","inv_coeff","invr","invrs","invsyslin","iqr","isLeapYear","is_absolute_path","is_param","iscell","iscellstr","isempty","isfield","isinf","isnan","isnum","issparse","isstruct","isvector","jmat","justify","kalm","karmarkar","kernel","kpure","krac2","kroneck","lattn","launchtest","lcf","lcm","lcmdiag","leastsq","leqe","leqr","lev","levin","lex_sort","lft","lin","lin2mu","lincos","lindquist","linf","linfn","linsolve","linspace","list2vec","list_param","listfiles","listfunctions","listvarinfile","lmisolver","lmitool","loadXcosLibs","loadmatfile","loadwave","log10","log2","logm","logspace","lqe","lqg","lqg2stan","lqg_ltr","lqr","ls","lyap","m2sci_gui","m_circle","macglov","macrovar","mad","makecell","manedit","mapsound","markp2ss","matfile2sci","mdelete","mean","meanf","median","mese","meshgrid","mfft","mfile2sci","minreal","minss","mkdir","modulo","moment","mrfit","msd","mstr2sci","mtlb","mtlb_0","mtlb_a","mtlb_all","mtlb_any","mtlb_axes","mtlb_axis","mtlb_beta","mtlb_box","mtlb_choices","mtlb_close","mtlb_colordef","mtlb_cond","mtlb_conv","mtlb_cov","mtlb_cumprod","mtlb_cumsum","mtlb_dec2hex","mtlb_delete","mtlb_diag","mtlb_diff","mtlb_dir","mtlb_double","mtlb_e","mtlb_echo","mtlb_error","mtlb_eval","mtlb_exist","mtlb_eye","mtlb_false","mtlb_fft","mtlb_fftshift","mtlb_filter","mtlb_find","mtlb_findstr","mtlb_fliplr","mtlb_fopen","mtlb_format","mtlb_fprintf","mtlb_fread","mtlb_fscanf","mtlb_full","mtlb_fwrite","mtlb_get","mtlb_grid","mtlb_hold","mtlb_i","mtlb_ifft","mtlb_image","mtlb_imp","mtlb_int16","mtlb_int32","mtlb_int8","mtlb_is","mtlb_isa","mtlb_isfield","mtlb_isletter","mtlb_isspace","mtlb_l","mtlb_legendre","mtlb_linspace","mtlb_logic","mtlb_logical","mtlb_loglog","mtlb_lower","mtlb_max","mtlb_mean","mtlb_median","mtlb_mesh","mtlb_meshdom","mtlb_min","mtlb_more","mtlb_num2str","mtlb_ones","mtlb_pcolor","mtlb_plot","mtlb_prod","mtlb_qr","mtlb_qz","mtlb_rand","mtlb_randn","mtlb_rcond","mtlb_realmax","mtlb_realmin","mtlb_repmat","mtlb_s","mtlb_semilogx","mtlb_semilogy","mtlb_setstr","mtlb_size","mtlb_sort","mtlb_sortrows","mtlb_sprintf","mtlb_sscanf","mtlb_std","mtlb_strcmp","mtlb_strcmpi","mtlb_strfind","mtlb_strrep","mtlb_subplot","mtlb_sum","mtlb_t","mtlb_toeplitz","mtlb_tril","mtlb_triu","mtlb_true","mtlb_type","mtlb_uint16","mtlb_uint32","mtlb_uint8","mtlb_upper","mtlb_var","mtlb_zeros","mu2lin","mutation_ga_binary","mutation_ga_default","mvcorrel","mvvacov","nancumsum","nand2mean","nanmax","nanmean","nanmeanf","nanmedian","nanmin","nanstdev","nansum","narsimul","ndgrid","ndims","nehari","neigh_func_csa","neigh_func_default","neigh_func_fsa","neigh_func_vfsa","neldermead_cget","neldermead_configure","neldermead_costf","neldermead_defaultoutput","neldermead_destroy","neldermead_display","neldermead_function","neldermead_get","neldermead_log","neldermead_new","neldermead_restart","neldermead_search","neldermead_updatesimp","nextpow2","nfreq","nicholschart","nlev","nmplot_cget","nmplot_configure","nmplot_contour","nmplot_destroy","nmplot_display","nmplot_function","nmplot_get","nmplot_historyplot","nmplot_log","nmplot_new","nmplot_outputcmd","nmplot_restart","nmplot_search","nmplot_simplexhistory","noisegen","nonreg_test_run","norm","now","null","num2cell","numdiff","numer","nyquist","nyquistfrequencybounds","obs_gram","obscont","observer","obsv_mat","obsvss","oct2dec","odeoptions","optim_ga","optim_moga","optim_nsga","optim_nsga2","optim_sa","optimbase_cget","optimbase_checkbounds","optimbase_checkcostfun","optimbase_checkx0","optimbase_configure","optimbase_destroy","optimbase_display","optimbase_function","optimbase_get","optimbase_hasbounds","optimbase_hasconstraints","optimbase_hasnlcons","optimbase_histget","optimbase_histset","optimbase_incriter","optimbase_isfeasible","optimbase_isinbounds","optimbase_isinnonlincons","optimbase_log","optimbase_logshutdown","optimbase_logstartup","optimbase_new","optimbase_outputcmd","optimbase_outstruct","optimbase_proj2bnds","optimbase_set","optimbase_stoplog","optimbase_terminate","optimget","optimplotfunccount","optimplotfval","optimplotx","optimset","optimsimplex_center","optimsimplex_check","optimsimplex_compsomefv","optimsimplex_computefv","optimsimplex_deltafv","optimsimplex_deltafvmax","optimsimplex_destroy","optimsimplex_dirmat","optimsimplex_fvmean","optimsimplex_fvstdev","optimsimplex_fvvariance","optimsimplex_getall","optimsimplex_getallfv","optimsimplex_getallx","optimsimplex_getfv","optimsimplex_getn","optimsimplex_getnbve","optimsimplex_getve","optimsimplex_getx","optimsimplex_gradientfv","optimsimplex_log","optimsimplex_new","optimsimplex_print","optimsimplex_reflect","optimsimplex_setall","optimsimplex_setallfv","optimsimplex_setallx","optimsimplex_setfv","optimsimplex_setn","optimsimplex_setnbve","optimsimplex_setve","optimsimplex_setx","optimsimplex_shrink","optimsimplex_size","optimsimplex_sort","optimsimplex_tostring","optimsimplex_xbar","orth","p_margin","pack","pareto_filter","parrot","pbig","pca","pcg","pdiv","pen2ea","pencan","pencost","penlaur","perctl","perl","perms","permute","pertrans","pfactors","pfss","phasemag","phaseplot","phc","pinv","playsnd","plotprofile","plzr","pmodulo","pol2des","pol2str","polar","polfact","prbs_a","prettyprint","primes","princomp","profile","proj","projsl","projspec","psmall","pspect","qmr","qpsolve","quart","quaskro","rafiter","randpencil","range","rank","read_csv","readxls","recompilefunction","recons","reglin","regress","remezb","remove_param","remove_profiling","repfreq","replace_Ix_by_Fx","repmat","reset_profiling","resize_matrix","returntoscilab","rhs2code","ric_desc","riccati","rmdir","routh_t","rowcomp","rowcompr","rowinout","rowregul","rowshuff","rref","sample","samplef","samwr","savematfile","savewave","scanf","sci2exp","sciGUI_init","sci_sparse","scicos_getvalue","scicos_simulate","scicos_workspace_init","scisptdemo","scitest","sdiff","sec","secd","sech","selection_ga_elitist","selection_ga_random","sensi","set_param","setdiff","sgrid","show_margins","show_pca","showprofile","signm","sinc","sincd","sind","sinh","sinhm","sinm","sm2des","sm2ss","smga","smooth","solve","sound","soundsec","sp2adj","spaninter","spanplus","spantwo","specfact","speye","sprand","spzeros","sqroot","sqrtm","squarewave","squeeze","srfaur","srkf","ss2des","ss2ss","ss2tf","sscanf","sskf","ssprint","ssrand","st_deviation","st_i_generic","st_ility","stabil","statgain","stdev","stdevf","steadycos","strange","strcmpi","struct","sub2ind","sva","svplot","sylm","sylv","sysconv","sysdiag","sysfact","syslin","syssize","system","systmat","tabul","tand","tanh","tanhm","tanm","tbx_build_blocks","tbx_build_cleaner","tbx_build_gateway","tbx_build_gateway_clean","tbx_build_gateway_loader","tbx_build_help","tbx_build_help_loader","tbx_build_loader","tbx_build_macros","tbx_build_src","tbx_builder","tbx_builder_gateway","tbx_builder_gateway_lang","tbx_builder_help","tbx_builder_help_lang","tbx_builder_macros","tbx_builder_src","tbx_builder_src_lang","temp_law_csa","temp_law_default","temp_law_fsa","temp_law_huang","temp_law_vfsa","test_clean","test_on_columns","test_run","test_run_level","testexamples","tf2des","tf2ss","thrownan","tic","time_id","toc","toeplitz","tokenpos","toolboxes","trace","trans","translatepaths","tree2code","trfmod","trianfml","trimmean","trisolve","trzeros","typeof","ui_observer","union","unique","unit_test_run","unix_g","unix_s","unix_w","unix_x","unobs","unpack","variance","variancef","vec2list","vectorfind","ver","warnobsolete","wavread","wavwrite","wcenter","weekday","wfir","wfir_gui","whereami","who_user","whos","wiener","wigner","winclose","window","winlist","with_javasci","with_macros_source","with_modelica_compiler","with_pvm","with_texmacs","with_tk","write_csv","xcosBlockEval","xcosBlockInterface","xcosCodeGeneration","xcosConfigureModelica","xcosPal","xcosPalAdd","xcosPalAddBlock","xcosPalExport","xcosShowBlockWarning","xcosValidateBlockSet","xcosValidateCompareBlock","xcos_compile","xcos_run","xcos_simulate","xcos_workspace_init","xmltochm","xmltoformat","xmltohtml","xmltojar","xmltopdf","xmltops","xmltoweb","yulewalk","zeropen","zgrid","zpbutt","zpch1","zpch2","zpell"]
28
+
29
+ builtin_consts = ["\\$","%F","%T","%e","%eps","%f","%fftw","%gui","%i","%inf","%io","%modalWarning","%nan","%pi","%s","%t","%tk","%toolboxes","%toolboxes_dir","%z","PWD","SCI","SCIHOME","TMPDIR","a","ans","assertlib","atomslib","cacsdlib","compatibility_functilib","corelib","data_structureslib","demo_toolslib","development_toolslib","differential_equationlib","dynamic_linklib","elementary_functionslib","fd","fileiolib","functionslib","genetic_algorithmslib","helptoolslib","home","i","integerlib","interpolationlib","iolib","j","linear_algebralib","m2scilib","matiolib","modules_managerlib","myStr","neldermeadlib","optimbaselib","optimizationlib","optimsimplexlib","output_streamlib","overloadinglib","parameterslib","polynomialslib","scicos_autolib","scicos_utilslib","scinoteslib","signal_processinglib","simulated_annealinglib","soundlib","sparselib","special_functionslib","spreadsheetlib","statisticslib","stringlib","tclscilib","timelib","umfpacklib","varType","xcoslib"]
@@ -0,0 +1,3 @@
1
+ auto=[('BufAdd','BufAdd'),('BufCreate','BufCreate'),('BufDelete','BufDelete'),('BufEnter','BufEnter'),('BufFilePost','BufFilePost'),('BufFilePre','BufFilePre'),('BufHidden','BufHidden'),('BufLeave','BufLeave'),('BufNew','BufNew'),('BufNewFile','BufNewFile'),('BufRead','BufRead'),('BufReadCmd','BufReadCmd'),('BufReadPost','BufReadPost'),('BufReadPre','BufReadPre'),('BufUnload','BufUnload'),('BufWinEnter','BufWinEnter'),('BufWinLeave','BufWinLeave'),('BufWipeout','BufWipeout'),('BufWrite','BufWrite'),('BufWriteCmd','BufWriteCmd'),('BufWritePost','BufWritePost'),('BufWritePre','BufWritePre'),('Cmd','Cmd'),('CmdwinEnter','CmdwinEnter'),('CmdwinLeave','CmdwinLeave'),('ColorScheme','ColorScheme'),('CursorHold','CursorHold'),('CursorHoldI','CursorHoldI'),('CursorMoved','CursorMoved'),('CursorMovedI','CursorMovedI'),('EncodingChanged','EncodingChanged'),('FileAppendCmd','FileAppendCmd'),('FileAppendPost','FileAppendPost'),('FileAppendPre','FileAppendPre'),('FileChangedRO','FileChangedRO'),('FileChangedShell','FileChangedShell'),('FileChangedShellPost','FileChangedShellPost'),('FileEncoding','FileEncoding'),('FileReadCmd','FileReadCmd'),('FileReadPost','FileReadPost'),('FileReadPre','FileReadPre'),('FileType','FileType'),('FileWriteCmd','FileWriteCmd'),('FileWritePost','FileWritePost'),('FileWritePre','FileWritePre'),('FilterReadPost','FilterReadPost'),('FilterReadPre','FilterReadPre'),('FilterWritePost','FilterWritePost'),('FilterWritePre','FilterWritePre'),('FocusGained','FocusGained'),('FocusLost','FocusLost'),('FuncUndefined','FuncUndefined'),('GUIEnter','GUIEnter'),('GUIFailed','GUIFailed'),('InsertChange','InsertChange'),('InsertCharPre','InsertCharPre'),('InsertEnter','InsertEnter'),('InsertLeave','InsertLeave'),('MenuPopup','MenuPopup'),('QuickFixCmdPost','QuickFixCmdPost'),('QuickFixCmdPre','QuickFixCmdPre'),('RemoteReply','RemoteReply'),('SessionLoadPost','SessionLoadPost'),('ShellCmdPost','ShellCmdPost'),('ShellFilterPost','ShellFilterPost'),('SourceCmd','SourceCmd'),('SourcePre','SourcePre'),('SpellFileMissing','SpellFileMissing'),('StdinReadPost','StdinReadPost'),('StdinReadPre','StdinReadPre'),('SwapExists','SwapExists'),('Syntax','Syntax'),('TabEnter','TabEnter'),('TabLeave','TabLeave'),('TermChanged','TermChanged'),('TermResponse','TermResponse'),('User','User'),('UserGettingBored','UserGettingBored'),('VimEnter','VimEnter'),('VimLeave','VimLeave'),('VimLeavePre','VimLeavePre'),('VimResized','VimResized'),('WinEnter','WinEnter'),('WinLeave','WinLeave'),('event','event')]
2
+ command=[('Allargs','Allargs'),('DiffOrig','DiffOrig'),('Error','Error'),('Man','Man'),('MyCommand','MyCommand'),('Mycmd','Mycmd'),('N','N'),('N','Next'),('P','P'),('P','Print'),('Ren','Ren'),('Rena','Rena'),('Renu','Renu'),('TOhtml','TOhtml'),('X','X'),('XMLent','XMLent'),('XMLns','XMLns'),('a','a'),('ab','ab'),('abc','abclear'),('abo','aboveleft'),('al','all'),('ar','ar'),('ar','args'),('arga','argadd'),('argd','argdelete'),('argdo','argdo'),('arge','argedit'),('argg','argglobal'),('argl','arglocal'),('argu','argument'),('as','ascii'),('au','au'),('b','buffer'),('bN','bNext'),('ba','ball'),('bad','badd'),('bar','bar'),('bd','bdelete'),('bel','belowright'),('bf','bfirst'),('bl','blast'),('bm','bmodified'),('bn','bnext'),('bo','botright'),('bp','bprevious'),('br','br'),('br','brewind'),('brea','break'),('breaka','breakadd'),('breakd','breakdel'),('breakl','breaklist'),('bro','browse'),('browseset','browseset'),('bu','bu'),('buf','buf'),('bufdo','bufdo'),('buffers','buffers'),('bun','bunload'),('bw','bwipeout'),('c','c'),('c','change'),('cN','cN'),('cN','cNext'),('cNf','cNf'),('cNf','cNfile'),('cabc','cabclear'),('cad','cad'),('cad','caddexpr'),('caddb','caddbuffer'),('caddf','caddfile'),('cal','call'),('cat','catch'),('cb','cbuffer'),('cc','cc'),('ccl','cclose'),('cd','cd'),('ce','center'),('cex','cexpr'),('cf','cfile'),('cfir','cfirst'),('cg','cgetfile'),('cgetb','cgetbuffer'),('cgete','cgetexpr'),('changes','changes'),('chd','chdir'),('che','checkpath'),('checkt','checktime'),('cl','cl'),('cl','clist'),('cla','clast'),('clo','close'),('cmapc','cmapclear'),('cmdname','cmdname'),('cn','cn'),('cn','cnext'),('cnew','cnewer'),('cnf','cnf'),('cnf','cnfile'),('co','copy'),('col','colder'),('colo','colorscheme'),('com','com'),('comc','comclear'),('comment','comment'),('comp','compiler'),('con','con'),('con','continue'),('conf','confirm'),('cope','copen'),('count','count'),('cp','cprevious'),('cpf','cpfile'),('cq','cquit'),('cr','crewind'),('cs','cs'),('cscope','cscope'),('cstag','cstag'),('cuna','cunabbrev'),('cw','cwindow'),('d','d'),('d','delete'),('de','de'),('debug','debug'),('debugg','debuggreedy'),('del','del'),('delc','delcommand'),('delf','delf'),('delf','delfunction'),('delm','delmarks'),('di','di'),('di','display'),('diffg','diffget'),('diffo','diffo'),('diffoff','diffoff'),('diffp','diffp'),('diffpatch','diffpatch'),('diffpu','diffput'),('diffsplit','diffsplit'),('difft','difft'),('diffthis','diffthis'),('diffu','diffupdate'),('dig','dig'),('dig','digraphs'),('dj','djump'),('dl','dlist'),('do','do'),('doau','doau'),('dr','drop'),('ds','dsearch'),('dsp','dsplit'),('dwim','dwim'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','edit'),('ea','ea'),('earlier','earlier'),('ec','ec'),('echoe','echoerr'),('echom','echomsg'),('echon','echon'),('el','else'),('elsei','elseif'),('em','emenu'),('emenu','emenu'),('en','en'),('en','endif'),('endf','endf'),('endf','endfunction'),('endfo','endfor'),('endfun','endfun'),('endt','endtry'),('endw','endwhile'),('ene','enew'),('ex','ex'),('exi','exit'),('exu','exusage'),('f','f'),('f','file'),('filename','filename'),('files','files'),('filet','filet'),('filetype','filetype'),('fin','fin'),('fin','find'),('fina','finally'),('fini','finish'),('fir','first'),('fix','fixdel'),('fo','fold'),('foldc','foldclose'),('foldd','folddoopen'),('folddoc','folddoclosed'),('foldo','foldopen'),('for','for'),('fu','fu'),('fu','function'),('fun','fun'),('g','g'),('get','get'),('go','goto'),('gr','grep'),('grepa','grepadd'),('gs','gs'),('gs','gs'),('gui','gui'),('gvim','gvim'),('h','h'),('h','h'),('h','h'),('h','h'),('h','help'),('ha','hardcopy'),('helpf','helpfind'),('helpg','helpgrep'),('helpt','helptags'),('hi','hi'),('hid','hide'),('his','history'),('i','i'),('ia','ia'),('iabc','iabclear'),('if','if'),('ij','ijump'),('il','ilist'),('imapc','imapclear'),('in','in'),('index','index'),('intro','intro'),('is','isearch'),('isp','isplit'),('iuna','iunabbrev'),('j','join'),('ju','jumps'),('k','k'),('kee','keepmarks'),('keepa','keepa'),('keepalt','keepalt'),('keepj','keepjumps'),('l','l'),('l','list'),('lN','lN'),('lN','lNext'),('lNf','lNf'),('lNf','lNfile'),('la','la'),('la','last'),('lad','lad'),('lad','laddexpr'),('laddb','laddbuffer'),('laddf','laddfile'),('lan','lan'),('lan','language'),('lat','lat'),('later','later'),('lb','lbuffer'),('lc','lcd'),('lch','lchdir'),('lcl','lclose'),('lcs','lcs'),('lcscope','lcscope'),('le','left'),('lefta','leftabove'),('let','let'),('lex','lexpr'),('lf','lfile'),('lfir','lfirst'),('lg','lgetfile'),('lgetb','lgetbuffer'),('lgete','lgetexpr'),('lgr','lgrep'),('lgrepa','lgrepadd'),('lh','lhelpgrep'),('ll','ll'),('lla','llast'),('lli','llist'),('lmak','lmake'),('lmapc','lmapclear'),('lne','lne'),('lne','lnext'),('lnew','lnewer'),('lnf','lnf'),('lnf','lnfile'),('lo','lo'),('lo','loadview'),('loadk','loadk'),('loadkeymap','loadkeymap'),('loc','lockmarks'),('locale','locale'),('lockv','lockvar'),('lol','lolder'),('lop','lopen'),('lp','lprevious'),('lpf','lpfile'),('lr','lrewind'),('ls','ls'),('lt','ltag'),('lua','lua'),('luado','luado'),('luafile','luafile'),('lv','lvimgrep'),('lvimgrepa','lvimgrepadd'),('lw','lwindow'),('m','move'),('ma','ma'),('ma','mark'),('main','main'),('main','main'),('mak','make'),('marks','marks'),('mat','match'),('menut','menut'),('menut','menutranslate'),('mes','mes'),('messages','messages'),('mk','mk'),('mk','mkexrc'),('mkdir','mkdir'),('mks','mksession'),('mksp','mkspell'),('mkv','mkv'),('mkv','mkvimrc'),('mkvie','mkview'),('mo','mo'),('mod','mode'),('mv','mv'),('mz','mz'),('mz','mzscheme'),('mzf','mzfile'),('n','n'),('n','n'),('n','next'),('nb','nbkey'),('nbc','nbclose'),('nbs','nbstart'),('ne','ne'),('new','new'),('nkf','nkf'),('nmapc','nmapclear'),('noa','noa'),('noautocmd','noautocmd'),('noh','nohlsearch'),('nu','number'),('o','o'),('o','open'),('ol','oldfiles'),('omapc','omapclear'),('on','only'),('opt','options'),('ownsyntax','ownsyntax'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','print'),('pat','pat'),('pat','pat'),('pc','pclose'),('pe','pe'),('pe','perl'),('ped','pedit'),('perld','perldo'),('po','pop'),('popu','popu'),('popu','popup'),('pp','ppop'),('pr','pr'),('pre','preserve'),('prev','previous'),('pro','pro'),('prof','profile'),('profd','profdel'),('promptf','promptfind'),('promptr','promptrepl'),('ps','psearch'),('ptN','ptN'),('ptN','ptNext'),('pta','ptag'),('ptf','ptfirst'),('ptj','ptjump'),('ptl','ptlast'),('ptn','ptn'),('ptn','ptnext'),('ptp','ptprevious'),('ptr','ptrewind'),('pts','ptselect'),('pu','put'),('pw','pwd'),('py','py'),('py','python'),('py3','py3'),('py3','py3'),('py3file','py3file'),('pyf','pyfile'),('python3','python3'),('q','q'),('q','quit'),('qa','qall'),('quita','quitall'),('quote','quote'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','read'),('re','re'),('rec','recover'),('red','red'),('red','redo'),('redi','redir'),('redr','redraw'),('redraws','redrawstatus'),('reg','registers'),('res','resize'),('ret','retab'),('retu','return'),('rew','rewind'),('ri','right'),('rightb','rightbelow'),('ru','ru'),('ru','runtime'),('rub','ruby'),('rubyd','rubydo'),('rubyf','rubyfile'),('rundo','rundo'),('rv','rviminfo'),('s','s'),('s','s'),('s','s'),('s','s'),('sN','sNext'),('sa','sargument'),('sal','sall'),('san','sandbox'),('sav','saveas'),('sb','sbuffer'),('sbN','sbNext'),('sba','sball'),('sbf','sbfirst'),('sbl','sblast'),('sbm','sbmodified'),('sbn','sbnext'),('sbp','sbprevious'),('sbr','sbrewind'),('scrip','scrip'),('scrip','scriptnames'),('scripte','scriptencoding'),('scs','scs'),('scscope','scscope'),('se','set'),('setf','setfiletype'),('setg','setglobal'),('setl','setlocal'),('sf','sfind'),('sfir','sfirst'),('sh','shell'),('si','si'),('sig','sig'),('sign','sign'),('sil','silent'),('sim','simalt'),('sl','sl'),('sl','sleep'),('sla','slast'),('sm','smagic'),('sm','smap'),('sme','sme'),('smenu','smenu'),('sn','snext'),('sni','sniff'),('sno','snomagic'),('snoreme','snoreme'),('snoremenu','snoremenu'),('so','so'),('so','source'),('sor','sort'),('sp','split'),('spe','spe'),('spe','spellgood'),('spelld','spelldump'),('spelli','spellinfo'),('spellr','spellrepall'),('spellu','spellundo'),('spellw','spellwrong'),('spr','sprevious'),('sre','srewind'),('st','st'),('st','stop'),('sta','stag'),('star','star'),('star','startinsert'),('start','start'),('startg','startgreplace'),('startr','startreplace'),('stj','stjump'),('stopi','stopinsert'),('sts','stselect'),('sub','sub'),('sub','sub'),('sun','sunhide'),('sunme','sunme'),('sunmenu','sunmenu'),('sus','suspend'),('sv','sview'),('sw','swapname'),('sy','sy'),('syn','syn'),('sync','sync'),('syncbind','syncbind'),('synlist','synlist'),('t','t'),('t','t'),('t','t'),('tN','tN'),('tN','tNext'),('ta','ta'),('ta','tag'),('tab','tab'),('tabN','tabN'),('tabN','tabNext'),('tabc','tabclose'),('tabd','tabdo'),('tabe','tabedit'),('tabf','tabfind'),('tabfir','tabfirst'),('tabl','tablast'),('tabm','tabmove'),('tabn','tabnext'),('tabnew','tabnew'),('tabo','tabonly'),('tabp','tabprevious'),('tabr','tabrewind'),('tabs','tabs'),('tags','tags'),('tc','tcl'),('tcld','tcldo'),('tclf','tclfile'),('te','tearoff'),('tf','tfirst'),('th','throw'),('tj','tjump'),('tl','tlast'),('tm','tm'),('tm','tmenu'),('tn','tn'),('tn','tnext'),('to','topleft'),('tp','tprevious'),('tr','tr'),('tr','trewind'),('try','try'),('ts','tselect'),('tu','tu'),('tu','tunmenu'),('u','u'),('u','undo'),('un','un'),('una','unabbreviate'),('undoj','undojoin'),('undol','undolist'),('unh','unhide'),('unl','unl'),('unlo','unlockvar'),('uns','unsilent'),('up','update'),('v','v'),('ve','ve'),('ve','version'),('verb','verbose'),('version','version'),('version','version'),('vert','vertical'),('vi','vi'),('vi','visual'),('vie','view'),('vim','vimgrep'),('vimgrepa','vimgrepadd'),('viu','viusage'),('vmapc','vmapclear'),('vne','vnew'),('vs','vsplit'),('w','w'),('w','write'),('wN','wNext'),('wa','wall'),('wh','while'),('win','win'),('win','winsize'),('winc','wincmd'),('windo','windo'),('winp','winpos'),('wn','wnext'),('wp','wprevious'),('wq','wq'),('wqa','wqall'),('ws','wsverb'),('wundo','wundo'),('wv','wviminfo'),('x','x'),('x','xit'),('xa','xall'),('xmapc','xmapclear'),('xme','xme'),('xmenu','xmenu'),('xnoreme','xnoreme'),('xnoremenu','xnoremenu'),('xterm','xterm'),('xunme','xunme'),('xunmenu','xunmenu'),('xwininfo','xwininfo'),('y','yank')]
3
+ option=[('acd','acd'),('ai','ai'),('akm','akm'),('al','al'),('aleph','aleph'),('allowrevins','allowrevins'),('altkeymap','altkeymap'),('ambiwidth','ambiwidth'),('ambw','ambw'),('anti','anti'),('antialias','antialias'),('ar','ar'),('arab','arab'),('arabic','arabic'),('arabicshape','arabicshape'),('ari','ari'),('arshape','arshape'),('autochdir','autochdir'),('autoindent','autoindent'),('autoread','autoread'),('autowrite','autowrite'),('autowriteall','autowriteall'),('aw','aw'),('awa','awa'),('background','background'),('backspace','backspace'),('backup','backup'),('backupcopy','backupcopy'),('backupdir','backupdir'),('backupext','backupext'),('backupskip','backupskip'),('balloondelay','balloondelay'),('ballooneval','ballooneval'),('balloonexpr','balloonexpr'),('bdir','bdir'),('bdlay','bdlay'),('beval','beval'),('bex','bex'),('bexpr','bexpr'),('bg','bg'),('bh','bh'),('bin','bin'),('binary','binary'),('biosk','biosk'),('bioskey','bioskey'),('bk','bk'),('bkc','bkc'),('bl','bl'),('bomb','bomb'),('breakat','breakat'),('brk','brk'),('browsedir','browsedir'),('bs','bs'),('bsdir','bsdir'),('bsk','bsk'),('bt','bt'),('bufhidden','bufhidden'),('buflisted','buflisted'),('buftype','buftype'),('casemap','casemap'),('cb','cb'),('cc','cc'),('ccv','ccv'),('cd','cd'),('cdpath','cdpath'),('cedit','cedit'),('cf','cf'),('cfu','cfu'),('ch','ch'),('charconvert','charconvert'),('ci','ci'),('cin','cin'),('cindent','cindent'),('cink','cink'),('cinkeys','cinkeys'),('cino','cino'),('cinoptions','cinoptions'),('cinw','cinw'),('cinwords','cinwords'),('clipboard','clipboard'),('cmdheight','cmdheight'),('cmdwinheight','cmdwinheight'),('cmp','cmp'),('cms','cms'),('co','co'),('cocu','cocu'),('cole','cole'),('colorcolumn','colorcolumn'),('columns','columns'),('com','com'),('comments','comments'),('commentstring','commentstring'),('compatible','compatible'),('complete','complete'),('completefunc','completefunc'),('completeopt','completeopt'),('concealcursor','concealcursor'),('conceallevel','conceallevel'),('confirm','confirm'),('consk','consk'),('conskey','conskey'),('copyindent','copyindent'),('cot','cot'),('cp','cp'),('cpo','cpo'),('cpoptions','cpoptions'),('cpt','cpt'),('crb','crb'),('cryptmethod','cryptmethod'),('cscopepathcomp','cscopepathcomp'),('cscopeprg','cscopeprg'),('cscopequickfix','cscopequickfix'),('cscoperelative','cscoperelative'),('cscopetag','cscopetag'),('cscopetagorder','cscopetagorder'),('cscopeverbose','cscopeverbose'),('cspc','cspc'),('csprg','csprg'),('csqf','csqf'),('csre','csre'),('cst','cst'),('csto','csto'),('csverb','csverb'),('cuc','cuc'),('cul','cul'),('cursorbind','cursorbind'),('cursorcolumn','cursorcolumn'),('cursorline','cursorline'),('cwh','cwh'),('debug','debug'),('deco','deco'),('def','def'),('define','define'),('delcombine','delcombine'),('dex','dex'),('dg','dg'),('dict','dict'),('dictionary','dictionary'),('diff','diff'),('diffexpr','diffexpr'),('diffopt','diffopt'),('digraph','digraph'),('dip','dip'),('dir','dir'),('directory','directory'),('display','display'),('dy','dy'),('ea','ea'),('ead','ead'),('eadirection','eadirection'),('eb','eb'),('ed','ed'),('edcompatible','edcompatible'),('ef','ef'),('efm','efm'),('ei','ei'),('ek','ek'),('enc','enc'),('encoding','encoding'),('endofline','endofline'),('eol','eol'),('ep','ep'),('equalalways','equalalways'),('equalprg','equalprg'),('errorbells','errorbells'),('errorfile','errorfile'),('errorformat','errorformat'),('esckeys','esckeys'),('et','et'),('eventignore','eventignore'),('ex','ex'),('expandtab','expandtab'),('exrc','exrc'),('fcl','fcl'),('fcs','fcs'),('fdc','fdc'),('fde','fde'),('fdi','fdi'),('fdl','fdl'),('fdls','fdls'),('fdm','fdm'),('fdn','fdn'),('fdo','fdo'),('fdt','fdt'),('fen','fen'),('fenc','fenc'),('fencs','fencs'),('fex','fex'),('ff','ff'),('ffs','ffs'),('fileencoding','fileencoding'),('fileencodings','fileencodings'),('fileformat','fileformat'),('fileformats','fileformats'),('filetype','filetype'),('fillchars','fillchars'),('fk','fk'),('fkmap','fkmap'),('flp','flp'),('fml','fml'),('fmr','fmr'),('fo','fo'),('foldclose','foldclose'),('foldcolumn','foldcolumn'),('foldenable','foldenable'),('foldexpr','foldexpr'),('foldignore','foldignore'),('foldlevel','foldlevel'),('foldlevelstart','foldlevelstart'),('foldmarker','foldmarker'),('foldmethod','foldmethod'),('foldminlines','foldminlines'),('foldnestmax','foldnestmax'),('foldopen','foldopen'),('foldtext','foldtext'),('formatexpr','formatexpr'),('formatlistpat','formatlistpat'),('formatoptions','formatoptions'),('formatprg','formatprg'),('fp','fp'),('fs','fs'),('fsync','fsync'),('ft','ft'),('gcr','gcr'),('gd','gd'),('gdefault','gdefault'),('gfm','gfm'),('gfn','gfn'),('gfs','gfs'),('gfw','gfw'),('ghr','ghr'),('go','go'),('gp','gp'),('grepformat','grepformat'),('grepprg','grepprg'),('gtl','gtl'),('gtt','gtt'),('guicursor','guicursor'),('guifont','guifont'),('guifontset','guifontset'),('guifontwide','guifontwide'),('guiheadroom','guiheadroom'),('guioptions','guioptions'),('guipty','guipty'),('guitablabel','guitablabel'),('guitabtooltip','guitabtooltip'),('helpfile','helpfile'),('helpheight','helpheight'),('helplang','helplang'),('hf','hf'),('hh','hh'),('hi','hi'),('hid','hid'),('hidden','hidden'),('highlight','highlight'),('history','history'),('hk','hk'),('hkmap','hkmap'),('hkmapp','hkmapp'),('hkp','hkp'),('hl','hl'),('hlg','hlg'),('hls','hls'),('hlsearch','hlsearch'),('ic','ic'),('icon','icon'),('iconstring','iconstring'),('ignorecase','ignorecase'),('im','im'),('imactivatekey','imactivatekey'),('imak','imak'),('imc','imc'),('imcmdline','imcmdline'),('imd','imd'),('imdisable','imdisable'),('imi','imi'),('iminsert','iminsert'),('ims','ims'),('imsearch','imsearch'),('inc','inc'),('include','include'),('includeexpr','includeexpr'),('incsearch','incsearch'),('inde','inde'),('indentexpr','indentexpr'),('indentkeys','indentkeys'),('indk','indk'),('inex','inex'),('inf','inf'),('infercase','infercase'),('inoremap','inoremap'),('insertmode','insertmode'),('invacd','invacd'),('invai','invai'),('invakm','invakm'),('invallowrevins','invallowrevins'),('invaltkeymap','invaltkeymap'),('invanti','invanti'),('invantialias','invantialias'),('invar','invar'),('invarab','invarab'),('invarabic','invarabic'),('invarabicshape','invarabicshape'),('invari','invari'),('invarshape','invarshape'),('invautochdir','invautochdir'),('invautoindent','invautoindent'),('invautoread','invautoread'),('invautowrite','invautowrite'),('invautowriteall','invautowriteall'),('invaw','invaw'),('invawa','invawa'),('invbackup','invbackup'),('invballooneval','invballooneval'),('invbeval','invbeval'),('invbin','invbin'),('invbinary','invbinary'),('invbiosk','invbiosk'),('invbioskey','invbioskey'),('invbk','invbk'),('invbl','invbl'),('invbomb','invbomb'),('invbuflisted','invbuflisted'),('invcf','invcf'),('invci','invci'),('invcin','invcin'),('invcindent','invcindent'),('invcompatible','invcompatible'),('invconfirm','invconfirm'),('invconsk','invconsk'),('invconskey','invconskey'),('invcopyindent','invcopyindent'),('invcp','invcp'),('invcrb','invcrb'),('invcscopetag','invcscopetag'),('invcscopeverbose','invcscopeverbose'),('invcst','invcst'),('invcsverb','invcsverb'),('invcuc','invcuc'),('invcul','invcul'),('invcursorbind','invcursorbind'),('invcursorcolumn','invcursorcolumn'),('invcursorline','invcursorline'),('invdeco','invdeco'),('invdelcombine','invdelcombine'),('invdg','invdg'),('invdiff','invdiff'),('invdigraph','invdigraph'),('invea','invea'),('inveb','inveb'),('inved','inved'),('invedcompatible','invedcompatible'),('invek','invek'),('invendofline','invendofline'),('inveol','inveol'),('invequalalways','invequalalways'),('inverrorbells','inverrorbells'),('invesckeys','invesckeys'),('invet','invet'),('invex','invex'),('invexpandtab','invexpandtab'),('invexrc','invexrc'),('invfen','invfen'),('invfk','invfk'),('invfkmap','invfkmap'),('invfoldenable','invfoldenable'),('invgd','invgd'),('invgdefault','invgdefault'),('invguipty','invguipty'),('invhid','invhid'),('invhidden','invhidden'),('invhk','invhk'),('invhkmap','invhkmap'),('invhkmapp','invhkmapp'),('invhkp','invhkp'),('invhls','invhls'),('invhlsearch','invhlsearch'),('invic','invic'),('invicon','invicon'),('invignorecase','invignorecase'),('invim','invim'),('invimc','invimc'),('invimcmdline','invimcmdline'),('invimd','invimd'),('invimdisable','invimdisable'),('invincsearch','invincsearch'),('invinf','invinf'),('invinfercase','invinfercase'),('invinsertmode','invinsertmode'),('invis','invis'),('invjoinspaces','invjoinspaces'),('invjs','invjs'),('invlazyredraw','invlazyredraw'),('invlbr','invlbr'),('invlinebreak','invlinebreak'),('invlisp','invlisp'),('invlist','invlist'),('invloadplugins','invloadplugins'),('invlpl','invlpl'),('invlz','invlz'),('invma','invma'),('invmacatsui','invmacatsui'),('invmagic','invmagic'),('invmh','invmh'),('invml','invml'),('invmod','invmod'),('invmodeline','invmodeline'),('invmodifiable','invmodifiable'),('invmodified','invmodified'),('invmore','invmore'),('invmousef','invmousef'),('invmousefocus','invmousefocus'),('invmousehide','invmousehide'),('invnu','invnu'),('invnumber','invnumber'),('invodev','invodev'),('invopendevice','invopendevice'),('invpaste','invpaste'),('invpi','invpi'),('invpreserveindent','invpreserveindent'),('invpreviewwindow','invpreviewwindow'),('invprompt','invprompt'),('invpvw','invpvw'),('invreadonly','invreadonly'),('invrelativenumber','invrelativenumber'),('invremap','invremap'),('invrestorescreen','invrestorescreen'),('invrevins','invrevins'),('invri','invri'),('invrightleft','invrightleft'),('invrl','invrl'),('invrnu','invrnu'),('invro','invro'),('invrs','invrs'),('invru','invru'),('invruler','invruler'),('invsb','invsb'),('invsc','invsc'),('invscb','invscb'),('invscrollbind','invscrollbind'),('invscs','invscs'),('invsecure','invsecure'),('invsft','invsft'),('invshellslash','invshellslash'),('invshelltemp','invshelltemp'),('invshiftround','invshiftround'),('invshortname','invshortname'),('invshowcmd','invshowcmd'),('invshowfulltag','invshowfulltag'),('invshowmatch','invshowmatch'),('invshowmode','invshowmode'),('invsi','invsi'),('invsm','invsm'),('invsmartcase','invsmartcase'),('invsmartindent','invsmartindent'),('invsmarttab','invsmarttab'),('invsmd','invsmd'),('invsn','invsn'),('invsol','invsol'),('invspell','invspell'),('invsplitbelow','invsplitbelow'),('invsplitright','invsplitright'),('invspr','invspr'),('invsr','invsr'),('invssl','invssl'),('invsta','invsta'),('invstartofline','invstartofline'),('invstmp','invstmp'),('invswapfile','invswapfile'),('invswf','invswf'),('invta','invta'),('invtagbsearch','invtagbsearch'),('invtagrelative','invtagrelative'),('invtagstack','invtagstack'),('invtbi','invtbi'),('invtbidi','invtbidi'),('invtbs','invtbs'),('invtermbidi','invtermbidi'),('invterse','invterse'),('invtextauto','invtextauto'),('invtextmode','invtextmode'),('invtf','invtf'),('invtgst','invtgst'),('invtildeop','invtildeop'),('invtimeout','invtimeout'),('invtitle','invtitle'),('invto','invto'),('invtop','invtop'),('invtr','invtr'),('invttimeout','invttimeout'),('invttybuiltin','invttybuiltin'),('invttyfast','invttyfast'),('invtx','invtx'),('invvb','invvb'),('invvisualbell','invvisualbell'),('invwa','invwa'),('invwarn','invwarn'),('invwb','invwb'),('invweirdinvert','invweirdinvert'),('invwfh','invwfh'),('invwfw','invwfw'),('invwildignorecase','invwildignorecase'),('invwildmenu','invwildmenu'),('invwinfixheight','invwinfixheight'),('invwinfixwidth','invwinfixwidth'),('invwiv','invwiv'),('invwmnu','invwmnu'),('invwrap','invwrap'),('invwrapscan','invwrapscan'),('invwrite','invwrite'),('invwriteany','invwriteany'),('invwritebackup','invwritebackup'),('invws','invws'),('is','is'),('isf','isf'),('isfname','isfname'),('isi','isi'),('isident','isident'),('isk','isk'),('iskeyword','iskeyword'),('isp','isp'),('isprint','isprint'),('joinspaces','joinspaces'),('js','js'),('key','key'),('keymap','keymap'),('keymodel','keymodel'),('keywordprg','keywordprg'),('km','km'),('kmp','kmp'),('kp','kp'),('langmap','langmap'),('langmenu','langmenu'),('laststatus','laststatus'),('lazyredraw','lazyredraw'),('lbr','lbr'),('lcs','lcs'),('linebreak','linebreak'),('lines','lines'),('linespace','linespace'),('lisp','lisp'),('lispwords','lispwords'),('list','list'),('listchars','listchars'),('lm','lm'),('lmap','lmap'),('loadplugins','loadplugins'),('lpl','lpl'),('ls','ls'),('lsp','lsp'),('lw','lw'),('lz','lz'),('ma','ma'),('macatsui','macatsui'),('magic','magic'),('makeef','makeef'),('makeprg','makeprg'),('mat','mat'),('matchpairs','matchpairs'),('matchtime','matchtime'),('maxcombine','maxcombine'),('maxfuncdepth','maxfuncdepth'),('maxmapdepth','maxmapdepth'),('maxmem','maxmem'),('maxmempattern','maxmempattern'),('maxmemtot','maxmemtot'),('mco','mco'),('mef','mef'),('menuitems','menuitems'),('mfd','mfd'),('mh','mh'),('mis','mis'),('mkspellmem','mkspellmem'),('ml','ml'),('mls','mls'),('mm','mm'),('mmd','mmd'),('mmp','mmp'),('mmt','mmt'),('mod','mod'),('modeline','modeline'),('modelines','modelines'),('modifiable','modifiable'),('modified','modified'),('more','more'),('mouse','mouse'),('mousef','mousef'),('mousefocus','mousefocus'),('mousehide','mousehide'),('mousem','mousem'),('mousemodel','mousemodel'),('mouses','mouses'),('mouseshape','mouseshape'),('mouset','mouset'),('mousetime','mousetime'),('mp','mp'),('mps','mps'),('msm','msm'),('mzq','mzq'),('mzquantum','mzquantum'),('nf','nf'),('nnoremap','nnoremap'),('noacd','noacd'),('noai','noai'),('noakm','noakm'),('noallowrevins','noallowrevins'),('noaltkeymap','noaltkeymap'),('noanti','noanti'),('noantialias','noantialias'),('noar','noar'),('noarab','noarab'),('noarabic','noarabic'),('noarabicshape','noarabicshape'),('noari','noari'),('noarshape','noarshape'),('noautochdir','noautochdir'),('noautoindent','noautoindent'),('noautoread','noautoread'),('noautowrite','noautowrite'),('noautowriteall','noautowriteall'),('noaw','noaw'),('noawa','noawa'),('nobackup','nobackup'),('noballooneval','noballooneval'),('nobeval','nobeval'),('nobin','nobin'),('nobinary','nobinary'),('nobiosk','nobiosk'),('nobioskey','nobioskey'),('nobk','nobk'),('nobl','nobl'),('nobomb','nobomb'),('nobuflisted','nobuflisted'),('nocf','nocf'),('noci','noci'),('nocin','nocin'),('nocindent','nocindent'),('nocompatible','nocompatible'),('noconfirm','noconfirm'),('noconsk','noconsk'),('noconskey','noconskey'),('nocopyindent','nocopyindent'),('nocp','nocp'),('nocrb','nocrb'),('nocscopetag','nocscopetag'),('nocscopeverbose','nocscopeverbose'),('nocst','nocst'),('nocsverb','nocsverb'),('nocuc','nocuc'),('nocul','nocul'),('nocursorbind','nocursorbind'),('nocursorcolumn','nocursorcolumn'),('nocursorline','nocursorline'),('nodeco','nodeco'),('nodelcombine','nodelcombine'),('nodg','nodg'),('nodiff','nodiff'),('nodigraph','nodigraph'),('noea','noea'),('noeb','noeb'),('noed','noed'),('noedcompatible','noedcompatible'),('noek','noek'),('noendofline','noendofline'),('noeol','noeol'),('noequalalways','noequalalways'),('noerrorbells','noerrorbells'),('noesckeys','noesckeys'),('noet','noet'),('noex','noex'),('noexpandtab','noexpandtab'),('noexrc','noexrc'),('nofen','nofen'),('nofk','nofk'),('nofkmap','nofkmap'),('nofoldenable','nofoldenable'),('nogd','nogd'),('nogdefault','nogdefault'),('noguipty','noguipty'),('nohid','nohid'),('nohidden','nohidden'),('nohk','nohk'),('nohkmap','nohkmap'),('nohkmapp','nohkmapp'),('nohkp','nohkp'),('nohls','nohls'),('nohlsearch','nohlsearch'),('noic','noic'),('noicon','noicon'),('noignorecase','noignorecase'),('noim','noim'),('noimc','noimc'),('noimcmdline','noimcmdline'),('noimd','noimd'),('noimdisable','noimdisable'),('noincsearch','noincsearch'),('noinf','noinf'),('noinfercase','noinfercase'),('noinsertmode','noinsertmode'),('nois','nois'),('nojoinspaces','nojoinspaces'),('nojs','nojs'),('nolazyredraw','nolazyredraw'),('nolbr','nolbr'),('nolinebreak','nolinebreak'),('nolisp','nolisp'),('nolist','nolist'),('noloadplugins','noloadplugins'),('nolpl','nolpl'),('nolz','nolz'),('noma','noma'),('nomacatsui','nomacatsui'),('nomagic','nomagic'),('nomh','nomh'),('noml','noml'),('nomod','nomod'),('nomodeline','nomodeline'),('nomodifiable','nomodifiable'),('nomodified','nomodified'),('nomore','nomore'),('nomousef','nomousef'),('nomousefocus','nomousefocus'),('nomousehide','nomousehide'),('nonu','nonu'),('nonumber','nonumber'),('noodev','noodev'),('noopendevice','noopendevice'),('nopaste','nopaste'),('nopi','nopi'),('nopreserveindent','nopreserveindent'),('nopreviewwindow','nopreviewwindow'),('noprompt','noprompt'),('nopvw','nopvw'),('noreadonly','noreadonly'),('norelativenumber','norelativenumber'),('noremap','noremap'),('norestorescreen','norestorescreen'),('norevins','norevins'),('nori','nori'),('norightleft','norightleft'),('norl','norl'),('nornu','nornu'),('noro','noro'),('nors','nors'),('noru','noru'),('noruler','noruler'),('nosb','nosb'),('nosc','nosc'),('noscb','noscb'),('noscrollbind','noscrollbind'),('noscs','noscs'),('nosecure','nosecure'),('nosft','nosft'),('noshellslash','noshellslash'),('noshelltemp','noshelltemp'),('noshiftround','noshiftround'),('noshortname','noshortname'),('noshowcmd','noshowcmd'),('noshowfulltag','noshowfulltag'),('noshowmatch','noshowmatch'),('noshowmode','noshowmode'),('nosi','nosi'),('nosm','nosm'),('nosmartcase','nosmartcase'),('nosmartindent','nosmartindent'),('nosmarttab','nosmarttab'),('nosmd','nosmd'),('nosn','nosn'),('nosol','nosol'),('nospell','nospell'),('nosplitbelow','nosplitbelow'),('nosplitright','nosplitright'),('nospr','nospr'),('nosr','nosr'),('nossl','nossl'),('nosta','nosta'),('nostartofline','nostartofline'),('nostmp','nostmp'),('noswapfile','noswapfile'),('noswf','noswf'),('nota','nota'),('notagbsearch','notagbsearch'),('notagrelative','notagrelative'),('notagstack','notagstack'),('notbi','notbi'),('notbidi','notbidi'),('notbs','notbs'),('notermbidi','notermbidi'),('noterse','noterse'),('notextauto','notextauto'),('notextmode','notextmode'),('notf','notf'),('notgst','notgst'),('notildeop','notildeop'),('notimeout','notimeout'),('notitle','notitle'),('noto','noto'),('notop','notop'),('notr','notr'),('nottimeout','nottimeout'),('nottybuiltin','nottybuiltin'),('nottyfast','nottyfast'),('notx','notx'),('novb','novb'),('novisualbell','novisualbell'),('nowa','nowa'),('nowarn','nowarn'),('nowb','nowb'),('noweirdinvert','noweirdinvert'),('nowfh','nowfh'),('nowfw','nowfw'),('nowildignorecase','nowildignorecase'),('nowildmenu','nowildmenu'),('nowinfixheight','nowinfixheight'),('nowinfixwidth','nowinfixwidth'),('nowiv','nowiv'),('nowmnu','nowmnu'),('nowrap','nowrap'),('nowrapscan','nowrapscan'),('nowrite','nowrite'),('nowriteany','nowriteany'),('nowritebackup','nowritebackup'),('nows','nows'),('nrformats','nrformats'),('nu','nu'),('number','number'),('numberwidth','numberwidth'),('nuw','nuw'),('odev','odev'),('oft','oft'),('ofu','ofu'),('omnifunc','omnifunc'),('opendevice','opendevice'),('operatorfunc','operatorfunc'),('opfunc','opfunc'),('osfiletype','osfiletype'),('pa','pa'),('para','para'),('paragraphs','paragraphs'),('paste','paste'),('pastetoggle','pastetoggle'),('patchexpr','patchexpr'),('patchmode','patchmode'),('path','path'),('pdev','pdev'),('penc','penc'),('pex','pex'),('pexpr','pexpr'),('pfn','pfn'),('ph','ph'),('pheader','pheader'),('pi','pi'),('pm','pm'),('pmbcs','pmbcs'),('pmbfn','pmbfn'),('popt','popt'),('preserveindent','preserveindent'),('previewheight','previewheight'),('previewwindow','previewwindow'),('printdevice','printdevice'),('printencoding','printencoding'),('printexpr','printexpr'),('printfont','printfont'),('printheader','printheader'),('printmbcharset','printmbcharset'),('printmbfont','printmbfont'),('printoptions','printoptions'),('prompt','prompt'),('pt','pt'),('pumheight','pumheight'),('pvh','pvh'),('pvw','pvw'),('qe','qe'),('quoteescape','quoteescape'),('rdt','rdt'),('readonly','readonly'),('redrawtime','redrawtime'),('relativenumber','relativenumber'),('remap','remap'),('report','report'),('restorescreen','restorescreen'),('revins','revins'),('ri','ri'),('rightleft','rightleft'),('rightleftcmd','rightleftcmd'),('rl','rl'),('rlc','rlc'),('rnu','rnu'),('ro','ro'),('rs','rs'),('rtp','rtp'),('ru','ru'),('ruf','ruf'),('ruler','ruler'),('rulerformat','rulerformat'),('runtimepath','runtimepath'),('sb','sb'),('sbo','sbo'),('sbr','sbr'),('sc','sc'),('scb','scb'),('scr','scr'),('scroll','scroll'),('scrollbind','scrollbind'),('scrolljump','scrolljump'),('scrolloff','scrolloff'),('scrollopt','scrollopt'),('scs','scs'),('sect','sect'),('sections','sections'),('secure','secure'),('sel','sel'),('selection','selection'),('selectmode','selectmode'),('sessionoptions','sessionoptions'),('sft','sft'),('sh','sh'),('shcf','shcf'),('shell','shell'),('shellcmdflag','shellcmdflag'),('shellpipe','shellpipe'),('shellquote','shellquote'),('shellredir','shellredir'),('shellslash','shellslash'),('shelltemp','shelltemp'),('shelltype','shelltype'),('shellxquote','shellxquote'),('shiftround','shiftround'),('shiftwidth','shiftwidth'),('shm','shm'),('shortmess','shortmess'),('shortname','shortname'),('showbreak','showbreak'),('showcmd','showcmd'),('showfulltag','showfulltag'),('showmatch','showmatch'),('showmode','showmode'),('showtabline','showtabline'),('shq','shq'),('si','si'),('sidescroll','sidescroll'),('sidescrolloff','sidescrolloff'),('siso','siso'),('sj','sj'),('slm','slm'),('sm','sm'),('smartcase','smartcase'),('smartindent','smartindent'),('smarttab','smarttab'),('smc','smc'),('smd','smd'),('sn','sn'),('so','so'),('softtabstop','softtabstop'),('sol','sol'),('sp','sp'),('spc','spc'),('spell','spell'),('spellcapcheck','spellcapcheck'),('spellfile','spellfile'),('spelllang','spelllang'),('spellsuggest','spellsuggest'),('spf','spf'),('spl','spl'),('splitbelow','splitbelow'),('splitright','splitright'),('spr','spr'),('sps','sps'),('sr','sr'),('srr','srr'),('ss','ss'),('ssl','ssl'),('ssop','ssop'),('st','st'),('sta','sta'),('stal','stal'),('startofline','startofline'),('statusline','statusline'),('stl','stl'),('stmp','stmp'),('sts','sts'),('su','su'),('sua','sua'),('suffixes','suffixes'),('suffixesadd','suffixesadd'),('sw','sw'),('swapfile','swapfile'),('swapsync','swapsync'),('swb','swb'),('swf','swf'),('switchbuf','switchbuf'),('sws','sws'),('sxq','sxq'),('syn','syn'),('synmaxcol','synmaxcol'),('syntax','syntax'),('t_AB','t_AB'),('t_AF','t_AF'),('t_AL','t_AL'),('t_CS','t_CS'),('t_CV','t_CV'),('t_Ce','t_Ce'),('t_Co','t_Co'),('t_Cs','t_Cs'),('t_DL','t_DL'),('t_EI','t_EI'),('t_F1','t_F1'),('t_F2','t_F2'),('t_F3','t_F3'),('t_F4','t_F4'),('t_F5','t_F5'),('t_F6','t_F6'),('t_F7','t_F7'),('t_F8','t_F8'),('t_F9','t_F9'),('t_IE','t_IE'),('t_IS','t_IS'),('t_K1','t_K1'),('t_K3','t_K3'),('t_K4','t_K4'),('t_K5','t_K5'),('t_K6','t_K6'),('t_K7','t_K7'),('t_K8','t_K8'),('t_K9','t_K9'),('t_KA','t_KA'),('t_KB','t_KB'),('t_KC','t_KC'),('t_KD','t_KD'),('t_KE','t_KE'),('t_KF','t_KF'),('t_KG','t_KG'),('t_KH','t_KH'),('t_KI','t_KI'),('t_KJ','t_KJ'),('t_KK','t_KK'),('t_KL','t_KL'),('t_RI','t_RI'),('t_RV','t_RV'),('t_SI','t_SI'),('t_Sb','t_Sb'),('t_Sf','t_Sf'),('t_WP','t_WP'),('t_WS','t_WS'),('t_ZH','t_ZH'),('t_ZR','t_ZR'),('t_al','t_al'),('t_bc','t_bc'),('t_cd','t_cd'),('t_ce','t_ce'),('t_cl','t_cl'),('t_cm','t_cm'),('t_cs','t_cs'),('t_da','t_da'),('t_db','t_db'),('t_dl','t_dl'),('t_fs','t_fs'),('t_k1','t_k1'),('t_k2','t_k2'),('t_k3','t_k3'),('t_k4','t_k4'),('t_k5','t_k5'),('t_k6','t_k6'),('t_k7','t_k7'),('t_k8','t_k8'),('t_k9','t_k9'),('t_kB','t_kB'),('t_kD','t_kD'),('t_kI','t_kI'),('t_kN','t_kN'),('t_kP','t_kP'),('t_kb','t_kb'),('t_kd','t_kd'),('t_ke','t_ke'),('t_kh','t_kh'),('t_kl','t_kl'),('t_kr','t_kr'),('t_ks','t_ks'),('t_ku','t_ku'),('t_le','t_le'),('t_mb','t_mb'),('t_md','t_md'),('t_me','t_me'),('t_mr','t_mr'),('t_ms','t_ms'),('t_nd','t_nd'),('t_op','t_op'),('t_se','t_se'),('t_so','t_so'),('t_sr','t_sr'),('t_te','t_te'),('t_ti','t_ti'),('t_ts','t_ts'),('t_ue','t_ue'),('t_us','t_us'),('t_ut','t_ut'),('t_vb','t_vb'),('t_ve','t_ve'),('t_vi','t_vi'),('t_vs','t_vs'),('t_xs','t_xs'),('ta','ta'),('tabline','tabline'),('tabpagemax','tabpagemax'),('tabstop','tabstop'),('tag','tag'),('tagbsearch','tagbsearch'),('taglength','taglength'),('tagrelative','tagrelative'),('tags','tags'),('tagstack','tagstack'),('tal','tal'),('tb','tb'),('tbi','tbi'),('tbidi','tbidi'),('tbis','tbis'),('tbs','tbs'),('tenc','tenc'),('term','term'),('termbidi','termbidi'),('termencoding','termencoding'),('terse','terse'),('textauto','textauto'),('textmode','textmode'),('textwidth','textwidth'),('tf','tf'),('tgst','tgst'),('thesaurus','thesaurus'),('tildeop','tildeop'),('timeout','timeout'),('timeoutlen','timeoutlen'),('title','title'),('titlelen','titlelen'),('titleold','titleold'),('titlestring','titlestring'),('tl','tl'),('tm','tm'),('to','to'),('toolbar','toolbar'),('toolbariconsize','toolbariconsize'),('top','top'),('tpm','tpm'),('tr','tr'),('ts','ts'),('tsl','tsl'),('tsr','tsr'),('ttimeout','ttimeout'),('ttimeoutlen','ttimeoutlen'),('ttm','ttm'),('tty','tty'),('ttybuiltin','ttybuiltin'),('ttyfast','ttyfast'),('ttym','ttym'),('ttymouse','ttymouse'),('ttyscroll','ttyscroll'),('ttytype','ttytype'),('tw','tw'),('tx','tx'),('uc','uc'),('udf','udf'),('udir','udir'),('ul','ul'),('undodir','undodir'),('undofile','undofile'),('undolevels','undolevels'),('undoreload','undoreload'),('updatecount','updatecount'),('updatetime','updatetime'),('ur','ur'),('ut','ut'),('vb','vb'),('vbs','vbs'),('vdir','vdir'),('ve','ve'),('verbose','verbose'),('verbosefile','verbosefile'),('vfile','vfile'),('vi','vi'),('viewdir','viewdir'),('viewoptions','viewoptions'),('viminfo','viminfo'),('virtualedit','virtualedit'),('visualbell','visualbell'),('vnoremap','vnoremap'),('vop','vop'),('wa','wa'),('wak','wak'),('warn','warn'),('wb','wb'),('wc','wc'),('wcm','wcm'),('wd','wd'),('weirdinvert','weirdinvert'),('wfh','wfh'),('wfw','wfw'),('wh','wh'),('whichwrap','whichwrap'),('wi','wi'),('wic','wic'),('wig','wig'),('wildchar','wildchar'),('wildcharm','wildcharm'),('wildignore','wildignore'),('wildignorecase','wildignorecase'),('wildmenu','wildmenu'),('wildmode','wildmode'),('wildoptions','wildoptions'),('wim','wim'),('winaltkeys','winaltkeys'),('window','window'),('winfixheight','winfixheight'),('winfixwidth','winfixwidth'),('winheight','winheight'),('winminheight','winminheight'),('winminwidth','winminwidth'),('winwidth','winwidth'),('wiv','wiv'),('wiw','wiw'),('wm','wm'),('wmh','wmh'),('wmnu','wmnu'),('wmw','wmw'),('wop','wop'),('wrap','wrap'),('wrapmargin','wrapmargin'),('wrapscan','wrapscan'),('write','write'),('writeany','writeany'),('writebackup','writebackup'),('writedelay','writedelay'),('ws','ws'),('ww','ww')]
@@ -0,0 +1,1803 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.lexers.agile
4
+ ~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Lexers for agile languages.
7
+
8
+ :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ import re
13
+
14
+ from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
15
+ LexerContext, include, combined, do_insertions, bygroups, using
16
+ from pygments.token import Error, Text, Other, \
17
+ Comment, Operator, Keyword, Name, String, Number, Generic, Punctuation
18
+ from pygments.util import get_bool_opt, get_list_opt, shebang_matches
19
+ from pygments import unistring as uni
20
+
21
+
22
+ __all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
23
+ 'Python3Lexer', 'Python3TracebackLexer', 'RubyLexer',
24
+ 'RubyConsoleLexer', 'PerlLexer', 'LuaLexer', 'MoonScriptLexer',
25
+ 'MiniDLexer', 'IoLexer', 'TclLexer', 'FactorLexer', 'FancyLexer']
26
+
27
+ # b/w compatibility
28
+ from pygments.lexers.functional import SchemeLexer
29
+ from pygments.lexers.jvm import IokeLexer, ClojureLexer
30
+
31
+ line_re = re.compile('.*?\n')
32
+
33
+
34
+ class PythonLexer(RegexLexer):
35
+ """
36
+ For `Python <http://www.python.org>`_ source code.
37
+ """
38
+
39
+ name = 'Python'
40
+ aliases = ['python', 'py']
41
+ filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac']
42
+ mimetypes = ['text/x-python', 'application/x-python']
43
+
44
+ tokens = {
45
+ 'root': [
46
+ (r'\n', Text),
47
+ (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
48
+ (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
49
+ (r'[^\S\n]+', Text),
50
+ (r'#.*$', Comment),
51
+ (r'[]{}:(),;[]', Punctuation),
52
+ (r'\\\n', Text),
53
+ (r'\\', Text),
54
+ (r'(in|is|and|or|not)\b', Operator.Word),
55
+ (r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator),
56
+ include('keywords'),
57
+ (r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'funcname'),
58
+ (r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'classname'),
59
+ (r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
60
+ 'fromimport'),
61
+ (r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
62
+ 'import'),
63
+ include('builtins'),
64
+ include('backtick'),
65
+ ('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'),
66
+ ("(?:[rR]|[uU][rR]|[rR][uU])'''", String, 'tsqs'),
67
+ ('(?:[rR]|[uU][rR]|[rR][uU])"', String, 'dqs'),
68
+ ("(?:[rR]|[uU][rR]|[rR][uU])'", String, 'sqs'),
69
+ ('[uU]?"""', String, combined('stringescape', 'tdqs')),
70
+ ("[uU]?'''", String, combined('stringescape', 'tsqs')),
71
+ ('[uU]?"', String, combined('stringescape', 'dqs')),
72
+ ("[uU]?'", String, combined('stringescape', 'sqs')),
73
+ include('name'),
74
+ include('numbers'),
75
+ ],
76
+ 'keywords': [
77
+ (r'(assert|break|continue|del|elif|else|except|exec|'
78
+ r'finally|for|global|if|lambda|pass|print|raise|'
79
+ r'return|try|while|yield|as|with)\b', Keyword),
80
+ ],
81
+ 'builtins': [
82
+ (r'(?<!\.)(__import__|abs|all|any|apply|basestring|bin|bool|buffer|'
83
+ r'bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|'
84
+ r'complex|delattr|dict|dir|divmod|enumerate|eval|execfile|exit|'
85
+ r'file|filter|float|frozenset|getattr|globals|hasattr|hash|hex|id|'
86
+ r'input|int|intern|isinstance|issubclass|iter|len|list|locals|'
87
+ r'long|map|max|min|next|object|oct|open|ord|pow|property|range|'
88
+ r'raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|'
89
+ r'sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|'
90
+ r'vars|xrange|zip)\b', Name.Builtin),
91
+ (r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True'
92
+ r')\b', Name.Builtin.Pseudo),
93
+ (r'(?<!\.)(ArithmeticError|AssertionError|AttributeError|'
94
+ r'BaseException|DeprecationWarning|EOFError|EnvironmentError|'
95
+ r'Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|'
96
+ r'ImportError|ImportWarning|IndentationError|IndexError|KeyError|'
97
+ r'KeyboardInterrupt|LookupError|MemoryError|NameError|'
98
+ r'NotImplemented|NotImplementedError|OSError|OverflowError|'
99
+ r'OverflowWarning|PendingDeprecationWarning|ReferenceError|'
100
+ r'RuntimeError|RuntimeWarning|StandardError|StopIteration|'
101
+ r'SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|'
102
+ r'TypeError|UnboundLocalError|UnicodeDecodeError|'
103
+ r'UnicodeEncodeError|UnicodeError|UnicodeTranslateError|'
104
+ r'UnicodeWarning|UserWarning|ValueError|VMSError|Warning|'
105
+ r'WindowsError|ZeroDivisionError)\b', Name.Exception),
106
+ ],
107
+ 'numbers': [
108
+ (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
109
+ (r'\d+[eE][+-]?[0-9]+j?', Number.Float),
110
+ (r'0[0-7]+j?', Number.Oct),
111
+ (r'0[xX][a-fA-F0-9]+', Number.Hex),
112
+ (r'\d+L', Number.Integer.Long),
113
+ (r'\d+j?', Number.Integer)
114
+ ],
115
+ 'backtick': [
116
+ ('`.*?`', String.Backtick),
117
+ ],
118
+ 'name': [
119
+ (r'@[a-zA-Z0-9_.]+', Name.Decorator),
120
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
121
+ ],
122
+ 'funcname': [
123
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
124
+ ],
125
+ 'classname': [
126
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
127
+ ],
128
+ 'import': [
129
+ (r'(?:[ \t]|\\\n)+', Text),
130
+ (r'as\b', Keyword.Namespace),
131
+ (r',', Operator),
132
+ (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
133
+ (r'', Text, '#pop') # all else: go back
134
+ ],
135
+ 'fromimport': [
136
+ (r'(?:[ \t]|\\\n)+', Text),
137
+ (r'import\b', Keyword.Namespace, '#pop'),
138
+ (r'[a-zA-Z_.][a-zA-Z0-9_.]*', Name.Namespace),
139
+ ],
140
+ 'stringescape': [
141
+ (r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
142
+ r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
143
+ ],
144
+ 'strings': [
145
+ (r'%(\([a-zA-Z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
146
+ '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol),
147
+ (r'[^\\\'"%\n]+', String),
148
+ # quotes, percents and backslashes must be parsed one at a time
149
+ (r'[\'"\\]', String),
150
+ # unhandled string formatting sign
151
+ (r'%', String)
152
+ # newlines are an error (use "nl" state)
153
+ ],
154
+ 'nl': [
155
+ (r'\n', String)
156
+ ],
157
+ 'dqs': [
158
+ (r'"', String, '#pop'),
159
+ (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
160
+ include('strings')
161
+ ],
162
+ 'sqs': [
163
+ (r"'", String, '#pop'),
164
+ (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
165
+ include('strings')
166
+ ],
167
+ 'tdqs': [
168
+ (r'"""', String, '#pop'),
169
+ include('strings'),
170
+ include('nl')
171
+ ],
172
+ 'tsqs': [
173
+ (r"'''", String, '#pop'),
174
+ include('strings'),
175
+ include('nl')
176
+ ],
177
+ }
178
+
179
+ def analyse_text(text):
180
+ return shebang_matches(text, r'pythonw?(2(\.\d)?)?')
181
+
182
+
183
+ class Python3Lexer(RegexLexer):
184
+ """
185
+ For `Python <http://www.python.org>`_ source code (version 3.0).
186
+
187
+ *New in Pygments 0.10.*
188
+ """
189
+
190
+ name = 'Python 3'
191
+ aliases = ['python3', 'py3']
192
+ filenames = [] # Nothing until Python 3 gets widespread
193
+ mimetypes = ['text/x-python3', 'application/x-python3']
194
+
195
+ flags = re.MULTILINE | re.UNICODE
196
+
197
+ uni_name = "[%s][%s]*" % (uni.xid_start, uni.xid_continue)
198
+
199
+ tokens = PythonLexer.tokens.copy()
200
+ tokens['keywords'] = [
201
+ (r'(assert|break|continue|del|elif|else|except|'
202
+ r'finally|for|global|if|lambda|pass|raise|nonlocal|'
203
+ r'return|try|while|yield|as|with|True|False|None)\b', Keyword),
204
+ ]
205
+ tokens['builtins'] = [
206
+ (r'(?<!\.)(__import__|abs|all|any|bin|bool|bytearray|bytes|'
207
+ r'chr|classmethod|cmp|compile|complex|delattr|dict|dir|'
208
+ r'divmod|enumerate|eval|filter|float|format|frozenset|getattr|'
209
+ r'globals|hasattr|hash|hex|id|input|int|isinstance|issubclass|'
210
+ r'iter|len|list|locals|map|max|memoryview|min|next|object|oct|'
211
+ r'open|ord|pow|print|property|range|repr|reversed|round|'
212
+ r'set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|'
213
+ r'vars|zip)\b', Name.Builtin),
214
+ (r'(?<!\.)(self|Ellipsis|NotImplemented)\b', Name.Builtin.Pseudo),
215
+ (r'(?<!\.)(ArithmeticError|AssertionError|AttributeError|'
216
+ r'BaseException|BufferError|BytesWarning|DeprecationWarning|'
217
+ r'EOFError|EnvironmentError|Exception|FloatingPointError|'
218
+ r'FutureWarning|GeneratorExit|IOError|ImportError|'
219
+ r'ImportWarning|IndentationError|IndexError|KeyError|'
220
+ r'KeyboardInterrupt|LookupError|MemoryError|NameError|'
221
+ r'NotImplementedError|OSError|OverflowError|'
222
+ r'PendingDeprecationWarning|ReferenceError|'
223
+ r'RuntimeError|RuntimeWarning|StopIteration|'
224
+ r'SyntaxError|SyntaxWarning|SystemError|SystemExit|TabError|'
225
+ r'TypeError|UnboundLocalError|UnicodeDecodeError|'
226
+ r'UnicodeEncodeError|UnicodeError|UnicodeTranslateError|'
227
+ r'UnicodeWarning|UserWarning|ValueError|VMSError|Warning|'
228
+ r'WindowsError|ZeroDivisionError)\b', Name.Exception),
229
+ ]
230
+ tokens['numbers'] = [
231
+ (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
232
+ (r'0[oO][0-7]+', Number.Oct),
233
+ (r'0[bB][01]+', Number.Bin),
234
+ (r'0[xX][a-fA-F0-9]+', Number.Hex),
235
+ (r'\d+', Number.Integer)
236
+ ]
237
+ tokens['backtick'] = []
238
+ tokens['name'] = [
239
+ (r'@[a-zA-Z0-9_]+', Name.Decorator),
240
+ (uni_name, Name),
241
+ ]
242
+ tokens['funcname'] = [
243
+ (uni_name, Name.Function, '#pop')
244
+ ]
245
+ tokens['classname'] = [
246
+ (uni_name, Name.Class, '#pop')
247
+ ]
248
+ tokens['import'] = [
249
+ (r'(\s+)(as)(\s+)', bygroups(Text, Keyword, Text)),
250
+ (r'\.', Name.Namespace),
251
+ (uni_name, Name.Namespace),
252
+ (r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
253
+ (r'', Text, '#pop') # all else: go back
254
+ ]
255
+ tokens['fromimport'] = [
256
+ (r'(\s+)(import)\b', bygroups(Text, Keyword), '#pop'),
257
+ (r'\.', Name.Namespace),
258
+ (uni_name, Name.Namespace),
259
+ ]
260
+ # don't highlight "%s" substitutions
261
+ tokens['strings'] = [
262
+ (r'[^\\\'"%\n]+', String),
263
+ # quotes, percents and backslashes must be parsed one at a time
264
+ (r'[\'"\\]', String),
265
+ # unhandled string formatting sign
266
+ (r'%', String)
267
+ # newlines are an error (use "nl" state)
268
+ ]
269
+
270
+ def analyse_text(text):
271
+ return shebang_matches(text, r'pythonw?3(\.\d)?')
272
+
273
+
274
+ class PythonConsoleLexer(Lexer):
275
+ """
276
+ For Python console output or doctests, such as:
277
+
278
+ .. sourcecode:: pycon
279
+
280
+ >>> a = 'foo'
281
+ >>> print a
282
+ foo
283
+ >>> 1 / 0
284
+ Traceback (most recent call last):
285
+ File "<stdin>", line 1, in <module>
286
+ ZeroDivisionError: integer division or modulo by zero
287
+
288
+ Additional options:
289
+
290
+ `python3`
291
+ Use Python 3 lexer for code. Default is ``False``.
292
+ *New in Pygments 1.0.*
293
+ """
294
+ name = 'Python console session'
295
+ aliases = ['pycon']
296
+ mimetypes = ['text/x-python-doctest']
297
+
298
+ def __init__(self, **options):
299
+ self.python3 = get_bool_opt(options, 'python3', False)
300
+ Lexer.__init__(self, **options)
301
+
302
+ def get_tokens_unprocessed(self, text):
303
+ if self.python3:
304
+ pylexer = Python3Lexer(**self.options)
305
+ tblexer = Python3TracebackLexer(**self.options)
306
+ else:
307
+ pylexer = PythonLexer(**self.options)
308
+ tblexer = PythonTracebackLexer(**self.options)
309
+
310
+ curcode = ''
311
+ insertions = []
312
+ curtb = ''
313
+ tbindex = 0
314
+ tb = 0
315
+ for match in line_re.finditer(text):
316
+ line = match.group()
317
+ if line.startswith(u'>>> ') or line.startswith(u'... '):
318
+ tb = 0
319
+ insertions.append((len(curcode),
320
+ [(0, Generic.Prompt, line[:4])]))
321
+ curcode += line[4:]
322
+ elif line.rstrip() == u'...' and not tb:
323
+ # only a new >>> prompt can end an exception block
324
+ # otherwise an ellipsis in place of the traceback frames
325
+ # will be mishandled
326
+ insertions.append((len(curcode),
327
+ [(0, Generic.Prompt, u'...')]))
328
+ curcode += line[3:]
329
+ else:
330
+ if curcode:
331
+ for item in do_insertions(insertions,
332
+ pylexer.get_tokens_unprocessed(curcode)):
333
+ yield item
334
+ curcode = ''
335
+ insertions = []
336
+ if (line.startswith(u'Traceback (most recent call last):') or
337
+ re.match(ur' File "[^"]+", line \d+\n$', line)):
338
+ tb = 1
339
+ curtb = line
340
+ tbindex = match.start()
341
+ elif line == 'KeyboardInterrupt\n':
342
+ yield match.start(), Name.Class, line
343
+ elif tb:
344
+ curtb += line
345
+ if not (line.startswith(' ') or line.strip() == u'...'):
346
+ tb = 0
347
+ for i, t, v in tblexer.get_tokens_unprocessed(curtb):
348
+ yield tbindex+i, t, v
349
+ else:
350
+ yield match.start(), Generic.Output, line
351
+ if curcode:
352
+ for item in do_insertions(insertions,
353
+ pylexer.get_tokens_unprocessed(curcode)):
354
+ yield item
355
+
356
+
357
+ class PythonTracebackLexer(RegexLexer):
358
+ """
359
+ For Python tracebacks.
360
+
361
+ *New in Pygments 0.7.*
362
+ """
363
+
364
+ name = 'Python Traceback'
365
+ aliases = ['pytb']
366
+ filenames = ['*.pytb']
367
+ mimetypes = ['text/x-python-traceback']
368
+
369
+ tokens = {
370
+ 'root': [
371
+ (r'^Traceback \(most recent call last\):\n',
372
+ Generic.Traceback, 'intb'),
373
+ # SyntaxError starts with this.
374
+ (r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
375
+ (r'^.*\n', Other),
376
+ ],
377
+ 'intb': [
378
+ (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
379
+ bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
380
+ (r'^( File )("[^"]+")(, line )(\d+)(\n)',
381
+ bygroups(Text, Name.Builtin, Text, Number, Text)),
382
+ (r'^( )(.+)(\n)',
383
+ bygroups(Text, using(PythonLexer), Text)),
384
+ (r'^([ \t]*)(\.\.\.)(\n)',
385
+ bygroups(Text, Comment, Text)), # for doctests...
386
+ (r'^(.+)(: )(.+)(\n)',
387
+ bygroups(Generic.Error, Text, Name, Text), '#pop'),
388
+ (r'^([a-zA-Z_][a-zA-Z0-9_]*)(:?\n)',
389
+ bygroups(Generic.Error, Text), '#pop')
390
+ ],
391
+ }
392
+
393
+
394
+ class Python3TracebackLexer(RegexLexer):
395
+ """
396
+ For Python 3.0 tracebacks, with support for chained exceptions.
397
+
398
+ *New in Pygments 1.0.*
399
+ """
400
+
401
+ name = 'Python 3.0 Traceback'
402
+ aliases = ['py3tb']
403
+ filenames = ['*.py3tb']
404
+ mimetypes = ['text/x-python3-traceback']
405
+
406
+ tokens = {
407
+ 'root': [
408
+ (r'\n', Text),
409
+ (r'^Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
410
+ (r'^During handling of the above exception, another '
411
+ r'exception occurred:\n\n', Generic.Traceback),
412
+ (r'^The above exception was the direct cause of the '
413
+ r'following exception:\n\n', Generic.Traceback),
414
+ ],
415
+ 'intb': [
416
+ (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
417
+ bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
418
+ (r'^( )(.+)(\n)',
419
+ bygroups(Text, using(Python3Lexer), Text)),
420
+ (r'^([ \t]*)(\.\.\.)(\n)',
421
+ bygroups(Text, Comment, Text)), # for doctests...
422
+ (r'^(.+)(: )(.+)(\n)',
423
+ bygroups(Generic.Error, Text, Name, Text), '#pop'),
424
+ (r'^([a-zA-Z_][a-zA-Z0-9_]*)(:?\n)',
425
+ bygroups(Generic.Error, Text), '#pop')
426
+ ],
427
+ }
428
+
429
+
430
+ class RubyLexer(ExtendedRegexLexer):
431
+ """
432
+ For `Ruby <http://www.ruby-lang.org>`_ source code.
433
+ """
434
+
435
+ name = 'Ruby'
436
+ aliases = ['rb', 'ruby', 'duby']
437
+ filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec',
438
+ '*.rbx', '*.duby']
439
+ mimetypes = ['text/x-ruby', 'application/x-ruby']
440
+
441
+ flags = re.DOTALL | re.MULTILINE
442
+
443
+ def heredoc_callback(self, match, ctx):
444
+ # okay, this is the hardest part of parsing Ruby...
445
+ # match: 1 = <<-?, 2 = quote? 3 = name 4 = quote? 5 = rest of line
446
+
447
+ start = match.start(1)
448
+ yield start, Operator, match.group(1) # <<-?
449
+ yield match.start(2), String.Heredoc, match.group(2) # quote ", ', `
450
+ yield match.start(3), Name.Constant, match.group(3) # heredoc name
451
+ yield match.start(4), String.Heredoc, match.group(4) # quote again
452
+
453
+ heredocstack = ctx.__dict__.setdefault('heredocstack', [])
454
+ outermost = not bool(heredocstack)
455
+ heredocstack.append((match.group(1) == '<<-', match.group(3)))
456
+
457
+ ctx.pos = match.start(5)
458
+ ctx.end = match.end(5)
459
+ # this may find other heredocs
460
+ for i, t, v in self.get_tokens_unprocessed(context=ctx):
461
+ yield i, t, v
462
+ ctx.pos = match.end()
463
+
464
+ if outermost:
465
+ # this is the outer heredoc again, now we can process them all
466
+ for tolerant, hdname in heredocstack:
467
+ lines = []
468
+ for match in line_re.finditer(ctx.text, ctx.pos):
469
+ if tolerant:
470
+ check = match.group().strip()
471
+ else:
472
+ check = match.group().rstrip()
473
+ if check == hdname:
474
+ for amatch in lines:
475
+ yield amatch.start(), String.Heredoc, amatch.group()
476
+ yield match.start(), Name.Constant, match.group()
477
+ ctx.pos = match.end()
478
+ break
479
+ else:
480
+ lines.append(match)
481
+ else:
482
+ # end of heredoc not found -- error!
483
+ for amatch in lines:
484
+ yield amatch.start(), Error, amatch.group()
485
+ ctx.end = len(ctx.text)
486
+ del heredocstack[:]
487
+
488
+
489
+ def gen_rubystrings_rules():
490
+ def intp_regex_callback(self, match, ctx):
491
+ yield match.start(1), String.Regex, match.group(1) # begin
492
+ nctx = LexerContext(match.group(3), 0, ['interpolated-regex'])
493
+ for i, t, v in self.get_tokens_unprocessed(context=nctx):
494
+ yield match.start(3)+i, t, v
495
+ yield match.start(4), String.Regex, match.group(4) # end[mixounse]*
496
+ ctx.pos = match.end()
497
+
498
+ def intp_string_callback(self, match, ctx):
499
+ yield match.start(1), String.Other, match.group(1)
500
+ nctx = LexerContext(match.group(3), 0, ['interpolated-string'])
501
+ for i, t, v in self.get_tokens_unprocessed(context=nctx):
502
+ yield match.start(3)+i, t, v
503
+ yield match.start(4), String.Other, match.group(4) # end
504
+ ctx.pos = match.end()
505
+
506
+ states = {}
507
+ states['strings'] = [
508
+ # easy ones
509
+ (r'\:@{0,2}([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
510
+ r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)', String.Symbol),
511
+ (r":'(\\\\|\\'|[^'])*'", String.Symbol),
512
+ (r"'(\\\\|\\'|[^'])*'", String.Single),
513
+ (r':"', String.Symbol, 'simple-sym'),
514
+ (r'"', String.Double, 'simple-string'),
515
+ (r'(?<!\.)`', String.Backtick, 'simple-backtick'),
516
+ ]
517
+
518
+ # double-quoted string and symbol
519
+ for name, ttype, end in ('string', String.Double, '"'), \
520
+ ('sym', String.Symbol, '"'), \
521
+ ('backtick', String.Backtick, '`'):
522
+ states['simple-'+name] = [
523
+ include('string-intp-escaped'),
524
+ (r'[^\\%s#]+' % end, ttype),
525
+ (r'[\\#]', ttype),
526
+ (end, ttype, '#pop'),
527
+ ]
528
+
529
+ # braced quoted strings
530
+ for lbrace, rbrace, name in ('\\{', '\\}', 'cb'), \
531
+ ('\\[', '\\]', 'sb'), \
532
+ ('\\(', '\\)', 'pa'), \
533
+ ('<', '>', 'ab'):
534
+ states[name+'-intp-string'] = [
535
+ (r'\\[\\' + lbrace + rbrace + ']', String.Other),
536
+ (r'(?<!\\)' + lbrace, String.Other, '#push'),
537
+ (r'(?<!\\)' + rbrace, String.Other, '#pop'),
538
+ include('string-intp-escaped'),
539
+ (r'[\\#' + lbrace + rbrace + ']', String.Other),
540
+ (r'[^\\#' + lbrace + rbrace + ']+', String.Other),
541
+ ]
542
+ states['strings'].append((r'%[QWx]?' + lbrace, String.Other,
543
+ name+'-intp-string'))
544
+ states[name+'-string'] = [
545
+ (r'\\[\\' + lbrace + rbrace + ']', String.Other),
546
+ (r'(?<!\\)' + lbrace, String.Other, '#push'),
547
+ (r'(?<!\\)' + rbrace, String.Other, '#pop'),
548
+ (r'[\\#' + lbrace + rbrace + ']', String.Other),
549
+ (r'[^\\#' + lbrace + rbrace + ']+', String.Other),
550
+ ]
551
+ states['strings'].append((r'%[qsw]' + lbrace, String.Other,
552
+ name+'-string'))
553
+ states[name+'-regex'] = [
554
+ (r'\\[\\' + lbrace + rbrace + ']', String.Regex),
555
+ (r'(?<!\\)' + lbrace, String.Regex, '#push'),
556
+ (r'(?<!\\)' + rbrace + '[mixounse]*', String.Regex, '#pop'),
557
+ include('string-intp'),
558
+ (r'[\\#' + lbrace + rbrace + ']', String.Regex),
559
+ (r'[^\\#' + lbrace + rbrace + ']+', String.Regex),
560
+ ]
561
+ states['strings'].append((r'%r' + lbrace, String.Regex,
562
+ name+'-regex'))
563
+
564
+ # these must come after %<brace>!
565
+ states['strings'] += [
566
+ # %r regex
567
+ (r'(%r([^a-zA-Z0-9]))((?:\\\2|(?!\2).)*)(\2[mixounse]*)',
568
+ intp_regex_callback),
569
+ # regular fancy strings with qsw
570
+ (r'%[qsw]([^a-zA-Z0-9])((?:\\\1|(?!\1).)*)\1', String.Other),
571
+ (r'(%[QWx]([^a-zA-Z0-9]))((?:\\\2|(?!\2).)*)(\2)',
572
+ intp_string_callback),
573
+ # special forms of fancy strings after operators or
574
+ # in method calls with braces
575
+ (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
576
+ bygroups(Text, String.Other, None)),
577
+ # and because of fixed width lookbehinds the whole thing a
578
+ # second time for line startings...
579
+ (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
580
+ bygroups(Text, String.Other, None)),
581
+ # all regular fancy strings without qsw
582
+ (r'(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)',
583
+ intp_string_callback),
584
+ ]
585
+
586
+ return states
587
+
588
+ tokens = {
589
+ 'root': [
590
+ (r'#.*?$', Comment.Single),
591
+ (r'=begin\s.*?\n=end.*?$', Comment.Multiline),
592
+ # keywords
593
+ (r'(BEGIN|END|alias|begin|break|case|defined\?|'
594
+ r'do|else|elsif|end|ensure|for|if|in|next|redo|'
595
+ r'rescue|raise|retry|return|super|then|undef|unless|until|when|'
596
+ r'while|yield)\b', Keyword),
597
+ # start of function, class and module names
598
+ (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*)',
599
+ bygroups(Keyword, Text, Name.Namespace)),
600
+ (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
601
+ (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
602
+ (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
603
+ # special methods
604
+ (r'(initialize|new|loop|include|extend|raise|attr_reader|'
605
+ r'attr_writer|attr_accessor|attr|catch|throw|private|'
606
+ r'module_function|public|protected|true|false|nil)\b',
607
+ Keyword.Pseudo),
608
+ (r'(not|and|or)\b', Operator.Word),
609
+ (r'(autoload|block_given|const_defined|eql|equal|frozen|include|'
610
+ r'instance_of|is_a|iterator|kind_of|method_defined|nil|'
611
+ r'private_method_defined|protected_method_defined|'
612
+ r'public_method_defined|respond_to|tainted)\?', Name.Builtin),
613
+ (r'(chomp|chop|exit|gsub|sub)!', Name.Builtin),
614
+ (r'(?<!\.)(Array|Float|Integer|String|__id__|__send__|abort|'
615
+ r'ancestors|at_exit|autoload|binding|callcc|caller|'
616
+ r'catch|chomp|chop|class_eval|class_variables|'
617
+ r'clone|const_defined\?|const_get|const_missing|const_set|'
618
+ r'constants|display|dup|eval|exec|exit|extend|fail|fork|'
619
+ r'format|freeze|getc|gets|global_variables|gsub|'
620
+ r'hash|id|included_modules|inspect|instance_eval|'
621
+ r'instance_method|instance_methods|'
622
+ r'instance_variable_get|instance_variable_set|instance_variables|'
623
+ r'lambda|load|local_variables|loop|'
624
+ r'method|method_missing|methods|module_eval|name|'
625
+ r'object_id|open|p|print|printf|private_class_method|'
626
+ r'private_instance_methods|'
627
+ r'private_methods|proc|protected_instance_methods|'
628
+ r'protected_methods|public_class_method|'
629
+ r'public_instance_methods|public_methods|'
630
+ r'putc|puts|raise|rand|readline|readlines|require|'
631
+ r'scan|select|self|send|set_trace_func|singleton_methods|sleep|'
632
+ r'split|sprintf|srand|sub|syscall|system|taint|'
633
+ r'test|throw|to_a|to_s|trace_var|trap|untaint|untrace_var|'
634
+ r'warn)\b', Name.Builtin),
635
+ (r'__(FILE|LINE)__\b', Name.Builtin.Pseudo),
636
+ # normal heredocs
637
+ (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)',
638
+ heredoc_callback),
639
+ # empty string heredocs
640
+ (r'(<<-?)("|\')()(\2)(.*?\n)', heredoc_callback),
641
+ (r'__END__', Comment.Preproc, 'end-part'),
642
+ # multiline regex (after keywords or assignments)
643
+ (r'(?:^|(?<=[=<>~!])|'
644
+ r'(?<=(?:\s|;)when\s)|'
645
+ r'(?<=(?:\s|;)or\s)|'
646
+ r'(?<=(?:\s|;)and\s)|'
647
+ r'(?<=(?:\s|;|\.)index\s)|'
648
+ r'(?<=(?:\s|;|\.)scan\s)|'
649
+ r'(?<=(?:\s|;|\.)sub\s)|'
650
+ r'(?<=(?:\s|;|\.)sub!\s)|'
651
+ r'(?<=(?:\s|;|\.)gsub\s)|'
652
+ r'(?<=(?:\s|;|\.)gsub!\s)|'
653
+ r'(?<=(?:\s|;|\.)match\s)|'
654
+ r'(?<=(?:\s|;)if\s)|'
655
+ r'(?<=(?:\s|;)elsif\s)|'
656
+ r'(?<=^when\s)|'
657
+ r'(?<=^index\s)|'
658
+ r'(?<=^scan\s)|'
659
+ r'(?<=^sub\s)|'
660
+ r'(?<=^gsub\s)|'
661
+ r'(?<=^sub!\s)|'
662
+ r'(?<=^gsub!\s)|'
663
+ r'(?<=^match\s)|'
664
+ r'(?<=^if\s)|'
665
+ r'(?<=^elsif\s)'
666
+ r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'),
667
+ # multiline regex (in method calls or subscripts)
668
+ (r'(?<=\(|,|\[)/', String.Regex, 'multiline-regex'),
669
+ # multiline regex (this time the funny no whitespace rule)
670
+ (r'(\s+)(/)(?![\s=])', bygroups(Text, String.Regex),
671
+ 'multiline-regex'),
672
+ # lex numbers and ignore following regular expressions which
673
+ # are division operators in fact (grrrr. i hate that. any
674
+ # better ideas?)
675
+ # since pygments 0.7 we also eat a "?" operator after numbers
676
+ # so that the char operator does not work. Chars are not allowed
677
+ # there so that you can use the ternary operator.
678
+ # stupid example:
679
+ # x>=0?n[x]:""
680
+ (r'(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?',
681
+ bygroups(Number.Oct, Text, Operator)),
682
+ (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?',
683
+ bygroups(Number.Hex, Text, Operator)),
684
+ (r'(0b[01]+(?:_[01]+)*)(\s*)([/?])?',
685
+ bygroups(Number.Bin, Text, Operator)),
686
+ (r'([\d]+(?:_\d+)*)(\s*)([/?])?',
687
+ bygroups(Number.Integer, Text, Operator)),
688
+ # Names
689
+ (r'@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
690
+ (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
691
+ (r'\$[a-zA-Z0-9_]+', Name.Variable.Global),
692
+ (r'\$[!@&`\'+~=/\\,;.<>_*$?:"]', Name.Variable.Global),
693
+ (r'\$-[0adFiIlpvw]', Name.Variable.Global),
694
+ (r'::', Operator),
695
+ include('strings'),
696
+ # chars
697
+ (r'\?(\\[MC]-)*' # modifiers
698
+ r'(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)'
699
+ r'(?!\w)',
700
+ String.Char),
701
+ (r'[A-Z][a-zA-Z0-9_]+', Name.Constant),
702
+ # this is needed because ruby attributes can look
703
+ # like keywords (class) or like this: ` ?!?
704
+ (r'(\.|::)([a-zA-Z_]\w*[\!\?]?|[*%&^`~+-/\[<>=])',
705
+ bygroups(Operator, Name)),
706
+ (r'[a-zA-Z_]\w*[\!\?]?', Name),
707
+ (r'(\[|\]|\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|'
708
+ r'!~|&&?|\|\||\.{1,3})', Operator),
709
+ (r'[-+/*%=<>&!^|~]=?', Operator),
710
+ (r'[(){};,/?:\\]', Punctuation),
711
+ (r'\s+', Text)
712
+ ],
713
+ 'funcname': [
714
+ (r'\(', Punctuation, 'defexpr'),
715
+ (r'(?:([a-zA-Z_][a-zA-Z0-9_]*)(\.))?'
716
+ r'([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
717
+ r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
718
+ bygroups(Name.Class, Operator, Name.Function), '#pop'),
719
+ (r'', Text, '#pop')
720
+ ],
721
+ 'classname': [
722
+ (r'\(', Punctuation, 'defexpr'),
723
+ (r'<<', Operator, '#pop'),
724
+ (r'[A-Z_]\w*', Name.Class, '#pop'),
725
+ (r'', Text, '#pop')
726
+ ],
727
+ 'defexpr': [
728
+ (r'(\))(\.|::)?', bygroups(Punctuation, Operator), '#pop'),
729
+ (r'\(', Operator, '#push'),
730
+ include('root')
731
+ ],
732
+ 'in-intp': [
733
+ ('}', String.Interpol, '#pop'),
734
+ include('root'),
735
+ ],
736
+ 'string-intp': [
737
+ (r'#{', String.Interpol, 'in-intp'),
738
+ (r'#@@?[a-zA-Z_][a-zA-Z0-9_]*', String.Interpol),
739
+ (r'#\$[a-zA-Z_][a-zA-Z0-9_]*', String.Interpol)
740
+ ],
741
+ 'string-intp-escaped': [
742
+ include('string-intp'),
743
+ (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})',
744
+ String.Escape)
745
+ ],
746
+ 'interpolated-regex': [
747
+ include('string-intp'),
748
+ (r'[\\#]', String.Regex),
749
+ (r'[^\\#]+', String.Regex),
750
+ ],
751
+ 'interpolated-string': [
752
+ include('string-intp'),
753
+ (r'[\\#]', String.Other),
754
+ (r'[^\\#]+', String.Other),
755
+ ],
756
+ 'multiline-regex': [
757
+ include('string-intp'),
758
+ (r'\\\\', String.Regex),
759
+ (r'\\/', String.Regex),
760
+ (r'[\\#]', String.Regex),
761
+ (r'[^\\/#]+', String.Regex),
762
+ (r'/[mixounse]*', String.Regex, '#pop'),
763
+ ],
764
+ 'end-part': [
765
+ (r'.+', Comment.Preproc, '#pop')
766
+ ]
767
+ }
768
+ tokens.update(gen_rubystrings_rules())
769
+
770
+ def analyse_text(text):
771
+ return shebang_matches(text, r'ruby(1\.\d)?')
772
+
773
+
774
+ class RubyConsoleLexer(Lexer):
775
+ """
776
+ For Ruby interactive console (**irb**) output like:
777
+
778
+ .. sourcecode:: rbcon
779
+
780
+ irb(main):001:0> a = 1
781
+ => 1
782
+ irb(main):002:0> puts a
783
+ 1
784
+ => nil
785
+ """
786
+ name = 'Ruby irb session'
787
+ aliases = ['rbcon', 'irb']
788
+ mimetypes = ['text/x-ruby-shellsession']
789
+
790
+ _prompt_re = re.compile('irb\([a-zA-Z_][a-zA-Z0-9_]*\):\d{3}:\d+[>*"\'] '
791
+ '|>> |\?> ')
792
+
793
+ def get_tokens_unprocessed(self, text):
794
+ rblexer = RubyLexer(**self.options)
795
+
796
+ curcode = ''
797
+ insertions = []
798
+ for match in line_re.finditer(text):
799
+ line = match.group()
800
+ m = self._prompt_re.match(line)
801
+ if m is not None:
802
+ end = m.end()
803
+ insertions.append((len(curcode),
804
+ [(0, Generic.Prompt, line[:end])]))
805
+ curcode += line[end:]
806
+ else:
807
+ if curcode:
808
+ for item in do_insertions(insertions,
809
+ rblexer.get_tokens_unprocessed(curcode)):
810
+ yield item
811
+ curcode = ''
812
+ insertions = []
813
+ yield match.start(), Generic.Output, line
814
+ if curcode:
815
+ for item in do_insertions(insertions,
816
+ rblexer.get_tokens_unprocessed(curcode)):
817
+ yield item
818
+
819
+
820
+ class PerlLexer(RegexLexer):
821
+ """
822
+ For `Perl <http://www.perl.org>`_ source code.
823
+ """
824
+
825
+ name = 'Perl'
826
+ aliases = ['perl', 'pl']
827
+ filenames = ['*.pl', '*.pm']
828
+ mimetypes = ['text/x-perl', 'application/x-perl']
829
+
830
+ flags = re.DOTALL | re.MULTILINE
831
+ # TODO: give this to a perl guy who knows how to parse perl...
832
+ tokens = {
833
+ 'balanced-regex': [
834
+ (r'/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', String.Regex, '#pop'),
835
+ (r'!(\\\\|\\[^\\]|[^\\!])*![egimosx]*', String.Regex, '#pop'),
836
+ (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'),
837
+ (r'{(\\\\|\\[^\\]|[^\\}])*}[egimosx]*', String.Regex, '#pop'),
838
+ (r'<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*', String.Regex, '#pop'),
839
+ (r'\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*', String.Regex, '#pop'),
840
+ (r'\((\\\\|\\[^\\]|[^\\\)])*\)[egimosx]*', String.Regex, '#pop'),
841
+ (r'@(\\\\|\\[^\\]|[^\\\@])*@[egimosx]*', String.Regex, '#pop'),
842
+ (r'%(\\\\|\\[^\\]|[^\\\%])*%[egimosx]*', String.Regex, '#pop'),
843
+ (r'\$(\\\\|\\[^\\]|[^\\\$])*\$[egimosx]*', String.Regex, '#pop'),
844
+ ],
845
+ 'root': [
846
+ (r'\#.*?$', Comment.Single),
847
+ (r'^=[a-zA-Z0-9]+\s+.*?\n=cut', Comment.Multiline),
848
+ (r'(case|continue|do|else|elsif|for|foreach|if|last|my|'
849
+ r'next|our|redo|reset|then|unless|until|while|use|'
850
+ r'print|new|BEGIN|CHECK|INIT|END|return)\b', Keyword),
851
+ (r'(format)(\s+)([a-zA-Z0-9_]+)(\s*)(=)(\s*\n)',
852
+ bygroups(Keyword, Text, Name, Text, Punctuation, Text), 'format'),
853
+ (r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word),
854
+ # common delimiters
855
+ (r's/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*',
856
+ String.Regex),
857
+ (r's!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*', String.Regex),
858
+ (r's\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*', String.Regex),
859
+ (r's@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*',
860
+ String.Regex),
861
+ (r's%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*',
862
+ String.Regex),
863
+ # balanced delimiters
864
+ (r's{(\\\\|\\[^\\]|[^\\}])*}\s*', String.Regex, 'balanced-regex'),
865
+ (r's<(\\\\|\\[^\\]|[^\\>])*>\s*', String.Regex, 'balanced-regex'),
866
+ (r's\[(\\\\|\\[^\\]|[^\\\]])*\]\s*', String.Regex,
867
+ 'balanced-regex'),
868
+ (r's\((\\\\|\\[^\\]|[^\\\)])*\)\s*', String.Regex,
869
+ 'balanced-regex'),
870
+
871
+ (r'm?/(\\\\|\\[^\\]|[^\\/\n])*/[gcimosx]*', String.Regex),
872
+ (r'm(?=[/!\\{<\[\(@%\$])', String.Regex, 'balanced-regex'),
873
+ (r'((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*',
874
+ String.Regex),
875
+ (r'\s+', Text),
876
+ (r'(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|'
877
+ r'chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|'
878
+ r'continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|'
879
+ r'dump|each|endgrent|endhostent|endnetent|endprotoent|'
880
+ r'endpwent|endservent|eof|eval|exec|exists|exit|exp|fcntl|'
881
+ r'fileno|flock|fork|format|formline|getc|getgrent|getgrgid|'
882
+ r'getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|'
883
+ r'getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|'
884
+ r'getppid|getpriority|getprotobyname|getprotobynumber|'
885
+ r'getprotoent|getpwent|getpwnam|getpwuid|getservbyname|'
886
+ r'getservbyport|getservent|getsockname|getsockopt|glob|gmtime|'
887
+ r'goto|grep|hex|import|index|int|ioctl|join|keys|kill|last|'
888
+ r'lc|lcfirst|length|link|listen|local|localtime|log|lstat|'
889
+ r'map|mkdir|msgctl|msgget|msgrcv|msgsnd|my|next|no|oct|open|'
890
+ r'opendir|ord|our|pack|package|pipe|pop|pos|printf|'
891
+ r'prototype|push|quotemeta|rand|read|readdir|'
892
+ r'readline|readlink|readpipe|recv|redo|ref|rename|require|'
893
+ r'reverse|rewinddir|rindex|rmdir|scalar|seek|seekdir|'
894
+ r'select|semctl|semget|semop|send|setgrent|sethostent|setnetent|'
895
+ r'setpgrp|setpriority|setprotoent|setpwent|setservent|'
896
+ r'setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|'
897
+ r'sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|'
898
+ r'srand|stat|study|substr|symlink|syscall|sysopen|sysread|'
899
+ r'sysseek|system|syswrite|tell|telldir|tie|tied|time|times|tr|'
900
+ r'truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|'
901
+ r'utime|values|vec|wait|waitpid|wantarray|warn|write'
902
+ r')\b', Name.Builtin),
903
+ (r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo),
904
+ (r'<<([\'"]?)([a-zA-Z_][a-zA-Z0-9_]*)\1;?\n.*?\n\2\n', String),
905
+ (r'__END__', Comment.Preproc, 'end-part'),
906
+ (r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global),
907
+ (r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global),
908
+ (r'[$@%#]+', Name.Variable, 'varname'),
909
+ (r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
910
+ (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
911
+ (r'0b[01]+(_[01]+)*', Number.Bin),
912
+ (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
913
+ Number.Float),
914
+ (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
915
+ (r'\d+(_\d+)*', Number.Integer),
916
+ (r"'(\\\\|\\[^\\]|[^'\\])*'", String),
917
+ (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
918
+ (r'`(\\\\|\\[^\\]|[^`\\])*`', String.Backtick),
919
+ (r'<([^\s>]+)>', String.Regex),
920
+ (r'(q|qq|qw|qr|qx)\{', String.Other, 'cb-string'),
921
+ (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'),
922
+ (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'),
923
+ (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'),
924
+ (r'(q|qq|qw|qr|qx)([^a-zA-Z0-9])(.|\n)*?\2', String.Other),
925
+ (r'package\s+', Keyword, 'modulename'),
926
+ (r'sub\s+', Keyword, 'funcname'),
927
+ (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|'
928
+ r'!~|&&?|\|\||\.{1,3})', Operator),
929
+ (r'[-+/*%=<>&^|!\\~]=?', Operator),
930
+ (r'[\(\)\[\]:;,<>/\?\{\}]', Punctuation), # yes, there's no shortage
931
+ # of punctuation in Perl!
932
+ (r'(?=\w)', Name, 'name'),
933
+ ],
934
+ 'format': [
935
+ (r'\.\n', String.Interpol, '#pop'),
936
+ (r'[^\n]*\n', String.Interpol),
937
+ ],
938
+ 'varname': [
939
+ (r'\s+', Text),
940
+ (r'\{', Punctuation, '#pop'), # hash syntax?
941
+ (r'\)|,', Punctuation, '#pop'), # argument specifier
942
+ (r'[a-zA-Z0-9_]+::', Name.Namespace),
943
+ (r'[a-zA-Z0-9_:]+', Name.Variable, '#pop'),
944
+ ],
945
+ 'name': [
946
+ (r'[a-zA-Z0-9_]+::', Name.Namespace),
947
+ (r'[a-zA-Z0-9_:]+', Name, '#pop'),
948
+ (r'[A-Z_]+(?=[^a-zA-Z0-9_])', Name.Constant, '#pop'),
949
+ (r'(?=[^a-zA-Z0-9_])', Text, '#pop'),
950
+ ],
951
+ 'modulename': [
952
+ (r'[a-zA-Z_]\w*', Name.Namespace, '#pop')
953
+ ],
954
+ 'funcname': [
955
+ (r'[a-zA-Z_]\w*[\!\?]?', Name.Function),
956
+ (r'\s+', Text),
957
+ # argument declaration
958
+ (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)),
959
+ (r'.*?{', Punctuation, '#pop'),
960
+ (r';', Punctuation, '#pop'),
961
+ ],
962
+ 'cb-string': [
963
+ (r'\\[\{\}\\]', String.Other),
964
+ (r'\\', String.Other),
965
+ (r'\{', String.Other, 'cb-string'),
966
+ (r'\}', String.Other, '#pop'),
967
+ (r'[^\{\}\\]+', String.Other)
968
+ ],
969
+ 'rb-string': [
970
+ (r'\\[\(\)\\]', String.Other),
971
+ (r'\\', String.Other),
972
+ (r'\(', String.Other, 'rb-string'),
973
+ (r'\)', String.Other, '#pop'),
974
+ (r'[^\(\)]+', String.Other)
975
+ ],
976
+ 'sb-string': [
977
+ (r'\\[\[\]\\]', String.Other),
978
+ (r'\\', String.Other),
979
+ (r'\[', String.Other, 'sb-string'),
980
+ (r'\]', String.Other, '#pop'),
981
+ (r'[^\[\]]+', String.Other)
982
+ ],
983
+ 'lt-string': [
984
+ (r'\\[\<\>\\]', String.Other),
985
+ (r'\\', String.Other),
986
+ (r'\<', String.Other, 'lt-string'),
987
+ (r'\>', String.Other, '#pop'),
988
+ (r'[^\<\>]+', String.Other)
989
+ ],
990
+ 'end-part': [
991
+ (r'.+', Comment.Preproc, '#pop')
992
+ ]
993
+ }
994
+
995
+ def analyse_text(text):
996
+ if shebang_matches(text, r'perl'):
997
+ return True
998
+ if 'my $' in text:
999
+ return 0.9
1000
+ return 0.1 # who knows, might still be perl!
1001
+
1002
+
1003
+ class LuaLexer(RegexLexer):
1004
+ """
1005
+ For `Lua <http://www.lua.org>`_ source code.
1006
+
1007
+ Additional options accepted:
1008
+
1009
+ `func_name_highlighting`
1010
+ If given and ``True``, highlight builtin function names
1011
+ (default: ``True``).
1012
+ `disabled_modules`
1013
+ If given, must be a list of module names whose function names
1014
+ should not be highlighted. By default all modules are highlighted.
1015
+
1016
+ To get a list of allowed modules have a look into the
1017
+ `_luabuiltins` module:
1018
+
1019
+ .. sourcecode:: pycon
1020
+
1021
+ >>> from pygments.lexers._luabuiltins import MODULES
1022
+ >>> MODULES.keys()
1023
+ ['string', 'coroutine', 'modules', 'io', 'basic', ...]
1024
+ """
1025
+
1026
+ name = 'Lua'
1027
+ aliases = ['lua']
1028
+ filenames = ['*.lua', '*.wlua']
1029
+ mimetypes = ['text/x-lua', 'application/x-lua']
1030
+
1031
+ tokens = {
1032
+ 'root': [
1033
+ # lua allows a file to start with a shebang
1034
+ (r'#!(.*?)$', Comment.Preproc),
1035
+ (r'', Text, 'base'),
1036
+ ],
1037
+ 'base': [
1038
+ (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline),
1039
+ ('--.*$', Comment.Single),
1040
+
1041
+ (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float),
1042
+ (r'(?i)\d+e[+-]?\d+', Number.Float),
1043
+ ('(?i)0x[0-9a-f]*', Number.Hex),
1044
+ (r'\d+', Number.Integer),
1045
+
1046
+ (r'\n', Text),
1047
+ (r'[^\S\n]', Text),
1048
+ # multiline strings
1049
+ (r'(?s)\[(=*)\[.*?\]\1\]', String),
1050
+
1051
+ (r'(==|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#])', Operator),
1052
+ (r'[\[\]\{\}\(\)\.,:;]', Punctuation),
1053
+ (r'(and|or|not)\b', Operator.Word),
1054
+
1055
+ ('(break|do|else|elseif|end|for|if|in|repeat|return|then|until|'
1056
+ r'while)\b', Keyword),
1057
+ (r'(local)\b', Keyword.Declaration),
1058
+ (r'(true|false|nil)\b', Keyword.Constant),
1059
+
1060
+ (r'(function)\b', Keyword, 'funcname'),
1061
+
1062
+ (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
1063
+
1064
+ ("'", String.Single, combined('stringescape', 'sqs')),
1065
+ ('"', String.Double, combined('stringescape', 'dqs'))
1066
+ ],
1067
+
1068
+ 'funcname': [
1069
+ (r'\s+', Text),
1070
+ ('(?:([A-Za-z_][A-Za-z0-9_]*)(\.))?([A-Za-z_][A-Za-z0-9_]*)',
1071
+ bygroups(Name.Class, Punctuation, Name.Function), '#pop'),
1072
+ # inline function
1073
+ ('\(', Punctuation, '#pop'),
1074
+ ],
1075
+
1076
+ # if I understand correctly, every character is valid in a lua string,
1077
+ # so this state is only for later corrections
1078
+ 'string': [
1079
+ ('.', String)
1080
+ ],
1081
+
1082
+ 'stringescape': [
1083
+ (r'''\\([abfnrtv\\"']|\d{1,3})''', String.Escape)
1084
+ ],
1085
+
1086
+ 'sqs': [
1087
+ ("'", String, '#pop'),
1088
+ include('string')
1089
+ ],
1090
+
1091
+ 'dqs': [
1092
+ ('"', String, '#pop'),
1093
+ include('string')
1094
+ ]
1095
+ }
1096
+
1097
+ def __init__(self, **options):
1098
+ self.func_name_highlighting = get_bool_opt(
1099
+ options, 'func_name_highlighting', True)
1100
+ self.disabled_modules = get_list_opt(options, 'disabled_modules', [])
1101
+
1102
+ self._functions = set()
1103
+ if self.func_name_highlighting:
1104
+ from pygments.lexers._luabuiltins import MODULES
1105
+ for mod, func in MODULES.iteritems():
1106
+ if mod not in self.disabled_modules:
1107
+ self._functions.update(func)
1108
+ RegexLexer.__init__(self, **options)
1109
+
1110
+ def get_tokens_unprocessed(self, text):
1111
+ for index, token, value in \
1112
+ RegexLexer.get_tokens_unprocessed(self, text):
1113
+ if token is Name:
1114
+ if value in self._functions:
1115
+ yield index, Name.Builtin, value
1116
+ continue
1117
+ elif '.' in value:
1118
+ a, b = value.split('.')
1119
+ yield index, Name, a
1120
+ yield index + len(a), Punctuation, u'.'
1121
+ yield index + len(a) + 1, Name, b
1122
+ continue
1123
+ yield index, token, value
1124
+
1125
+
1126
+ class MoonScriptLexer(LuaLexer):
1127
+ """
1128
+ For `MoonScript <http://moonscript.org.org>`_ source code.
1129
+
1130
+ *New in Pygments 1.5.*
1131
+ """
1132
+
1133
+ name = "MoonScript"
1134
+ aliases = ["moon", "moonscript"]
1135
+ filenames = ["*.moon"]
1136
+ mimetypes = ['text/x-moonscript', 'application/x-moonscript']
1137
+
1138
+ tokens = {
1139
+ 'root': [
1140
+ (r'#!(.*?)$', Comment.Preproc),
1141
+ (r'', Text, 'base'),
1142
+ ],
1143
+ 'base': [
1144
+ ('--.*$', Comment.Single),
1145
+ (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float),
1146
+ (r'(?i)\d+e[+-]?\d+', Number.Float),
1147
+ (r'(?i)0x[0-9a-f]*', Number.Hex),
1148
+ (r'\d+', Number.Integer),
1149
+ (r'\n', Text),
1150
+ (r'[^\S\n]+', Text),
1151
+ (r'(?s)\[(=*)\[.*?\]\1\]', String),
1152
+ (r'(->|=>)', Name.Function),
1153
+ (r':[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
1154
+ (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator),
1155
+ (r'[;,]', Punctuation),
1156
+ (r'[\[\]\{\}\(\)]', Keyword.Type),
1157
+ (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Variable),
1158
+ (r"(class|extends|if|then|super|do|with|import|export|"
1159
+ r"while|elseif|return|for|in|from|when|using|else|"
1160
+ r"and|or|not|switch|break)\b", Keyword),
1161
+ (r'(true|false|nil)\b', Keyword.Constant),
1162
+ (r'(and|or|not)\b', Operator.Word),
1163
+ (r'(self)\b', Name.Builtin.Pseudo),
1164
+ (r'@@?([a-zA-Z_][a-zA-Z0-9_]*)?', Name.Variable.Class),
1165
+ (r'[A-Z]\w*', Name.Class), # proper name
1166
+ (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
1167
+ ("'", String.Single, combined('stringescape', 'sqs')),
1168
+ ('"', String.Double, combined('stringescape', 'dqs'))
1169
+ ],
1170
+ 'stringescape': [
1171
+ (r'''\\([abfnrtv\\"']|\d{1,3})''', String.Escape)
1172
+ ],
1173
+ 'sqs': [
1174
+ ("'", String.Single, '#pop'),
1175
+ (".", String)
1176
+ ],
1177
+ 'dqs': [
1178
+ ('"', String.Double, '#pop'),
1179
+ (".", String)
1180
+ ]
1181
+ }
1182
+
1183
+ def get_tokens_unprocessed(self, text):
1184
+ # set . as Operator instead of Punctuation
1185
+ for index, token, value in \
1186
+ LuaLexer.get_tokens_unprocessed(self, text):
1187
+ if token == Punctuation and value == ".":
1188
+ token = Operator
1189
+ yield index, token, value
1190
+
1191
+
1192
+
1193
+ class MiniDLexer(RegexLexer):
1194
+ """
1195
+ For `MiniD <http://www.dsource.org/projects/minid>`_ (a D-like scripting
1196
+ language) source.
1197
+ """
1198
+ name = 'MiniD'
1199
+ filenames = ['*.md']
1200
+ aliases = ['minid']
1201
+ mimetypes = ['text/x-minidsrc']
1202
+
1203
+ tokens = {
1204
+ 'root': [
1205
+ (r'\n', Text),
1206
+ (r'\s+', Text),
1207
+ # Comments
1208
+ (r'//(.*?)\n', Comment.Single),
1209
+ (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
1210
+ (r'/\+', Comment.Multiline, 'nestedcomment'),
1211
+ # Keywords
1212
+ (r'(as|assert|break|case|catch|class|continue|coroutine|default'
1213
+ r'|do|else|finally|for|foreach|function|global|namespace'
1214
+ r'|if|import|in|is|local|module|return|super|switch'
1215
+ r'|this|throw|try|vararg|while|with|yield)\b', Keyword),
1216
+ (r'(false|true|null)\b', Keyword.Constant),
1217
+ # FloatLiteral
1218
+ (r'([0-9][0-9_]*)?\.[0-9_]+([eE][+\-]?[0-9_]+)?', Number.Float),
1219
+ # IntegerLiteral
1220
+ # -- Binary
1221
+ (r'0[Bb][01_]+', Number),
1222
+ # -- Octal
1223
+ (r'0[Cc][0-7_]+', Number.Oct),
1224
+ # -- Hexadecimal
1225
+ (r'0[xX][0-9a-fA-F_]+', Number.Hex),
1226
+ # -- Decimal
1227
+ (r'(0|[1-9][0-9_]*)', Number.Integer),
1228
+ # CharacterLiteral
1229
+ (r"""'(\\['"?\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-9]{1,3}"""
1230
+ r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|.)'""",
1231
+ String.Char
1232
+ ),
1233
+ # StringLiteral
1234
+ # -- WysiwygString
1235
+ (r'@"(""|[^"])*"', String),
1236
+ # -- AlternateWysiwygString
1237
+ (r'`(``|.)*`', String),
1238
+ # -- DoubleQuotedString
1239
+ (r'"(\\\\|\\"|[^"])*"', String),
1240
+ # Tokens
1241
+ (
1242
+ r'(~=|\^=|%=|\*=|==|!=|>>>=|>>>|>>=|>>|>=|<=>|\?=|-\>'
1243
+ r'|<<=|<<|<=|\+\+|\+=|--|-=|\|\||\|=|&&|&=|\.\.|/=)'
1244
+ r'|[-/.&$@|\+<>!()\[\]{}?,;:=*%^~#\\]', Punctuation
1245
+ ),
1246
+ # Identifier
1247
+ (r'[a-zA-Z_]\w*', Name),
1248
+ ],
1249
+ 'nestedcomment': [
1250
+ (r'[^+/]+', Comment.Multiline),
1251
+ (r'/\+', Comment.Multiline, '#push'),
1252
+ (r'\+/', Comment.Multiline, '#pop'),
1253
+ (r'[+/]', Comment.Multiline),
1254
+ ],
1255
+ }
1256
+
1257
+
1258
+ class IoLexer(RegexLexer):
1259
+ """
1260
+ For `Io <http://iolanguage.com/>`_ (a small, prototype-based
1261
+ programming language) source.
1262
+
1263
+ *New in Pygments 0.10.*
1264
+ """
1265
+ name = 'Io'
1266
+ filenames = ['*.io']
1267
+ aliases = ['io']
1268
+ mimetypes = ['text/x-iosrc']
1269
+ tokens = {
1270
+ 'root': [
1271
+ (r'\n', Text),
1272
+ (r'\s+', Text),
1273
+ # Comments
1274
+ (r'//(.*?)\n', Comment.Single),
1275
+ (r'#(.*?)\n', Comment.Single),
1276
+ (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
1277
+ (r'/\+', Comment.Multiline, 'nestedcomment'),
1278
+ # DoubleQuotedString
1279
+ (r'"(\\\\|\\"|[^"])*"', String),
1280
+ # Operators
1281
+ (r'::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}',
1282
+ Operator),
1283
+ # keywords
1284
+ (r'(clone|do|doFile|doString|method|for|if|else|elseif|then)\b',
1285
+ Keyword),
1286
+ # constants
1287
+ (r'(nil|false|true)\b', Name.Constant),
1288
+ # names
1289
+ (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
1290
+ Name.Builtin),
1291
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1292
+ # numbers
1293
+ (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
1294
+ (r'\d+', Number.Integer)
1295
+ ],
1296
+ 'nestedcomment': [
1297
+ (r'[^+/]+', Comment.Multiline),
1298
+ (r'/\+', Comment.Multiline, '#push'),
1299
+ (r'\+/', Comment.Multiline, '#pop'),
1300
+ (r'[+/]', Comment.Multiline),
1301
+ ]
1302
+ }
1303
+
1304
+
1305
+ class TclLexer(RegexLexer):
1306
+ """
1307
+ For Tcl source code.
1308
+
1309
+ *New in Pygments 0.10.*
1310
+ """
1311
+
1312
+ keyword_cmds_re = (
1313
+ r'\b(after|apply|array|break|catch|continue|elseif|else|error|'
1314
+ r'eval|expr|for|foreach|global|if|namespace|proc|rename|return|'
1315
+ r'set|switch|then|trace|unset|update|uplevel|upvar|variable|'
1316
+ r'vwait|while)\b'
1317
+ )
1318
+
1319
+ builtin_cmds_re = (
1320
+ r'\b(append|bgerror|binary|cd|chan|clock|close|concat|dde|dict|'
1321
+ r'encoding|eof|exec|exit|fblocked|fconfigure|fcopy|file|'
1322
+ r'fileevent|flush|format|gets|glob|history|http|incr|info|interp|'
1323
+ r'join|lappend|lassign|lindex|linsert|list|llength|load|loadTk|'
1324
+ r'lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|mathfunc|'
1325
+ r'mathop|memory|msgcat|open|package|pid|pkg::create|pkg_mkIndex|'
1326
+ r'platform|platform::shell|puts|pwd|re_syntax|read|refchan|'
1327
+ r'regexp|registry|regsub|scan|seek|socket|source|split|string|'
1328
+ r'subst|tell|time|tm|unknown|unload)\b'
1329
+ )
1330
+
1331
+ name = 'Tcl'
1332
+ aliases = ['tcl']
1333
+ filenames = ['*.tcl']
1334
+ mimetypes = ['text/x-tcl', 'text/x-script.tcl', 'application/x-tcl']
1335
+
1336
+ def _gen_command_rules(keyword_cmds_re, builtin_cmds_re, context=""):
1337
+ return [
1338
+ (keyword_cmds_re, Keyword, 'params' + context),
1339
+ (builtin_cmds_re, Name.Builtin, 'params' + context),
1340
+ (r'([\w\.\-]+)', Name.Variable, 'params' + context),
1341
+ (r'#', Comment, 'comment'),
1342
+ ]
1343
+
1344
+ tokens = {
1345
+ 'root': [
1346
+ include('command'),
1347
+ include('basic'),
1348
+ include('data'),
1349
+ (r'}', Keyword), # HACK: somehow we miscounted our braces
1350
+ ],
1351
+ 'command': _gen_command_rules(keyword_cmds_re, builtin_cmds_re),
1352
+ 'command-in-brace': _gen_command_rules(keyword_cmds_re,
1353
+ builtin_cmds_re,
1354
+ "-in-brace"),
1355
+ 'command-in-bracket': _gen_command_rules(keyword_cmds_re,
1356
+ builtin_cmds_re,
1357
+ "-in-bracket"),
1358
+ 'command-in-paren': _gen_command_rules(keyword_cmds_re,
1359
+ builtin_cmds_re,
1360
+ "-in-paren"),
1361
+ 'basic': [
1362
+ (r'\(', Keyword, 'paren'),
1363
+ (r'\[', Keyword, 'bracket'),
1364
+ (r'\{', Keyword, 'brace'),
1365
+ (r'"', String.Double, 'string'),
1366
+ (r'(eq|ne|in|ni)\b', Operator.Word),
1367
+ (r'!=|==|<<|>>|<=|>=|&&|\|\||\*\*|[-+~!*/%<>&^|?:]', Operator),
1368
+ ],
1369
+ 'data': [
1370
+ (r'\s+', Text),
1371
+ (r'0x[a-fA-F0-9]+', Number.Hex),
1372
+ (r'0[0-7]+', Number.Oct),
1373
+ (r'\d+\.\d+', Number.Float),
1374
+ (r'\d+', Number.Integer),
1375
+ (r'\$([\w\.\-\:]+)', Name.Variable),
1376
+ (r'([\w\.\-\:]+)', Text),
1377
+ ],
1378
+ 'params': [
1379
+ (r';', Keyword, '#pop'),
1380
+ (r'\n', Text, '#pop'),
1381
+ (r'(else|elseif|then)\b', Keyword),
1382
+ include('basic'),
1383
+ include('data'),
1384
+ ],
1385
+ 'params-in-brace': [
1386
+ (r'}', Keyword, ('#pop', '#pop')),
1387
+ include('params')
1388
+ ],
1389
+ 'params-in-paren': [
1390
+ (r'\)', Keyword, ('#pop', '#pop')),
1391
+ include('params')
1392
+ ],
1393
+ 'params-in-bracket': [
1394
+ (r'\]', Keyword, ('#pop', '#pop')),
1395
+ include('params')
1396
+ ],
1397
+ 'string': [
1398
+ (r'\[', String.Double, 'string-square'),
1399
+ (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\])', String.Double),
1400
+ (r'"', String.Double, '#pop')
1401
+ ],
1402
+ 'string-square': [
1403
+ (r'\[', String.Double, 'string-square'),
1404
+ (r'(?s)(\\\\|\\[0-7]+|\\.|\\\n|[^\]\\])', String.Double),
1405
+ (r'\]', String.Double, '#pop')
1406
+ ],
1407
+ 'brace': [
1408
+ (r'}', Keyword, '#pop'),
1409
+ include('command-in-brace'),
1410
+ include('basic'),
1411
+ include('data'),
1412
+ ],
1413
+ 'paren': [
1414
+ (r'\)', Keyword, '#pop'),
1415
+ include('command-in-paren'),
1416
+ include('basic'),
1417
+ include('data'),
1418
+ ],
1419
+ 'bracket': [
1420
+ (r'\]', Keyword, '#pop'),
1421
+ include('command-in-bracket'),
1422
+ include('basic'),
1423
+ include('data'),
1424
+ ],
1425
+ 'comment': [
1426
+ (r'.*[^\\]\n', Comment, '#pop'),
1427
+ (r'.*\\\n', Comment),
1428
+ ],
1429
+ }
1430
+
1431
+ def analyse_text(text):
1432
+ return shebang_matches(text, r'(tcl)')
1433
+
1434
+
1435
+ class FactorLexer(RegexLexer):
1436
+ """
1437
+ Lexer for the `Factor <http://factorcode.org>`_ language.
1438
+
1439
+ *New in Pygments 1.4.*
1440
+ """
1441
+ name = 'Factor'
1442
+ aliases = ['factor']
1443
+ filenames = ['*.factor']
1444
+ mimetypes = ['text/x-factor']
1445
+
1446
+ flags = re.MULTILINE | re.UNICODE
1447
+
1448
+ builtin_kernel = (
1449
+ r'(?:or|2bi|2tri|while|wrapper|nip|4dip|wrapper\\?|bi\\*|'
1450
+ r'callstack>array|both\\?|hashcode|die|dupd|callstack|'
1451
+ r'callstack\\?|3dup|tri@|pick|curry|build|\\?execute|3bi|'
1452
+ r'prepose|>boolean|\\?if|clone|eq\\?|tri\\*|\\?|=|swapd|'
1453
+ r'2over|2keep|3keep|clear|2dup|when|not|tuple\\?|dup|2bi\\*|'
1454
+ r'2tri\\*|call|tri-curry|object|bi@|do|unless\\*|if\\*|loop|'
1455
+ r'bi-curry\\*|drop|when\\*|assert=|retainstack|assert\\?|-rot|'
1456
+ r'execute|2bi@|2tri@|boa|with|either\\?|3drop|bi|curry\\?|'
1457
+ r'datastack|until|3dip|over|3curry|tri-curry\\*|tri-curry@|swap|'
1458
+ r'and|2nip|throw|bi-curry|\\(clone\\)|hashcode\\*|compose|2dip|if|3tri|'
1459
+ r'unless|compose\\?|tuple|keep|2curry|equal\\?|assert|tri|2drop|'
1460
+ r'most|<wrapper>|boolean\\?|identity-hashcode|identity-tuple\\?|'
1461
+ r'null|new|dip|bi-curry@|rot|xor|identity-tuple|boolean)\s'
1462
+ )
1463
+
1464
+ builtin_assocs = (
1465
+ r'(?:\\?at|assoc\\?|assoc-clone-like|assoc=|delete-at\\*|'
1466
+ r'assoc-partition|extract-keys|new-assoc|value\\?|assoc-size|'
1467
+ r'map>assoc|push-at|assoc-like|key\\?|assoc-intersect|'
1468
+ r'assoc-refine|update|assoc-union|assoc-combine|at\\*|'
1469
+ r'assoc-empty\\?|at\\+|set-at|assoc-all\\?|assoc-subset\\?|'
1470
+ r'assoc-hashcode|change-at|assoc-each|assoc-diff|zip|values|'
1471
+ r'value-at|rename-at|inc-at|enum\\?|at|cache|assoc>map|<enum>|'
1472
+ r'assoc|assoc-map|enum|value-at\\*|assoc-map-as|>alist|'
1473
+ r'assoc-filter-as|clear-assoc|assoc-stack|maybe-set-at|'
1474
+ r'substitute|assoc-filter|2cache|delete-at|assoc-find|keys|'
1475
+ r'assoc-any\\?|unzip)\s'
1476
+ )
1477
+
1478
+ builtin_combinators = (
1479
+ r'(?:case|execute-effect|no-cond|no-case\\?|3cleave>quot|2cleave|'
1480
+ r'cond>quot|wrong-values\\?|no-cond\\?|cleave>quot|no-case|'
1481
+ r'case>quot|3cleave|wrong-values|to-fixed-point|alist>quot|'
1482
+ r'case-find|cond|cleave|call-effect|2cleave>quot|recursive-hashcode|'
1483
+ r'linear-case-quot|spread|spread>quot)\s'
1484
+ )
1485
+
1486
+ builtin_math = (
1487
+ r'(?:number=|if-zero|next-power-of-2|each-integer|\\?1\\+|'
1488
+ r'fp-special\\?|imaginary-part|unless-zero|float>bits|number\\?|'
1489
+ r'fp-infinity\\?|bignum\\?|fp-snan\\?|denominator|fp-bitwise=|\\*|'
1490
+ r'\\+|power-of-2\\?|-|u>=|/|>=|bitand|log2-expects-positive|<|'
1491
+ r'log2|>|integer\\?|number|bits>double|2/|zero\\?|(find-integer)|'
1492
+ r'bits>float|float\\?|shift|ratio\\?|even\\?|ratio|fp-sign|bitnot|'
1493
+ r'>fixnum|complex\\?|/i|/f|byte-array>bignum|when-zero|sgn|>bignum|'
1494
+ r'next-float|u<|u>|mod|recip|rational|find-last-integer|>float|'
1495
+ r'(all-integers\\?)|2^|times|integer|fixnum\\?|neg|fixnum|sq|'
1496
+ r'bignum|(each-integer)|bit\\?|fp-qnan\\?|find-integer|complex|'
1497
+ r'<fp-nan>|real|double>bits|bitor|rem|fp-nan-payload|all-integers\\?|'
1498
+ r'real-part|log2-expects-positive\\?|prev-float|align|unordered\\?|'
1499
+ r'float|fp-nan\\?|abs|bitxor|u<=|odd\\?|<=|/mod|rational\\?|>integer|'
1500
+ r'real\\?|numerator)\s'
1501
+ )
1502
+
1503
+ builtin_sequences = (
1504
+ r'(?:member-eq\\?|append|assert-sequence=|find-last-from|trim-head-slice|'
1505
+ r'clone-like|3sequence|assert-sequence\\?|map-as|last-index-from|'
1506
+ r'reversed|index-from|cut\\*|pad-tail|remove-eq!|concat-as|'
1507
+ r'but-last|snip|trim-tail|nths|nth|2selector|sequence|slice\\?|'
1508
+ r'<slice>|partition|remove-nth|tail-slice|empty\\?|tail\\*|'
1509
+ r'if-empty|find-from|virtual-sequence\\?|member\\?|set-length|'
1510
+ r'drop-prefix|unclip|unclip-last-slice|iota|map-sum|'
1511
+ r'bounds-error\\?|sequence-hashcode-step|selector-for|'
1512
+ r'accumulate-as|map|start|midpoint@|\\(accumulate\\)|rest-slice|'
1513
+ r'prepend|fourth|sift|accumulate!|new-sequence|follow|map!|'
1514
+ r'like|first4|1sequence|reverse|slice|unless-empty|padding|'
1515
+ r'virtual@|repetition\\?|set-last|index|4sequence|max-length|'
1516
+ r'set-second|immutable-sequence|first2|first3|replicate-as|'
1517
+ r'reduce-index|unclip-slice|supremum|suffix!|insert-nth|'
1518
+ r'trim-tail-slice|tail|3append|short|count|suffix|concat|'
1519
+ r'flip|filter|sum|immutable\\?|reverse!|2sequence|map-integers|'
1520
+ r'delete-all|start\\*|indices|snip-slice|check-slice|sequence\\?|'
1521
+ r'head|map-find|filter!|append-as|reduce|sequence=|halves|'
1522
+ r'collapse-slice|interleave|2map|filter-as|binary-reduce|'
1523
+ r'slice-error\\?|product|bounds-check\\?|bounds-check|harvest|'
1524
+ r'immutable|virtual-exemplar|find|produce|remove|pad-head|last|'
1525
+ r'replicate|set-fourth|remove-eq|shorten|reversed\\?|'
1526
+ r'map-find-last|3map-as|2unclip-slice|shorter\\?|3map|find-last|'
1527
+ r'head-slice|pop\\*|2map-as|tail-slice\\*|but-last-slice|'
1528
+ r'2map-reduce|iota\\?|collector-for|accumulate|each|selector|'
1529
+ r'append!|new-resizable|cut-slice|each-index|head-slice\\*|'
1530
+ r'2reverse-each|sequence-hashcode|pop|set-nth|\\?nth|'
1531
+ r'<flat-slice>|second|join|when-empty|collector|'
1532
+ r'immutable-sequence\\?|<reversed>|all\\?|3append-as|'
1533
+ r'virtual-sequence|subseq\\?|remove-nth!|push-either|new-like|'
1534
+ r'length|last-index|push-if|2all\\?|lengthen|assert-sequence|'
1535
+ r'copy|map-reduce|move|third|first|3each|tail\\?|set-first|'
1536
+ r'prefix|bounds-error|any\\?|<repetition>|trim-slice|exchange|'
1537
+ r'surround|2reduce|cut|change-nth|min-length|set-third|produce-as|'
1538
+ r'push-all|head\\?|delete-slice|rest|sum-lengths|2each|head\\*|'
1539
+ r'infimum|remove!|glue|slice-error|subseq|trim|replace-slice|'
1540
+ r'push|repetition|map-index|trim-head|unclip-last|mismatch)\s'
1541
+ )
1542
+
1543
+ builtin_namespaces = (
1544
+ r'(?:global|\\+@|change|set-namestack|change-global|init-namespaces|'
1545
+ r'on|off|set-global|namespace|set|with-scope|bind|with-variable|'
1546
+ r'inc|dec|counter|initialize|namestack|get|get-global|make-assoc)\s'
1547
+ )
1548
+
1549
+ builtin_arrays = (
1550
+ r'(?:<array>|2array|3array|pair|>array|1array|4array|pair\\?|'
1551
+ r'array|resize-array|array\\?)\s'
1552
+ )
1553
+
1554
+ builtin_io = (
1555
+ r'(?:\\+character\\+|bad-seek-type\\?|readln|each-morsel|stream-seek|'
1556
+ r'read|print|with-output-stream|contents|write1|stream-write1|'
1557
+ r'stream-copy|stream-element-type|with-input-stream|'
1558
+ r'stream-print|stream-read|stream-contents|stream-tell|'
1559
+ r'tell-output|bl|seek-output|bad-seek-type|nl|stream-nl|write|'
1560
+ r'flush|stream-lines|\\+byte\\+|stream-flush|read1|'
1561
+ r'seek-absolute\\?|stream-read1|lines|stream-readln|'
1562
+ r'stream-read-until|each-line|seek-end|with-output-stream\\*|'
1563
+ r'seek-absolute|with-streams|seek-input|seek-relative\\?|'
1564
+ r'input-stream|stream-write|read-partial|seek-end\\?|'
1565
+ r'seek-relative|error-stream|read-until|with-input-stream\\*|'
1566
+ r'with-streams\\*|tell-input|each-block|output-stream|'
1567
+ r'stream-read-partial|each-stream-block|each-stream-line)\s'
1568
+ )
1569
+
1570
+ builtin_strings = (
1571
+ r'(?:resize-string|>string|<string>|1string|string|string\\?)\s'
1572
+ )
1573
+
1574
+ builtin_vectors = (
1575
+ r'(?:vector\\?|<vector>|\\?push|vector|>vector|1vector)\s'
1576
+ )
1577
+
1578
+ builtin_continuations = (
1579
+ r'(?:with-return|restarts|return-continuation|with-datastack|'
1580
+ r'recover|rethrow-restarts|<restart>|ifcc|set-catchstack|'
1581
+ r'>continuation<|cleanup|ignore-errors|restart\\?|'
1582
+ r'compute-restarts|attempt-all-error|error-thread|continue|'
1583
+ r'<continuation>|attempt-all-error\\?|condition\\?|'
1584
+ r'<condition>|throw-restarts|error|catchstack|continue-with|'
1585
+ r'thread-error-hook|continuation|rethrow|callcc1|'
1586
+ r'error-continuation|callcc0|attempt-all|condition|'
1587
+ r'continuation\\?|restart|return)\s'
1588
+ )
1589
+
1590
+ tokens = {
1591
+ 'root': [
1592
+ # TODO: (( inputs -- outputs ))
1593
+ # TODO: << ... >>
1594
+
1595
+ # defining words
1596
+ (r'(\s*)(:|::|MACRO:|MEMO:)(\s+)(\S+)',
1597
+ bygroups(Text, Keyword, Text, Name.Function)),
1598
+ (r'(\s*)(M:)(\s+)(\S+)(\s+)(\S+)',
1599
+ bygroups(Text, Keyword, Text, Name.Class, Text, Name.Function)),
1600
+ (r'(\s*)(GENERIC:)(\s+)(\S+)',
1601
+ bygroups(Text, Keyword, Text, Name.Function)),
1602
+ (r'(\s*)(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)',
1603
+ bygroups(Text, Keyword, Text, Name.Function, Text, Name.Function)),
1604
+ (r'(\()(\s+)', bygroups(Name.Function, Text), 'stackeffect'),
1605
+ (r'\;\s', Keyword),
1606
+
1607
+ # imports and namespaces
1608
+ (r'(USING:)((?:\s|\\\s)+)',
1609
+ bygroups(Keyword.Namespace, Text), 'import'),
1610
+ (r'(USE:)(\s+)(\S+)',
1611
+ bygroups(Keyword.Namespace, Text, Name.Namespace)),
1612
+ (r'(UNUSE:)(\s+)(\S+)',
1613
+ bygroups(Keyword.Namespace, Text, Name.Namespace)),
1614
+ (r'(QUALIFIED:)(\s+)(\S+)',
1615
+ bygroups(Keyword.Namespace, Text, Name.Namespace)),
1616
+ (r'(QUALIFIED-WITH:)(\s+)(\S+)',
1617
+ bygroups(Keyword.Namespace, Text, Name.Namespace)),
1618
+ (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+)(=>)',
1619
+ bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Text)),
1620
+ (r'(IN:)(\s+)(\S+)',
1621
+ bygroups(Keyword.Namespace, Text, Name.Namespace)),
1622
+ (r'(?:ALIAS|DEFER|FORGET|POSTPONE):', Keyword.Namespace),
1623
+
1624
+ # tuples and classes
1625
+ (r'(TUPLE:)(\s+)(\S+)(\s+<\s+)(\S+)',
1626
+ bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'),
1627
+ (r'(TUPLE:)(\s+)(\S+)',
1628
+ bygroups(Keyword, Text, Name.Class), 'slots'),
1629
+ (r'(UNION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1630
+ (r'(INTERSECTION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1631
+ (r'(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)',
1632
+ bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
1633
+ (r'(C:)(\s+)(\S+)(\s+)(\S+)',
1634
+ bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
1635
+ (r'INSTANCE:', Keyword),
1636
+ (r'SLOT:', Keyword),
1637
+ (r'MIXIN:', Keyword),
1638
+ (r'(?:SINGLETON|SINGLETONS):', Keyword),
1639
+
1640
+ # other syntax
1641
+ (r'CONSTANT:', Keyword),
1642
+ (r'(?:SYMBOL|SYMBOLS):', Keyword),
1643
+ (r'ERROR:', Keyword),
1644
+ (r'SYNTAX:', Keyword),
1645
+ (r'(HELP:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)),
1646
+ (r'(MAIN:)(\s+)(\S+)',
1647
+ bygroups(Keyword.Namespace, Text, Name.Function)),
1648
+ (r'(?:ALIEN|TYPEDEF|FUNCTION|STRUCT):', Keyword),
1649
+
1650
+ # vocab.private
1651
+ # TODO: words inside vocab.private should have red names?
1652
+ (r'(?:<PRIVATE|PRIVATE>)', Keyword.Namespace),
1653
+
1654
+ # strings
1655
+ (r'"""\s+(?:.|\n)*?\s+"""', String),
1656
+ (r'"(?:\\\\|\\"|[^"])*"', String),
1657
+ (r'CHAR:\s+(\\[\\abfnrstv]*|\S)\s', String.Char),
1658
+
1659
+ # comments
1660
+ (r'\!\s+.*$', Comment),
1661
+ (r'#\!\s+.*$', Comment),
1662
+
1663
+ # boolean constants
1664
+ (r'(t|f)\s', Name.Constant),
1665
+
1666
+ # numbers
1667
+ (r'-?\d+\.\d+\s', Number.Float),
1668
+ (r'-?\d+\s', Number.Integer),
1669
+ (r'HEX:\s+[a-fA-F\d]+\s', Number.Hex),
1670
+ (r'BIN:\s+[01]+\s', Number.Integer),
1671
+ (r'OCT:\s+[0-7]+\s', Number.Oct),
1672
+
1673
+ # operators
1674
+ (r'[-+/*=<>^]\s', Operator),
1675
+
1676
+ # keywords
1677
+ (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s',
1678
+ Keyword),
1679
+
1680
+ # builtins
1681
+ (builtin_kernel, Name.Builtin),
1682
+ (builtin_assocs, Name.Builtin),
1683
+ (builtin_combinators, Name.Builtin),
1684
+ (builtin_math, Name.Builtin),
1685
+ (builtin_sequences, Name.Builtin),
1686
+ (builtin_namespaces, Name.Builtin),
1687
+ (builtin_arrays, Name.Builtin),
1688
+ (builtin_io, Name.Builtin),
1689
+ (builtin_strings, Name.Builtin),
1690
+ (builtin_vectors, Name.Builtin),
1691
+ (builtin_continuations, Name.Builtin),
1692
+
1693
+ # whitespaces - usually not relevant
1694
+ (r'\s+', Text),
1695
+
1696
+ # everything else is text
1697
+ (r'\S+', Text),
1698
+ ],
1699
+
1700
+ 'stackeffect': [
1701
+ (r'\s*\(', Name.Function, 'stackeffect'),
1702
+ (r'\)', Name.Function, '#pop'),
1703
+ (r'\-\-', Name.Function),
1704
+ (r'\s+', Text),
1705
+ (r'\S+', Name.Variable),
1706
+ ],
1707
+
1708
+ 'slots': [
1709
+ (r'\s+', Text),
1710
+ (r';\s', Keyword, '#pop'),
1711
+ (r'\S+', Name.Variable),
1712
+ ],
1713
+
1714
+ 'import': [
1715
+ (r';', Keyword, '#pop'),
1716
+ (r'\S+', Name.Namespace),
1717
+ (r'\s+', Text),
1718
+ ],
1719
+ }
1720
+
1721
+
1722
+ class FancyLexer(RegexLexer):
1723
+ """
1724
+ Pygments Lexer For `Fancy <http://www.fancy-lang.org/>`_.
1725
+
1726
+ Fancy is a self-hosted, pure object-oriented, dynamic,
1727
+ class-based, concurrent general-purpose programming language
1728
+ running on Rubinius, the Ruby VM.
1729
+
1730
+ *New in Pygments 1.5.*
1731
+ """
1732
+ name = 'Fancy'
1733
+ filenames = ['*.fy', '*.fancypack']
1734
+ aliases = ['fancy', 'fy']
1735
+ mimetypes = ['text/x-fancysrc']
1736
+
1737
+ tokens = {
1738
+ # copied from PerlLexer:
1739
+ 'balanced-regex': [
1740
+ (r'/(\\\\|\\/|[^/])*/[egimosx]*', String.Regex, '#pop'),
1741
+ (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'),
1742
+ (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'),
1743
+ (r'{(\\\\|\\}|[^}])*}[egimosx]*', String.Regex, '#pop'),
1744
+ (r'<(\\\\|\\>|[^>])*>[egimosx]*', String.Regex, '#pop'),
1745
+ (r'\[(\\\\|\\\]|[^\]])*\][egimosx]*', String.Regex, '#pop'),
1746
+ (r'\((\\\\|\\\)|[^\)])*\)[egimosx]*', String.Regex, '#pop'),
1747
+ (r'@(\\\\|\\\@|[^\@])*@[egimosx]*', String.Regex, '#pop'),
1748
+ (r'%(\\\\|\\\%|[^\%])*%[egimosx]*', String.Regex, '#pop'),
1749
+ (r'\$(\\\\|\\\$|[^\$])*\$[egimosx]*', String.Regex, '#pop'),
1750
+ ],
1751
+ 'root': [
1752
+ (r'\s+', Text),
1753
+
1754
+ # balanced delimiters (copied from PerlLexer):
1755
+ (r's{(\\\\|\\}|[^}])*}\s*', String.Regex, 'balanced-regex'),
1756
+ (r's<(\\\\|\\>|[^>])*>\s*', String.Regex, 'balanced-regex'),
1757
+ (r's\[(\\\\|\\\]|[^\]])*\]\s*', String.Regex, 'balanced-regex'),
1758
+ (r's\((\\\\|\\\)|[^\)])*\)\s*', String.Regex, 'balanced-regex'),
1759
+ (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex),
1760
+ (r'm(?=[/!\\{<\[\(@%\$])', String.Regex, 'balanced-regex'),
1761
+
1762
+ # Comments
1763
+ (r'#(.*?)\n', Comment.Single),
1764
+ # Symbols
1765
+ (r'\'([^\'\s\[\]\(\)\{\}]+|\[\])', String.Symbol),
1766
+ # Multi-line DoubleQuotedString
1767
+ (r'"""(\\\\|\\"|[^"])*"""', String),
1768
+ # DoubleQuotedString
1769
+ (r'"(\\\\|\\"|[^"])*"', String),
1770
+ # keywords
1771
+ (r'(def|class|try|catch|finally|retry|return|return_local|match|'
1772
+ r'case|->|=>)\b', Keyword),
1773
+ # constants
1774
+ (r'(self|super|nil|false|true)\b', Name.Constant),
1775
+ (r'[(){};,/?\|:\\]', Punctuation),
1776
+ # names
1777
+ (r'(Object|Array|Hash|Directory|File|Class|String|Number|'
1778
+ r'Enumerable|FancyEnumerable|Block|TrueClass|NilClass|'
1779
+ r'FalseClass|Tuple|Symbol|Stack|Set|FancySpec|Method|Package|'
1780
+ r'Range)\b', Name.Builtin),
1781
+ # functions
1782
+ (r'[a-zA-Z]([a-zA-Z0-9_]|[-+?!=*/^><%])*:', Name.Function),
1783
+ # operators, must be below functions
1784
+ (r'[-+*/~,<>=&!?%^\[\]\.$]+', Operator),
1785
+ ('[A-Z][a-zA-Z0-9_]*', Name.Constant),
1786
+ ('@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
1787
+ ('@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
1788
+ ('@@?', Operator),
1789
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1790
+ # numbers - / checks are necessary to avoid mismarking regexes,
1791
+ # see comment in RubyLexer
1792
+ (r'(0[oO]?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?',
1793
+ bygroups(Number.Oct, Text, Operator)),
1794
+ (r'(0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?',
1795
+ bygroups(Number.Hex, Text, Operator)),
1796
+ (r'(0[bB][01]+(?:_[01]+)*)(\s*)([/?])?',
1797
+ bygroups(Number.Bin, Text, Operator)),
1798
+ (r'([\d]+(?:_\d+)*)(\s*)([/?])?',
1799
+ bygroups(Number.Integer, Text, Operator)),
1800
+ (r'\d+([eE][+-]?[0-9]+)|\d+\.\d+([eE][+-]?[0-9]+)?', Number.Float),
1801
+ (r'\d+', Number.Integer)
1802
+ ]
1803
+ }