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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +40 -0
- data/README.md +3 -0
- data/lexers +0 -0
- data/lib/pygments/popen.rb +3 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/vendor/pygments-main/AUTHORS +20 -1
- data/vendor/pygments-main/CHANGES +55 -3
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/MANIFEST.in +1 -1
- data/vendor/pygments-main/Makefile +5 -8
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/doc/Makefile +153 -0
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
- data/vendor/pygments-main/doc/conf.py +249 -0
- data/vendor/pygments-main/doc/docs/api.rst +316 -0
- data/vendor/pygments-main/doc/docs/authors.rst +4 -0
- data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
- data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
- data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
- data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
- data/vendor/pygments-main/doc/docs/index.rst +66 -0
- data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
- data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
- data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
- data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
- data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
- data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
- data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
- data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
- data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
- data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
- data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
- data/vendor/pygments-main/doc/download.rst +41 -0
- data/vendor/pygments-main/doc/faq.rst +143 -0
- data/vendor/pygments-main/doc/index.rst +53 -0
- data/vendor/pygments-main/doc/languages.rst +151 -0
- data/vendor/pygments-main/doc/make.bat +190 -0
- data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
- data/vendor/pygments-main/external/autopygmentize +65 -48
- data/vendor/pygments-main/external/markdown-processor.py +15 -15
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +2 -3
- data/vendor/pygments-main/ez_setup.py +340 -234
- data/vendor/pygments-main/pygments/__init__.py +4 -4
- data/vendor/pygments-main/pygments/cmdline.py +81 -68
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
- data/vendor/pygments-main/pygments/formatter.py +3 -3
- data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
- data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +44 -26
- data/vendor/pygments-main/pygments/formatters/img.py +21 -14
- data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
- data/vendor/pygments-main/pygments/formatters/other.py +53 -6
- data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
- data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
- data/vendor/pygments-main/pygments/lexer.py +59 -39
- data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
- data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
- data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
- data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
- data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
- data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
- data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
- data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
- data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
- data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
- data/vendor/pygments-main/pygments/lexers/math.py +438 -70
- data/vendor/pygments-main/pygments/lexers/other.py +885 -171
- data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
- data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
- data/vendor/pygments-main/pygments/lexers/special.py +7 -8
- data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
- data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
- data/vendor/pygments-main/pygments/lexers/text.py +208 -46
- data/vendor/pygments-main/pygments/lexers/web.py +729 -264
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/sphinxext.py +153 -0
- data/vendor/pygments-main/pygments/style.py +3 -2
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +29 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
- data/vendor/pygments-main/pygments/token.py +4 -1
- data/vendor/pygments-main/pygments/unistring.py +6 -5
- data/vendor/pygments-main/pygments/util.py +35 -21
- data/vendor/pygments-main/scripts/check_sources.py +28 -44
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
- data/vendor/pygments-main/scripts/find_codetags.py +27 -19
- data/vendor/pygments-main/scripts/find_error.py +16 -13
- data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
- data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
- data/vendor/pygments-main/setup.py +19 -19
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
- data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
- data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
- data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
- data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
- data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
- data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
- data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
- data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
- data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
- data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
- data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
- data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
- data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
- data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
- data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
- data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
- data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
- data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
- data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
- data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
- data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
- data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
- data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
- data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
- data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
- data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
- data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
- data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
- data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
- data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
- data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
- data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
- data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
- data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
- data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
- data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
- data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
- data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
- data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
- data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
- data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
- data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
- data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
- data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
- data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
- data/vendor/pygments-main/tests/run.py +14 -19
- data/vendor/pygments-main/tests/string_asserts.py +22 -0
- data/vendor/pygments-main/tests/test_basic_api.py +28 -14
- data/vendor/pygments-main/tests/test_cfm.py +46 -0
- data/vendor/pygments-main/tests/test_clexer.py +208 -3
- data/vendor/pygments-main/tests/test_cmdline.py +6 -5
- data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
- data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
- data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
- data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
- data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
- data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
- data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
- data/vendor/pygments-main/tests/test_token.py +3 -3
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +1 -1
- metadata +138 -51
- data/vendor/pygments-main/docs/generate.py +0 -472
- data/vendor/pygments-main/docs/src/api.txt +0 -270
- data/vendor/pygments-main/docs/src/authors.txt +0 -5
- data/vendor/pygments-main/docs/src/changelog.txt +0 -5
- data/vendor/pygments-main/docs/src/index.txt +0 -69
- data/vendor/pygments-main/docs/src/installation.txt +0 -71
- data/vendor/pygments-main/external/rst-directive-old.py +0 -77
- data/vendor/pygments-main/scripts/reindent.py +0 -291
- data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
- 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
|
-
(
|
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
|
-
(
|
43
|
+
(define 100-Continue 'symbol)
|
44
|
+
(and (append (car'(1 2 3))))
|
19
45
|
(regexp-match? #rx"foobar" "foobar")
|
20
|
-
(regexp-match? #px"
|
21
|
-
(
|
22
|
-
(
|
23
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
55
|
+
(cond
|
56
|
+
[(pair? x) (car x)]
|
57
|
+
[else x])))
|
28
58
|
|
29
|
-
;;
|
59
|
+
;; Literals
|
30
60
|
(values
|
31
61
|
;; #b
|
32
|
-
#b1
|
33
|
-
#b
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#b1
|
37
|
-
#
|
38
|
-
#
|
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)))
|