/
number_feature.test
147 lines (117 loc) · 2.77 KB
/
number_feature.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
123
(foo 42 +42 -42)
(foo 1e3 +1e3 -1e3)
(foo 1e+3 1e-3 3.14159 3.14159e-1)
(foo 8/3)
(foo 3+4i 2.5+0.0i 2.5+0.0i -2.5e4+0.0e4i 3+0i -2e-5i)
(list +10i -10i 10+10i 10.10+10.10i 10-10i 10+10e+10i)
(list #d123 #e#d123e-4 #d#i12 #i-1.234i)
(list #xBAD #b1110011 #o777)
(list #i#x10 #i#x10+10i #b10+10i)
[list 123]
10+i
10+.1i
10+1.i
10.0E2
10.0D2
10.0L2
10.0S2
10.0F2
10.0e2
10.0d2
10.0l2
10.0s2
10.0f2
; not a number but a symbol
(define 1+2 10)
(list 10.0P2 10.0g2 10.0w2)
----------------------------------------------------
[
["number", "123"],
["punctuation", "("],
["function", "foo"],
["number", "42"],
["number", "+42"],
["number", "-42"],
["punctuation", ")"],
["punctuation", "("],
["function", "foo"],
["number", "1e3"],
["number", "+1e3"],
["number", "-1e3"],
["punctuation", ")"],
["punctuation", "("],
["function", "foo"],
["number", "1e+3"],
["number", "1e-3"],
["number", "3.14159"],
["number", "3.14159e-1"],
["punctuation", ")"],
["punctuation", "("],
["function", "foo"],
["number", "8/3"],
["punctuation", ")"],
["punctuation", "("],
["function", "foo"],
["number", "3+4i"],
["number", "2.5+0.0i"],
["number", "2.5+0.0i"],
["number", "-2.5e4+0.0e4i"],
["number", "3+0i"],
["number", "-2e-5i"],
["punctuation", ")"],
["punctuation", "("],
["builtin", "list"],
["number", "+10i"],
["number", "-10i"],
["number", "10+10i"],
["number", "10.10+10.10i"],
["number", "10-10i"],
["number", "10+10e+10i"],
["punctuation", ")"],
["punctuation", "("],
["builtin", "list"],
["number", "#d123"],
["number", "#e#d123e-4"],
["number", "#d#i12"],
["number", "#i-1.234i"],
["punctuation", ")"],
["punctuation", "("],
["builtin", "list"],
["number", "#xBAD"],
["number", "#b1110011"],
["number", "#o777"],
["punctuation", ")"],
["punctuation", "("],
["builtin", "list"],
["number", "#i#x10"],
["number", "#i#x10+10i"],
["number", "#b10+10i"],
["punctuation", ")"],
["punctuation", "["], ["builtin", "list"], ["number", "123"], ["punctuation", "]"],
["number", "10+i"],
["number", "10+.1i"],
["number", "10+1.i"],
["number", "10.0E2"],
["number", "10.0D2"],
["number", "10.0L2"],
["number", "10.0S2"],
["number", "10.0F2"],
["number", "10.0e2"],
["number", "10.0d2"],
["number", "10.0l2"],
["number", "10.0s2"],
["number", "10.0f2"],
["comment", "; not a number but a symbol"],
["punctuation", "("],
["keyword", "define"],
" 1+2 ",
["number", "10"],
["punctuation", ")"],
["punctuation", "("],
["builtin", "list"],
" 10.0P2 10.0g2 10.0w2",
["punctuation", ")"]
]
----------------------------------------------------
Checks for numbers, rational numbers, and complex numbers.