Skip to content

Commit 4eb81fa

Browse files
authoredOct 23, 2021
Scheme: Updates syntax for reals (#3159)
According to R7RS spec, you can use different mnemonics for the scientific notation that indicated the precision of the number.
1 parent 3755120 commit 4eb81fa

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed
 

‎components/prism-scheme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
// non-decimal bases together. This results in a decimal (dec) and combined binary, octal, and hexadecimal (box)
7171
// pattern:
7272
pattern: RegExp(SortedBNF({
73-
'<ureal dec>': /\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/.source,
73+
'<ureal dec>': /\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:[esfdl][+-]?\d+)?/.source,
7474
'<real dec>': /[+-]?<ureal dec>|[+-](?:inf|nan)\.0/.source,
7575
'<imaginary dec>': /[+-](?:<ureal dec>|(?:inf|nan)\.0)?i/.source,
7676
'<complex dec>': /<real dec>(?:@<real dec>|<imaginary dec>)?|<imaginary dec>/.source,

‎components/prism-scheme.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/scheme/number_feature.test

+32
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@
1818
10+.1i
1919
10+1.i
2020

21+
10.0E2
22+
10.0D2
23+
10.0L2
24+
10.0S2
25+
10.0F2
26+
27+
10.0e2
28+
10.0d2
29+
10.0l2
30+
10.0s2
31+
10.0f2
32+
2133
; not a number but a symbol
2234
(define 1+2 10)
2335

36+
(list 10.0P2 10.0g2 10.0w2)
37+
2438
----------------------------------------------------
2539

2640
[
@@ -101,13 +115,31 @@
101115
["number", "10+.1i"],
102116
["number", "10+1.i"],
103117

118+
["number", "10.0E2"],
119+
["number", "10.0D2"],
120+
["number", "10.0L2"],
121+
["number", "10.0S2"],
122+
["number", "10.0F2"],
123+
124+
["number", "10.0e2"],
125+
["number", "10.0d2"],
126+
["number", "10.0l2"],
127+
["number", "10.0s2"],
128+
["number", "10.0f2"],
129+
104130
["comment", "; not a number but a symbol"],
105131

106132
["punctuation", "("],
107133
["keyword", "define"],
108134
" 1+2 ",
109135
["number", "10"],
136+
["punctuation", ")"],
137+
138+
["punctuation", "("],
139+
["builtin", "list"],
140+
" 10.0P2 10.0g2 10.0w2",
110141
["punctuation", ")"]
142+
111143
]
112144

113145
----------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.