13 /* multline ( x -- y )
15 6 /* something else */ 2 +
19 USING: vocabularies ... ;
23 FROM: vocab => words ... ;
24 EXCLUDE: vocab => words ... ;
26 QUALIFIED-WITH: vocab word-prefix
27 RENAME: word vocab => new-name
28 ALIAS: new-word existing-word
37 TUPLE: class slots ... ;
38 TUPLE: class < superclass slots ... ;
39 BUILTIN: class slots ... ;
40 INSTANCE: instance mixin
42 SINGLETONS: words ... ;
43 PREDICATE: class < superclass predicate... ;
47 TUPLE: interval-map { array array read-only } ;
48 BUILTIN: string { length array-capacity read-only initial: 0 } aux ;
52 : word ( x -- ) drop ;
54 :: word ( x -- ) x drop ;
55 TYPED: word ( a b: class ... -- x: class y ... ) body ;
56 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
57 MACRO: word ( inputs... -- ) definition... ) ;
58 MACRO:: word ( vars... -- outputs... ) definition... ) ;
59 M: object explain drop "an object" print ;
60 M: class generic definition... ;
61 M:: class generic ( vars... -- outputs... ) body... ;
62 M:: class generic error body... ;
63 GENERIC: word ( stack -- effect )
68 GENERIC: word ! comment
70 GENERIC: word drop ! 3rd token wrong
71 GENERIC: word ! next line wrong
75 HOOK: word variable ( stack -- effect )
76 GENERIC#: word 1 ( stack -- effect )
78 word 1 ( stack -- effect )
79 GENERIC#: word 1 ( stack -- effect ) drop ! last token other
80 GENERIC#: word ! 2 should GENERIC# stack effect error
81 1 2 ( stack -- effect )
82 GENERIC#: word ! 2nd eff. should be independent of GENERIC#,
83 1 ! and 2 & 3 shouldn't GENERIC# highlight
84 ( stack -- effect ) ( independent -- effect ) 2 3
85 GENERIC#: word 1 ! comment
87 MATH: + ( x y -- z ) foldable flushable
89 CONSTRUCTOR: <circle> circle ( radius -- obj ) ;
95 : word ( x -- ) drop ;
96 :: word ( x -- ) x drop ;
97 TYPED: word ( a b: class ... -- x: class y ... ) body ;
98 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
99 MACRO: word ( inputs... -- ) definition... ) ;
100 MACRO:: word ( vars... -- outputs... ) definition... ) ;
101 M: class generic definition... ;
102 M:: class generic ( vars... -- outputs... ) body... ;
103 GENERIC: word ( stack -- effect )
104 HOOK: word variable ( stack -- effect )
105 GENERIC#: word 1 ( stack -- effect )
106 MATH: + ( x y -- z ) foldable flushable
115 ENUM: type words... ;
116 ENUM: type < base-type words...
117 FUNCTION: return name ( parameters ) ;
118 FUNCTION-ALIAS: factor-name return name ( parameters ) ;
120 ! Symbols and literals
161 "\a\b\e\f\n\r\t\s\v\s\0\\\""
164 URL" http://google.com"
169 ! Triple quote strings (old Factor)
178 [=[this is a weird new string]=]
199 ! Symbols are colored wrong:
201 : rock ( -- ) \ rock computer play. ;
203 ! SBUF is colored wrong:
205 SBUF" " clone swap [ " " append ] [ number>string append ] interleave
207 ! Update to new library words:
209 key? and assoc-empty? are not colored
210 tail* is not highlighted
212 ! IN poker, unicode characters:
220 CHAR: symbol-for-end-of-transmission
270 NAN: CAFE1234 0,. ! third token wrong
271 0,. ! wrong, next line also wrong
273 NAN: ! ff 0xff comment
275 ff ! shouldn't match as a hex number
284 NAN: ALKSJDflKJ ! XXX: should error
301 ! Comments in STRUCT: definitions
302 ! STRUCT: features like bitfields, etc.
305 { a int initial: 0 } ! a comment
320 ( quot: ( a -- b ) -- )
321 ( x quot: ( a -- b ) -- y )
322 ( ..a quot: ( ..a x -- ..b ) -- ..b )
327 boolean -- q: boolean )
328 ( m: integer -- n: float )
329 ( :integer -- :float )
344 : foo ( x -- y ) foo>> + ; inline
361 ! Numeral comma separator parsing (!: wrong, ~: other):
364 /* ! */ ,0 ,00 0,, 00,, +,0 -,,0 +0, -0,, /* ~ */ , +, -,,
367 0,0e0 0e0,0 0,0e0,0 +0,0e+0,0 -0,0e-0,0
368 /* ~ */ e e, ,e ,e, +e -e +e, -e,
369 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
370 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
371 /* ! */ e0, -e,0 ,0e, 0,e, +,e0 -,e-0 0,e0 +0,0e+ -0,0e-,, 0e+ -0e-
372 /* ! */ +0e+0, -0e-,,0
375 0,0. .0,0 /* ! */ 0,. .,0 ,.0 0., ,0. .0,
377 0,0.0,0e0 0,0.0,0e0,0
378 0,0.0,0e+0,0 0,0.0,0e-0,0
381 /* ~ */ / /. +/ -/ ,/ /, 0/ /0
382 0/1 1/1 1/1. 1/0. 0/0. /* ! */ 0/0 1/0 1./1
383 1/2 +1/2 -1/2 +2/2 /* ! */ 1/+2 1/-2 1/+0 +2/+2
384 +1+1/2 -0-1/2 /* ! */ +1+2/2 +1+1/2. +0-1/2 -0+1/2
386 ! Regexp is colored wrong (on Github):
388 : using-line ( source -- vocabs )
389 R/ USING: [^;]* ;/s all-matching-subseqs ?first
390 [ { } ] [ " \n" split rest but-last ] if-empty ;