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 } ;
49 TUPLE: foo < bar d e f ;
50 BUILTIN: string { length array-capacity read-only initial: 0 } aux ;
54 : word ( x -- ) drop ;
56 :: word ( x -- ) x drop ;
57 TYPED: word ( a b: class ... -- x: class y ... ) body ;
58 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
59 MACRO: word ( inputs... -- ) definition... ) ;
60 MACRO:: word ( vars... -- outputs... ) definition... ) ;
61 M: object explain drop "an object" print ;
62 M: class generic definition... ;
63 M:: class generic ( vars... -- outputs... ) body... ;
64 M:: class generic error body... ;
65 GENERIC: word ( stack -- effect )
70 GENERIC: word ! comment
72 GENERIC: word drop ! 3rd token wrong
73 GENERIC: word ! next line wrong
77 HOOK: word variable ( stack -- effect )
78 GENERIC#: word 1 ( stack -- effect )
80 word 1 ( stack -- effect )
81 GENERIC#: word 1 ( stack -- effect ) drop ! last token other
82 GENERIC#: word ! 2 should GENERIC# stack effect error
83 1 2 ( stack -- effect )
84 GENERIC#: word ! 2nd eff. should be independent of GENERIC#,
85 1 ! and 2 & 3 shouldn't GENERIC# highlight
86 ( stack -- effect ) ( independent -- effect ) 2 3
87 GENERIC#: word 1 ! comment
89 MATH: + ( x y -- z ) foldable flushable
91 CONSTRUCTOR: <circle> circle ( radius -- obj ) ;
92 CONSTRUCTOR: <circle> circle ( radius -- obj ) definition... ;
98 : word ( x -- ) drop ;
99 :: word ( x -- ) x drop ;
100 TYPED: word ( a b: class ... -- x: class y ... ) body ;
101 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
102 MACRO: word ( inputs... -- ) definition... ) ;
103 MACRO:: word ( vars... -- outputs... ) definition... ) ;
104 M: class generic definition... ;
105 M:: class generic ( vars... -- outputs... ) body... ;
106 GENERIC: word ( stack -- effect )
107 HOOK: word variable ( stack -- effect )
108 GENERIC#: word 1 ( stack -- effect )
109 MATH: + ( x y -- z ) foldable flushable
111 CONSTRUCTOR: <circle> circle ( radius -- obj ) ;
112 CONSTRUCTOR: <circle> circle ( radius -- obj ) definition... ;
120 ENUM: type words... ;
121 ENUM: type < base-type words...
122 FUNCTION: return name ( parameters ) ;
123 FUNCTION-ALIAS: factor-name return name ( parameters ) ;
125 ! Symbols and literals
166 "\a\b\e\f\n\r\t\s\v\s\0\\\""
169 URL" http://google.com"
174 ! Triple quote strings (old Factor)
183 [=[this is a weird new string]=]
204 ! Symbols are colored wrong:
206 : rock ( -- ) \ rock computer play. ;
208 ! SBUF is colored wrong:
210 SBUF" " clone swap [ " " append ] [ number>string append ] interleave
212 ! Update to new library words:
214 key? and assoc-empty? are not colored
215 tail* is not highlighted
217 ! IN poker, unicode characters:
225 CHAR: symbol-for-end-of-transmission
276 NAN: CAFE1234 0,. ! third token wrong
277 0,. ! wrong, next line also wrong
279 NAN: ! ff 0xff comment
281 ff ! shouldn't match as a hex number
290 NAN: ALKSJDflKJ ! XXX: should error
307 ! Comments in STRUCT: definitions
308 ! STRUCT: features like bitfields, etc.
311 { a int initial: 0 } ! a comment
326 ( quot: ( a -- b ) -- )
327 ( x quot: ( a -- b ) -- y )
328 ( ..a quot: ( ..a x -- ..b ) -- ..b )
333 boolean -- q: boolean )
334 ( m: integer -- n: float )
335 ( :integer -- :float )
350 : foo ( x -- y ) foo>> + ; inline
367 ! Numeral comma separator parsing (!: wrong, ~: other):
370 /* ! */ ,0 ,00 0,, 00,, +,0 -,,0 +0, -0,, /* ~ */ , +, -,,
373 0,0e0 0e0,0 0,0e0,0 +0,0e+0,0 -0,0e-0,0
374 /* ~ */ e e, ,e ,e, +e -e +e, -e,
375 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
376 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
377 /* ! */ e0, -e,0 ,0e, 0,e, +,e0 -,e-0 0,e0 +0,0e+ -0,0e-,, 0e+ -0e-
378 /* ! */ +0e+0, -0e-,,0
381 0,0. .0,0 /* ! */ 0,. .,0 ,.0 0., ,0. .0,
383 0,0.0,0e0 0,0.0,0e0,0
384 0,0.0,0e+0,0 0,0.0,0e-0,0
387 /* ~ */ / /. +/ -/ ,/ /, 0/ /0
388 0/1 1/1 1/1. 1/0. 0/0. /* ! */ 0/0 1/0 1./1
389 1/2 +1/2 -1/2 +2/2 /* ! */ 1/+2 1/-2 1/+0 +2/+2
390 +1+1/2 -0-1/2 /* ! */ +1+2/2 +1+1/2. +0-1/2 -0+1/2
392 ! Regexp is colored wrong (on Github):
394 : using-line ( source -- vocabs )
395 R/ USING: [^;]* ;/s all-matching-subseqs ?first
396 [ { } ] [ " \n" split rest but-last ] if-empty ;