1 USING: xmode.tokens xmode.catalog
2 xmode.marker tools.test kernel ;
7 T{ token f "int" KEYWORD3 }
11 ] [ f "int x" "c" load-mode tokenize-line nip ] unit-test
15 T{ token f "\"" LITERAL1 }
16 T{ token f "hello\\\"" LITERAL1 }
17 T{ token f " " LITERAL1 }
18 T{ token f "world" LITERAL1 }
19 T{ token f "\"" LITERAL1 }
21 ] [ f "\"hello\\\" world\"" "c" load-mode tokenize-line nip ] unit-test
25 T{ token f "\"" LITERAL1 }
26 T{ token f "hello\\\ world" LITERAL1 }
27 T{ token f "\"" LITERAL1 }
29 ] [ f "\"hello\\\ world\"" "c" load-mode tokenize-line nip ] unit-test
33 T{ token f "int" KEYWORD3 }
37 ] [ f "int x" "java" load-mode tokenize-line nip ] unit-test
41 T{ token f "//" COMMENT2 }
42 T{ token f " " COMMENT2 }
43 T{ token f "hello" COMMENT2 }
44 T{ token f " " COMMENT2 }
45 T{ token f "world" COMMENT2 }
47 ] [ f "// hello world" "java" load-mode tokenize-line nip ] unit-test
52 T{ token f "hello" f }
54 T{ token f "world" f }
57 ] [ f "hello world:" "java" load-mode tokenize-line nip ] unit-test
61 T{ token f "hello_world" LABEL }
62 T{ token f ":" OPERATOR }
64 ] [ f "hello_world:" "java" load-mode tokenize-line nip ] unit-test
69 T{ token f "hello_world" LABEL }
70 T{ token f ":" OPERATOR }
72 ] [ f "\thello_world:" "java" load-mode tokenize-line nip ] unit-test
76 T{ token f "<!" KEYWORD2 }
77 T{ token f "ELEMENT" KEYWORD2 }
78 T{ token f " " KEYWORD2 }
79 T{ token f "%" LITERAL2 }
80 T{ token f "hello" LITERAL2 }
81 T{ token f ";" LITERAL2 }
82 T{ token f " " KEYWORD2 }
83 T{ token f ">" KEYWORD2 }
86 f "<!ELEMENT %hello; >" "xml" load-mode tokenize-line nip
91 T{ token f "<!" KEYWORD2 }
92 T{ token f "ELEMENT" KEYWORD2 }
93 T{ token f " " KEYWORD2 }
94 T{ token f "%" LITERAL2 }
95 T{ token f "hello-world" LITERAL2 }
96 T{ token f ";" LITERAL2 }
97 T{ token f " " KEYWORD2 }
98 T{ token f ">" KEYWORD2 }
101 f "<!ELEMENT %hello-world; >" "xml" load-mode tokenize-line nip
106 T{ token f "$" KEYWORD2 }
107 T{ token f "FOO" KEYWORD2 }
110 f "$FOO" "shellscript" load-mode tokenize-line nip
115 T{ token f "AND" KEYWORD1 }
118 f "AND" "pascal" load-mode tokenize-line nip
123 T{ token f "Comment {" COMMENT1 }
124 T{ token f "XXX" COMMENT1 }
125 T{ token f "}" COMMENT1 }
128 f "Comment {XXX}" "rebol" load-mode tokenize-line nip
134 f "font:75%/1.6em \"Lucida Grande\", \"Lucida Sans Unicode\", verdana, geneva, sans-serif;" "css" load-mode tokenize-line 2drop
139 T{ token f "<" MARKUP }
140 T{ token f "aaa" MARKUP }
141 T{ token f ">" MARKUP }
143 ] [ f "<aaa>" "html" load-mode tokenize-line nip ] unit-test