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
36 TUPLE: class slots ... ;
37 TUPLE: class < superclass slots ... ;
38 BUILTIN: class slots ... ;
39 INSTANCE: instance mixin
41 SINGLETONS: words ... ;
42 PREDICATE: class < superclass predicate... ;
46 TUPLE: interval-map { array array read-only } ;
47 BUILTIN: string { length array-capacity read-only initial: 0 } aux ;
51 : word ( x -- ) drop ;
53 :: word ( x -- ) x drop ;
54 TYPED: word ( a b: class ... -- x: class y ... ) body ;
55 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
56 MACRO: word ( inputs... -- ) definition... ) ;
57 MACRO:: word ( vars... -- outputs... ) definition... ) ;
58 M: object explain drop "an object" print ;
59 M: class generic definition... ;
60 M:: class generic ( vars... -- outputs... ) body... ;
61 M:: class generic error body... ;
62 GENERIC: word ( stack -- effect )
67 GENERIC: word ! comment
69 GENERIC: word drop ! 3rd token wrong
70 GENERIC: word ! next line wrong
74 HOOK: word variable ( stack -- effect )
75 GENERIC#: word 1 ( stack -- effect )
77 word 1 ( stack -- effect )
78 GENERIC#: word 1 ( stack -- effect ) drop ! last token other
79 GENERIC#: word ! 2 should GENERIC# stack effect error
80 1 2 ( stack -- effect )
81 GENERIC#: word ! 2nd eff. should be independent of GENERIC#,
82 1 ! and 2 & 3 shouldn't GENERIC# highlight
83 ( stack -- effect ) ( independent -- effect ) 2 3
84 GENERIC#: word 1 ! comment
86 MATH: + ( x y -- z ) foldable flushable
94 : word ( x -- ) drop ;
95 :: word ( x -- ) x drop ;
96 TYPED: word ( a b: class ... -- x: class y ... ) body ;
97 TYPED:: word ( a b: class ... -- x: class y ... ) body ;
98 MACRO: word ( inputs... -- ) definition... ) ;
99 MACRO:: word ( vars... -- outputs... ) definition... ) ;
100 M: class generic definition... ;
101 M:: class generic ( vars... -- outputs... ) body... ;
102 GENERIC: word ( stack -- effect )
103 HOOK: word variable ( stack -- effect )
104 GENERIC#: word 1 ( stack -- effect )
105 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
163 "\a\b\e\f\n\r\t\s\v\s\0\\\""
166 URL" http://google.com"
171 ! Triple quote strings (old Factor)
180 [=[this is a weird new string]=]
201 ! Symbols are colored wrong:
203 : rock ( -- ) \ rock computer play. ;
205 ! SBUF is colored wrong:
207 SBUF" " clone swap [ " " append ] [ number>string append ] interleave
209 ! Update to new library words:
211 key? and assoc-empty? are not colored
212 tail* is not highlighted
214 ! IN poker, unicode characters:
222 CHAR: symbol-for-end-of-transmission
230 ! New number literals:
257 NAN: CAFE1234 0,. ! third token wrong
258 0,. ! wrong, next line also wrong
260 NAN: ! ff 0xff comment
262 ff ! shouldn't match as a hex number
285 ! Comments in STRUCT: definitions
286 ! STRUCT: features like bitfields, etc.
289 { a int initial: 0 } ! a comment
304 ( quot: ( a -- b ) -- )
305 ( x quot: ( a -- b ) -- y )
306 ( ..a quot: ( ..a x -- ..b ) -- ..b )
311 boolean -- q: boolean )
312 ( m: integer -- n: float )
313 ( :integer -- :float )
329 : foo ( x -- y ) foo>> + ; inline
349 ! Numeral comma separator parsing (!: wrong, ~: other):
352 /* ! */ ,0 ,00 0,, 00,, +,0 -,,0 +0, -0,, /* ~ */ , +, -,,
355 0,0e0 0e0,0 0,0e0,0 +0,0e+0,0 -0,0e-0,0
356 /* ~ */ e e, ,e ,e, +e -e +e, -e,
357 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
358 /* ~ */ +e -e +,e -,e +e+, -e-, +,e-,, -,,e+,
359 /* ! */ e0, -e,0 ,0e, 0,e, +,e0 -,e-0 0,e0 +0,0e+ -0,0e-,, 0e+ -0e-
360 /* ! */ +0e+0, -0e-,,0
363 0,0. .0,0 /* ! */ 0,. .,0 ,.0 0., ,0. .0,
365 0,0.0,0e0 0,0.0,0e0,0
366 0,0.0,0e+0,0 0,0.0,0e-0,0
369 /* ~ */ / /. +/ -/ ,/ /, 0/ /0
370 0/1 1/1 1/1. 1/0. 0/0. /* ! */ 0/0 1/0 1./1
371 1/2 +1/2 -1/2 +2/2 /* ! */ 1/+2 1/-2 1/+0 +2/+2
372 +1+1/2 -0-1/2 /* ! */ +1+2/2 +1+1/2. +0-1/2 -0+1/2
374 ! Regexp is colored wrong (on Github):
376 : using-line ( source -- vocabs )
377 R/ USING: [^;]* ;/s all-matching-subseqs ?first
378 [ { } ] [ " \n" split rest but-last ] if-empty ;