]> gitweb.factorcode.org Git - factor.git/blob - basis/prettyprint/stylesheet/stylesheet.factor
Merge branch 'master' into strong-typing
[factor.git] / basis / prettyprint / stylesheet / stylesheet.factor
1 ! Copyright (C) 2009 Your name.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: colors.constants hashtables io.styles kernel namespaces
4 words words.symbol ;
5 IN: prettyprint.stylesheet
6
7 : word-style ( word -- style )
8     dup "word-style" word-prop >hashtable [
9         [
10             [ presented set ] [
11                 [ parsing-word? ] [ delimiter? ] [ symbol? ] tri
12                 or or [ COLOR: DarkSlateGray ] [ COLOR: black ] if
13                 foreground set
14             ] bi
15         ] bind
16     ] keep ;
17
18 : string-style ( obj -- style )
19     [
20         presented set
21         COLOR: LightSalmon4 foreground set
22     ] H{ } make-assoc ;
23
24 : vocab-style ( vocab -- style )
25     [
26         presented set
27         COLOR: cornsilk4 foreground set
28     ] H{ } make-assoc ;
29
30 : effect-style ( effect -- style )
31     [
32         presented set
33         COLOR: DarkGreen foreground set
34     ] H{ } make-assoc ;