prettyprint.sections: more use of hash-sets.
parent
26506a4b0b
commit
e9d8ff1c0d
|
@ -5,6 +5,7 @@ namespaces make sequences strings io.styles vectors words
|
||||||
prettyprint.config splitting classes continuations
|
prettyprint.config splitting classes continuations
|
||||||
accessors sets vocabs.parser combinators vocabs
|
accessors sets vocabs.parser combinators vocabs
|
||||||
classes.maybe ;
|
classes.maybe ;
|
||||||
|
FROM: sets => members ;
|
||||||
FROM: namespaces => set ;
|
FROM: namespaces => set ;
|
||||||
IN: prettyprint.sections
|
IN: prettyprint.sections
|
||||||
|
|
||||||
|
@ -23,7 +24,7 @@ TUPLE: pprinter last-newline line-count indent ;
|
||||||
|
|
||||||
: (record-vocab) ( vocab -- )
|
: (record-vocab) ( vocab -- )
|
||||||
dup pprinter-in get dup [ vocab-name ] when =
|
dup pprinter-in get dup [ vocab-name ] when =
|
||||||
[ drop ] [ pprinter-use get conjoin ] if ;
|
[ drop ] [ pprinter-use get adjoin ] if ;
|
||||||
|
|
||||||
GENERIC: vocabulary-name ( obj -- string )
|
GENERIC: vocabulary-name ( obj -- string )
|
||||||
|
|
||||||
|
@ -347,7 +348,7 @@ M: block long-section ( block -- )
|
||||||
|
|
||||||
: pprinter-manifest ( -- manifest )
|
: pprinter-manifest ( -- manifest )
|
||||||
<manifest>
|
<manifest>
|
||||||
[ [ pprinter-use get keys >vector ] dip search-vocabs<< ]
|
[ [ pprinter-use get members >vector ] dip search-vocabs<< ]
|
||||||
[ [ pprinter-in get ] dip current-vocab<< ]
|
[ [ pprinter-in get ] dip current-vocab<< ]
|
||||||
[ ]
|
[ ]
|
||||||
tri ;
|
tri ;
|
||||||
|
@ -355,7 +356,7 @@ M: block long-section ( block -- )
|
||||||
: make-pprint ( obj quot -- block manifest )
|
: make-pprint ( obj quot -- block manifest )
|
||||||
[
|
[
|
||||||
0 position ,,
|
0 position ,,
|
||||||
H{ } clone pprinter-use ,,
|
HS{ } clone pprinter-use ,,
|
||||||
V{ } clone recursion-check ,,
|
V{ } clone recursion-check ,,
|
||||||
V{ } clone pprinter-stack ,,
|
V{ } clone pprinter-stack ,,
|
||||||
] H{ } make [
|
] H{ } make [
|
||||||
|
|
Loading…
Reference in New Issue