2005-03-28 23:45:13 -05:00
|
|
|
IN: temporary
|
2004-07-16 02:26:21 -04:00
|
|
|
USE: parser
|
|
|
|
USE: test
|
2004-12-10 19:29:07 -05:00
|
|
|
USE: kernel
|
2004-12-23 01:14:07 -05:00
|
|
|
USE: generic
|
|
|
|
USE: words
|
2004-07-16 02:26:21 -04:00
|
|
|
|
2006-01-05 00:33:12 -05:00
|
|
|
[ 1 CHAR: a ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ 0 "abcd" next-char ] unit-test
|
|
|
|
|
2006-01-05 00:33:12 -05:00
|
|
|
[ 6 CHAR: \s ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ 1 "\\u0020hello" next-escape ] unit-test
|
|
|
|
|
2006-01-05 00:33:12 -05:00
|
|
|
[ 2 CHAR: \n ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ 1 "\\nhello" next-escape ] unit-test
|
|
|
|
|
2006-01-05 00:33:12 -05:00
|
|
|
[ 6 CHAR: \s ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ 0 "\\u0020hello" next-char ] unit-test
|
|
|
|
|
2004-07-16 02:26:21 -04:00
|
|
|
[ [ 1 [ 2 [ 3 ] 4 ] 5 ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "1\n[\n2\n[\n3\n]\n4\n]\n5" parse ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ [ t t f f ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "t t f f" parse ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
2004-08-04 03:12:55 -04:00
|
|
|
[ [ "hello world" ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "\"hello world\"" parse ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ [ "\n\r\t\\" ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "\"\\n\\r\\t\\\\\"" parse ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ "hello world" ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[
|
2005-03-28 23:45:13 -05:00
|
|
|
"IN: temporary : hello \"hello world\" ;"
|
2005-01-14 14:56:19 -05:00
|
|
|
parse call "USE: scratchpad hello" eval
|
|
|
|
] unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "! This is a comment, people." parse call ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "( This is a comment, people. )" parse call ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
! Test escapes
|
|
|
|
|
|
|
|
[ [ " " ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "\"\\u0020\"" parse ]
|
|
|
|
unit-test
|
2004-07-16 02:26:21 -04:00
|
|
|
|
|
|
|
[ [ "'" ] ]
|
2005-01-14 14:56:19 -05:00
|
|
|
[ "\"\\u0027\"" parse ]
|
|
|
|
unit-test
|
|
|
|
|
|
|
|
[ "\\u123" parse ] unit-test-fails
|
2004-10-06 23:40:46 -04:00
|
|
|
|
2004-10-27 23:13:00 -04:00
|
|
|
! Test EOL comments in multiline strings.
|
|
|
|
[ [ "Hello" ] ] [ "#! This calls until-eol.\n\"Hello\"" parse ] unit-test
|
2004-11-13 18:07:18 -05:00
|
|
|
|
2004-12-23 01:14:07 -05:00
|
|
|
[ word ] [ \ f class ] unit-test
|