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
@@ -1,5 +1,7 @@
1
1
  #lang racket
2
2
 
3
+ (require (only-in srfi/13 string-contains))
4
+
3
5
  ; Single-line comment style.
4
6
 
5
7
  ;; Single-line comment style.
@@ -8,45 +10,259 @@
8
10
 
9
11
  #|
10
12
  Multi-line comment style ...
13
+ #|### #| nested |#||| |#
11
14
  ... on multiple lines
12
15
  |#
13
16
 
14
- (define (a-function x #:keyword [y 0])
17
+ #;(s-expression comment (one line))
18
+
19
+ #;
20
+ (s-expression comment
21
+ (multiple lines))
22
+
23
+ #! shebang comment
24
+
25
+ #!/shebang comment
26
+
27
+ #! shebang \
28
+ comment
29
+
30
+ #!/shebang \
31
+ comment
32
+
33
+ ;; Uncommented numbers after single-line comments
34
+ ;; NEL…133
35
+ ;; LS
8232
36
+ ;; PS
8233
37
+
38
+ #reader racket
39
+ (define(a-function x #:keyword [y 0])
15
40
  (define foo0 'symbol) ; ()
16
41
  [define foo1 'symbol] ; []
17
42
  {define foo2 'symbol} ; {}
18
- (and (append (car '(1 2 3))))
43
+ (define 100-Continue 'symbol)
44
+ (and (append (car'(1 2 3))))
19
45
  (regexp-match? #rx"foobar" "foobar")
20
- (regexp-match? #px"foobar" "foobar")
21
- (define a 1))
22
- (let ([b "foo"])
23
- (displayln b))
46
+ (regexp-match? #px"\"foo\\(bar\\)?\"" "foobar")
47
+ (regexp-match? #rx#"foobar" "foobar")
48
+ (regexp-match? #px#"foobar" "foobar")
49
+ (define #csa 1)
50
+ #Ci (let ([#%A|||b #true C
51
+ \|d "foo"])
52
+ (displayln #cS #%\ab\ #true\ C\
53
+ \\d||))
24
54
  (for/list ([x (in-list (list 1 2 (list 3 4)))])
25
- (cond
26
- [(pair? x) (car x)]
27
- [else x])))
55
+ (cond
56
+ [(pair? x) (car x)]
57
+ [else x])))
28
58
 
29
- ;; Literal number examples
59
+ ;; Literals
30
60
  (values
31
61
  ;; #b
32
- #b1.1
33
- #b-1.1
34
- #b1e1
35
- #b0/1
36
- #b1/1
37
- #b1e-1
38
- #b101
39
-
62
+ #b1
63
+ #b+1
64
+ #b-1
65
+ #b.1
66
+ #b1.
67
+ #b0.1
68
+ #b+0.1
69
+ #b-0.1
70
+ #b1/10
71
+ #b+1/10
72
+ #b-1/10
73
+ #b1e11
74
+ #b+1e11
75
+ #b-1e11
76
+ #b.1e11
77
+ #b1.e11
78
+ #b0.1e11
79
+ #b+0.1e11
80
+ #b-0.1e11
81
+ #b1/10e11
82
+ #b+1/10e11
83
+ #b-1/10e11
84
+ #b+i
85
+ #b1+i
86
+ #b+1+i
87
+ #b-1+i
88
+ #b.1+i
89
+ #b1.+i
90
+ #b0.1+i
91
+ #b+0.1+i
92
+ #b-0.1+i
93
+ #b1/10+i
94
+ #b+1/10+i
95
+ #b-1/10+i
96
+ #b1e11+i
97
+ #b+1e11+i
98
+ #b-1e11+i
99
+ #b1.e11+i
100
+ #b.1e11+i
101
+ #b0.1e11+i
102
+ #b+0.1e11+i
103
+ #b-0.1e11+i
104
+ #b1/10e11+i
105
+ #b+1/10e11+i
106
+ #b-1/10e11+i
107
+ #b+1i
108
+ #b1+1i
109
+ #b+1+1i
110
+ #b-1+1i
111
+ #b1.+1i
112
+ #b.1+1i
113
+ #b0.1+1i
114
+ #b+0.1+1i
115
+ #b-0.1+1i
116
+ #b1/10+1i
117
+ #b+1/10+1i
118
+ #b-1/10+1i
119
+ #b1e11+1i
120
+ #b+1e11+1i
121
+ #b-1e11+1i
122
+ #b.1e11+1i
123
+ #b0.1e11+1i
124
+ #b+0.1e11+1i
125
+ #b-0.1e11+1i
126
+ #b1/10e11+1i
127
+ #b+1/10e11+1i
128
+ #b-1/10e11+1i
129
+ #b+1/10e11i
130
+ #b1+1/10e11i
131
+ #b+1+1/10e11i
132
+ #b-1+1/10e11i
133
+ #b.1+1/10e11i
134
+ #b0.1+1/10e11i
135
+ #b+0.1+1/10e11i
136
+ #b-0.1+1/10e11i
137
+ #b1/10+1/10e11i
138
+ #b+1/10+1/10e11i
139
+ #b-1/10+1/10e11i
140
+ #b1e11+1/10e11i
141
+ #b+1e11+1/10e11i
142
+ #b-1e11+1/10e11i
143
+ #b.1e11+1/10e11i
144
+ #b0.1e11+1/10e11i
145
+ #b+0.1e11+1/10e11i
146
+ #b-0.1e11+1/10e11i
147
+ #b1/10e11+1/10e11i
148
+ #b+1/10e11+1/10e11i
149
+ #b-1/10e11+1/10e11i
40
150
  ;; #d
41
- #d-1.23
42
- #d1.123
43
- #d1e3
44
- #d1e-22
45
- #d1/2
46
- #d-1/2
47
151
  #d1
152
+ #d+1
48
153
  #d-1
49
-
154
+ #d.1
155
+ #d1.
156
+ #d1.2
157
+ #d+1.2
158
+ #d-1.2
159
+ #d1/2
160
+ #d+1/2
161
+ #d-1/2
162
+ #d1e3
163
+ #d+1e3
164
+ #d-1e3
165
+ #d.1e3
166
+ #d1.e3
167
+ #d1.2e3
168
+ #d+1.2e3
169
+ #d-1.2e3
170
+ #d1/2e3
171
+ #d+1/2e3
172
+ #d-1/2e3
173
+ #d+i
174
+ #d1+i
175
+ #d+1+i
176
+ #d-1+i
177
+ #d.1+i
178
+ #d1.+i
179
+ #d1.2+i
180
+ #d+1.2+i
181
+ #d-1.2+i
182
+ #d1/2+i
183
+ #d+1/2+i
184
+ #d-1/2+i
185
+ #d1e3+i
186
+ #d+1e3+i
187
+ #d-1e3+i
188
+ #d1.e3+i
189
+ #d.1e3+i
190
+ #d1.2e3+i
191
+ #d+1.2e3+i
192
+ #d-1.2e3+i
193
+ #d1/2e3+i
194
+ #d+1/2e3+i
195
+ #d-1/2e3+i
196
+ #d+1i
197
+ #d1+1i
198
+ #d+1+1i
199
+ #d-1+1i
200
+ #d1.+1i
201
+ #d.1+1i
202
+ #d1.2+1i
203
+ #d+1.2+1i
204
+ #d-1.2+1i
205
+ #d1/2+1i
206
+ #d+1/2+1i
207
+ #d-1/2+1i
208
+ #d1e3+1i
209
+ #d+1e3+1i
210
+ #d-1e3+1i
211
+ #d.1e3+1i
212
+ #d1.2e3+1i
213
+ #d+1.2e3+1i
214
+ #d-1.2e3+1i
215
+ #d1/2e3+1i
216
+ #d+1/2e3+1i
217
+ #d-1/2e3+1i
218
+ #d+1/2e3i
219
+ #d1+1/2e3i
220
+ #d+1+1/2e3i
221
+ #d-1+1/2e3i
222
+ #d.1+1/2e3i
223
+ #d1.2+1/2e3i
224
+ #d+1.2+1/2e3i
225
+ #d-1.2+1/2e3i
226
+ #d1/2+1/2e3i
227
+ #d+1/2+1/2e3i
228
+ #d-1/2+1/2e3i
229
+ #d1e3+1/2e3i
230
+ #d+1e3+1/2e3i
231
+ #d-1e3+1/2e3i
232
+ #d.1e3+1/2e3i
233
+ #d1.2e3+1/2e3i
234
+ #d+1.2e3+1/2e3i
235
+ #d-1.2e3+1/2e3i
236
+ #d1/2e3+1/2e3i
237
+ #d+1/2e3+1/2e3i
238
+ #d-1/2e3+1/2e3i
239
+ ;; Extflonums
240
+ +nan.t
241
+ 1t3
242
+ +1t3
243
+ -1t3
244
+ .1t3
245
+ 1.t3
246
+ 1.2t3
247
+ +1.2t3
248
+ -1.2t3
249
+ 1/2t3
250
+ +1/2t3
251
+ -1/2t3
252
+ 1#t0
253
+ 1.#t0
254
+ .2#t0
255
+ 1.2#t0
256
+ 1#/2t0
257
+ 1/2#t0
258
+ 1#/2#t0
259
+ 1#t3
260
+ 1.#t3
261
+ .2#t3
262
+ 1.2#t3
263
+ 1#/2t3
264
+ 1/2#t3
265
+ 1#/2#t3
50
266
  ;; No # reader prefix -- same as #d
51
267
  -1.23
52
268
  1.123
@@ -56,7 +272,6 @@ Multi-line comment style ...
56
272
  -1/2
57
273
  1
58
274
  -1
59
-
60
275
  ;; #e
61
276
  #e-1.23
62
277
  #e1.123
@@ -66,7 +281,24 @@ Multi-line comment style ...
66
281
  #e-1
67
282
  #e1/2
68
283
  #e-1/2
69
-
284
+ ;; #d#e
285
+ #d#e-1.23
286
+ #d#e1.123
287
+ #d#e1e3
288
+ #d#e1e-22
289
+ #d#e1
290
+ #d#e-1
291
+ #d#e1/2
292
+ #d#e-1/2
293
+ ;; #e#d
294
+ #e#d-1.23
295
+ #e#d1.123
296
+ #e#d1e3
297
+ #e#d1e-22
298
+ #e#d1
299
+ #e#d-1
300
+ #e#d1/2
301
+ #e#d-1/2
70
302
  ;; #i always float
71
303
  #i-1.23
72
304
  #i1.123
@@ -76,7 +308,126 @@ Multi-line comment style ...
76
308
  #i-1/2
77
309
  #i1
78
310
  #i-1
79
-
311
+ ;; Implicitly inexact numbers
312
+ +nan.0
313
+ 1#
314
+ 1.#
315
+ .2#
316
+ 1.2#
317
+ 1#/2
318
+ 1/2#
319
+ 1#/2#
320
+ 1#e3
321
+ 1.#e3
322
+ .2#e3
323
+ 1.2#e3
324
+ 1#/2e3
325
+ 1/2#e3
326
+ 1#/2#e3
327
+ +nan.0+i
328
+ 1#+i
329
+ 1.#+i
330
+ .2#+i
331
+ 1.2#+i
332
+ 1#/2+i
333
+ 1/2#+i
334
+ 1#/2#+i
335
+ 1#e3+i
336
+ 1.#e3+i
337
+ .2#e3+i
338
+ 1.2#e3+i
339
+ 1#/2e3+i
340
+ 1/2#e3+i
341
+ 1#/2#e3+i
342
+ +nan.0i
343
+ +1#i
344
+ +1.#i
345
+ +.2#i
346
+ +1.2#i
347
+ +1#/2i
348
+ +1/2#i
349
+ +1#/2#i
350
+ +1#e3i
351
+ +1.#e3i
352
+ +.2#e3i
353
+ +1.2#e3i
354
+ +1#/2e3i
355
+ +1/2#e3i
356
+ +1#/2#e3i
357
+ 0+nan.0i
358
+ 0+1#i
359
+ 0+1.#i
360
+ 0+.2#i
361
+ 0+1.2#i
362
+ 0+1#/2i
363
+ 0+1/2#i
364
+ 0+1#/2#i
365
+ 0+1#e3i
366
+ 0+1.#e3i
367
+ 0+.2#e3i
368
+ 0+1.2#e3i
369
+ 0+1#/2e3i
370
+ 0+1/2#e3i
371
+ 0+1#/2#e3i
372
+ 1#/2#e3+nan.0i
373
+ 1#/2#e3+1#i
374
+ 1#/2#e3+1.#i
375
+ 1#/2#e3+.2#i
376
+ 1#/2#e3+1.2#i
377
+ 1#/2#e3+1#/2i
378
+ 1#/2#e3+1/2#i
379
+ 1#/2#e3+1#/2#i
380
+ 1#/2#e3+1#e3i
381
+ 1#/2#e3+1.#e3i
382
+ 1#/2#e3+.2#e3i
383
+ 1#/2#e3+1.2#e3i
384
+ 1#/2#e3+1#/2e3i
385
+ 1#/2#e3+1/2#e3i
386
+ 1#/2#e3+1#/2#e3i
387
+ +nan.0@1
388
+ 1#@1
389
+ 1.#@1
390
+ .2#@1
391
+ 1.2#@1
392
+ 1#/2@1
393
+ 1/2#@1
394
+ 1#/2#@1
395
+ 1#e3@1
396
+ 1.#e3@1
397
+ .2#e3@1
398
+ 1.2#e3@1
399
+ 1#/2e3@1
400
+ 1/2#e3@1
401
+ 1#/2#e3@1
402
+ 1@+nan.0
403
+ 1@1#
404
+ 1@1.#
405
+ 1@.2#
406
+ 1@1.2#
407
+ 1@1#/2
408
+ 1@1/2#
409
+ 1@1#/2#
410
+ 1@1#e3
411
+ 1@1.#e3
412
+ 1@.2#e3
413
+ 1@1.2#e3
414
+ 1@1#/2e3
415
+ 1@1/2#e3
416
+ 1@1#/2#e3
417
+ 1#/2#e3@1#
418
+ 1#/2#e3@1.#
419
+ 1#/2#e3@.2#
420
+ 1#/2#e3@1.2#
421
+ 1#/2#e3@1#/2
422
+ 1#/2#e3@1/2#
423
+ 1#/2#e3@1#/2#
424
+ 1#/2#e3@1#e3
425
+ 1#/2#e3@1.#e3
426
+ 1#/2#e3@.2#e3
427
+ 1#/2#e3@1.2#e3
428
+ 1#/2#e3@1#/2e3
429
+ 1#/2#e3@1/2#e3
430
+ 1#/2#e3@1#/2#e3
80
431
  ;; #o
81
432
  #o777.777
82
433
  #o-777.777
@@ -86,10 +437,307 @@ Multi-line comment style ...
86
437
  #o-3/7
87
438
  #o777
88
439
  #o-777
89
-
440
+ #e#o777.777
441
+ #e#o-777.777
442
+ #e#o777e777
443
+ #e#o777e-777
444
+ #e#o3/7
445
+ #e#o-3/7
446
+ #e#o777
447
+ #e#o-777
448
+ #i#o777.777
449
+ #i#o-777.777
450
+ #i#o777e777
451
+ #i#o777e-777
452
+ #i#o3/7
453
+ #i#o-3/7
454
+ #i#o777
455
+ #i#o-777
90
456
  ;; #x
91
457
  #x-f.f
92
458
  #xf.f
459
+ #xfsf
460
+ #xfs-f
461
+ #x7/f
462
+ #x-7/f
93
463
  #x-f
94
464
  #xf
465
+ #e#x-f.f
466
+ #e#xf.f
467
+ #e#xfsf
468
+ #e#xfs-f
469
+ #e#x7/f
470
+ #e#x-7/f
471
+ #e#x-f
472
+ #e#xf
473
+ #i#x-f.f
474
+ #i#xf.f
475
+ #i#xfsf
476
+ #i#xfs-f
477
+ #i#x7/f
478
+ #i#x-7/f
479
+ #i#x-f
480
+ #i#xf
481
+ ;; Not numbers
482
+ '-1.23x
483
+ '1.123x
484
+ '1e3x
485
+ '1e-22x
486
+ '1/2x
487
+ '-1/2x
488
+ '1x
489
+ '-1x
490
+ '/
491
+ '1/
492
+ '/2
493
+ '1//2
494
+ '1e3.
495
+ '1e
496
+ 'e3
497
+ '.i
498
+ '1.2.3
499
+ '1..2
500
+ '.1.
501
+ '@
502
+ '1@
503
+ '@2
504
+ '1@@2
505
+ '1@2@3
506
+ '1@2i
507
+ '1+-2i
508
+ '1i+2
509
+ '1i+2i
510
+ '1+2i+3i
511
+ '-
512
+ '--1
513
+ '+
514
+ '++1
515
+ '1/2.3
516
+ '1#2
517
+ '1#.2
518
+ '1.#2
519
+ '.#2
520
+ '+nan.t+nan.ti
521
+ '+nan.t@nan.t
522
+ ;; Booleans
523
+ #t
524
+ #T
525
+ #true
526
+ #f
527
+ #F
528
+ #false
529
+ ;; Characters, strings, and byte strings
530
+ #\
531
+ #\Null9
532
+ #\n9
533
+ #\99
534
+ #\0009
535
+ #\u3BB
536
+ #\u03BB9
537
+ #\U3BB
538
+ #\U000003BB9
539
+ #\λ9
540
+ "string\
541
+ \a.\b.\t.\n.\v.\f.\r.\e.\".\'.\\.\1.\123.\1234.\x9.\x30.\x303"
542
+ "\u9.\u1234.\u12345.\U9.\U00100000.\U001000000"
543
+ #"byte-string\7\xff\t"
544
+ #<<HERE STRING
545
+ lorem ipsum
546
+ dolor sit amet
547
+ consectetur HERE STRING
548
+ HERE STRING adipisicing elit
549
+ HERE STRING
550
+ #|
551
+ HERE STRING
552
+ |#
553
+ ;; Other literals
554
+ #(vector)
555
+ #20()
556
+ #s[prefab-structure 1 2 3]
557
+ #&{box}
558
+ #hash(("a" . 5))
559
+ #hasheq((a . 5) (b . 7))
560
+ #hasheqv((a . 5) (b . 7))
561
+ #'(define x 1)
562
+ #`(define x #,pi)
563
+ ;; quote, quasiquote, and unquote
564
+ 'pi
565
+ ' pi
566
+ ''pi
567
+ '`pi
568
+ '`,pi
569
+ ',pi
570
+ `pi
571
+ ` pi
572
+ `'pi
573
+ ``pi
574
+ `,pi
575
+ ` , pi
576
+ `,'pi
577
+ `,`pi
578
+ `,`,pi
579
+ '(+)
580
+ ' (+)
581
+ ''(+)
582
+ '`(+)
583
+ ',(+)
584
+ `(+)
585
+ ` (+)
586
+ `'(+)
587
+ ``(+)
588
+ `,(+)
589
+ ` , (+)
590
+ `,'(+)
591
+ `,`(+)
592
+ `,`,(+)
593
+ #readerracket/base'pi.f
594
+ '#readerracket/base pi.f
595
+ #readerracket/base`pi.f
596
+ `#readerracket/base pi.f
597
+ #readerracket/base`,pi.f
598
+ `#readerracket/base,pi.f
599
+ `,#readerracket/base pi.f
600
+ #readerracket/base'`,pi.f
601
+ '#readerracket/base`,pi.f
602
+ '`#readerracket/base,pi.f
603
+ '`,#readerracket/base pi.f
604
+ #readerracket/base'(*)
605
+ '#readerracket/base(*)
606
+ #readerracket/base`(*)
607
+ `#readerracket/base(*)
608
+ #readerracket/base`,(*)
609
+ `#readerracket/base,(*)
610
+ `,#readerracket/base(*)
611
+ #readerracket/base'`,(*)
612
+ '#readerracket/base`,(*)
613
+ '`#readerracket/base,(*)
614
+ '`,#readerracket/base(*)
615
+ (quote pi)
616
+ (quote (quote pi))
617
+ (quote (quasiquote pi))
618
+ (quote (quasiquote (unquote pi)))
619
+ (quote (unquote pi))
620
+ (quasiquote pi)
621
+ (quasiquote (quote pi))
622
+ (quasiquote (quasiquote pi))
623
+ (quasiquote (unquote pi))
624
+ (quasiquote (unquote (quote pi)))
625
+ (quasiquote (unquote (quasiquote pi)))
626
+ (quasiquote (unquote (quasiquote (unquote pi))))
627
+ (quote (+))
628
+ (quote (quote (+)))
629
+ (quote (quasiquote (+)))
630
+ (quote (unquote (+)))
631
+ (quasiquote (+))
632
+ (quasiquote (quote (+)))
633
+ (quasiquote (quasiquote (+)))
634
+ (quasiquote (unquote (+)))
635
+ (quasiquote (unquote (quote (+))))
636
+ (quasiquote (unquote (quasiquote (+))))
637
+ (quasiquote (unquote (quasiquote (unquote (+)))))
638
+ #reader racket/base (quote pi.f)
639
+ (quote #reader racket/base pi.f)
640
+ #reader racket/base (quasiquote pi.f)
641
+ (quasiquote #reader racket/base pi.f)
642
+ #reader racket/base (quasiquote (unquote pi.f))
643
+ (quasiquote #reader racket/base (unquote pi.f))
644
+ (quasiquote (unquote #reader racket/base pi.f))
645
+ #reader racket/base (quote (quasiquote (unquote pi.f)))
646
+ (quote #reader racket/base (quasiquote (unquote pi.f)))
647
+ (quote (quasiquote #reader racket/base (unquote pi.f)))
648
+ (quote (quasiquote (unquote #reader racket/base pi.f)))
649
+ #reader racket/base (quote (*))
650
+ (quote #reader racket/base (*))
651
+ #reader racket/base (quasiquote (*))
652
+ (quasiquote #reader racket/base (*))
653
+ #reader racket/base (quasiquote (unquote (*)))
654
+ (quasiquote #reader racket/base (unquote (*)))
655
+ (quasiquote (unquote #reader racket/base (*)))
656
+ #reader racket/base (quote (quasiquote (unquote (*))))
657
+ (quote #reader racket/base (quasiquote (unquote (*))))
658
+ (quote (quasiquote #reader racket/base (unquote (*))))
659
+ (quote (quasiquote (unquote #reader racket/base (*))))
660
+ ;; Make sure non-identifiers work with quotes
661
+ ' "" pi
662
+ ' #t pi
663
+ ' #() pi
664
+ ' #s(s) pi
665
+ ' #\u3BB pi
666
+ ' #\U000003BB pi
667
+ ' #\space pi
668
+ ' #\. pi
669
+ ' #"" pi
670
+ ' #:kw pi
671
+ ' #&b pi
672
+ ' #'(define x 1) pi
673
+ ' #`(define x #,pi) pi
674
+ ' #I0 pi
675
+ ' #E0 pi
676
+ ' #X0 pi
677
+ ' #O0 pi
678
+ ' #D0 pi
679
+ ' #B0 pi
680
+ ' #<<EOF
681
+ EOF
682
+ pi
683
+ ' #rx"" pi
684
+ ' #rx#"" pi
685
+ ' #px"" pi
686
+ ' #px#"" pi
687
+ ' #hash() pi
688
+ ' #hasheq[] pi
689
+ ' #hasheqv{} pi
690
+ ' #1(v) pi
95
691
  )
692
+
693
+ ;; Use the following to generate lists of built-ins and keywords.
694
+ ;; Run
695
+ ;; (displayln (wrap-lines KEYWORDS))
696
+ ;; (displayln (wrap-lines BUILTINS))
697
+ ;; and copy the results into RacketLexer._keywords and RacketLexer._builtins.
698
+
699
+ ;; (-> (listof string?) string?)
700
+ ;; Appends all the strings together, quoting them as appropriate for Python,
701
+ ;; with commas and spaces between them, wrapping at 80 characters, with an
702
+ ;; indentation of 8 spaces.
703
+ (define (wrap-lines lst)
704
+ (define INDENTATION '" ")
705
+ (define WIDTH '80)
706
+ (define (wrap-lines* lst done-lines current-line)
707
+ (if (null? lst)
708
+ (string-append (foldr string-append "" done-lines) current-line)
709
+ (let* ([str (first lst)]
710
+ [wrapped-str (if (regexp-match-exact? '#px"[[:ascii:]]+" str)
711
+ (string-append "'" str "',")
712
+ (string-append "u'" str "',"))]
713
+ [new-line (string-append current-line " " wrapped-str)])
714
+ (if ((string-length new-line) . >= . WIDTH)
715
+ (wrap-lines* (rest lst)
716
+ (append done-lines
717
+ `(,(string-append current-line "\n")))
718
+ (string-append INDENTATION wrapped-str))
719
+ (wrap-lines* (rest lst)
720
+ done-lines
721
+ new-line)))))
722
+ (wrap-lines* lst '() INDENTATION))
723
+
724
+ ;; (-> string? boolean?)
725
+ ;; Returns #t if str represents a syntax identifier in the current namespace,
726
+ ;; otherwise #f.
727
+ (define (syntax-identifier? str)
728
+ (with-handlers ([exn? exn?])
729
+ (not (eval (call-with-input-string str read)))))
730
+
731
+ (define RACKET-NAMESPACE
732
+ (parameterize ([current-namespace (make-base-namespace)])
733
+ (namespace-require 'racket)
734
+ (current-namespace)))
735
+
736
+ (define BOUND-IDENTIFIERS
737
+ (parameterize ([current-namespace RACKET-NAMESPACE])
738
+ (sort (map symbol->string (namespace-mapped-symbols))
739
+ string<=?)))
740
+
741
+ (define-values (KEYWORDS BUILTINS)
742
+ (parameterize ([current-namespace RACKET-NAMESPACE])
743
+ (partition syntax-identifier? BOUND-IDENTIFIERS)))