1 |
wakaba |
1.1 |
{"tests": [ |
2 |
|
|
{"description": "empty", |
3 |
|
|
"input": "", |
4 |
|
|
"output": []}, |
5 |
|
|
|
6 |
|
|
{"description": "length=1 IDENT (lowercase)", |
7 |
|
|
"input": "a", |
8 |
|
|
"output": [["IDENT", "a"]]}, |
9 |
|
|
|
10 |
|
|
{"description": "length=1 IDENT (uppercase)", |
11 |
|
|
"input": "A", |
12 |
|
|
"output": [["IDENT", "A"]]}, |
13 |
|
|
|
14 |
|
|
{"description": "length=2 IDENT (uppercase)", |
15 |
|
|
"input": "AB", |
16 |
|
|
"output": [["IDENT", "AB"]]}, |
17 |
|
|
|
18 |
|
|
{"description": "length=2 IDENT (lowercase)", |
19 |
|
|
"input": "ab", |
20 |
|
|
"output": [["IDENT", "ab"]]}, |
21 |
|
|
|
22 |
wakaba |
1.2 |
{"description": "\\", |
23 |
|
|
"input": "\\", |
24 |
|
|
"output": [["DELIM", "\\"]]}, |
25 |
|
|
|
26 |
wakaba |
1.1 |
{"description": "IDENT started by escape 1", |
27 |
|
|
"input": "\\41", |
28 |
|
|
"output": [["IDENT", "A"]]}, |
29 |
|
|
|
30 |
|
|
{"description": "IDENT started by escape 2", |
31 |
|
|
"input": "\\041", |
32 |
|
|
"output": [["IDENT", "A"]]}, |
33 |
|
|
|
34 |
|
|
{"description": "IDENT started by escape 3", |
35 |
|
|
"input": "\\0041", |
36 |
|
|
"output": [["IDENT", "A"]]}, |
37 |
|
|
|
38 |
|
|
{"description": "IDENT started by escape 4", |
39 |
|
|
"input": "\\00041", |
40 |
|
|
"output": [["IDENT", "A"]]}, |
41 |
|
|
|
42 |
|
|
{"description": "IDENT started by escape 5", |
43 |
|
|
"input": "\\000041", |
44 |
|
|
"output": [["IDENT", "A"]]}, |
45 |
|
|
|
46 |
|
|
{"description": "IDENT started by escape 6", |
47 |
|
|
"input": "\\0000041", |
48 |
|
|
"output": [["IDENT", "\u00041"]]}, |
49 |
|
|
|
50 |
|
|
{"description": "IDENT started by escape 7", |
51 |
|
|
"input": "\\00000041", |
52 |
|
|
"output": [["IDENT", "\u000041"]]}, |
53 |
|
|
|
54 |
|
|
{"description": "IDENT started by escape followed by a space 1", |
55 |
|
|
"input": "\\41 ", |
56 |
|
|
"output": [["IDENT", "A"]]}, |
57 |
|
|
|
58 |
|
|
{"description": "IDENT started by escape followed by a space 2", |
59 |
|
|
"input": "\\41 a", |
60 |
|
|
"output": [["IDENT", "Aa"]]}, |
61 |
|
|
|
62 |
|
|
{"description": "IDENT started by escape followed by a space 3", |
63 |
|
|
"input": "\\41\u0009a", |
64 |
|
|
"output": [["IDENT", "Aa"]]}, |
65 |
|
|
|
66 |
|
|
{"description": "IDENT started by escape followed by a space 4", |
67 |
|
|
"input": "\\000041 ", |
68 |
|
|
"output": [["IDENT", "A"]]}, |
69 |
|
|
|
70 |
|
|
{"description": "IDENT started by escape followed by a space 5", |
71 |
|
|
"input": "\\000041\u000D\u000A", |
72 |
wakaba |
1.2 |
"output": [["IDENT", "A"]]}, |
73 |
|
|
|
74 |
|
|
{"description": "\\\u000D", |
75 |
|
|
"input": "\\\u000D", |
76 |
|
|
"output": [["DELIM", "\\"], ["S"]]}, |
77 |
|
|
|
78 |
|
|
{"description": "\\\u000D\u000A", |
79 |
|
|
"input": "\\\u000D\u000A", |
80 |
|
|
"output": [["DELIM", "\\"], ["S"]]}, |
81 |
|
|
|
82 |
|
|
{"description": "\\\u000D\\\u000A", |
83 |
|
|
"input": "\\\u000D\\\u000A", |
84 |
|
|
"output": [["DELIM", "\\"], ["S"], ["DELIM", "\\"], ["S"]]}, |
85 |
|
|
|
86 |
|
|
{"description": "\\\u000C", |
87 |
|
|
"input": "\\\u000C", |
88 |
|
|
"output": [["DELIM", "\\"], ["S"]]}, |
89 |
|
|
|
90 |
|
|
{"description": "\\\u000A", |
91 |
|
|
"input": "\\\u000A", |
92 |
|
|
"output": [["DELIM", "\\"], ["S"]]}, |
93 |
|
|
|
94 |
|
|
{"description": "\\ ", |
95 |
|
|
"input": "\\ ", |
96 |
|
|
"output": [["IDENT", " "]]}, |
97 |
|
|
|
98 |
|
|
{"description": "\\\\", |
99 |
|
|
"input": "\\\\", |
100 |
|
|
"output": [["IDENT", "\\"]]}, |
101 |
|
|
|
102 |
|
|
{"description": "\\\\\\", |
103 |
|
|
"input": "\\\\\\", |
104 |
|
|
"output": [["IDENT", "\\"], ["DELIM", "\\"]]}, |
105 |
|
|
|
106 |
|
|
{"description": "\\\u0009", |
107 |
|
|
"input": "\\\u0009", |
108 |
|
|
"output": [["IDENT", "\u0009"]]}, |
109 |
|
|
|
110 |
|
|
{"description": "\\X", |
111 |
|
|
"input": "\\X", |
112 |
|
|
"output": [["IDENT", "X"]]}, |
113 |
|
|
|
114 |
|
|
{"description": "a\\", |
115 |
|
|
"input": "a\\", |
116 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"]]}, |
117 |
|
|
|
118 |
|
|
{"description": "a\\f1", |
119 |
|
|
"input": "a\\f1", |
120 |
|
|
"output": [["IDENT", "a\u00f1"]]}, |
121 |
|
|
|
122 |
|
|
{"description": "a\\F1", |
123 |
|
|
"input": "a\\F1", |
124 |
|
|
"output": [["IDENT", "a\u00f1"]]}, |
125 |
|
|
|
126 |
|
|
{"description": "a\\0f1", |
127 |
|
|
"input": "a\\0f1", |
128 |
|
|
"output": [["IDENT", "a\u00f1"]]}, |
129 |
|
|
|
130 |
|
|
{"description": "a\\0F1", |
131 |
|
|
"input": "a\\0F1", |
132 |
|
|
"output": [["IDENT", "a\u00f1"]]}, |
133 |
|
|
|
134 |
|
|
{"description": "a\\41", |
135 |
|
|
"input": "a\\41", |
136 |
|
|
"output": [["IDENT", "aA"]]}, |
137 |
|
|
|
138 |
|
|
{"description": "a\\41 b", |
139 |
|
|
"input": "a\\41 b", |
140 |
|
|
"output": [["IDENT", "aAb"]]}, |
141 |
|
|
|
142 |
|
|
{"description": "a\\41\u0009X", |
143 |
|
|
"input": "a\\41\u0009X", |
144 |
|
|
"output": [["IDENT", "aAX"]]}, |
145 |
|
|
|
146 |
|
|
{"description": "a\\4e00", |
147 |
|
|
"input": "a\\4e00", |
148 |
|
|
"output": [["IDENT", "a\u4e00"]]}, |
149 |
|
|
|
150 |
|
|
{"description": "a\\41 X", |
151 |
|
|
"input": "a\\41 X", |
152 |
|
|
"output": [["IDENT", "aA"], ["S"], ["IDENT", "X"]]}, |
153 |
|
|
|
154 |
|
|
{"description": "a\\ ", |
155 |
|
|
"input": "a\\ ", |
156 |
|
|
"output": [["IDENT", "a "]]}, |
157 |
|
|
|
158 |
|
|
{"description": "a\\ b", |
159 |
|
|
"input": "a\\ b", |
160 |
|
|
"output": [["IDENT", "a b"]]}, |
161 |
|
|
|
162 |
|
|
{"description": "a\\\\b", |
163 |
|
|
"input": "a\\\\b", |
164 |
|
|
"output": [["IDENT", "a\\b"]]}, |
165 |
|
|
|
166 |
|
|
{"description": "a\\\u0009b", |
167 |
|
|
"input": "a\\\u0009b", |
168 |
|
|
"output": [["IDENT", "a\u0009b"]]}, |
169 |
|
|
|
170 |
|
|
{"description": "a\\GB", |
171 |
|
|
"input": "a\\GB", |
172 |
|
|
"output": [["IDENT", "aGB"]]}, |
173 |
|
|
|
174 |
|
|
{"description": "a\\\u000D", |
175 |
|
|
"input": "a\\\u000D", |
176 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]}, |
177 |
|
|
|
178 |
|
|
{"description": "a\\\u000A", |
179 |
|
|
"input": "a\\\u000A", |
180 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]}, |
181 |
|
|
|
182 |
|
|
{"description": "a\\\u000D\u000A", |
183 |
|
|
"input": "a\\\u000D\u000A", |
184 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]}, |
185 |
|
|
|
186 |
|
|
{"description": "a\\\u000D\\\u000A", |
187 |
|
|
"input": "a\\\u000D\\\u000A", |
188 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"], ["S"], ["DELIM", "\\"], ["S"]]}, |
189 |
|
|
|
190 |
|
|
{"description": "a\\\u000C", |
191 |
|
|
"input": "a\\\u000C", |
192 |
|
|
"output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]}, |
193 |
|
|
|
194 |
|
|
{"description": "-", |
195 |
|
|
"input": "-", |
196 |
|
|
"output": [["DELIM", "-"]]}, |
197 |
|
|
|
198 |
|
|
{"description": "\\-", |
199 |
|
|
"input": "\\-", |
200 |
|
|
"output": [["IDENT", "-"]]}, |
201 |
|
|
|
202 |
|
|
{"description": "-i", |
203 |
|
|
"input": "-i", |
204 |
|
|
"output": [["IDENT", "-i"]]}, |
205 |
|
|
|
206 |
|
|
{"description": "\\-i", |
207 |
|
|
"input": "\\-i", |
208 |
|
|
"output": [["IDENT", "-i"]]}, |
209 |
|
|
|
210 |
|
|
{"description": "-ident", |
211 |
|
|
"input": "-ident", |
212 |
|
|
"output": [["IDENT", "-ident"]]}, |
213 |
|
|
|
214 |
|
|
{"description": "\\-ident", |
215 |
|
|
"input": "\\-ident", |
216 |
|
|
"output": [["IDENT", "-ident"]]}, |
217 |
|
|
|
218 |
|
|
{"description": "-ident-ident", |
219 |
|
|
"input": "-ident-ident", |
220 |
|
|
"output": [["IDENT", "-ident-ident"]]}, |
221 |
|
|
|
222 |
|
|
{"description": "\\-ident-ident", |
223 |
|
|
"input": "\\-ident-ident", |
224 |
|
|
"output": [["IDENT", "-ident-ident"]]}, |
225 |
|
|
|
226 |
|
|
{"description": "-1", |
227 |
|
|
"input": "-1", |
228 |
|
|
"output": [["DELIM", "-"], ["NUMBER", "1"]]}, |
229 |
|
|
|
230 |
|
|
{"description": "\\-1", |
231 |
|
|
"input": "\\-1", |
232 |
|
|
"output": [["IDENT", "-1"]]}, |
233 |
|
|
|
234 |
|
|
{"description": "-1a", |
235 |
|
|
"input": "-1a", |
236 |
|
|
"output": [["DELIM", "-"], ["DIMENSION", "1", "a"]]}, |
237 |
|
|
|
238 |
|
|
{"description": "\\-1a", |
239 |
|
|
"input": "\\-1a", |
240 |
|
|
"output": [["IDENT", "-1a"]]}, |
241 |
|
|
|
242 |
|
|
{"description": "-\\31", |
243 |
|
|
"input": "-\\31", |
244 |
|
|
"output": [["IDENT", "-1"]]}, |
245 |
|
|
|
246 |
|
|
{"description": "\\-\\31", |
247 |
|
|
"input": "\\-\\31", |
248 |
|
|
"output": [["IDENT", "-1"]]}, |
249 |
|
|
|
250 |
|
|
{"description": "-\\41", |
251 |
|
|
"input": "-\\41", |
252 |
|
|
"output": [["IDENT", "-A"]]}, |
253 |
|
|
|
254 |
|
|
{"description": "\\-\\41", |
255 |
|
|
"input": "\\-\\41", |
256 |
|
|
"output": [["IDENT", "-A"]]}, |
257 |
|
|
|
258 |
|
|
{"description": "-\\\u000D", |
259 |
|
|
"input": "-\\\u000D", |
260 |
|
|
"output": [["DELIM", "-"], ["DELIM", "\\"], ["S"]]}, |
261 |
|
|
|
262 |
|
|
{"description": "\\-\\\u000D", |
263 |
|
|
"input": "\\-\\\u000D", |
264 |
|
|
"output": [["IDENT", "-"], ["DELIM", "\\"], ["S"]]}, |
265 |
|
|
|
266 |
|
|
{"description": "\u4e00", |
267 |
|
|
"input": "\u4e00", |
268 |
|
|
"output": [["IDENT", "\u4e00"]]}, |
269 |
|
|
|
270 |
|
|
{"description": "a\u4e00b", |
271 |
|
|
"input": "a\u4e00b", |
272 |
|
|
"output": [["IDENT", "a\u4e00b"]]}, |
273 |
|
|
|
274 |
|
|
{"description": "@", |
275 |
|
|
"input": "@", |
276 |
|
|
"output": [["DELIM", "@"]]}, |
277 |
|
|
|
278 |
|
|
{"description": "@a", |
279 |
|
|
"input": "@a", |
280 |
|
|
"output": [["ATKEYWORD", "a"]]}, |
281 |
|
|
|
282 |
|
|
{"description": "@A", |
283 |
|
|
"input": "@A", |
284 |
|
|
"output": [["ATKEYWORD", "A"]]}, |
285 |
|
|
|
286 |
|
|
{"description": "@abc", |
287 |
|
|
"input": "@abc", |
288 |
|
|
"output": [["ATKEYWORD", "abc"]]}, |
289 |
|
|
|
290 |
|
|
{"description": "@-", |
291 |
|
|
"input": "@-", |
292 |
|
|
"output": [["DELIM", "@"], ["DELIM", "-"]]}, |
293 |
|
|
|
294 |
|
|
{"description": "@-a", |
295 |
|
|
"input": "@-a", |
296 |
|
|
"output": [["ATKEYWORD", "-a"]]}, |
297 |
|
|
|
298 |
|
|
{"description": "@1", |
299 |
|
|
"input": "@1", |
300 |
|
|
"output": [["DELIM", "@"], ["NUMBER", "1"]]}, |
301 |
|
|
|
302 |
|
|
{"description": "@-1", |
303 |
|
|
"input": "@-1", |
304 |
|
|
"output": [["DELIM", "@"], ["DELIM", "-"], ["NUMBER", "1"]]}, |
305 |
|
|
|
306 |
|
|
{"description": "@\\41", |
307 |
|
|
"input": "@\\41", |
308 |
|
|
"output": [["ATKEYWORD", "A"]]}, |
309 |
|
|
|
310 |
|
|
{"description": "@\\61 b", |
311 |
|
|
"input": "@\\61 b", |
312 |
|
|
"output": [["ATKEYWORD", "ab"]]}, |
313 |
|
|
|
314 |
|
|
{"description": "@\\61 b", |
315 |
|
|
"input": "@\\61 b", |
316 |
|
|
"output": [["ATKEYWORD", "a"], ["S"], ["IDENT", "b"]]}, |
317 |
|
|
|
318 |
|
|
{"description": "@a\\41", |
319 |
|
|
"input": "@aA", |
320 |
|
|
"output": [["ATKEYWORD", "aA"]]}, |
321 |
|
|
|
322 |
|
|
{"description": "@a\\4e00X", |
323 |
|
|
"input": "@a\\4e00X", |
324 |
|
|
"output": [["ATKEYWORD", "a\u4e00X"]]} |
325 |
wakaba |
1.1 |
]} |