]> gitweb.factorcode.org Git - factor.git/blob - core/parser/parser-tests.factor
factor: Rename GENERIC# to GENERIC#:.
[factor.git] / core / parser / parser-tests.factor
1 USING: accessors arrays assocs classes compiler.units effects
2 eval generic grouping io.pathnames io.streams.string kernel
3 lexer math multiline namespaces parser sequences sets
4 source-files source-files.errors strings tools.crossref
5 tools.test vocabs vocabs.parser words words.symbol ;
6 IN: parser.tests
7
8 { 1 [ 2 [ 3 ] 4 ] 5 }
9 [ "1\n[\n2\n[\n3\n]\n4\n]\n5" eval( -- a b c ) ]
10 unit-test
11
12 { t t f f }
13 [ "t t f f" eval( -- ? ? ? ? ) ]
14 unit-test
15
16 { "hello world" }
17 [ "\"hello world\"" eval( -- string ) ]
18 unit-test
19
20 { "\n\r\t\\" }
21 [ "\"\\n\\r\\t\\\\\"" eval( -- string ) ]
22 unit-test
23
24 { "hello world" }
25 [
26 "#!/usr/bin/env factor
27 \"hello world\"" eval( -- string )
28 ] unit-test
29
30 { "hello world" }
31 [
32     "IN: parser.tests : hello ( -- str ) \"hello world\" ;"
33     eval( -- ) "USE: parser.tests hello" eval( -- string )
34 ] unit-test
35
36 [ "IN: parser.tests : \" ( -- n ) 123 ;" eval( -- ) ]
37 [ error>> invalid-word-name? ] must-fail-with
38 [ "IN: parser.tests : \"asdf ( -- n ) 123 ;" eval( -- ) ]
39 [ error>> invalid-word-name? ] must-fail-with
40 [ "IN: parser.tests : 123 ( -- n ) 123 ;" eval( -- ) ]
41 [ error>> invalid-word-name? ] must-fail-with
42
43 { }
44 [ "! This is a comment, people." eval( -- ) ]
45 unit-test
46
47 ! Test escapes
48
49 { " " }
50 [ "\"\\u000020\"" eval( -- string ) ]
51 unit-test
52
53 { "'" }
54 [ "\"\\u000027\"" eval( -- string ) ]
55 unit-test
56
57 ! Test EOL comments in multiline strings.
58 { "Hello" } [ "! This calls until-eol.\n\"Hello\"" eval( -- string ) ] unit-test
59
60 { word } [ \ f class-of ] unit-test
61
62 ! Test stack effect parsing
63
64 : effect-parsing-test ( a b -- c ) + ;
65
66 { t } [
67     "effect-parsing-test" "parser.tests" lookup-word
68     \ effect-parsing-test eq?
69 ] unit-test
70
71 { T{ effect f { "a" "b" } { "c" } f } }
72 [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
73
74 : baz ( a b -- * ) 2array throw ;
75
76 { t }
77 [ \ baz "declared-effect" word-prop terminated?>> ]
78 unit-test
79
80 { } [ "IN: parser.tests USE: math : effect-parsing-test ( a b -- d ) - ;" eval( -- ) ] unit-test
81
82 { t } [
83     "effect-parsing-test" "parser.tests" lookup-word
84     \ effect-parsing-test eq?
85 ] unit-test
86
87 { T{ effect f { "a" "b" } { "d" } f } }
88 [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
89
90 [ "IN: parser.tests : missing-- ( a b ) ;" eval( -- ) ] must-fail
91
92 ! Funny bug
93 { 2 } [ "IN: parser.tests : \0. ( -- x ) 2 ; \0." eval( -- n ) ] unit-test
94
95 DEFER: foo
96
97 "IN: parser.tests USING: math prettyprint ; SYNTAX: foo 2 2 + . ;" eval( -- )
98
99 { } [ "USE: parser.tests foo" eval( -- ) ] unit-test
100
101 "IN: parser.tests USING: math prettyprint ; : foo ( -- ) 2 2 + . ;" eval( -- )
102
103 { t } [
104     "USE: parser.tests \\ foo" eval( -- word )
105     "foo" "parser.tests" lookup-word eq?
106 ] unit-test
107
108 ! parse-tokens should do the right thing on EOF
109 [ "USING: kernel" eval( -- ) ]
110 [ error>> T{ unexpected { want "token" } } = ] must-fail-with
111
112 ! Test smudging
113
114 { 1 } [
115     "IN: parser.tests : smudge-me ( -- ) ;" <string-reader> "foo"
116     parse-stream drop
117
118     "foo" path>source-file definitions>> first cardinality
119 ] unit-test
120
121 { t } [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
122
123 { } [
124     "IN: parser.tests : smudge-me-more ( -- ) ;" <string-reader> "foo"
125     parse-stream drop
126 ] unit-test
127
128 { t } [ "smudge-me-more" "parser.tests" lookup-word >boolean ] unit-test
129 { f } [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
130
131 { 3 } [
132     "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
133     parse-stream drop
134
135     "foo" path>source-file definitions>> first cardinality
136 ] unit-test
137
138 { 1 } [
139     "IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar"
140     parse-stream drop
141
142     "bar" path>source-file definitions>> first cardinality
143 ] unit-test
144
145 { 2 } [
146     "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ;" <string-reader> "foo"
147     parse-stream drop
148
149     "foo" path>source-file definitions>> first cardinality
150 ] unit-test
151
152 { t } [
153     array "smudge-me" "parser.tests" lookup-word order member-eq?
154 ] unit-test
155
156 { t } [
157     integer "smudge-me" "parser.tests" lookup-word order member-eq?
158 ] unit-test
159
160 { f } [
161     string "smudge-me" "parser.tests" lookup-word order member-eq?
162 ] unit-test
163
164 { } [
165     "IN: parser.tests USE: math 2 2 +" <string-reader> "a"
166     parse-stream drop
167 ] unit-test
168
169 { t } [
170     "a" <pathname> \ + usage member?
171 ] unit-test
172
173 { } [
174     "IN: parser.tests USE: math 2 2 -" <string-reader> "a"
175     parse-stream drop
176 ] unit-test
177
178 { f } [
179     "a" <pathname> \ + usage member?
180 ] unit-test
181
182 { } [
183     "a" source-files get delete-at
184     2 [
185         "IN: parser.tests DEFER: x : y ( -- ) x ; : x ( -- ) y ;"
186         <string-reader> "a" parse-stream drop
187     ] times
188 ] unit-test
189
190 "a" source-files get delete-at
191
192 [
193     "IN: parser.tests : x ( -- ) ; : y ( -- * ) 3 throw ; this is an error"
194     <string-reader> "a" parse-stream
195 ] [ source-file-error? ] must-fail-with
196
197 { t } [
198     "y" "parser.tests" lookup-word >boolean
199 ] unit-test
200
201 { f } [
202     "IN: parser.tests : x ( -- ) ;"
203     <string-reader> "a" parse-stream drop
204     "y" "parser.tests" lookup-word
205 ] unit-test
206
207 ! Test new forward definition logic
208 { } [
209     "IN: axx : axx ( -- ) ;"
210     <string-reader> "axx" parse-stream drop
211 ] unit-test
212
213 { } [
214     "USE: axx IN: bxx : bxx ( -- ) ; : cxx ( -- ) axx bxx ;"
215     <string-reader> "bxx" parse-stream drop
216 ] unit-test
217
218 ! So we move the bxx word to axx...
219 { } [
220     "IN: axx : axx ( -- ) ; : bxx ( -- ) ;"
221     <string-reader> "axx" parse-stream drop
222 ] unit-test
223
224 { t } [ "bxx" "axx" lookup-word >boolean ] unit-test
225
226 ! And reload the file that uses it...
227 { } [
228     "USE: axx IN: bxx ( -- ) : cxx ( -- ) axx bxx ;"
229     <string-reader> "bxx" parse-stream drop
230 ] unit-test
231
232 ! And hope not to get a forward-error!
233
234 ! Turning a generic into a non-generic could cause all
235 ! kinds of funnyness
236 { } [
237     "IN: ayy USE: kernel GENERIC: ayy ( a -- b ) M: object ayy ;"
238     <string-reader> "ayy" parse-stream drop
239 ] unit-test
240
241 { } [
242     "IN: ayy USE: kernel : ayy ( -- ) ;"
243     <string-reader> "ayy" parse-stream drop
244 ] unit-test
245
246 { } [
247     "IN: azz TUPLE: my-class ; GENERIC: a-generic ( a -- b )"
248     <string-reader> "azz" parse-stream drop
249 ] unit-test
250
251 { } [
252     "USE: azz M: my-class a-generic ;"
253     <string-reader> "azz-2" parse-stream drop
254 ] unit-test
255
256 { } [
257     "IN: azz GENERIC: a-generic ( a -- b )"
258     <string-reader> "azz" parse-stream drop
259 ] unit-test
260
261 { } [
262     "USE: azz USE: math M: integer a-generic ;"
263     <string-reader> "azz-2" parse-stream drop
264 ] unit-test
265
266 { } [
267     "IN: parser.tests : <bogus-error> ( -- ) ; : bogus ( -- error ) <bogus-error> ;"
268     <string-reader> "bogus-error" parse-stream drop
269 ] unit-test
270
271 { } [
272     "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus ( -- error ) <bogus-error> ;"
273     <string-reader> "bogus-error" parse-stream drop
274 ] unit-test
275
276 ! Problems with class predicates -vs- ordinary words
277 { } [
278     "IN: parser.tests TUPLE: killer ;"
279     <string-reader> "removing-the-predicate" parse-stream drop
280 ] unit-test
281
282 { } [
283     "IN: parser.tests GENERIC: killer? ( a -- b )"
284     <string-reader> "removing-the-predicate" parse-stream drop
285 ] unit-test
286
287 { t } [
288     "killer?" "parser.tests" lookup-word >boolean
289 ] unit-test
290
291 [
292     "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test? ( a -- b )"
293     <string-reader> "removing-the-predicate" parse-stream
294 ] [ error>> error>> error>> redefine-error? ] must-fail-with
295
296 [
297     "IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;"
298     <string-reader> "redefining-a-class-1" parse-stream
299 ] [ error>> error>> error>> redefine-error? ] must-fail-with
300
301 { } [
302     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test"
303     <string-reader> "redefining-a-class-2" parse-stream drop
304 ] unit-test
305
306 [
307     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ( -- ) ;"
308     <string-reader> "redefining-a-class-3" parse-stream drop
309 ] [ error>> error>> error>> redefine-error? ] must-fail-with
310
311 { } [
312     "IN: parser.tests TUPLE: class-fwd-test ;"
313     <string-reader> "redefining-a-class-3" parse-stream drop
314 ] unit-test
315
316 [
317     "IN: parser.tests \\ class-fwd-test"
318     <string-reader> "redefining-a-class-3" parse-stream drop
319 ] [ error>> error>> error>> no-word-error? ] must-fail-with
320
321 { } [
322     "IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test"
323     <string-reader> "redefining-a-class-3" parse-stream drop
324 ] unit-test
325
326 [
327     "IN: parser.tests \\ class-fwd-test"
328     <string-reader> "redefining-a-class-3" parse-stream drop
329 ] [ error>> error>> error>> no-word-error? ] must-fail-with
330
331 [
332     "IN: parser.tests : foo ( -- ) ; TUPLE: foo ;"
333     <string-reader> "redefining-a-class-4" parse-stream drop
334 ] [ error>> error>> error>> redefine-error? ] must-fail-with
335
336 { } [
337     "IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval( -- )
338 ] unit-test
339
340 [
341     "IN: parser.tests : foo ( x y -- z) 1 2 ; : bar ( a -- b ) ;" eval( -- )
342 ] must-fail
343
344 { } [
345     "IN: parser.tests USE: kernel PREDICATE: foo < object ;" eval( -- )
346 ] unit-test
347
348 { t } [
349     "foo" "parser.tests" lookup-word last-word eq?
350 ] unit-test
351
352 { } [
353     [
354         "redefining-a-class-5" forget-source
355         "redefining-a-class-6" forget-source
356         "redefining-a-class-7" forget-source
357     ] with-compilation-unit
358 ] unit-test
359
360 2 [
361     [ ] [
362         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
363         <string-reader> "redefining-a-class-5" parse-stream drop
364     ] unit-test
365
366     [ ] [
367         "IN: parser.tests M: f foo ;"
368         <string-reader> "redefining-a-class-6" parse-stream drop
369     ] unit-test
370
371     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
372
373     [ ] [
374         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
375         <string-reader> "redefining-a-class-5" parse-stream drop
376     ] unit-test
377
378     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
379
380     [ ] [
381         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
382     <string-reader> "redefining-a-class-7" parse-stream drop
383     ] unit-test
384
385     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
386
387     [ ] [
388         "IN: parser.tests TUPLE: foo ;"
389         <string-reader> "redefining-a-class-7" parse-stream drop
390     ] unit-test
391
392     [ t ] [ "foo" "parser.tests" lookup-word symbol? ] unit-test
393 ] times
394
395 [ "vocab:parser/test/assert-depth.factor" run-file ] must-fail
396
397 2 [
398     [ ] [
399         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
400         <string-reader> "d-f-s-test" parse-stream drop
401     ] unit-test
402
403     [ ] [
404         "IN: parser.tests DEFER: d-f-s d-f-s FORGET: d-f-s SYMBOL: d-f-s d-f-s"
405         <string-reader> "d-f-s-test" parse-stream drop
406     ] unit-test
407
408     [ ] [
409         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
410         <string-reader> "d-f-s-test" parse-stream drop
411     ] unit-test
412 ] times
413
414 { } [
415     [ "this-better-not-exist" forget-vocab ] with-compilation-unit
416 ] unit-test
417
418 [
419     "USE: this-better-not-exist" eval( -- )
420 ] must-fail
421
422 [ ": foo ;" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
423
424 { 92 } [ "CHAR: \\" eval( -- n ) ] unit-test
425 { 92 } [ "CHAR: \\\\" eval( -- n ) ] unit-test
426
427 { } [
428     {
429         "IN: parser.tests"
430         "USING: math arrays kernel ;"
431         "GENERIC: change-combination ( obj a -- b )"
432         "M: integer change-combination 2drop 1 ;"
433         "M: array change-combination 2drop 2 ;"
434     } "\n" join <string-reader> "change-combination-test" parse-stream drop
435 ] unit-test
436
437 { } [
438     {
439         "IN: parser.tests"
440         "USING: math arrays kernel ;"
441         "GENERIC#: change-combination 1 ( obj a -- b )"
442         "M: integer change-combination 2drop 1 ;"
443         "M: array change-combination 2drop 2 ;"
444     } "\n" join <string-reader> "change-combination-test" parse-stream drop
445 ] unit-test
446
447 { 2 } [
448     "change-combination" "parser.tests" lookup-word
449     "methods" word-prop assoc-size
450 ] unit-test
451
452 { } [
453     2 [
454         "IN: parser.tests DEFER: twice-fails FORGET: twice-fails MIXIN: twice-fails"
455         <string-reader> "twice-fails-test" parse-stream drop
456     ] times
457 ] unit-test
458
459 { [ ] } [
460     "IN: parser.tests : staging-problem-test-1 ( -- a ) 1 ; : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
461     <string-reader> "staging-problem-test" parse-stream
462 ] unit-test
463
464 { t } [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
465
466 { t } [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
467
468 { [ ] } [
469     "IN: parser.tests << : staging-problem-test-1 ( -- a ) 1 ; >> : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
470     <string-reader> "staging-problem-test" parse-stream
471 ] unit-test
472
473 { t } [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
474
475 { t } [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
476
477 [ "DEFER: blahy" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
478
479 [
480     "IN: parser.tests SYNTAX: blahy ; FORGET: blahy" eval( -- )
481 ] [
482     error>> staging-violation?
483 ] must-fail-with
484
485 ! Bogus error message
486 DEFER: blahy
487
488 [ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval( -- ) ]
489 [ error>> error>> def>> \ blahy eq? ] must-fail-with
490
491 [ "CHAR: \\u9999999999999" eval( -- n ) ] must-fail
492
493 SYMBOLS: a b c ;
494
495 { a } [ a ] unit-test
496 { b } [ b ] unit-test
497 { c } [ c ] unit-test
498
499 DEFER: blah
500
501 { } [ "IN: parser.tests GENERIC: blah ( x -- x )" eval( -- ) ] unit-test
502 { } [ "IN: parser.tests SYMBOLS: blah ;" eval( -- ) ] unit-test
503
504 { f } [ \ blah generic? ] unit-test
505 { t } [ \ blah symbol? ] unit-test
506
507 DEFER: blah1
508
509 [ "IN: parser.tests SINGLETONS: blah1 blah1 blah1 ;" eval( -- ) ]
510 [ error>> error>> def>> \ blah1 eq? ]
511 must-fail-with
512
513 IN: qualified.tests.foo
514 : x ( -- a ) 1 ;
515 : y ( -- a ) 5 ;
516 IN: qualified.tests.bar
517 : x ( -- a ) 2 ;
518 : y ( -- a ) 4 ;
519 IN: qualified.tests.baz
520 : x ( -- a ) 3 ;
521
522 QUALIFIED: qualified.tests.foo
523 QUALIFIED: qualified.tests.bar
524 { 1 2 3 } [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
525
526 QUALIFIED-WITH: qualified.tests.bar p
527 { 2 } [ p:x ] unit-test
528
529 RENAME: x qualified.tests.baz => y
530 { 3 } [ y ] unit-test
531
532 FROM: qualified.tests.baz => x ;
533 { 3 } [ x ] unit-test
534 { 3 } [ y ] unit-test
535
536 EXCLUDE: qualified.tests.bar => x ;
537 { 3 } [ x ] unit-test
538 { 4 } [ y ] unit-test
539
540 ! Two similar bugs
541
542 ! Replace : def with something in << >>
543 /* { [ ] } [
544     "IN: parser.tests : was-once-a-word-bug ( -- ) ;"
545     <string-reader> "was-once-a-word-test" parse-stream
546 ] unit-test
547
548 { t } [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test
549
550 { [ ] } [
551     "IN: parser.tests USE: words << \"was-once-a-word-bug\" \"parser.tests\" create-word [ ] ( -- ) define-declared >>"
552     <string-reader> "was-once-a-word-test" parse-stream
553 ] unit-test
554
555 { t } [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test */
556
557 ! Replace : def with DEFER:
558 { [ ] } [
559     "IN: parser.tests : is-not-deferred ( -- ) ;"
560     <string-reader> "is-not-deferred" parse-stream
561 ] unit-test
562
563 { t } [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
564 { f } [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
565
566 { [ ] } [
567     "IN: parser.tests DEFER: is-not-deferred"
568     <string-reader> "is-not-deferred" parse-stream
569 ] unit-test
570
571 { t } [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
572 { t } [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
573
574 ! Forward-reference resolution case iterated using list in the wrong direction
575 { [ ] } [
576     "IN: parser.tests.forward-ref-1 DEFER: x DEFER: y"
577     <string-reader> "forward-ref-1" parse-stream
578 ] unit-test
579
580 { [ ] } [
581     "IN: parser.tests.forward-ref-2 DEFER: x DEFER: y"
582     <string-reader> "forward-ref-2" parse-stream
583 ] unit-test
584
585 { [ ] } [
586     "IN: parser.tests.forward-ref-3 FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; : z ( -- ) x y ;"
587     <string-reader> "forward-ref-3" parse-stream
588 ] unit-test
589
590 { t } [
591     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
592 ] unit-test
593
594 { [ ] } [
595     "FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; IN: parser.tests.forward-ref-3 : x ( -- ) ; : z ( -- ) x y ;"
596     <string-reader> "forward-ref-3" parse-stream
597 ] unit-test
598
599 { f } [
600     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
601 ] unit-test
602
603 { [ ] } [
604     "IN: parser.tests.forward-ref-3 FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; : z ( -- ) x y ;"
605     <string-reader> "forward-ref-3" parse-stream
606 ] unit-test
607
608 { t } [
609     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
610 ] unit-test
611
612 { [ dup ] } [
613     "USE: kernel dup" <string-reader> "unuse-test" parse-stream
614 ] unit-test
615
616 [
617     "dup" <string-reader> "unuse-test" parse-stream
618 ] [ error>> error>> error>> no-word-error? ] must-fail-with
619
620 [
621     "USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
622 ] [ error>> error>> error>> no-word-error? ] must-fail-with
623
624 { } [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test
625
626 [
627     [ "vocabs.loader.test.l" use-vocab ] must-fail
628     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
629     [ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test
630     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
631 ] with-file-vocabs
632
633 ! Test cases for #183
634 [ "SINGLETON: 33" <string-reader> "class identifier test" parse-stream ]
635 [ error>> lexer-error? ] must-fail-with
636
637 [ ": 44 ( -- ) ;" <string-reader> "word identifier test" parse-stream ]
638 [ error>> lexer-error? ] must-fail-with
639
640 [ "GENERIC: 33 ( -- )" <string-reader> "generic identifier test" parse-stream ]
641 [ error>> lexer-error? ] must-fail-with
642
643 { t } [
644     t auto-use? [
645         { private? } use-first-word?
646     ] with-variable
647 ] unit-test
648
649 ! parse-array-def
650 { { 10 20 30 } } [
651     [
652         { "10 20 30 ;" } <lexer> [ parse-array-def ] with-lexer
653     ] with-file-vocabs
654 ] unit-test