From c8b1db0a3e2f9f0ea59c7335850708f695dbb344 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Wed, 9 Jan 2008 19:34:29 -0600 Subject: [PATCH] Changes for unicode --- core/parser/parser.factor | 1 - extra/hash2/hash2-docs.factor | 3 ++- extra/unicode/data/data.factor | 13 ++++--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/core/parser/parser.factor b/core/parser/parser.factor index eb15df8c1b..d7c3ae8592 100755 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -399,7 +399,6 @@ SYMBOL: bootstrap-syntax "Loading " write . flush ] if ; -<<<<<<< HEAD:core/parser/parser.factor : no-parse-hook ( quot -- ) >r f parse-hook r> with-variable do-parse-hook ; inline diff --git a/extra/hash2/hash2-docs.factor b/extra/hash2/hash2-docs.factor index f39ddb1fe9..5bcbb7cc11 100644 --- a/extra/hash2/hash2-docs.factor +++ b/extra/hash2/hash2-docs.factor @@ -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:" diff --git a/extra/unicode/data/data.factor b/extra/unicode/data/data.factor index fd8ba0e5a4..49f77a61d8 100644 --- a/extra/unicode/data/data.factor +++ b/extra/unicode/data/data.factor @@ -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 ;