1 USING: arrays errors math parser test kernel generic words io
6 [ 0 "abcd" next-char ] unit-test
9 [ 1 "\\u0020hello" next-escape ] unit-test
12 [ 1 "\\nhello" next-escape ] unit-test
15 [ 0 "\\u0020hello" next-char ] unit-test
17 [ [ 1 [ 2 [ 3 ] 4 ] 5 ] ]
18 [ "1\n[\n2\n[\n3\n]\n4\n]\n5" parse ]
26 [ "\"hello world\"" parse ]
30 [ "\"\\n\\r\\t\\\\\"" parse ]
35 "IN: temporary : hello \"hello world\" ;"
36 parse call "USE: scratchpad hello" eval
40 [ "! This is a comment, people." parse call ]
46 [ "\"\\u0020\"" parse ]
50 [ "\"\\u0027\"" parse ]
53 [ "\\u123" parse ] unit-test-fails
55 ! Test EOL comments in multiline strings.
56 [ [ "Hello" ] ] [ "#! This calls until-eol.\n\"Hello\"" parse ] unit-test
58 [ word ] [ \ f class ] unit-test
60 ! Test stack effect parsing
62 : foo ( a b -- c ) + ;
64 [ T{ effect f { "a" "b" } { "c" } f } ]
65 [ \ foo "declared-effect" word-prop ] unit-test
67 [ t ] [ 1 1 <effect> 2 2 <effect> effect<= ] unit-test
68 [ f ] [ 1 0 <effect> 2 2 <effect> effect<= ] unit-test
69 [ t ] [ 2 2 <effect> 2 2 <effect> effect<= ] unit-test
70 [ f ] [ 3 3 <effect> 2 2 <effect> effect<= ] unit-test
71 [ f ] [ 2 3 <effect> 2 2 <effect> effect<= ] unit-test
73 : baz ( a b -- * ) 2array throw ;
76 [ \ baz "declared-effect" word-prop effect-terminated? ]
79 [ [ ] ] [ "IN: temporary : foo ( a b -- c ) + ;" parse ] unit-test
80 [ [ ] ] [ "IN: temporary : foo ;" parse ] unit-test
81 [ f ] [ \ foo "declared-effect" word-prop ] unit-test
84 [ 2 ] [ "IN: temporary : \0. 2 ; \0." eval ] unit-test
86 [ "IN: temporary : missing-- ( a b ) ;" eval ] unit-test-fails
88 ! Test interactive parsing, restarts
100 parse-interactive "cont" get continue-with