Changes for unicode

db4
Daniel Ehrenberg 2008-01-09 19:34:29 -06:00
parent 1dfabe3b34
commit c8b1db0a3e
3 changed files with 6 additions and 11 deletions

View File

@ -399,7 +399,6 @@ SYMBOL: bootstrap-syntax
"Loading " write <pathname> . flush
] if ;
<<<<<<< HEAD:core/parser/parser.factor
: no-parse-hook ( quot -- )
>r f parse-hook r> with-variable do-parse-hook ; inline

View File

@ -1,4 +1,5 @@
USING: hash2 help.syntax help.markup ;
USING: help.syntax help.markup ;
IN: hash2
ARTICLE: { "hash2" "intro" }
"The hash2 vocabulary specifies a simple minimal datastructure for hash tables with two integers as keys. These hash tables are fixed size and do not conform to the associative mapping protocol. Words used in creating and manipulating these hash tables include:"

View File

@ -1,6 +1,6 @@
USING: assocs math kernel sequences io.files hashtables quotations
splitting arrays math.parser combinators.lib hash2 byte-arrays words
namespaces ;
namespaces words ;
IN: unicode.data
! Convenience functions
@ -8,16 +8,11 @@ IN: unicode.data
drop [ 1+ ] [ 0 ] if* ;
: define-value ( value word -- )
swap 1quotation define-compound ;
swap 1quotation define ;
: ?between? ( n/f from to -- ? )
pick [ between? ] [ 3drop f ] if ;
! Remove this soon
USE: parser
DEFER: >>
: << \ >> parse-until >quotation call ; parsing
! Loading data from UnicodeData.txt
: data ( filename -- data )
@ -27,7 +22,7 @@ DEFER: >>
"extra/unicode/UnicodeData.txt" resource-path data ;
: (process-data) ( index data -- newdata )
[ [ nth ] keep first swap 2array ] curry* map
[ [ nth ] keep first swap 2array ] with map
[ second empty? not ] subset
[ >r hex> r> ] assoc-map ;
@ -38,7 +33,7 @@ DEFER: >>
[
2dup swap at
[ (chain-decomposed) ] [ 1array nip ] ?if
] curry* map concat ;
] with map concat ;
: chain-decomposed ( hash -- newhash )
dup [ swap (chain-decomposed) ] curry assoc-map ;