1 ! Copyright (C) 2008 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel tools.test peg peg.javascript.ast
5 peg.javascript.tokenizer accessors ;
11 T{ ast-string f "hello" }
20 "123; 'hello'; foo(x);" tokenize-javascript
23 { V{ T{ ast-regexp f "<(w+)[^>]*?)/>" "g" } } } [
24 "/<(\\w+)[^>]*?)\\/>/g" tokenize-javascript
28 V{ T{ ast-string { value "abc\"def\"" } } }
29 } [ "\"abc\\\"def\\\"\"" tokenize-javascript ] unit-test
32 V{ T{ ast-string { value "\b\f\n\r\t\v'\"\\" } } }
33 } [ "\"\\b\\f\\n\\r\\t\\v\\'\\\"\\\\\"" tokenize-javascript ] unit-test
36 V{ T{ ast-string { value "abc" } } }
37 } [ "\"\\x61\\u0062\\u{63}\"" tokenize-javascript ] unit-test