pygments.rb 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +3 -0
  4. data/lexers +0 -0
  5. data/lib/pygments/popen.rb +3 -2
  6. data/lib/pygments/version.rb +1 -1
  7. data/pygments.rb.gemspec +2 -1
  8. data/vendor/pygments-main/AUTHORS +20 -1
  9. data/vendor/pygments-main/CHANGES +55 -3
  10. data/vendor/pygments-main/LICENSE +1 -1
  11. data/vendor/pygments-main/MANIFEST.in +1 -1
  12. data/vendor/pygments-main/Makefile +5 -8
  13. data/vendor/pygments-main/REVISION +1 -1
  14. data/vendor/pygments-main/doc/Makefile +153 -0
  15. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  16. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  17. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  18. data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
  19. data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
  20. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
  21. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  22. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  23. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  24. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  25. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  26. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
  27. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
  28. data/vendor/pygments-main/doc/conf.py +249 -0
  29. data/vendor/pygments-main/doc/docs/api.rst +316 -0
  30. data/vendor/pygments-main/doc/docs/authors.rst +4 -0
  31. data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
  32. data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
  33. data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
  34. data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
  35. data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
  36. data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
  37. data/vendor/pygments-main/doc/docs/index.rst +66 -0
  38. data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
  39. data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
  40. data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
  41. data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
  42. data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
  43. data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
  44. data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
  45. data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
  46. data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
  47. data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
  48. data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
  49. data/vendor/pygments-main/doc/download.rst +41 -0
  50. data/vendor/pygments-main/doc/faq.rst +143 -0
  51. data/vendor/pygments-main/doc/index.rst +53 -0
  52. data/vendor/pygments-main/doc/languages.rst +151 -0
  53. data/vendor/pygments-main/doc/make.bat +190 -0
  54. data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
  55. data/vendor/pygments-main/external/autopygmentize +65 -48
  56. data/vendor/pygments-main/external/markdown-processor.py +15 -15
  57. data/vendor/pygments-main/external/moin-parser.py +1 -1
  58. data/vendor/pygments-main/external/rst-directive.py +2 -3
  59. data/vendor/pygments-main/ez_setup.py +340 -234
  60. data/vendor/pygments-main/pygments/__init__.py +4 -4
  61. data/vendor/pygments-main/pygments/cmdline.py +81 -68
  62. data/vendor/pygments-main/pygments/console.py +1 -1
  63. data/vendor/pygments-main/pygments/filter.py +1 -1
  64. data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
  65. data/vendor/pygments-main/pygments/formatter.py +3 -3
  66. data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
  67. data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
  68. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  69. data/vendor/pygments-main/pygments/formatters/html.py +44 -26
  70. data/vendor/pygments-main/pygments/formatters/img.py +21 -14
  71. data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
  72. data/vendor/pygments-main/pygments/formatters/other.py +53 -6
  73. data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
  74. data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
  75. data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
  76. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
  77. data/vendor/pygments-main/pygments/lexer.py +59 -39
  78. data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
  79. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
  80. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
  81. data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
  82. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
  83. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
  84. data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
  85. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
  86. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
  87. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
  88. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
  89. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
  90. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
  91. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
  92. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
  93. data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
  94. data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
  96. data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
  97. data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
  98. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  99. data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
  100. data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
  101. data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
  102. data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
  103. data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
  104. data/vendor/pygments-main/pygments/lexers/math.py +438 -70
  105. data/vendor/pygments-main/pygments/lexers/other.py +885 -171
  106. data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
  107. data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
  108. data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
  109. data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
  110. data/vendor/pygments-main/pygments/lexers/special.py +7 -8
  111. data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
  112. data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
  113. data/vendor/pygments-main/pygments/lexers/text.py +208 -46
  114. data/vendor/pygments-main/pygments/lexers/web.py +729 -264
  115. data/vendor/pygments-main/pygments/modeline.py +1 -1
  116. data/vendor/pygments-main/pygments/plugin.py +1 -1
  117. data/vendor/pygments-main/pygments/scanner.py +1 -1
  118. data/vendor/pygments-main/pygments/sphinxext.py +153 -0
  119. data/vendor/pygments-main/pygments/style.py +3 -2
  120. data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
  121. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  122. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  123. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  124. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  125. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  126. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  127. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  128. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  129. data/vendor/pygments-main/pygments/styles/igor.py +29 -0
  130. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  131. data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
  132. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  133. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  134. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
  135. data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
  136. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  137. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  138. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  139. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  140. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  141. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  142. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  143. data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
  144. data/vendor/pygments-main/pygments/token.py +4 -1
  145. data/vendor/pygments-main/pygments/unistring.py +6 -5
  146. data/vendor/pygments-main/pygments/util.py +35 -21
  147. data/vendor/pygments-main/scripts/check_sources.py +28 -44
  148. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
  149. data/vendor/pygments-main/scripts/find_codetags.py +27 -19
  150. data/vendor/pygments-main/scripts/find_error.py +16 -13
  151. data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
  152. data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
  153. data/vendor/pygments-main/setup.py +19 -19
  154. data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
  155. data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
  156. data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
  157. data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
  158. data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
  159. data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
  160. data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
  161. data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
  162. data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
  163. data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
  164. data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
  165. data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
  166. data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
  167. data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
  168. data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
  169. data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
  170. data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
  171. data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
  172. data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
  173. data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
  174. data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
  175. data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
  176. data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
  177. data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
  178. data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
  179. data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
  180. data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
  181. data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
  182. data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
  183. data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
  184. data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
  185. data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
  186. data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
  187. data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
  188. data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
  189. data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
  190. data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
  191. data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
  192. data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
  193. data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
  194. data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
  195. data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
  196. data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
  197. data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
  198. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
  199. data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
  200. data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
  201. data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
  202. data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
  203. data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
  204. data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
  205. data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
  206. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
  207. data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
  208. data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
  209. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
  210. data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
  211. data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
  212. data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
  213. data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
  214. data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
  215. data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
  216. data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
  217. data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
  218. data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
  219. data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
  220. data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
  221. data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
  222. data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
  223. data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
  224. data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
  225. data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
  226. data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
  227. data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
  228. data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
  229. data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
  230. data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
  231. data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
  232. data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
  233. data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
  234. data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
  235. data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
  236. data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
  237. data/vendor/pygments-main/tests/run.py +14 -19
  238. data/vendor/pygments-main/tests/string_asserts.py +22 -0
  239. data/vendor/pygments-main/tests/test_basic_api.py +28 -14
  240. data/vendor/pygments-main/tests/test_cfm.py +46 -0
  241. data/vendor/pygments-main/tests/test_clexer.py +208 -3
  242. data/vendor/pygments-main/tests/test_cmdline.py +6 -5
  243. data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
  244. data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
  245. data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
  246. data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
  247. data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
  248. data/vendor/pygments-main/tests/test_perllexer.py +1 -1
  249. data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
  250. data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
  251. data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
  252. data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
  253. data/vendor/pygments-main/tests/test_token.py +3 -3
  254. data/vendor/pygments-main/tests/test_using_api.py +1 -1
  255. data/vendor/pygments-main/tests/test_util.py +1 -1
  256. metadata +138 -51
  257. data/vendor/pygments-main/docs/generate.py +0 -472
  258. data/vendor/pygments-main/docs/src/api.txt +0 -270
  259. data/vendor/pygments-main/docs/src/authors.txt +0 -5
  260. data/vendor/pygments-main/docs/src/changelog.txt +0 -5
  261. data/vendor/pygments-main/docs/src/index.txt +0 -69
  262. data/vendor/pygments-main/docs/src/installation.txt +0 -71
  263. data/vendor/pygments-main/external/rst-directive-old.py +0 -77
  264. data/vendor/pygments-main/scripts/reindent.py +0 -291
  265. data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
  266. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
  267. data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -4,7 +4,7 @@
4
4
  def _getauto():
5
5
  return [('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')]
6
6
  def _getcommand():
7
- return [('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')]
7
+ return [('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','autocmd'),('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')]
8
8
  def _getoption():
9
9
  return [('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')]
10
10
 
@@ -5,17 +5,17 @@
5
5
 
6
6
  Lexers for agile languages.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
12
12
  import re
13
13
 
14
14
  from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
15
- LexerContext, include, combined, do_insertions, bygroups, using, this
15
+ LexerContext, include, combined, do_insertions, bygroups, using, this, default
16
16
  from pygments.token import Error, Text, Other, \
17
17
  Comment, Operator, Keyword, Name, String, Number, Generic, Punctuation
18
- from pygments.util import get_bool_opt, get_list_opt, shebang_matches
18
+ from pygments.util import get_bool_opt, get_list_opt, shebang_matches, iteritems
19
19
  from pygments import unistring as uni
20
20
 
21
21
 
@@ -23,7 +23,8 @@ __all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
23
23
  'Python3Lexer', 'Python3TracebackLexer', 'RubyLexer',
24
24
  'RubyConsoleLexer', 'PerlLexer', 'LuaLexer', 'MoonScriptLexer',
25
25
  'CrocLexer', 'MiniDLexer', 'IoLexer', 'TclLexer', 'FactorLexer',
26
- 'FancyLexer', 'DgLexer', 'Perl6Lexer']
26
+ 'FancyLexer', 'DgLexer', 'Perl6Lexer', 'HyLexer',
27
+ 'ChaiscriptLexer']
27
28
 
28
29
  # b/w compatibility
29
30
  from pygments.lexers.functional import SchemeLexer
@@ -109,6 +110,7 @@ class PythonLexer(RegexLexer):
109
110
  (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
110
111
  (r'\d+[eE][+-]?[0-9]+j?', Number.Float),
111
112
  (r'0[0-7]+j?', Number.Oct),
113
+ (r'0[bB][01]+', Number.Bin),
112
114
  (r'0[xX][a-fA-F0-9]+', Number.Hex),
113
115
  (r'\d+L', Number.Integer.Long),
114
116
  (r'\d+j?', Number.Integer)
@@ -117,21 +119,21 @@ class PythonLexer(RegexLexer):
117
119
  ('`.*?`', String.Backtick),
118
120
  ],
119
121
  'name': [
120
- (r'@[a-zA-Z0-9_.]+', Name.Decorator),
121
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
122
+ (r'@[\w.]+', Name.Decorator),
123
+ ('[a-zA-Z_]\w*', Name),
122
124
  ],
123
125
  'funcname': [
124
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
126
+ ('[a-zA-Z_]\w*', Name.Function, '#pop')
125
127
  ],
126
128
  'classname': [
127
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
129
+ ('[a-zA-Z_]\w*', Name.Class, '#pop')
128
130
  ],
129
131
  'import': [
130
132
  (r'(?:[ \t]|\\\n)+', Text),
131
133
  (r'as\b', Keyword.Namespace),
132
134
  (r',', Operator),
133
- (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
134
- (r'', Text, '#pop') # all else: go back
135
+ (r'[a-zA-Z_][\w.]*', Name.Namespace),
136
+ default('#pop') # all else: go back
135
137
  ],
136
138
  'fromimport': [
137
139
  (r'(?:[ \t]|\\\n)+', Text),
@@ -140,17 +142,17 @@ class PythonLexer(RegexLexer):
140
142
  # never be a module name
141
143
  (r'None\b', Name.Builtin.Pseudo, '#pop'),
142
144
  # sadly, in "raise x from y" y will be highlighted as namespace too
143
- (r'[a-zA-Z_.][a-zA-Z0-9_.]*', Name.Namespace),
145
+ (r'[a-zA-Z_.][\w.]*', Name.Namespace),
144
146
  # anything else here also means "raise x from y" and is therefore
145
147
  # not an error
146
- (r'', Text, '#pop'),
148
+ default('#pop'),
147
149
  ],
148
150
  'stringescape': [
149
151
  (r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
150
152
  r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
151
153
  ],
152
154
  'strings': [
153
- (r'%(\([a-zA-Z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
155
+ (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
154
156
  '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol),
155
157
  (r'[^\\\'"%\n]+', String),
156
158
  # quotes, percents and backslashes must be parsed one at a time
@@ -193,7 +195,7 @@ class Python3Lexer(RegexLexer):
193
195
  """
194
196
  For `Python <http://www.python.org>`_ source code (version 3.0).
195
197
 
196
- *New in Pygments 0.10.*
198
+ .. versionadded:: 0.10
197
199
  """
198
200
 
199
201
  name = 'Python 3'
@@ -253,7 +255,7 @@ class Python3Lexer(RegexLexer):
253
255
  ]
254
256
  tokens['backtick'] = []
255
257
  tokens['name'] = [
256
- (r'@[a-zA-Z0-9_]+', Name.Decorator),
258
+ (r'@\w+', Name.Decorator),
257
259
  (uni_name, Name),
258
260
  ]
259
261
  tokens['funcname'] = [
@@ -267,13 +269,13 @@ class Python3Lexer(RegexLexer):
267
269
  (r'\.', Name.Namespace),
268
270
  (uni_name, Name.Namespace),
269
271
  (r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
270
- (r'', Text, '#pop') # all else: go back
272
+ default('#pop') # all else: go back
271
273
  ]
272
274
  tokens['fromimport'] = [
273
275
  (r'(\s+)(import)\b', bygroups(Text, Keyword), '#pop'),
274
276
  (r'\.', Name.Namespace),
275
277
  (uni_name, Name.Namespace),
276
- (r'', Text, '#pop'),
278
+ default('#pop'),
277
279
  ]
278
280
  # don't highlight "%s" substitutions
279
281
  tokens['strings'] = [
@@ -307,7 +309,8 @@ class PythonConsoleLexer(Lexer):
307
309
 
308
310
  `python3`
309
311
  Use Python 3 lexer for code. Default is ``False``.
310
- *New in Pygments 1.0.*
312
+
313
+ .. versionadded:: 1.0
311
314
  """
312
315
  name = 'Python console session'
313
316
  aliases = ['pycon']
@@ -352,7 +355,7 @@ class PythonConsoleLexer(Lexer):
352
355
  curcode = ''
353
356
  insertions = []
354
357
  if (line.startswith(u'Traceback (most recent call last):') or
355
- re.match(ur' File "[^"]+", line \d+\n$', line)):
358
+ re.match(u' File "[^"]+", line \\d+\\n$', line)):
356
359
  tb = 1
357
360
  curtb = line
358
361
  tbindex = match.start()
@@ -376,7 +379,7 @@ class PythonTracebackLexer(RegexLexer):
376
379
  """
377
380
  For Python tracebacks.
378
381
 
379
- *New in Pygments 0.7.*
382
+ .. versionadded:: 0.7
380
383
  """
381
384
 
382
385
  name = 'Python Traceback'
@@ -403,7 +406,7 @@ class PythonTracebackLexer(RegexLexer):
403
406
  bygroups(Text, Comment, Text)), # for doctests...
404
407
  (r'^([^:]+)(: )(.+)(\n)',
405
408
  bygroups(Generic.Error, Text, Name, Text), '#pop'),
406
- (r'^([a-zA-Z_][a-zA-Z0-9_]*)(:?\n)',
409
+ (r'^([a-zA-Z_]\w*)(:?\n)',
407
410
  bygroups(Generic.Error, Text), '#pop')
408
411
  ],
409
412
  }
@@ -413,7 +416,7 @@ class Python3TracebackLexer(RegexLexer):
413
416
  """
414
417
  For Python 3.0 tracebacks, with support for chained exceptions.
415
418
 
416
- *New in Pygments 1.0.*
419
+ .. versionadded:: 1.0
417
420
  """
418
421
 
419
422
  name = 'Python 3.0 Traceback'
@@ -442,7 +445,7 @@ class Python3TracebackLexer(RegexLexer):
442
445
  bygroups(Text, Comment, Text)), # for doctests...
443
446
  (r'^([^:]+)(: )(.+)(\n)',
444
447
  bygroups(Generic.Error, Text, Name, Text), '#pop'),
445
- (r'^([a-zA-Z_][a-zA-Z0-9_]*)(:?\n)',
448
+ (r'^([a-zA-Z_]\w*)(:?\n)',
446
449
  bygroups(Generic.Error, Text), '#pop')
447
450
  ],
448
451
  }
@@ -532,7 +535,7 @@ class RubyLexer(ExtendedRegexLexer):
532
535
  (r":'(\\\\|\\'|[^'])*'", String.Symbol),
533
536
  (r"'(\\\\|\\'|[^'])*'", String.Single),
534
537
  (r':"', String.Symbol, 'simple-sym'),
535
- (r'([a-zA-Z_][a-zA-Z0-9]*)(:)(?!:)',
538
+ (r'([a-zA-Z_]\w*)(:)(?!:)',
536
539
  bygroups(String.Symbol, Punctuation)), # Since Ruby 1.9
537
540
  (r'"', String.Double, 'simple-string'),
538
541
  (r'(?<!\.)`', String.Backtick, 'simple-backtick'),
@@ -618,8 +621,8 @@ class RubyLexer(ExtendedRegexLexer):
618
621
  r'rescue|raise|retry|return|super|then|undef|unless|until|when|'
619
622
  r'while|yield)\b', Keyword),
620
623
  # start of function, class and module names
621
- (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*'
622
- r'(?:::[a-zA-Z_][a-zA-Z0-9_]*)*)',
624
+ (r'(module)(\s+)([a-zA-Z_]\w*'
625
+ r'(?:::[a-zA-Z_]\w*)*)',
623
626
  bygroups(Keyword, Text, Name.Namespace)),
624
627
  (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
625
628
  (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
@@ -710,9 +713,9 @@ class RubyLexer(ExtendedRegexLexer):
710
713
  (r'([\d]+(?:_\d+)*)(\s*)([/?])?',
711
714
  bygroups(Number.Integer, Text, Operator)),
712
715
  # Names
713
- (r'@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
714
- (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
715
- (r'\$[a-zA-Z0-9_]+', Name.Variable.Global),
716
+ (r'@@[a-zA-Z_]\w*', Name.Variable.Class),
717
+ (r'@[a-zA-Z_]\w*', Name.Variable.Instance),
718
+ (r'\$\w+', Name.Variable.Global),
716
719
  (r'\$[!@&`\'+~=/\\,;.<>_*$?:"]', Name.Variable.Global),
717
720
  (r'\$-[0adFiIlpvw]', Name.Variable.Global),
718
721
  (r'::', Operator),
@@ -722,7 +725,7 @@ class RubyLexer(ExtendedRegexLexer):
722
725
  r'(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)'
723
726
  r'(?!\w)',
724
727
  String.Char),
725
- (r'[A-Z][a-zA-Z0-9_]+', Name.Constant),
728
+ (r'[A-Z]\w+', Name.Constant),
726
729
  # this is needed because ruby attributes can look
727
730
  # like keywords (class) or like this: ` ?!?
728
731
  (r'(\.|::)([a-zA-Z_]\w*[\!\?]?|[*%&^`~+-/\[<>=])',
@@ -736,17 +739,17 @@ class RubyLexer(ExtendedRegexLexer):
736
739
  ],
737
740
  'funcname': [
738
741
  (r'\(', Punctuation, 'defexpr'),
739
- (r'(?:([a-zA-Z_][a-zA-Z0-9_]*)(\.))?'
742
+ (r'(?:([a-zA-Z_]\w*)(\.))?'
740
743
  r'([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
741
744
  r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
742
745
  bygroups(Name.Class, Operator, Name.Function), '#pop'),
743
- (r'', Text, '#pop')
746
+ default('#pop')
744
747
  ],
745
748
  'classname': [
746
749
  (r'\(', Punctuation, 'defexpr'),
747
750
  (r'<<', Operator, '#pop'),
748
751
  (r'[A-Z_]\w*', Name.Class, '#pop'),
749
- (r'', Text, '#pop')
752
+ default('#pop')
750
753
  ],
751
754
  'defexpr': [
752
755
  (r'(\))(\.|::)?', bygroups(Punctuation, Operator), '#pop'),
@@ -759,8 +762,8 @@ class RubyLexer(ExtendedRegexLexer):
759
762
  ],
760
763
  'string-intp': [
761
764
  (r'#{', String.Interpol, 'in-intp'),
762
- (r'#@@?[a-zA-Z_][a-zA-Z0-9_]*', String.Interpol),
763
- (r'#\$[a-zA-Z_][a-zA-Z0-9_]*', String.Interpol)
765
+ (r'#@@?[a-zA-Z_]\w*', String.Interpol),
766
+ (r'#\$[a-zA-Z_]\w*', String.Interpol)
764
767
  ],
765
768
  'string-intp-escaped': [
766
769
  include('string-intp'),
@@ -811,7 +814,7 @@ class RubyConsoleLexer(Lexer):
811
814
  aliases = ['rbcon', 'irb']
812
815
  mimetypes = ['text/x-ruby-shellsession']
813
816
 
814
- _prompt_re = re.compile('irb\([a-zA-Z_][a-zA-Z0-9_]*\):\d{3}:\d+[>*"\'] '
817
+ _prompt_re = re.compile('irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] '
815
818
  '|>> |\?> ')
816
819
 
817
820
  def get_tokens_unprocessed(self, text):
@@ -848,7 +851,7 @@ class PerlLexer(RegexLexer):
848
851
 
849
852
  name = 'Perl'
850
853
  aliases = ['perl', 'pl']
851
- filenames = ['*.pl', '*.pm']
854
+ filenames = ['*.pl', '*.pm', '*.t']
852
855
  mimetypes = ['text/x-perl', 'application/x-perl']
853
856
 
854
857
  flags = re.DOTALL | re.MULTILINE
@@ -872,7 +875,7 @@ class PerlLexer(RegexLexer):
872
875
  (r'(case|continue|do|else|elsif|for|foreach|if|last|my|'
873
876
  r'next|our|redo|reset|then|unless|until|while|use|'
874
877
  r'print|new|BEGIN|CHECK|INIT|END|return)\b', Keyword),
875
- (r'(format)(\s+)([a-zA-Z0-9_]+)(\s*)(=)(\s*\n)',
878
+ (r'(format)(\s+)(\w+)(\s*)(=)(\s*\n)',
876
879
  bygroups(Keyword, Text, Name, Text, Punctuation, Text), 'format'),
877
880
  (r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word),
878
881
  # common delimiters
@@ -925,7 +928,7 @@ class PerlLexer(RegexLexer):
925
928
  r'utime|values|vec|wait|waitpid|wantarray|warn|write'
926
929
  r')\b', Name.Builtin),
927
930
  (r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo),
928
- (r'<<([\'"]?)([a-zA-Z_][a-zA-Z0-9_]*)\1;?\n.*?\n\2\n', String),
931
+ (r'<<([\'"]?)([a-zA-Z_]\w*)\1;?\n.*?\n\2\n', String),
929
932
  (r'__END__', Comment.Preproc, 'end-part'),
930
933
  (r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global),
931
934
  (r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global),
@@ -963,14 +966,14 @@ class PerlLexer(RegexLexer):
963
966
  (r'\s+', Text),
964
967
  (r'\{', Punctuation, '#pop'), # hash syntax?
965
968
  (r'\)|,', Punctuation, '#pop'), # argument specifier
966
- (r'[a-zA-Z0-9_]+::', Name.Namespace),
967
- (r'[a-zA-Z0-9_:]+', Name.Variable, '#pop'),
969
+ (r'\w+::', Name.Namespace),
970
+ (r'[\w:]+', Name.Variable, '#pop'),
968
971
  ],
969
972
  'name': [
970
- (r'[a-zA-Z0-9_]+::', Name.Namespace),
971
- (r'[a-zA-Z0-9_:]+', Name, '#pop'),
972
- (r'[A-Z_]+(?=[^a-zA-Z0-9_])', Name.Constant, '#pop'),
973
- (r'(?=[^a-zA-Z0-9_])', Text, '#pop'),
973
+ (r'\w+::', Name.Namespace),
974
+ (r'[\w:]+', Name, '#pop'),
975
+ (r'[A-Z_]+(?=\W)', Name.Constant, '#pop'),
976
+ (r'(?=\W)', Text, '#pop'),
974
977
  ],
975
978
  'modulename': [
976
979
  (r'[a-zA-Z_]\w*', Name.Namespace, '#pop')
@@ -1019,9 +1022,8 @@ class PerlLexer(RegexLexer):
1019
1022
  def analyse_text(text):
1020
1023
  if shebang_matches(text, r'perl'):
1021
1024
  return True
1022
- if 'my $' in text:
1025
+ if re.search('(?:my|our)\s+[$@%(]', text):
1023
1026
  return 0.9
1024
- return 0.1 # who knows, might still be perl!
1025
1027
 
1026
1028
 
1027
1029
  class LuaLexer(RegexLexer):
@@ -1056,7 +1058,7 @@ class LuaLexer(RegexLexer):
1056
1058
  'root': [
1057
1059
  # lua allows a file to start with a shebang
1058
1060
  (r'#!(.*?)$', Comment.Preproc),
1059
- (r'', Text, 'base'),
1061
+ default('base'),
1060
1062
  ],
1061
1063
  'base': [
1062
1064
  (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline),
@@ -1083,7 +1085,7 @@ class LuaLexer(RegexLexer):
1083
1085
 
1084
1086
  (r'(function)\b', Keyword, 'funcname'),
1085
1087
 
1086
- (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
1088
+ (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name),
1087
1089
 
1088
1090
  ("'", String.Single, combined('stringescape', 'sqs')),
1089
1091
  ('"', String.Double, combined('stringescape', 'dqs'))
@@ -1091,7 +1093,7 @@ class LuaLexer(RegexLexer):
1091
1093
 
1092
1094
  'funcname': [
1093
1095
  (r'\s+', Text),
1094
- ('(?:([A-Za-z_][A-Za-z0-9_]*)(\.))?([A-Za-z_][A-Za-z0-9_]*)',
1096
+ ('(?:([A-Za-z_]\w*)(\.))?([A-Za-z_]\w*)',
1095
1097
  bygroups(Name.Class, Punctuation, Name.Function), '#pop'),
1096
1098
  # inline function
1097
1099
  ('\(', Punctuation, '#pop'),
@@ -1126,7 +1128,7 @@ class LuaLexer(RegexLexer):
1126
1128
  self._functions = set()
1127
1129
  if self.func_name_highlighting:
1128
1130
  from pygments.lexers._luabuiltins import MODULES
1129
- for mod, func in MODULES.iteritems():
1131
+ for mod, func in iteritems(MODULES):
1130
1132
  if mod not in self.disabled_modules:
1131
1133
  self._functions.update(func)
1132
1134
  RegexLexer.__init__(self, **options)
@@ -1151,7 +1153,7 @@ class MoonScriptLexer(LuaLexer):
1151
1153
  """
1152
1154
  For `MoonScript <http://moonscript.org.org>`_ source code.
1153
1155
 
1154
- *New in Pygments 1.5.*
1156
+ .. versionadded:: 1.5
1155
1157
  """
1156
1158
 
1157
1159
  name = "MoonScript"
@@ -1162,7 +1164,7 @@ class MoonScriptLexer(LuaLexer):
1162
1164
  tokens = {
1163
1165
  'root': [
1164
1166
  (r'#!(.*?)$', Comment.Preproc),
1165
- (r'', Text, 'base'),
1167
+ default('base'),
1166
1168
  ],
1167
1169
  'base': [
1168
1170
  ('--.*$', Comment.Single),
@@ -1174,20 +1176,20 @@ class MoonScriptLexer(LuaLexer):
1174
1176
  (r'[^\S\n]+', Text),
1175
1177
  (r'(?s)\[(=*)\[.*?\]\1\]', String),
1176
1178
  (r'(->|=>)', Name.Function),
1177
- (r':[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
1179
+ (r':[a-zA-Z_]\w*', Name.Variable),
1178
1180
  (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator),
1179
1181
  (r'[;,]', Punctuation),
1180
1182
  (r'[\[\]\{\}\(\)]', Keyword.Type),
1181
- (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Variable),
1183
+ (r'[a-zA-Z_]\w*:', Name.Variable),
1182
1184
  (r"(class|extends|if|then|super|do|with|import|export|"
1183
1185
  r"while|elseif|return|for|in|from|when|using|else|"
1184
1186
  r"and|or|not|switch|break)\b", Keyword),
1185
1187
  (r'(true|false|nil)\b', Keyword.Constant),
1186
1188
  (r'(and|or|not)\b', Operator.Word),
1187
1189
  (r'(self)\b', Name.Builtin.Pseudo),
1188
- (r'@@?([a-zA-Z_][a-zA-Z0-9_]*)?', Name.Variable.Class),
1190
+ (r'@@?([a-zA-Z_]\w*)?', Name.Variable.Class),
1189
1191
  (r'[A-Z]\w*', Name.Class), # proper name
1190
- (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
1192
+ (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name),
1191
1193
  ("'", String.Single, combined('stringescape', 'sqs')),
1192
1194
  ('"', String.Double, combined('stringescape', 'dqs'))
1193
1195
  ],
@@ -1240,7 +1242,7 @@ class CrocLexer(RegexLexer):
1240
1242
  Number.Float),
1241
1243
  # IntegerLiteral
1242
1244
  # -- Binary
1243
- (r'0[bB][01][01_]*', Number),
1245
+ (r'0[bB][01][01_]*', Number.Bin),
1244
1246
  # -- Hexadecimal
1245
1247
  (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*', Number.Hex),
1246
1248
  # -- Decimal
@@ -1290,7 +1292,7 @@ class IoLexer(RegexLexer):
1290
1292
  For `Io <http://iolanguage.com/>`_ (a small, prototype-based
1291
1293
  programming language) source.
1292
1294
 
1293
- *New in Pygments 0.10.*
1295
+ .. versionadded:: 0.10
1294
1296
  """
1295
1297
  name = 'Io'
1296
1298
  filenames = ['*.io']
@@ -1318,7 +1320,7 @@ class IoLexer(RegexLexer):
1318
1320
  # names
1319
1321
  (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
1320
1322
  Name.Builtin),
1321
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1323
+ ('[a-zA-Z_]\w*', Name),
1322
1324
  # numbers
1323
1325
  (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
1324
1326
  (r'\d+', Number.Integer)
@@ -1336,7 +1338,7 @@ class TclLexer(RegexLexer):
1336
1338
  """
1337
1339
  For Tcl source code.
1338
1340
 
1339
- *New in Pygments 0.10.*
1341
+ .. versionadded:: 0.10
1340
1342
  """
1341
1343
 
1342
1344
  keyword_cmds_re = (
@@ -1466,7 +1468,7 @@ class FactorLexer(RegexLexer):
1466
1468
  """
1467
1469
  Lexer for the `Factor <http://factorcode.org>`_ language.
1468
1470
 
1469
- *New in Pygments 1.4.*
1471
+ .. versionadded:: 1.4
1470
1472
  """
1471
1473
  name = 'Factor'
1472
1474
  aliases = ['factor']
@@ -1476,232 +1478,272 @@ class FactorLexer(RegexLexer):
1476
1478
  flags = re.MULTILINE | re.UNICODE
1477
1479
 
1478
1480
  builtin_kernel = (
1479
- r'(?:or|2bi|2tri|while|wrapper|nip|4dip|wrapper\\?|bi\\*|'
1480
- r'callstack>array|both\\?|hashcode|die|dupd|callstack|'
1481
- r'callstack\\?|3dup|tri@|pick|curry|build|\\?execute|3bi|'
1482
- r'prepose|>boolean|\\?if|clone|eq\\?|tri\\*|\\?|=|swapd|'
1483
- r'2over|2keep|3keep|clear|2dup|when|not|tuple\\?|dup|2bi\\*|'
1484
- r'2tri\\*|call|tri-curry|object|bi@|do|unless\\*|if\\*|loop|'
1485
- r'bi-curry\\*|drop|when\\*|assert=|retainstack|assert\\?|-rot|'
1486
- r'execute|2bi@|2tri@|boa|with|either\\?|3drop|bi|curry\\?|'
1487
- r'datastack|until|3dip|over|3curry|tri-curry\\*|tri-curry@|swap|'
1488
- r'and|2nip|throw|bi-curry|\\(clone\\)|hashcode\\*|compose|2dip|if|3tri|'
1489
- r'unless|compose\\?|tuple|keep|2curry|equal\\?|assert|tri|2drop|'
1490
- r'most|<wrapper>|boolean\\?|identity-hashcode|identity-tuple\\?|'
1491
- r'null|new|dip|bi-curry@|rot|xor|identity-tuple|boolean)\s'
1492
- )
1481
+ r'(?:-rot|2bi|2bi@|2bi\*|2curry|2dip|2drop|2dup|2keep|2nip|'
1482
+ r'2over|2tri|2tri@|2tri\*|3bi|3curry|3dip|3drop|3dup|3keep|'
1483
+ r'3tri|4dip|4drop|4dup|4keep|<wrapper>|=|>boolean|\(clone\)|'
1484
+ r'\?|\?execute|\?if|and|assert|assert=|assert\?|bi|bi-curry|'
1485
+ r'bi-curry@|bi-curry\*|bi@|bi\*|boa|boolean|boolean\?|both\?|'
1486
+ r'build|call|callstack|callstack>array|callstack\?|clear|clone|'
1487
+ r'compose|compose\?|curry|curry\?|datastack|die|dip|do|drop|'
1488
+ r'dup|dupd|either\?|eq\?|equal\?|execute|hashcode|hashcode\*|'
1489
+ r'identity-hashcode|identity-tuple|identity-tuple\?|if|if\*|'
1490
+ r'keep|loop|most|new|nip|not|null|object|or|over|pick|prepose|'
1491
+ r'retainstack|rot|same\?|swap|swapd|throw|tri|tri-curry|'
1492
+ r'tri-curry@|tri-curry\*|tri@|tri\*|tuple|tuple\?|unless|'
1493
+ r'unless\*|until|when|when\*|while|with|wrapper|wrapper\?|xor)\s'
1494
+ )
1493
1495
 
1494
1496
  builtin_assocs = (
1495
- r'(?:\\?at|assoc\\?|assoc-clone-like|assoc=|delete-at\\*|'
1496
- r'assoc-partition|extract-keys|new-assoc|value\\?|assoc-size|'
1497
- r'map>assoc|push-at|assoc-like|key\\?|assoc-intersect|'
1498
- r'assoc-refine|update|assoc-union|assoc-combine|at\\*|'
1499
- r'assoc-empty\\?|at\\+|set-at|assoc-all\\?|assoc-subset\\?|'
1500
- r'assoc-hashcode|change-at|assoc-each|assoc-diff|zip|values|'
1501
- r'value-at|rename-at|inc-at|enum\\?|at|cache|assoc>map|<enum>|'
1502
- r'assoc|assoc-map|enum|value-at\\*|assoc-map-as|>alist|'
1503
- r'assoc-filter-as|clear-assoc|assoc-stack|maybe-set-at|'
1504
- r'substitute|assoc-filter|2cache|delete-at|assoc-find|keys|'
1505
- r'assoc-any\\?|unzip)\s'
1506
- )
1497
+ r'(?:2cache|<enum>|>alist|\?at|\?of|assoc|assoc-all\?|'
1498
+ r'assoc-any\?|assoc-clone-like|assoc-combine|assoc-diff|'
1499
+ r'assoc-diff!|assoc-differ|assoc-each|assoc-empty\?|'
1500
+ r'assoc-filter|assoc-filter!|assoc-filter-as|assoc-find|'
1501
+ r'assoc-hashcode|assoc-intersect|assoc-like|assoc-map|'
1502
+ r'assoc-map-as|assoc-partition|assoc-refine|assoc-size|'
1503
+ r'assoc-stack|assoc-subset\?|assoc-union|assoc-union!|'
1504
+ r'assoc=|assoc>map|assoc\?|at|at+|at\*|cache|change-at|'
1505
+ r'clear-assoc|delete-at|delete-at\*|enum|enum\?|extract-keys|'
1506
+ r'inc-at|key\?|keys|map>assoc|maybe-set-at|new-assoc|of|'
1507
+ r'push-at|rename-at|set-at|sift-keys|sift-values|substitute|'
1508
+ r'unzip|value-at|value-at\*|value\?|values|zip)\s'
1509
+ )
1507
1510
 
1508
1511
  builtin_combinators = (
1509
- r'(?:case|execute-effect|no-cond|no-case\\?|3cleave>quot|2cleave|'
1510
- r'cond>quot|wrong-values\\?|no-cond\\?|cleave>quot|no-case|'
1511
- r'case>quot|3cleave|wrong-values|to-fixed-point|alist>quot|'
1512
- r'case-find|cond|cleave|call-effect|2cleave>quot|recursive-hashcode|'
1513
- r'linear-case-quot|spread|spread>quot)\s'
1514
- )
1512
+ r'(?:2cleave|2cleave>quot|3cleave|3cleave>quot|4cleave|'
1513
+ r'4cleave>quot|alist>quot|call-effect|case|case-find|'
1514
+ r'case>quot|cleave|cleave>quot|cond|cond>quot|deep-spread>quot|'
1515
+ r'execute-effect|linear-case-quot|no-case|no-case\?|no-cond|'
1516
+ r'no-cond\?|recursive-hashcode|shallow-spread>quot|spread|'
1517
+ r'to-fixed-point|wrong-values|wrong-values\?)\s'
1518
+ )
1515
1519
 
1516
1520
  builtin_math = (
1517
- r'(?:number=|if-zero|next-power-of-2|each-integer|\\?1\\+|'
1518
- r'fp-special\\?|imaginary-part|unless-zero|float>bits|number\\?|'
1519
- r'fp-infinity\\?|bignum\\?|fp-snan\\?|denominator|fp-bitwise=|\\*|'
1520
- r'\\+|power-of-2\\?|-|u>=|/|>=|bitand|log2-expects-positive|<|'
1521
- r'log2|>|integer\\?|number|bits>double|2/|zero\\?|(find-integer)|'
1522
- r'bits>float|float\\?|shift|ratio\\?|even\\?|ratio|fp-sign|bitnot|'
1523
- r'>fixnum|complex\\?|/i|/f|byte-array>bignum|when-zero|sgn|>bignum|'
1524
- r'next-float|u<|u>|mod|recip|rational|find-last-integer|>float|'
1525
- r'(all-integers\\?)|2^|times|integer|fixnum\\?|neg|fixnum|sq|'
1526
- r'bignum|(each-integer)|bit\\?|fp-qnan\\?|find-integer|complex|'
1527
- r'<fp-nan>|real|double>bits|bitor|rem|fp-nan-payload|all-integers\\?|'
1528
- r'real-part|log2-expects-positive\\?|prev-float|align|unordered\\?|'
1529
- r'float|fp-nan\\?|abs|bitxor|u<=|odd\\?|<=|/mod|rational\\?|>integer|'
1530
- r'real\\?|numerator)\s'
1531
- )
1521
+ r'(?:-|/|/f|/i|/mod|2/|2\^|<|<=|<fp-nan>|>|>=|>bignum|'
1522
+ r'>fixnum|>float|>integer|\(all-integers\?\)|'
1523
+ r'\(each-integer\)|\(find-integer\)|\*|\+|\?1\+|'
1524
+ r'abs|align|all-integers\?|bignum|bignum\?|bit\?|bitand|'
1525
+ r'bitnot|bitor|bits>double|bits>float|bitxor|complex|'
1526
+ r'complex\?|denominator|double>bits|each-integer|even\?|'
1527
+ r'find-integer|find-last-integer|fixnum|fixnum\?|float|'
1528
+ r'float>bits|float\?|fp-bitwise=|fp-infinity\?|fp-nan-payload|'
1529
+ r'fp-nan\?|fp-qnan\?|fp-sign|fp-snan\?|fp-special\?|'
1530
+ r'if-zero|imaginary-part|integer|integer>fixnum|'
1531
+ r'integer>fixnum-strict|integer\?|log2|log2-expects-positive|'
1532
+ r'log2-expects-positive\?|mod|neg|neg\?|next-float|'
1533
+ r'next-power-of-2|number|number=|number\?|numerator|odd\?|'
1534
+ r'out-of-fixnum-range|out-of-fixnum-range\?|power-of-2\?|'
1535
+ r'prev-float|ratio|ratio\?|rational|rational\?|real|'
1536
+ r'real-part|real\?|recip|rem|sgn|shift|sq|times|u<|u<=|u>|'
1537
+ r'u>=|unless-zero|unordered\?|when-zero|zero\?)\s'
1538
+ )
1532
1539
 
1533
1540
  builtin_sequences = (
1534
- r'(?:member-eq\\?|append|assert-sequence=|find-last-from|trim-head-slice|'
1535
- r'clone-like|3sequence|assert-sequence\\?|map-as|last-index-from|'
1536
- r'reversed|index-from|cut\\*|pad-tail|remove-eq!|concat-as|'
1537
- r'but-last|snip|trim-tail|nths|nth|2selector|sequence|slice\\?|'
1538
- r'<slice>|partition|remove-nth|tail-slice|empty\\?|tail\\*|'
1539
- r'if-empty|find-from|virtual-sequence\\?|member\\?|set-length|'
1540
- r'drop-prefix|unclip|unclip-last-slice|iota|map-sum|'
1541
- r'bounds-error\\?|sequence-hashcode-step|selector-for|'
1542
- r'accumulate-as|map|start|midpoint@|\\(accumulate\\)|rest-slice|'
1543
- r'prepend|fourth|sift|accumulate!|new-sequence|follow|map!|'
1544
- r'like|first4|1sequence|reverse|slice|unless-empty|padding|'
1545
- r'virtual@|repetition\\?|set-last|index|4sequence|max-length|'
1546
- r'set-second|immutable-sequence|first2|first3|replicate-as|'
1547
- r'reduce-index|unclip-slice|supremum|suffix!|insert-nth|'
1548
- r'trim-tail-slice|tail|3append|short|count|suffix|concat|'
1549
- r'flip|filter|sum|immutable\\?|reverse!|2sequence|map-integers|'
1550
- r'delete-all|start\\*|indices|snip-slice|check-slice|sequence\\?|'
1551
- r'head|map-find|filter!|append-as|reduce|sequence=|halves|'
1552
- r'collapse-slice|interleave|2map|filter-as|binary-reduce|'
1553
- r'slice-error\\?|product|bounds-check\\?|bounds-check|harvest|'
1554
- r'immutable|virtual-exemplar|find|produce|remove|pad-head|last|'
1555
- r'replicate|set-fourth|remove-eq|shorten|reversed\\?|'
1556
- r'map-find-last|3map-as|2unclip-slice|shorter\\?|3map|find-last|'
1557
- r'head-slice|pop\\*|2map-as|tail-slice\\*|but-last-slice|'
1558
- r'2map-reduce|iota\\?|collector-for|accumulate|each|selector|'
1559
- r'append!|new-resizable|cut-slice|each-index|head-slice\\*|'
1560
- r'2reverse-each|sequence-hashcode|pop|set-nth|\\?nth|'
1561
- r'<flat-slice>|second|join|when-empty|collector|'
1562
- r'immutable-sequence\\?|<reversed>|all\\?|3append-as|'
1563
- r'virtual-sequence|subseq\\?|remove-nth!|push-either|new-like|'
1564
- r'length|last-index|push-if|2all\\?|lengthen|assert-sequence|'
1565
- r'copy|map-reduce|move|third|first|3each|tail\\?|set-first|'
1566
- r'prefix|bounds-error|any\\?|<repetition>|trim-slice|exchange|'
1567
- r'surround|2reduce|cut|change-nth|min-length|set-third|produce-as|'
1568
- r'push-all|head\\?|delete-slice|rest|sum-lengths|2each|head\\*|'
1569
- r'infimum|remove!|glue|slice-error|subseq|trim|replace-slice|'
1570
- r'push|repetition|map-index|trim-head|unclip-last|mismatch)\s'
1571
- )
1541
+ r'(?:1sequence|2all\?|2each|2map|2map-as|2map-reduce|2reduce|'
1542
+ r'2selector|2sequence|3append|3append-as|3each|3map|3map-as|'
1543
+ r'3sequence|4sequence|<repetition>|<reversed>|<slice>|\?first|'
1544
+ r'\?last|\?nth|\?second|\?set-nth|accumulate|accumulate!|'
1545
+ r'accumulate-as|all\?|any\?|append|append!|append-as|'
1546
+ r'assert-sequence|assert-sequence=|assert-sequence\?|'
1547
+ r'binary-reduce|bounds-check|bounds-check\?|bounds-error|'
1548
+ r'bounds-error\?|but-last|but-last-slice|cartesian-each|'
1549
+ r'cartesian-map|cartesian-product|change-nth|check-slice|'
1550
+ r'check-slice-error|clone-like|collapse-slice|collector|'
1551
+ r'collector-for|concat|concat-as|copy|count|cut|cut-slice|'
1552
+ r'cut\*|delete-all|delete-slice|drop-prefix|each|each-from|'
1553
+ r'each-index|empty\?|exchange|filter|filter!|filter-as|find|'
1554
+ r'find-from|find-index|find-index-from|find-last|find-last-from|'
1555
+ r'first|first2|first3|first4|flip|follow|fourth|glue|halves|'
1556
+ r'harvest|head|head-slice|head-slice\*|head\*|head\?|'
1557
+ r'if-empty|immutable|immutable-sequence|immutable-sequence\?|'
1558
+ r'immutable\?|index|index-from|indices|infimum|infimum-by|'
1559
+ r'insert-nth|interleave|iota|iota-tuple|iota-tuple\?|join|'
1560
+ r'join-as|last|last-index|last-index-from|length|lengthen|'
1561
+ r'like|longer|longer\?|longest|map|map!|map-as|map-find|'
1562
+ r'map-find-last|map-index|map-integers|map-reduce|map-sum|'
1563
+ r'max-length|member-eq\?|member\?|midpoint@|min-length|'
1564
+ r'mismatch|move|new-like|new-resizable|new-sequence|'
1565
+ r'non-negative-integer-expected|non-negative-integer-expected\?|'
1566
+ r'nth|nths|pad-head|pad-tail|padding|partition|pop|pop\*|'
1567
+ r'prefix|prepend|prepend-as|produce|produce-as|product|push|'
1568
+ r'push-all|push-either|push-if|reduce|reduce-index|remove|'
1569
+ r'remove!|remove-eq|remove-eq!|remove-nth|remove-nth!|repetition|'
1570
+ r'repetition\?|replace-slice|replicate|replicate-as|rest|'
1571
+ r'rest-slice|reverse|reverse!|reversed|reversed\?|second|'
1572
+ r'selector|selector-for|sequence|sequence-hashcode|sequence=|'
1573
+ r'sequence\?|set-first|set-fourth|set-last|set-length|set-nth|'
1574
+ r'set-second|set-third|short|shorten|shorter|shorter\?|'
1575
+ r'shortest|sift|slice|slice-error|slice-error\?|slice\?|'
1576
+ r'snip|snip-slice|start|start\*|subseq|subseq\?|suffix|'
1577
+ r'suffix!|sum|sum-lengths|supremum|supremum-by|surround|tail|'
1578
+ r'tail-slice|tail-slice\*|tail\*|tail\?|third|trim|'
1579
+ r'trim-head|trim-head-slice|trim-slice|trim-tail|trim-tail-slice|'
1580
+ r'unclip|unclip-last|unclip-last-slice|unclip-slice|unless-empty|'
1581
+ r'virtual-exemplar|virtual-sequence|virtual-sequence\?|virtual@|'
1582
+ r'when-empty)\s'
1583
+ )
1572
1584
 
1573
1585
  builtin_namespaces = (
1574
- r'(?:global|\\+@|change|set-namestack|change-global|init-namespaces|'
1575
- r'on|off|set-global|namespace|set|with-scope|bind|with-variable|'
1576
- r'inc|dec|counter|initialize|namestack|get|get-global|make-assoc)\s'
1577
- )
1586
+ r'(?:\+@|change|change-global|counter|dec|get|get-global|'
1587
+ r'global|inc|init-namespaces|initialize|is-global|make-assoc|'
1588
+ r'namespace|namestack|off|on|set|set-global|set-namestack|'
1589
+ r'toggle|with-global|with-scope|with-variable|with-variables)\s'
1590
+ )
1578
1591
 
1579
1592
  builtin_arrays = (
1580
- r'(?:<array>|2array|3array|pair|>array|1array|4array|pair\\?|'
1581
- r'array|resize-array|array\\?)\s'
1582
- )
1593
+ r'(?:1array|2array|3array|4array|<array>|>array|array|array\?|'
1594
+ r'pair|pair\?|resize-array)\s'
1595
+ )
1583
1596
 
1584
1597
  builtin_io = (
1585
- r'(?:\\+character\\+|bad-seek-type\\?|readln|each-morsel|stream-seek|'
1586
- r'read|print|with-output-stream|contents|write1|stream-write1|'
1587
- r'stream-copy|stream-element-type|with-input-stream|'
1588
- r'stream-print|stream-read|stream-contents|stream-tell|'
1589
- r'tell-output|bl|seek-output|bad-seek-type|nl|stream-nl|write|'
1590
- r'flush|stream-lines|\\+byte\\+|stream-flush|read1|'
1591
- r'seek-absolute\\?|stream-read1|lines|stream-readln|'
1592
- r'stream-read-until|each-line|seek-end|with-output-stream\\*|'
1593
- r'seek-absolute|with-streams|seek-input|seek-relative\\?|'
1594
- r'input-stream|stream-write|read-partial|seek-end\\?|'
1595
- r'seek-relative|error-stream|read-until|with-input-stream\\*|'
1596
- r'with-streams\\*|tell-input|each-block|output-stream|'
1597
- r'stream-read-partial|each-stream-block|each-stream-line)\s'
1598
- )
1598
+ r'(?:\(each-stream-block-slice\)|\(each-stream-block\)|'
1599
+ r'\(stream-contents-by-block\)|\(stream-contents-by-element\)|'
1600
+ r'\(stream-contents-by-length-or-block\)|'
1601
+ r'\(stream-contents-by-length\)|\+byte\+|\+character\+|'
1602
+ r'bad-seek-type|bad-seek-type\?|bl|contents|each-block|'
1603
+ r'each-block-size|each-block-slice|each-line|each-morsel|'
1604
+ r'each-stream-block|each-stream-block-slice|each-stream-line|'
1605
+ r'error-stream|flush|input-stream|input-stream\?|'
1606
+ r'invalid-read-buffer|invalid-read-buffer\?|lines|nl|'
1607
+ r'output-stream|output-stream\?|print|read|read-into|'
1608
+ r'read-partial|read-partial-into|read-until|read1|readln|'
1609
+ r'seek-absolute|seek-absolute\?|seek-end|seek-end\?|'
1610
+ r'seek-input|seek-output|seek-relative|seek-relative\?|'
1611
+ r'stream-bl|stream-contents|stream-contents\*|stream-copy|'
1612
+ r'stream-copy\*|stream-element-type|stream-flush|'
1613
+ r'stream-length|stream-lines|stream-nl|stream-print|'
1614
+ r'stream-read|stream-read-into|stream-read-partial|'
1615
+ r'stream-read-partial-into|stream-read-partial-unsafe|'
1616
+ r'stream-read-unsafe|stream-read-until|stream-read1|'
1617
+ r'stream-readln|stream-seek|stream-seekable\?|stream-tell|'
1618
+ r'stream-write|stream-write1|tell-input|tell-output|'
1619
+ r'with-error-stream|with-error-stream\*|with-error>output|'
1620
+ r'with-input-output\+error-streams|'
1621
+ r'with-input-output\+error-streams\*|with-input-stream|'
1622
+ r'with-input-stream\*|with-output-stream|with-output-stream\*|'
1623
+ r'with-output>error|with-output\+error-stream|'
1624
+ r'with-output\+error-stream\*|with-streams|with-streams\*|'
1625
+ r'write|write1)\s'
1626
+ )
1599
1627
 
1600
1628
  builtin_strings = (
1601
- r'(?:resize-string|>string|<string>|1string|string|string\\?)\s'
1602
- )
1629
+ r'(?:1string|<string>|>string|resize-string|string|string\?)\s'
1630
+ )
1603
1631
 
1604
1632
  builtin_vectors = (
1605
- r'(?:vector\\?|<vector>|\\?push|vector|>vector|1vector)\s'
1606
- )
1633
+ r'(?:1vector|<vector>|>vector|\?push|vector|vector\?)\s'
1634
+ )
1607
1635
 
1608
1636
  builtin_continuations = (
1609
- r'(?:with-return|restarts|return-continuation|with-datastack|'
1610
- r'recover|rethrow-restarts|<restart>|ifcc|set-catchstack|'
1611
- r'>continuation<|cleanup|ignore-errors|restart\\?|'
1612
- r'compute-restarts|attempt-all-error|error-thread|continue|'
1613
- r'<continuation>|attempt-all-error\\?|condition\\?|'
1614
- r'<condition>|throw-restarts|error|catchstack|continue-with|'
1615
- r'thread-error-hook|continuation|rethrow|callcc1|'
1616
- r'error-continuation|callcc0|attempt-all|condition|'
1617
- r'continuation\\?|restart|return)\s'
1618
- )
1637
+ r'(?:<condition>|<continuation>|<restart>|attempt-all|'
1638
+ r'attempt-all-error|attempt-all-error\?|callback-error-hook|'
1639
+ r'callcc0|callcc1|cleanup|compute-restarts|condition|'
1640
+ r'condition\?|continuation|continuation\?|continue|'
1641
+ r'continue-restart|continue-with|current-continuation|'
1642
+ r'error|error-continuation|error-in-thread|error-thread|'
1643
+ r'ifcc|ignore-errors|in-callback\?|original-error|recover|'
1644
+ r'restart|restart\?|restarts|rethrow|rethrow-restarts|'
1645
+ r'return|return-continuation|thread-error-hook|throw-continue|'
1646
+ r'throw-restarts|with-datastack|with-return)\s'
1647
+ )
1619
1648
 
1620
1649
  tokens = {
1621
1650
  'root': [
1622
- # TODO: (( inputs -- outputs ))
1623
- # TODO: << ... >>
1651
+ # factor allows a file to start with a shebang
1652
+ (r'#!.*$', Comment.Preproc),
1653
+ default('base'),
1654
+ ],
1655
+ 'base': [
1656
+ (r'\s+', Text),
1624
1657
 
1625
1658
  # defining words
1626
- (r'(\s*)(:|::|MACRO:|MEMO:)(\s+)(\S+)',
1627
- bygroups(Text, Keyword, Text, Name.Function)),
1628
- (r'(\s*)(M:)(\s+)(\S+)(\s+)(\S+)',
1629
- bygroups(Text, Keyword, Text, Name.Class, Text, Name.Function)),
1630
- (r'(\s*)(GENERIC:)(\s+)(\S+)',
1631
- bygroups(Text, Keyword, Text, Name.Function)),
1632
- (r'(\s*)(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)',
1633
- bygroups(Text, Keyword, Text, Name.Function, Text, Name.Function)),
1634
- (r'(\()(\s+)', bygroups(Name.Function, Text), 'stackeffect'),
1635
- (r'\;\s', Keyword),
1659
+ (r'((?:MACRO|MEMO|TYPED)?:[:]?)(\s+)(\S+)',
1660
+ bygroups(Keyword, Text, Name.Function)),
1661
+ (r'(M:[:]?)(\s+)(\S+)(\s+)(\S+)',
1662
+ bygroups(Keyword, Text, Name.Class, Text, Name.Function)),
1663
+ (r'(C:)(\s+)(\S+)(\s+)(\S+)',
1664
+ bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
1665
+ (r'(GENERIC:)(\s+)(\S+)',
1666
+ bygroups(Keyword, Text, Name.Function)),
1667
+ (r'(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)',
1668
+ bygroups(Keyword, Text, Name.Function, Text, Name.Function)),
1669
+ (r'\(\s', Name.Function, 'stackeffect'),
1670
+ (r';\s', Keyword),
1636
1671
 
1637
1672
  # imports and namespaces
1638
- (r'(USING:)((?:\s|\\\s)+)',
1639
- bygroups(Keyword.Namespace, Text), 'import'),
1640
- (r'(USE:)(\s+)(\S+)',
1641
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
1642
- (r'(UNUSE:)(\s+)(\S+)',
1673
+ (r'(USING:)(\s+)',
1674
+ bygroups(Keyword.Namespace, Text), 'vocabs'),
1675
+ (r'(USE:|UNUSE:|IN:|QUALIFIED:)(\s+)(\S+)',
1643
1676
  bygroups(Keyword.Namespace, Text, Name.Namespace)),
1644
- (r'(QUALIFIED:)(\s+)(\S+)',
1645
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
1646
- (r'(QUALIFIED-WITH:)(\s+)(\S+)',
1647
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
1648
- (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+)(=>)',
1649
- bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Text)),
1650
- (r'(IN:)(\s+)(\S+)',
1651
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
1652
- (r'(?:ALIAS|DEFER|FORGET|POSTPONE):', Keyword.Namespace),
1677
+ (r'(QUALIFIED-WITH:)(\s+)(\S+)(\s+)(\S+)',
1678
+ bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Name.Namespace)),
1679
+ (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+=>\s)',
1680
+ bygroups(Keyword.Namespace, Text, Name.Namespace, Text), 'words'),
1681
+ (r'(RENAME:)(\s+)(\S+)(\s+)(\S+)(\s+=>\s+)(\S+)',
1682
+ bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Namespace, Text, Name.Function)),
1683
+ (r'(ALIAS:|TYPEDEF:)(\s+)(\S+)(\s+)(\S+)',
1684
+ bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Function)),
1685
+ (r'(DEFER:|FORGET:|POSTPONE:)(\s+)(\S+)',
1686
+ bygroups(Keyword.Namespace, Text, Name.Function)),
1653
1687
 
1654
1688
  # tuples and classes
1655
- (r'(TUPLE:)(\s+)(\S+)(\s+<\s+)(\S+)',
1689
+ (r'(TUPLE:|ERROR:)(\s+)(\S+)(\s+<\s+)(\S+)',
1656
1690
  bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'),
1657
- (r'(TUPLE:)(\s+)(\S+)',
1691
+ (r'(TUPLE:|ERROR:|BUILTIN:)(\s+)(\S+)',
1658
1692
  bygroups(Keyword, Text, Name.Class), 'slots'),
1659
- (r'(UNION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1660
- (r'(INTERSECTION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1693
+ (r'(MIXIN:|UNION:|INTERSECTION:)(\s+)(\S+)',
1694
+ bygroups(Keyword, Text, Name.Class)),
1661
1695
  (r'(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)',
1662
- bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
1696
+ bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
1663
1697
  (r'(C:)(\s+)(\S+)(\s+)(\S+)',
1664
- bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
1665
- (r'INSTANCE:', Keyword),
1666
- (r'SLOT:', Keyword),
1667
- (r'MIXIN:', Keyword),
1668
- (r'(?:SINGLETON|SINGLETONS):', Keyword),
1698
+ bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
1699
+ (r'(INSTANCE:)(\s+)(\S+)(\s+)(\S+)',
1700
+ bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
1701
+ (r'(SLOT:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)),
1702
+ (r'(SINGLETON:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1703
+ (r'SINGLETONS:', Keyword, 'classes'),
1669
1704
 
1670
1705
  # other syntax
1671
- (r'CONSTANT:', Keyword),
1672
- (r'(?:SYMBOL|SYMBOLS):', Keyword),
1673
- (r'ERROR:', Keyword),
1674
- (r'SYNTAX:', Keyword),
1675
- (r'(HELP:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)),
1676
- (r'(MAIN:)(\s+)(\S+)',
1677
- bygroups(Keyword.Namespace, Text, Name.Function)),
1678
- (r'(?:ALIEN|TYPEDEF|FUNCTION|STRUCT):', Keyword),
1706
+ (r'(CONSTANT:|SYMBOL:|MAIN:|HELP:)(\s+)(\S+)',
1707
+ bygroups(Keyword, Text, Name.Function)),
1708
+ (r'SYMBOLS:\s', Keyword, 'words'),
1709
+ (r'SYNTAX:\s', Keyword),
1710
+ (r'ALIEN:\s', Keyword),
1711
+ (r'(STRUCT:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
1712
+ (r'(FUNCTION:)(\s+\S+\s+)(\S+)(\s+\(\s+[^\)]+\)\s)',
1713
+ bygroups(Keyword.Namespace, Text, Name.Function, Text)),
1714
+ (r'(FUNCTION-ALIAS:)(\s+)(\S+)(\s+\S+\s+)(\S+)(\s+\(\s+[^\)]+\)\s)',
1715
+ bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Function, Text)),
1679
1716
 
1680
1717
  # vocab.private
1681
- # TODO: words inside vocab.private should have red names?
1682
- (r'(?:<PRIVATE|PRIVATE>)', Keyword.Namespace),
1718
+ (r'(?:<PRIVATE|PRIVATE>)\s', Keyword.Namespace),
1683
1719
 
1684
1720
  # strings
1685
1721
  (r'"""\s+(?:.|\n)*?\s+"""', String),
1686
1722
  (r'"(?:\\\\|\\"|[^"])*"', String),
1687
- (r'CHAR:\s+(\\[\\abfnrstv]*|\S)\s', String.Char),
1723
+ (r'\S+"\s+(?:\\\\|\\"|[^"])*"', String),
1724
+ (r'CHAR:\s+(?:\\[\\abfnrstv]|[^\\]\S*)\s', String.Char),
1688
1725
 
1689
1726
  # comments
1690
- (r'\!\s+.*$', Comment),
1691
- (r'#\!\s+.*$', Comment),
1727
+ (r'!\s+.*$', Comment),
1728
+ (r'#!\s+.*$', Comment),
1729
+ (r'/\*\s+(?:.|\n)*?\s\*/\s', Comment),
1692
1730
 
1693
1731
  # boolean constants
1694
- (r'(t|f)\s', Name.Constant),
1732
+ (r'[tf]\s', Name.Constant),
1695
1733
 
1696
- # numbers
1697
- (r'-?\d+\.\d+\s', Number.Float),
1698
- (r'-?\d+\s', Number.Integer),
1699
- (r'HEX:\s+[a-fA-F\d]+\s', Number.Hex),
1700
- (r'BIN:\s+[01]+\s', Number.Integer),
1701
- (r'OCT:\s+[0-7]+\s', Number.Oct),
1734
+ # symbols and literals
1735
+ (r'[\\$]\s+\S+', Name.Constant),
1736
+ (r'M\\\s+\S+\s+\S+', Name.Constant),
1702
1737
 
1703
- # operators
1704
- (r'[-+/*=<>^]\s', Operator),
1738
+ # numbers
1739
+ (r'[+-]?(?:[\d,]*\d)?\.(?:\d([\d,]*\d)?)?(?:[eE][+-]?\d+)?\s', Number),
1740
+ (r'[+-]?\d(?:[\d,]*\d)?(?:[eE][+-]?\d+)?\s', Number),
1741
+ (r'0x[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s', Number),
1742
+ (r'NAN:\s+[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s', Number),
1743
+ (r'0b[01]+\s', Number.Bin),
1744
+ (r'0o[0-7]+\s', Number.Oct),
1745
+ (r'(?:\d([\d,]*\d)?)?\+\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s', Number),
1746
+ (r'(?:\-\d([\d,]*\d)?)?\-\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s', Number),
1705
1747
 
1706
1748
  # keywords
1707
1749
  (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s',
@@ -1720,31 +1762,37 @@ class FactorLexer(RegexLexer):
1720
1762
  (builtin_vectors, Name.Builtin),
1721
1763
  (builtin_continuations, Name.Builtin),
1722
1764
 
1723
- # whitespaces - usually not relevant
1724
- (r'\s+', Text),
1725
-
1726
1765
  # everything else is text
1727
1766
  (r'\S+', Text),
1728
1767
  ],
1729
-
1730
1768
  'stackeffect': [
1731
- (r'\s*\(', Name.Function, 'stackeffect'),
1732
- (r'\)', Name.Function, '#pop'),
1733
- (r'\-\-', Name.Function),
1734
1769
  (r'\s+', Text),
1770
+ (r'\(\s+', Name.Function, 'stackeffect'),
1771
+ (r'\)\s', Name.Function, '#pop'),
1772
+ (r'--\s', Name.Function),
1735
1773
  (r'\S+', Name.Variable),
1736
1774
  ],
1737
-
1738
1775
  'slots': [
1739
1776
  (r'\s+', Text),
1740
1777
  (r';\s', Keyword, '#pop'),
1778
+ (r'({\s+)(\S+)(\s+[^}]+\s+}\s)',
1779
+ bygroups(Text, Name.Variable, Text)),
1741
1780
  (r'\S+', Name.Variable),
1742
1781
  ],
1743
-
1744
- 'import': [
1745
- (r';', Keyword, '#pop'),
1782
+ 'vocabs': [
1783
+ (r'\s+', Text),
1784
+ (r';\s', Keyword, '#pop'),
1746
1785
  (r'\S+', Name.Namespace),
1786
+ ],
1787
+ 'classes': [
1788
+ (r'\s+', Text),
1789
+ (r';\s', Keyword, '#pop'),
1790
+ (r'\S+', Name.Class),
1791
+ ],
1792
+ 'words': [
1747
1793
  (r'\s+', Text),
1794
+ (r';\s', Keyword, '#pop'),
1795
+ (r'\S+', Name.Function),
1748
1796
  ],
1749
1797
  }
1750
1798
 
@@ -1757,7 +1805,7 @@ class FancyLexer(RegexLexer):
1757
1805
  class-based, concurrent general-purpose programming language
1758
1806
  running on Rubinius, the Ruby VM.
1759
1807
 
1760
- *New in Pygments 1.5.*
1808
+ .. versionadded:: 1.5
1761
1809
  """
1762
1810
  name = 'Fancy'
1763
1811
  filenames = ['*.fy', '*.fancypack']
@@ -1809,14 +1857,14 @@ class FancyLexer(RegexLexer):
1809
1857
  r'FalseClass|Tuple|Symbol|Stack|Set|FancySpec|Method|Package|'
1810
1858
  r'Range)\b', Name.Builtin),
1811
1859
  # functions
1812
- (r'[a-zA-Z]([a-zA-Z0-9_]|[-+?!=*/^><%])*:', Name.Function),
1860
+ (r'[a-zA-Z](\w|[-+?!=*/^><%])*:', Name.Function),
1813
1861
  # operators, must be below functions
1814
1862
  (r'[-+*/~,<>=&!?%^\[\]\.$]+', Operator),
1815
- ('[A-Z][a-zA-Z0-9_]*', Name.Constant),
1816
- ('@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
1817
- ('@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
1863
+ ('[A-Z]\w*', Name.Constant),
1864
+ ('@[a-zA-Z_]\w*', Name.Variable.Instance),
1865
+ ('@@[a-zA-Z_]\w*', Name.Variable.Class),
1818
1866
  ('@@?', Operator),
1819
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
1867
+ ('[a-zA-Z_]\w*', Name),
1820
1868
  # numbers - / checks are necessary to avoid mismarking regexes,
1821
1869
  # see comment in RubyLexer
1822
1870
  (r'(0[oO]?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?',
@@ -1839,7 +1887,7 @@ class DgLexer(RegexLexer):
1839
1887
  a functional and object-oriented programming language
1840
1888
  running on the CPython 3 VM.
1841
1889
 
1842
- *New in Pygments 1.6.*
1890
+ .. versionadded:: 1.6
1843
1891
  """
1844
1892
  name = 'dg'
1845
1893
  aliases = ['dg']
@@ -1848,63 +1896,60 @@ class DgLexer(RegexLexer):
1848
1896
 
1849
1897
  tokens = {
1850
1898
  'root': [
1851
- # Whitespace:
1852
1899
  (r'\s+', Text),
1853
1900
  (r'#.*?$', Comment.Single),
1854
- # Lexemes:
1855
- # Numbers
1856
- (r'0[bB][01]+', Number.Bin),
1857
- (r'0[oO][0-7]+', Number.Oct),
1858
- (r'0[xX][\da-fA-F]+', Number.Hex),
1859
- (r'[+-]?\d+\.\d+([eE][+-]?\d+)?[jJ]?', Number.Float),
1860
- (r'[+-]?\d+[eE][+-]?\d+[jJ]?', Number.Float),
1861
- (r'[+-]?\d+[jJ]?', Number.Integer),
1862
- # Character/String Literals
1863
- (r"[br]*'''", String, combined('stringescape', 'tsqs', 'string')),
1864
- (r'[br]*"""', String, combined('stringescape', 'tdqs', 'string')),
1865
- (r"[br]*'", String, combined('stringescape', 'sqs', 'string')),
1866
- (r'[br]*"', String, combined('stringescape', 'dqs', 'string')),
1867
- # Operators
1868
- (r"`\w+'*`", Operator), # Infix links
1869
- # Reserved infix links
1870
- (r'\b(or|and|if|else|where|is|in)\b', Operator.Word),
1901
+
1902
+ (r'(?i)0b[01]+', Number.Bin),
1903
+ (r'(?i)0o[0-7]+', Number.Oct),
1904
+ (r'(?i)0x[0-9a-f]+', Number.Hex),
1905
+ (r'(?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?', Number.Float),
1906
+ (r'(?i)[+-]?[0-9]+e[+-]?\d+j?', Number.Float),
1907
+ (r'(?i)[+-]?[0-9]+j?', Number.Integer),
1908
+
1909
+ (r"(?i)(br|r?b?)'''", String, combined('stringescape', 'tsqs', 'string')),
1910
+ (r'(?i)(br|r?b?)"""', String, combined('stringescape', 'tdqs', 'string')),
1911
+ (r"(?i)(br|r?b?)'", String, combined('stringescape', 'sqs', 'string')),
1912
+ (r'(?i)(br|r?b?)"', String, combined('stringescape', 'dqs', 'string')),
1913
+
1914
+ (r"`\w+'*`", Operator),
1915
+ (r'\b(and|in|is|or|where)\b', Operator.Word),
1871
1916
  (r'[!$%&*+\-./:<-@\\^|~;,]+', Operator),
1872
- # Identifiers
1873
- # Python 3 types
1917
+
1874
1918
  (r"(?<!\.)(bool|bytearray|bytes|classmethod|complex|dict'?|"
1875
1919
  r"float|frozenset|int|list'?|memoryview|object|property|range|"
1876
1920
  r"set'?|slice|staticmethod|str|super|tuple'?|type)"
1877
1921
  r"(?!['\w])", Name.Builtin),
1878
- # Python 3 builtins + some more
1879
1922
  (r'(?<!\.)(__import__|abs|all|any|bin|bind|chr|cmp|compile|complex|'
1880
- r'delattr|dir|divmod|drop|dropwhile|enumerate|eval|filter|flip|'
1881
- r'foldl1?|format|fst|getattr|globals|hasattr|hash|head|hex|id|'
1882
- r'init|input|isinstance|issubclass|iter|iterate|last|len|locals|'
1883
- r'map|max|min|next|oct|open|ord|pow|print|repr|reversed|round|'
1884
- r'setattr|scanl1?|snd|sorted|sum|tail|take|takewhile|vars|zip)'
1885
- r"(?!['\w])", Name.Builtin),
1923
+ r'delattr|dir|divmod|drop|dropwhile|enumerate|eval|exhaust|'
1924
+ r'filter|flip|foldl1?|format|fst|getattr|globals|hasattr|hash|'
1925
+ r'head|hex|id|init|input|isinstance|issubclass|iter|iterate|last|'
1926
+ r'len|locals|map|max|min|next|oct|open|ord|pow|print|repr|'
1927
+ r'reversed|round|setattr|scanl1?|snd|sorted|sum|tail|take|'
1928
+ r"takewhile|vars|zip)(?!['\w])", Name.Builtin),
1886
1929
  (r"(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])",
1887
1930
  Name.Builtin.Pseudo),
1931
+
1888
1932
  (r"(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])",
1889
1933
  Name.Exception),
1890
- (r"(?<!\.)(KeyboardInterrupt|SystemExit|StopIteration|"
1891
- r"GeneratorExit)(?!['\w])", Name.Exception),
1892
- # Compiler-defined identifiers
1893
- (r"(?<![\.\w])(import|inherit|for|while|switch|not|raise|unsafe|"
1894
- r"yield|with)(?!['\w])", Keyword.Reserved),
1895
- # Other links
1896
- (r"[A-Z_']+\b", Name),
1897
- (r"[A-Z][\w']*\b", Keyword.Type),
1934
+ (r"(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|"
1935
+ r"SystemExit)(?!['\w])", Name.Exception),
1936
+
1937
+ (r"(?<![\.\w])(except|finally|for|if|import|not|otherwise|raise|"
1938
+ r"subclass|while|with|yield)(?!['\w])", Keyword.Reserved),
1939
+
1940
+ (r"[A-Z_]+'*(?!['\w])", Name),
1941
+ (r"[A-Z]\w+'*(?!['\w])", Keyword.Type),
1898
1942
  (r"\w+'*", Name),
1899
- # Blocks
1943
+
1900
1944
  (r'[()]', Punctuation),
1945
+ (r'.', Error),
1901
1946
  ],
1902
1947
  'stringescape': [
1903
1948
  (r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
1904
1949
  r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
1905
1950
  ],
1906
1951
  'string': [
1907
- (r'%(\([a-zA-Z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
1952
+ (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
1908
1953
  '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol),
1909
1954
  (r'[^\\\'"%\n]+', String),
1910
1955
  # quotes, percents and backslashes must be parsed one at a time
@@ -1927,21 +1972,22 @@ class DgLexer(RegexLexer):
1927
1972
  ],
1928
1973
  }
1929
1974
 
1975
+
1930
1976
  class Perl6Lexer(ExtendedRegexLexer):
1931
1977
  """
1932
1978
  For `Perl 6 <http://www.perl6.org>`_ source code.
1933
1979
 
1934
- *New in Pygments 1.7.*
1980
+ .. versionadded:: 2.0
1935
1981
  """
1936
1982
 
1937
1983
  name = 'Perl6'
1938
1984
  aliases = ['perl6', 'pl6']
1939
1985
  filenames = ['*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6',
1940
- '*.6pm', '*.p6m', '*.pm6']
1986
+ '*.6pm', '*.p6m', '*.pm6', '*.t']
1941
1987
  mimetypes = ['text/x-perl6', 'application/x-perl6']
1942
1988
  flags = re.MULTILINE | re.DOTALL | re.UNICODE
1943
1989
 
1944
- PERL6_IDENTIFIER_RANGE = "['a-zA-Z0-9_:-]"
1990
+ PERL6_IDENTIFIER_RANGE = "['\w:-]"
1945
1991
 
1946
1992
  PERL6_KEYWORDS = (
1947
1993
  'BEGIN', 'CATCH', 'CHECK', 'CONTROL', 'END', 'ENTER', 'FIRST', 'INIT',
@@ -2032,62 +2078,80 @@ class Perl6Lexer(ExtendedRegexLexer):
2032
2078
  # Perl 6 has a *lot* of possible bracketing characters
2033
2079
  # this list was lifted from STD.pm6 (https://github.com/perl6/std)
2034
2080
  PERL6_BRACKETS = {
2035
- u'\u0028' : u'\u0029', u'\u003c' : u'\u003e', u'\u005b' : u'\u005d', u'\u007b' : u'\u007d',
2036
- u'\u00ab' : u'\u00bb', u'\u0f3a' : u'\u0f3b', u'\u0f3c' : u'\u0f3d', u'\u169b' : u'\u169c',
2037
- u'\u2018' : u'\u2019', u'\u201a' : u'\u2019', u'\u201b' : u'\u2019', u'\u201c' : u'\u201d',
2038
- u'\u201e' : u'\u201d', u'\u201f' : u'\u201d', u'\u2039' : u'\u203a', u'\u2045' : u'\u2046',
2039
- u'\u207d' : u'\u207e', u'\u208d' : u'\u208e', u'\u2208' : u'\u220b', u'\u2209' : u'\u220c',
2040
- u'\u220a' : u'\u220d', u'\u2215' : u'\u29f5', u'\u223c' : u'\u223d', u'\u2243' : u'\u22cd',
2041
- u'\u2252' : u'\u2253', u'\u2254' : u'\u2255', u'\u2264' : u'\u2265', u'\u2266' : u'\u2267',
2042
- u'\u2268' : u'\u2269', u'\u226a' : u'\u226b', u'\u226e' : u'\u226f', u'\u2270' : u'\u2271',
2043
- u'\u2272' : u'\u2273', u'\u2274' : u'\u2275', u'\u2276' : u'\u2277', u'\u2278' : u'\u2279',
2044
- u'\u227a' : u'\u227b', u'\u227c' : u'\u227d', u'\u227e' : u'\u227f', u'\u2280' : u'\u2281',
2045
- u'\u2282' : u'\u2283', u'\u2284' : u'\u2285', u'\u2286' : u'\u2287', u'\u2288' : u'\u2289',
2046
- u'\u228a' : u'\u228b', u'\u228f' : u'\u2290', u'\u2291' : u'\u2292', u'\u2298' : u'\u29b8',
2047
- u'\u22a2' : u'\u22a3', u'\u22a6' : u'\u2ade', u'\u22a8' : u'\u2ae4', u'\u22a9' : u'\u2ae3',
2048
- u'\u22ab' : u'\u2ae5', u'\u22b0' : u'\u22b1', u'\u22b2' : u'\u22b3', u'\u22b4' : u'\u22b5',
2049
- u'\u22b6' : u'\u22b7', u'\u22c9' : u'\u22ca', u'\u22cb' : u'\u22cc', u'\u22d0' : u'\u22d1',
2050
- u'\u22d6' : u'\u22d7', u'\u22d8' : u'\u22d9', u'\u22da' : u'\u22db', u'\u22dc' : u'\u22dd',
2051
- u'\u22de' : u'\u22df', u'\u22e0' : u'\u22e1', u'\u22e2' : u'\u22e3', u'\u22e4' : u'\u22e5',
2052
- u'\u22e6' : u'\u22e7', u'\u22e8' : u'\u22e9', u'\u22ea' : u'\u22eb', u'\u22ec' : u'\u22ed',
2053
- u'\u22f0' : u'\u22f1', u'\u22f2' : u'\u22fa', u'\u22f3' : u'\u22fb', u'\u22f4' : u'\u22fc',
2054
- u'\u22f6' : u'\u22fd', u'\u22f7' : u'\u22fe', u'\u2308' : u'\u2309', u'\u230a' : u'\u230b',
2055
- u'\u2329' : u'\u232a', u'\u23b4' : u'\u23b5', u'\u2768' : u'\u2769', u'\u276a' : u'\u276b',
2056
- u'\u276c' : u'\u276d', u'\u276e' : u'\u276f', u'\u2770' : u'\u2771', u'\u2772' : u'\u2773',
2057
- u'\u2774' : u'\u2775', u'\u27c3' : u'\u27c4', u'\u27c5' : u'\u27c6', u'\u27d5' : u'\u27d6',
2058
- u'\u27dd' : u'\u27de', u'\u27e2' : u'\u27e3', u'\u27e4' : u'\u27e5', u'\u27e6' : u'\u27e7',
2059
- u'\u27e8' : u'\u27e9', u'\u27ea' : u'\u27eb', u'\u2983' : u'\u2984', u'\u2985' : u'\u2986',
2060
- u'\u2987' : u'\u2988', u'\u2989' : u'\u298a', u'\u298b' : u'\u298c', u'\u298d' : u'\u298e',
2061
- u'\u298f' : u'\u2990', u'\u2991' : u'\u2992', u'\u2993' : u'\u2994', u'\u2995' : u'\u2996',
2062
- u'\u2997' : u'\u2998', u'\u29c0' : u'\u29c1', u'\u29c4' : u'\u29c5', u'\u29cf' : u'\u29d0',
2063
- u'\u29d1' : u'\u29d2', u'\u29d4' : u'\u29d5', u'\u29d8' : u'\u29d9', u'\u29da' : u'\u29db',
2064
- u'\u29f8' : u'\u29f9', u'\u29fc' : u'\u29fd', u'\u2a2b' : u'\u2a2c', u'\u2a2d' : u'\u2a2e',
2065
- u'\u2a34' : u'\u2a35', u'\u2a3c' : u'\u2a3d', u'\u2a64' : u'\u2a65', u'\u2a79' : u'\u2a7a',
2066
- u'\u2a7d' : u'\u2a7e', u'\u2a7f' : u'\u2a80', u'\u2a81' : u'\u2a82', u'\u2a83' : u'\u2a84',
2067
- u'\u2a8b' : u'\u2a8c', u'\u2a91' : u'\u2a92', u'\u2a93' : u'\u2a94', u'\u2a95' : u'\u2a96',
2068
- u'\u2a97' : u'\u2a98', u'\u2a99' : u'\u2a9a', u'\u2a9b' : u'\u2a9c', u'\u2aa1' : u'\u2aa2',
2069
- u'\u2aa6' : u'\u2aa7', u'\u2aa8' : u'\u2aa9', u'\u2aaa' : u'\u2aab', u'\u2aac' : u'\u2aad',
2070
- u'\u2aaf' : u'\u2ab0', u'\u2ab3' : u'\u2ab4', u'\u2abb' : u'\u2abc', u'\u2abd' : u'\u2abe',
2071
- u'\u2abf' : u'\u2ac0', u'\u2ac1' : u'\u2ac2', u'\u2ac3' : u'\u2ac4', u'\u2ac5' : u'\u2ac6',
2072
- u'\u2acd' : u'\u2ace', u'\u2acf' : u'\u2ad0', u'\u2ad1' : u'\u2ad2', u'\u2ad3' : u'\u2ad4',
2073
- u'\u2ad5' : u'\u2ad6', u'\u2aec' : u'\u2aed', u'\u2af7' : u'\u2af8', u'\u2af9' : u'\u2afa',
2074
- u'\u2e02' : u'\u2e03', u'\u2e04' : u'\u2e05', u'\u2e09' : u'\u2e0a', u'\u2e0c' : u'\u2e0d',
2075
- u'\u2e1c' : u'\u2e1d', u'\u2e20' : u'\u2e21', u'\u3008' : u'\u3009', u'\u300a' : u'\u300b',
2076
- u'\u300c' : u'\u300d', u'\u300e' : u'\u300f', u'\u3010' : u'\u3011', u'\u3014' : u'\u3015',
2077
- u'\u3016' : u'\u3017', u'\u3018' : u'\u3019', u'\u301a' : u'\u301b', u'\u301d' : u'\u301e',
2078
- u'\ufd3e' : u'\ufd3f', u'\ufe17' : u'\ufe18', u'\ufe35' : u'\ufe36', u'\ufe37' : u'\ufe38',
2079
- u'\ufe39' : u'\ufe3a', u'\ufe3b' : u'\ufe3c', u'\ufe3d' : u'\ufe3e', u'\ufe3f' : u'\ufe40',
2080
- u'\ufe41' : u'\ufe42', u'\ufe43' : u'\ufe44', u'\ufe47' : u'\ufe48', u'\ufe59' : u'\ufe5a',
2081
- u'\ufe5b' : u'\ufe5c', u'\ufe5d' : u'\ufe5e', u'\uff08' : u'\uff09', u'\uff1c' : u'\uff1e',
2082
- u'\uff3b' : u'\uff3d', u'\uff5b' : u'\uff5d', u'\uff5f' : u'\uff60', u'\uff62' : u'\uff63',
2081
+ u'\u0028' : u'\u0029', u'\u003c' : u'\u003e', u'\u005b' : u'\u005d',
2082
+ u'\u007b' : u'\u007d', u'\u00ab' : u'\u00bb', u'\u0f3a' : u'\u0f3b',
2083
+ u'\u0f3c' : u'\u0f3d', u'\u169b' : u'\u169c', u'\u2018' : u'\u2019',
2084
+ u'\u201a' : u'\u2019', u'\u201b' : u'\u2019', u'\u201c' : u'\u201d',
2085
+ u'\u201e' : u'\u201d', u'\u201f' : u'\u201d', u'\u2039' : u'\u203a',
2086
+ u'\u2045' : u'\u2046', u'\u207d' : u'\u207e', u'\u208d' : u'\u208e',
2087
+ u'\u2208' : u'\u220b', u'\u2209' : u'\u220c', u'\u220a' : u'\u220d',
2088
+ u'\u2215' : u'\u29f5', u'\u223c' : u'\u223d', u'\u2243' : u'\u22cd',
2089
+ u'\u2252' : u'\u2253', u'\u2254' : u'\u2255', u'\u2264' : u'\u2265',
2090
+ u'\u2266' : u'\u2267', u'\u2268' : u'\u2269', u'\u226a' : u'\u226b',
2091
+ u'\u226e' : u'\u226f', u'\u2270' : u'\u2271', u'\u2272' : u'\u2273',
2092
+ u'\u2274' : u'\u2275', u'\u2276' : u'\u2277', u'\u2278' : u'\u2279',
2093
+ u'\u227a' : u'\u227b', u'\u227c' : u'\u227d', u'\u227e' : u'\u227f',
2094
+ u'\u2280' : u'\u2281', u'\u2282' : u'\u2283', u'\u2284' : u'\u2285',
2095
+ u'\u2286' : u'\u2287', u'\u2288' : u'\u2289', u'\u228a' : u'\u228b',
2096
+ u'\u228f' : u'\u2290', u'\u2291' : u'\u2292', u'\u2298' : u'\u29b8',
2097
+ u'\u22a2' : u'\u22a3', u'\u22a6' : u'\u2ade', u'\u22a8' : u'\u2ae4',
2098
+ u'\u22a9' : u'\u2ae3', u'\u22ab' : u'\u2ae5', u'\u22b0' : u'\u22b1',
2099
+ u'\u22b2' : u'\u22b3', u'\u22b4' : u'\u22b5', u'\u22b6' : u'\u22b7',
2100
+ u'\u22c9' : u'\u22ca', u'\u22cb' : u'\u22cc', u'\u22d0' : u'\u22d1',
2101
+ u'\u22d6' : u'\u22d7', u'\u22d8' : u'\u22d9', u'\u22da' : u'\u22db',
2102
+ u'\u22dc' : u'\u22dd', u'\u22de' : u'\u22df', u'\u22e0' : u'\u22e1',
2103
+ u'\u22e2' : u'\u22e3', u'\u22e4' : u'\u22e5', u'\u22e6' : u'\u22e7',
2104
+ u'\u22e8' : u'\u22e9', u'\u22ea' : u'\u22eb', u'\u22ec' : u'\u22ed',
2105
+ u'\u22f0' : u'\u22f1', u'\u22f2' : u'\u22fa', u'\u22f3' : u'\u22fb',
2106
+ u'\u22f4' : u'\u22fc', u'\u22f6' : u'\u22fd', u'\u22f7' : u'\u22fe',
2107
+ u'\u2308' : u'\u2309', u'\u230a' : u'\u230b', u'\u2329' : u'\u232a',
2108
+ u'\u23b4' : u'\u23b5', u'\u2768' : u'\u2769', u'\u276a' : u'\u276b',
2109
+ u'\u276c' : u'\u276d', u'\u276e' : u'\u276f', u'\u2770' : u'\u2771',
2110
+ u'\u2772' : u'\u2773', u'\u2774' : u'\u2775', u'\u27c3' : u'\u27c4',
2111
+ u'\u27c5' : u'\u27c6', u'\u27d5' : u'\u27d6', u'\u27dd' : u'\u27de',
2112
+ u'\u27e2' : u'\u27e3', u'\u27e4' : u'\u27e5', u'\u27e6' : u'\u27e7',
2113
+ u'\u27e8' : u'\u27e9', u'\u27ea' : u'\u27eb', u'\u2983' : u'\u2984',
2114
+ u'\u2985' : u'\u2986', u'\u2987' : u'\u2988', u'\u2989' : u'\u298a',
2115
+ u'\u298b' : u'\u298c', u'\u298d' : u'\u298e', u'\u298f' : u'\u2990',
2116
+ u'\u2991' : u'\u2992', u'\u2993' : u'\u2994', u'\u2995' : u'\u2996',
2117
+ u'\u2997' : u'\u2998', u'\u29c0' : u'\u29c1', u'\u29c4' : u'\u29c5',
2118
+ u'\u29cf' : u'\u29d0', u'\u29d1' : u'\u29d2', u'\u29d4' : u'\u29d5',
2119
+ u'\u29d8' : u'\u29d9', u'\u29da' : u'\u29db', u'\u29f8' : u'\u29f9',
2120
+ u'\u29fc' : u'\u29fd', u'\u2a2b' : u'\u2a2c', u'\u2a2d' : u'\u2a2e',
2121
+ u'\u2a34' : u'\u2a35', u'\u2a3c' : u'\u2a3d', u'\u2a64' : u'\u2a65',
2122
+ u'\u2a79' : u'\u2a7a', u'\u2a7d' : u'\u2a7e', u'\u2a7f' : u'\u2a80',
2123
+ u'\u2a81' : u'\u2a82', u'\u2a83' : u'\u2a84', u'\u2a8b' : u'\u2a8c',
2124
+ u'\u2a91' : u'\u2a92', u'\u2a93' : u'\u2a94', u'\u2a95' : u'\u2a96',
2125
+ u'\u2a97' : u'\u2a98', u'\u2a99' : u'\u2a9a', u'\u2a9b' : u'\u2a9c',
2126
+ u'\u2aa1' : u'\u2aa2', u'\u2aa6' : u'\u2aa7', u'\u2aa8' : u'\u2aa9',
2127
+ u'\u2aaa' : u'\u2aab', u'\u2aac' : u'\u2aad', u'\u2aaf' : u'\u2ab0',
2128
+ u'\u2ab3' : u'\u2ab4', u'\u2abb' : u'\u2abc', u'\u2abd' : u'\u2abe',
2129
+ u'\u2abf' : u'\u2ac0', u'\u2ac1' : u'\u2ac2', u'\u2ac3' : u'\u2ac4',
2130
+ u'\u2ac5' : u'\u2ac6', u'\u2acd' : u'\u2ace', u'\u2acf' : u'\u2ad0',
2131
+ u'\u2ad1' : u'\u2ad2', u'\u2ad3' : u'\u2ad4', u'\u2ad5' : u'\u2ad6',
2132
+ u'\u2aec' : u'\u2aed', u'\u2af7' : u'\u2af8', u'\u2af9' : u'\u2afa',
2133
+ u'\u2e02' : u'\u2e03', u'\u2e04' : u'\u2e05', u'\u2e09' : u'\u2e0a',
2134
+ u'\u2e0c' : u'\u2e0d', u'\u2e1c' : u'\u2e1d', u'\u2e20' : u'\u2e21',
2135
+ u'\u3008' : u'\u3009', u'\u300a' : u'\u300b', u'\u300c' : u'\u300d',
2136
+ u'\u300e' : u'\u300f', u'\u3010' : u'\u3011', u'\u3014' : u'\u3015',
2137
+ u'\u3016' : u'\u3017', u'\u3018' : u'\u3019', u'\u301a' : u'\u301b',
2138
+ u'\u301d' : u'\u301e', u'\ufd3e' : u'\ufd3f', u'\ufe17' : u'\ufe18',
2139
+ u'\ufe35' : u'\ufe36', u'\ufe37' : u'\ufe38', u'\ufe39' : u'\ufe3a',
2140
+ u'\ufe3b' : u'\ufe3c', u'\ufe3d' : u'\ufe3e', u'\ufe3f' : u'\ufe40',
2141
+ u'\ufe41' : u'\ufe42', u'\ufe43' : u'\ufe44', u'\ufe47' : u'\ufe48',
2142
+ u'\ufe59' : u'\ufe5a', u'\ufe5b' : u'\ufe5c', u'\ufe5d' : u'\ufe5e',
2143
+ u'\uff08' : u'\uff09', u'\uff1c' : u'\uff1e', u'\uff3b' : u'\uff3d',
2144
+ u'\uff5b' : u'\uff5d', u'\uff5f' : u'\uff60', u'\uff62' : u'\uff63',
2083
2145
  }
2084
2146
 
2085
2147
  def _build_word_match(words, boundary_regex_fragment = None, prefix = '', suffix = ''):
2086
2148
  if boundary_regex_fragment is None:
2087
- return r'\b(' + prefix + r'|'.join([ re.escape(x) for x in words]) + suffix + r')\b'
2149
+ return r'\b(' + prefix + r'|'.join([ re.escape(x) for x in words]) + \
2150
+ suffix + r')\b'
2088
2151
  else:
2089
- return r'(?<!' + boundary_regex_fragment + ')' + prefix + '(' + \
2090
- r'|'.join([ re.escape(x) for x in words]) + r')' + suffix + '(?!' + boundary_regex_fragment + ')'
2152
+ return r'(?<!' + boundary_regex_fragment + r')' + prefix + r'(' + \
2153
+ r'|'.join([ re.escape(x) for x in words]) + r')' + suffix + r'(?!' + \
2154
+ boundary_regex_fragment + r')'
2091
2155
 
2092
2156
  def brackets_callback(token_class):
2093
2157
  def callback(lexer, match, context):
@@ -2126,12 +2190,16 @@ class Perl6Lexer(ExtendedRegexLexer):
2126
2190
 
2127
2191
  end_pos = next_close_pos
2128
2192
 
2193
+ if end_pos < 0: # if we didn't find a closer, just highlight the
2194
+ # rest of the text in this class
2195
+ end_pos = len(text)
2196
+
2129
2197
  if adverbs is not None and re.search(r':to\b', adverbs):
2130
2198
  heredoc_terminator = text[match.start('delimiter') + n_chars : end_pos]
2131
- end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + r'\s*$', text[ match.end('delimiter') : ], re.MULTILINE)
2199
+ end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + r'\s*$', text[ end_pos : ], re.MULTILINE)
2132
2200
 
2133
2201
  if end_heredoc:
2134
- end_pos = match.end('delimiter') + end_heredoc.end()
2202
+ end_pos += end_heredoc.end()
2135
2203
  else:
2136
2204
  end_pos = len(text)
2137
2205
 
@@ -2173,18 +2241,19 @@ class Perl6Lexer(ExtendedRegexLexer):
2173
2241
  context.pos = match.end()
2174
2242
  context.stack.append('root')
2175
2243
 
2176
- # If you're modifying these rules, be careful if you need to process '{' or '}' characters.
2177
- # We have special logic for processing these characters (due to the fact that you can nest
2178
- # Perl 6 code in regex blocks), so if you need to process one of them, make sure you also
2179
- # process the corresponding one!
2244
+ # If you're modifying these rules, be careful if you need to process '{' or '}'
2245
+ # characters. We have special logic for processing these characters (due to the fact
2246
+ # that you can nest Perl 6 code in regex blocks), so if you need to process one of
2247
+ # them, make sure you also process the corresponding one!
2180
2248
  tokens = {
2181
2249
  'common' : [
2182
- (r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + r'])(?P=first_char)*)', brackets_callback(Comment.Multiline)),
2250
+ (r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)', brackets_callback(Comment.Multiline)),
2183
2251
  (r'#[^\n]*$', Comment.Singleline),
2184
2252
  (r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline),
2185
2253
  (r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline),
2186
2254
  (r'^=.*?\n\s*?\n', Comment.Multiline),
2187
- (r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)', bygroups(Keyword, Name), 'token-sym-brackets'),
2255
+ (r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)',
2256
+ bygroups(Keyword, Name), 'token-sym-brackets'),
2188
2257
  (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?', bygroups(Keyword, Name), 'pre-token'),
2189
2258
  # deal with a special case in the Perl 6 grammar (role q { ... })
2190
2259
  (r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text)),
@@ -2192,24 +2261,28 @@ class Perl6Lexer(ExtendedRegexLexer):
2192
2261
  (_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix = '(?::[UD])?'), Name.Builtin),
2193
2262
  (_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin),
2194
2263
  # copied from PerlLexer
2195
- (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable),
2264
+ (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*',
2265
+ Name.Variable),
2196
2266
  (r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
2197
2267
  (r'::\?\w+', Name.Variable.Global),
2198
- (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
2268
+ (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*',
2269
+ Name.Variable.Global),
2199
2270
  (r'\$(?:<.*?>)+', Name.Variable),
2200
2271
  (r'(?:q|qq|Q)[a-zA-Z]?\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String)),
2201
2272
  # copied from PerlLexer
2202
2273
  (r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
2203
2274
  (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
2204
2275
  (r'0b[01]+(_[01]+)*', Number.Bin),
2205
- (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', Number.Float),
2276
+ (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
2277
+ Number.Float),
2206
2278
  (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
2207
2279
  (r'\d+(_\d+)*', Number.Integer),
2208
2280
  (r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex),
2209
2281
  (r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex),
2210
2282
  (r'm\w+(?=\()', Name),
2211
- (r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String.Regex)),
2212
- (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/', String.Regex),
2283
+ (r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z_:\s])(?P=first_char)*)', brackets_callback(String.Regex)),
2284
+ (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/',
2285
+ String.Regex),
2213
2286
  (r'<[^\s=].*?\S>', String),
2214
2287
  (_build_word_match(PERL6_OPERATORS), Operator),
2215
2288
  (r'[0-9a-zA-Z_]' + PERL6_IDENTIFIER_RANGE + '*', Name),
@@ -2228,8 +2301,8 @@ class Perl6Lexer(ExtendedRegexLexer):
2228
2301
  (r'.+?', Text),
2229
2302
  ],
2230
2303
  'token-sym-brackets' : [
2231
- (r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + '])(?P=first_char)*)', brackets_callback(Name), ('#pop', 'pre-token')),
2232
- (r'', Name, ('#pop', 'pre-token')),
2304
+ (r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + '])(?P=first_char)*)', brackets_callback(Name), ('#pop', 'pre-token')),
2305
+ default(('#pop', 'pre-token')),
2233
2306
  ],
2234
2307
  'token': [
2235
2308
  (r'}', Text, '#pop'),
@@ -2260,31 +2333,220 @@ class Perl6Lexer(ExtendedRegexLexer):
2260
2333
 
2261
2334
  return stripped_lines
2262
2335
 
2336
+ # XXX handle block comments
2263
2337
  lines = text.splitlines()
2264
2338
  lines = strip_pod(lines)
2265
2339
  text = '\n'.join(lines)
2266
2340
 
2267
- if shebang_matches(text, r'perl6|rakudo|niecza'):
2341
+ if shebang_matches(text, r'perl6|rakudo|niecza|pugs'):
2268
2342
  return True
2269
2343
 
2270
- if 'use v6' in text:
2271
- return 0.91 # 0.01 greater than Perl says for 'my $'
2272
- if re.search(r'[$@%]\*[A-Z]+', text): # Perl 6-style globals ($*OS)
2273
- return 0.91
2274
- if re.search(r'[$@%]\?[A-Z]+', text): # Perl 6 compiler variables ($?PACKAGE)
2275
- return 0.91
2276
- if re.search(r'[$@%][!.][A-Za-z0-9_-]+', text): # Perl 6 member variables
2277
- return 0.91
2278
-
2279
- for line in text.splitlines():
2280
- if re.match(r'\s*(?:my|our)?\s*module', line): # module declarations
2281
- return 0.91
2282
- if re.match(r'\s*(?:my|our)?\s*role', line): # role declarations
2283
- return 0.91
2284
- if re.match(r'\s*(?:my|our)?\s*class\b', line): # class declarations
2285
- return 0.91
2286
- return False
2344
+ saw_perl_decl = False
2345
+ rating = False
2346
+
2347
+ # check for my/our/has declarations
2348
+ if re.search("(?:my|our|has)\s+(?:" + Perl6Lexer.PERL6_IDENTIFIER_RANGE + \
2349
+ "+\s+)?[$@%&(]", text):
2350
+ rating = 0.8
2351
+ saw_perl_decl = True
2352
+
2353
+ for line in lines:
2354
+ line = re.sub('#.*', '', line)
2355
+ if re.match('^\s*$', line):
2356
+ continue
2357
+
2358
+ # match v6; use v6; use v6.0; use v6.0.0;
2359
+ if re.match('^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
2360
+ return True
2361
+ # match class, module, role, enum, grammar declarations
2362
+ class_decl = re.match('^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
2363
+ if class_decl:
2364
+ if saw_perl_decl or class_decl.group('scope') is not None:
2365
+ return True
2366
+ rating = 0.05
2367
+ continue
2368
+ break
2369
+
2370
+ return rating
2287
2371
 
2288
2372
  def __init__(self, **options):
2289
2373
  super(Perl6Lexer, self).__init__(**options)
2290
2374
  self.encoding = options.get('encoding', 'utf-8')
2375
+
2376
+
2377
+ class HyLexer(RegexLexer):
2378
+ """
2379
+ Lexer for `Hy <http://hylang.org/>`_ source code.
2380
+
2381
+ .. versionadded:: 2.0
2382
+ """
2383
+ name = 'Hy'
2384
+ aliases = ['hylang']
2385
+ filenames = ['*.hy']
2386
+ mimetypes = ['text/x-hy', 'application/x-hy']
2387
+
2388
+ special_forms = [
2389
+ 'cond', 'for', '->', '->>', 'car',
2390
+ 'cdr', 'first', 'rest', 'let', 'when', 'unless',
2391
+ 'import', 'do', 'progn', 'get', 'slice', 'assoc', 'with-decorator',
2392
+ ',', 'list_comp', 'kwapply', '~', 'is', 'in', 'is-not', 'not-in',
2393
+ 'quasiquote', 'unquote', 'unquote-splice', 'quote', '|', '<<=', '>>=',
2394
+ 'foreach', 'while',
2395
+ 'eval-and-compile', 'eval-when-compile'
2396
+ ]
2397
+
2398
+ declarations = [
2399
+ 'def' 'defn', 'defun', 'defmacro', 'defclass', 'lambda', 'fn', 'setv'
2400
+ ]
2401
+
2402
+ hy_builtins = []
2403
+
2404
+ hy_core = [
2405
+ 'cycle', 'dec', 'distinct', 'drop', 'even?', 'filter', 'inc',
2406
+ 'instance?', 'iterable?', 'iterate', 'iterator?', 'neg?',
2407
+ 'none?', 'nth', 'numeric?', 'odd?', 'pos?', 'remove', 'repeat',
2408
+ 'repeatedly', 'take', 'take_nth', 'take_while', 'zero?'
2409
+ ]
2410
+
2411
+ builtins = hy_builtins + hy_core
2412
+
2413
+ # valid names for identifiers
2414
+ # well, names can only not consist fully of numbers
2415
+ # but this should be good enough for now
2416
+ valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
2417
+
2418
+ def _multi_escape(entries):
2419
+ return '(%s)' % ('|'.join(re.escape(entry) + ' ' for entry in entries))
2420
+
2421
+ tokens = {
2422
+ 'root': [
2423
+ # the comments - always starting with semicolon
2424
+ # and going to the end of the line
2425
+ (r';.*$', Comment.Single),
2426
+
2427
+ # whitespaces - usually not relevant
2428
+ (r'[,\s]+', Text),
2429
+
2430
+ # numbers
2431
+ (r'-?\d+\.\d+', Number.Float),
2432
+ (r'-?\d+', Number.Integer),
2433
+ (r'0[0-7]+j?', Number.Oct),
2434
+ (r'0[xX][a-fA-F0-9]+', Number.Hex),
2435
+
2436
+ # strings, symbols and characters
2437
+ (r'"(\\\\|\\"|[^"])*"', String),
2438
+ (r"'" + valid_name, String.Symbol),
2439
+ (r"\\(.|[a-z]+)", String.Char),
2440
+ (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
2441
+ (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
2442
+
2443
+ # keywords
2444
+ (r'::?' + valid_name, String.Symbol),
2445
+
2446
+ # special operators
2447
+ (r'~@|[`\'#^~&@]', Operator),
2448
+
2449
+ include('py-keywords'),
2450
+ include('py-builtins'),
2451
+
2452
+ # highlight the special forms
2453
+ (_multi_escape(special_forms), Keyword),
2454
+
2455
+ # Technically, only the special forms are 'keywords'. The problem
2456
+ # is that only treating them as keywords means that things like
2457
+ # 'defn' and 'ns' need to be highlighted as builtins. This is ugly
2458
+ # and weird for most styles. So, as a compromise we're going to
2459
+ # highlight them as Keyword.Declarations.
2460
+ (_multi_escape(declarations), Keyword.Declaration),
2461
+
2462
+ # highlight the builtins
2463
+ (_multi_escape(builtins), Name.Builtin),
2464
+
2465
+ # the remaining functions
2466
+ (r'(?<=\()' + valid_name, Name.Function),
2467
+
2468
+ # find the remaining variables
2469
+ (valid_name, Name.Variable),
2470
+
2471
+ # Hy accepts vector notation
2472
+ (r'(\[|\])', Punctuation),
2473
+
2474
+ # Hy accepts map notation
2475
+ (r'(\{|\})', Punctuation),
2476
+
2477
+ # the famous parentheses!
2478
+ (r'(\(|\))', Punctuation),
2479
+
2480
+ ],
2481
+ 'py-keywords': PythonLexer.tokens['keywords'],
2482
+ 'py-builtins': PythonLexer.tokens['builtins'],
2483
+ }
2484
+
2485
+ def analyse_text(text):
2486
+ if '(import ' in text or '(defn ' in text:
2487
+ return 0.9
2488
+
2489
+
2490
+ class ChaiscriptLexer(RegexLexer):
2491
+ """
2492
+ For `ChaiScript <http://chaiscript.com/>`_ source code.
2493
+
2494
+ .. versionadded:: 2.0
2495
+ """
2496
+
2497
+ name = 'ChaiScript'
2498
+ aliases = ['chai', 'chaiscript']
2499
+ filenames = ['*.chai']
2500
+ mimetypes = ['text/x-chaiscript', 'application/x-chaiscript']
2501
+
2502
+ flags = re.DOTALL
2503
+ tokens = {
2504
+ 'commentsandwhitespace': [
2505
+ (r'\s+', Text),
2506
+ (r'//.*?\n', Comment.Single),
2507
+ (r'/\*.*?\*/', Comment.Multiline),
2508
+ (r'^\#.*?\n', Comment.Single)
2509
+ ],
2510
+ 'slashstartsregex': [
2511
+ include('commentsandwhitespace'),
2512
+ (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
2513
+ r'([gim]+\b|\B)', String.Regex, '#pop'),
2514
+ (r'(?=/)', Text, ('#pop', 'badregex')),
2515
+ default('#pop')
2516
+ ],
2517
+ 'badregex': [
2518
+ ('\n', Text, '#pop')
2519
+ ],
2520
+ 'root': [
2521
+ include('commentsandwhitespace'),
2522
+ (r'\n', Text),
2523
+ (r'[^\S\n]+', Text),
2524
+ (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|\.\.'
2525
+ r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?', Operator, 'slashstartsregex'),
2526
+ (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
2527
+ (r'[})\].]', Punctuation),
2528
+ (r'[=+\-*/]', Operator),
2529
+ (r'(for|in|while|do|break|return|continue|if|else|'
2530
+ r'throw|try|catch'
2531
+ r')\b', Keyword, 'slashstartsregex'),
2532
+ (r'(var)\b', Keyword.Declaration, 'slashstartsregex'),
2533
+ (r'(attr|def|fun)\b', Keyword.Reserved),
2534
+ (r'(true|false)\b', Keyword.Constant),
2535
+ (r'(eval|throw)\b', Name.Builtin),
2536
+ (r'`\S+`', Name.Builtin),
2537
+ (r'[$a-zA-Z_]\w*', Name.Other),
2538
+ (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
2539
+ (r'0x[0-9a-fA-F]+', Number.Hex),
2540
+ (r'[0-9]+', Number.Integer),
2541
+ (r'"', String.Double, 'dqstring'),
2542
+ (r"'(\\\\|\\'|[^'])*'", String.Single),
2543
+ ],
2544
+ 'dqstring': [
2545
+ (r'\${[^"}]+?}', String.Iterpol),
2546
+ (r'\$', String.Double),
2547
+ (r'\\\\', String.Double),
2548
+ (r'\\"', String.Double),
2549
+ (r'[^\\\\\\"$]+', String.Double),
2550
+ (r'"', String.Double, '#pop'),
2551
+ ],
2552
+ }