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 ) ;
90 CONSTRUCTOR: <circle> circle ( radius -- obj ) definition... ;
96 : word ( x -- ) drop ;
97 :: word ( x -- ) x drop ;
98 TYPED: word ( a b: class ... -- x: class y ... ) body ;
99 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
100 MACRO: word ( inputs... -- ) definition... ) ;
101 MACRO:: word ( vars... -- outputs... ) definition... ) ;
102 M: class generic definition... ;
103 M:: class generic ( vars... -- outputs... ) body... ;
104 GENERIC: word ( stack -- effect )
105 HOOK: word variable ( stack -- effect )
106 GENERIC#: word 1 ( stack -- effect )
107 MATH: + ( x y -- z ) foldable flushable
109 CONSTRUCTOR: <circle> circle ( radius -- obj ) ;
110 CONSTRUCTOR: <circle> circle ( radius -- obj ) definition... ;
118 ENUM: type words... ;
119 ENUM: type < base-type words...
120 FUNCTION: return name ( parameters ) ;
121 FUNCTION-ALIAS: factor-name return name ( parameters ) ;
123 ! Symbols and literals
164 "\a\b\e\f\n\r\t\s\v\s\0\\\""
167 URL" http://google.com"
172 ! Triple quote strings (old Factor)
181 [=[this is a weird new string]=]
202 ! Symbols are colored wrong:
204 : rock ( -- ) \ rock computer play. ;
206 ! SBUF is colored wrong:
208 SBUF" " clone swap [ " " append ] [ number>string append ] interleave
210 ! Update to new library words:
212 key? and assoc-empty? are not colored
213 tail* is not highlighted
215 ! IN poker, unicode characters:
223 CHAR: symbol-for-end-of-transmission
273 NAN: CAFE1234 0,. ! third token wrong
274 0,. ! wrong, next line also wrong
276 NAN: ! ff 0xff comment
278 ff ! shouldn't match as a hex number
287 NAN: ALKSJDflKJ ! XXX: should error
304 ! Comments in STRUCT: definitions
305 ! STRUCT: features like bitfields, etc.
308 { a int initial: 0 } ! a comment
323 ( quot: ( a -- b ) -- )
324 ( x quot: ( a -- b ) -- y )
325 ( ..a quot: ( ..a x -- ..b ) -- ..b )
330 boolean -- q: boolean )
331 ( m: integer -- n: float )
332 ( :integer -- :float )
347 : foo ( x -- y ) foo>> + ; inline
364 ! Numeral comma separator parsing (!: wrong, ~: other):
367 /* ! */ ,0 ,00 0,, 00,, +,0 -,,0 +0, -0,, /* ~ */ , +, -,,
370 0,0e0 0e0,0 0,0e0,0 +0,0e+0,0 -0,0e-0,0
371 /* ~ */ e e, ,e ,e, +e -e +e, -e,
372 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
373 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
374 /* ! */ e0, -e,0 ,0e, 0,e, +,e0 -,e-0 0,e0 +0,0e+ -0,0e-,, 0e+ -0e-
375 /* ! */ +0e+0, -0e-,,0
378 0,0. .0,0 /* ! */ 0,. .,0 ,.0 0., ,0. .0,
380 0,0.0,0e0 0,0.0,0e0,0
381 0,0.0,0e+0,0 0,0.0,0e-0,0
384 /* ~ */ / /. +/ -/ ,/ /, 0/ /0
385 0/1 1/1 1/1. 1/0. 0/0. /* ! */ 0/0 1/0 1./1
386 1/2 +1/2 -1/2 +2/2 /* ! */ 1/+2 1/-2 1/+0 +2/+2
387 +1+1/2 -0-1/2 /* ! */ +1+2/2 +1+1/2. +0-1/2 -0+1/2
389 ! Regexp is colored wrong (on Github):
391 : using-line ( source -- vocabs )
392 R/ USING: [^;]* ;/s all-matching-subseqs ?first
393 [ { } ] [ " \n" split rest but-last ] if-empty ;