PageRenderTime 31ms CodeModel.GetById 19ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/extra/fonts/syntax/syntax.factor

http://github.com/abeaumont/factor
Unknown | 16 lines | 12 code | 4 blank | 0 comment | 0 complexity | 7d30a059fc1e1bd2615e890c104b876f MD5 | raw file
 1USING: accessors arrays variants combinators io.styles
 2kernel math parser sequences fry ;
 3IN: fonts.syntax
 4
 5VARIANT: fontname serif monospace ;
 6
 7: install ( object quot -- quot/? ) over [ curry ] [ 2drop [ ] ] if ;
 8
 9: >>name* ( object fontname -- object ) name>> >>name ;
10
11SYNTAX: FONT: \ ; parse-until {
12    [ [ number? ] find nip [ >>size ] install ]
13    [ [ italic = ] find nip [ >>italic? ] install ]
14    [ [ bold = ] find nip [ >>bold? ] install ]
15    [ [ fontname? ] find nip [ >>name* ] install ]
16} cleave 4array concat '[ dup font>> @ drop ] append! ;