1 ! Copyright (C) 2009 Your name.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: colors.constants combinators combinators.short-circuit
4 hashtables io.styles kernel namespaces sequences words
6 IN: prettyprint.stylesheet
10 CONSTANT: dim-color COLOR: cornsilk4
12 : dimly-lit-word? ( word -- ? )
13 { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;
15 : parsing-word-color ( word -- color )
16 dimly-lit-word? dim-color COLOR: DarkSlateGray ? ;
20 : word-style ( word -- style )
21 dup "word-style" word-prop >hashtable [
25 { [ dup parsing-word? ] [ parsing-word-color ] }
26 { [ dup delimiter? ] [ drop COLOR: DarkSlateGray ] }
27 { [ dup symbol? ] [ drop COLOR: DarkSlateGray ] }
34 : string-style ( obj -- style )
37 COLOR: LightSalmon4 foreground set
40 : vocab-style ( vocab -- style )
43 dim-color foreground set
46 : effect-style ( effect -- style )
49 COLOR: DarkGreen foreground set