prettyprint.stylesheet: use assoc-union! and set-at when possible.
parent
752ceb57fc
commit
df50480878
|
@ -23,16 +23,19 @@ GENERIC: word-style ( word -- style )
|
||||||
|
|
||||||
M: word word-style
|
M: word word-style
|
||||||
[ presented associate ]
|
[ presented associate ]
|
||||||
[ "word-style" word-prop >hashtable ] bi assoc-union ;
|
[ "word-style" word-prop ] bi assoc-union! ;
|
||||||
|
|
||||||
M: highlighted-word word-style
|
M: highlighted-word word-style
|
||||||
call-next-method COLOR: DarkSlateGray foreground associate
|
call-next-method
|
||||||
swap assoc-union ;
|
COLOR: DarkSlateGray foreground pick set-at ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: colored-presentation-style ( obj color -- style )
|
: colored-presentation-style ( obj color -- style )
|
||||||
[ presented associate ] [ foreground associate ] bi* assoc-union ;
|
H{ } clone [
|
||||||
|
[ presented foreground ] dip
|
||||||
|
[ set-at ] curry bi-curry@ bi*
|
||||||
|
] keep ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue