Fix simple-flat-file
parent
4f81b6750f
commit
8a7d877ec6
|
@ -7,10 +7,13 @@ IN: simple-flat-file
|
||||||
[ "#" split1 drop ] map harvest ;
|
[ "#" split1 drop ] map harvest ;
|
||||||
|
|
||||||
: split-column ( line -- columns )
|
: split-column ( line -- columns )
|
||||||
" \t" split harvest 2 head ;
|
" \t" split harvest 2 short head 2 f pad-tail ;
|
||||||
|
|
||||||
: parse-hex ( s -- n )
|
: parse-hex ( s -- n )
|
||||||
2 short tail hex> ;
|
dup [
|
||||||
|
"0x" ?head [ "U+" ?head [ "Missing 0x or U+" throw ] unless ] unless
|
||||||
|
hex>
|
||||||
|
] when ;
|
||||||
|
|
||||||
: parse-line ( line -- code-unicode )
|
: parse-line ( line -- code-unicode )
|
||||||
split-column [ parse-hex ] map ;
|
split-column [ parse-hex ] map ;
|
||||||
|
|
Loading…
Reference in New Issue