Fixing 8-bit encodings
parent
64203f762d
commit
caf3ebb31d
|
@ -3,7 +3,7 @@
|
||||||
USING: math.parser arrays io.encodings sequences kernel
|
USING: math.parser arrays io.encodings sequences kernel
|
||||||
assocs hashtables io.encodings.ascii combinators.cleave
|
assocs hashtables io.encodings.ascii combinators.cleave
|
||||||
generic parser tuples words io io.files splitting namespaces
|
generic parser tuples words io io.files splitting namespaces
|
||||||
classes quotations math compiler.units accessors ;
|
math compiler.units accessors ;
|
||||||
IN: io.encodings.8-bit
|
IN: io.encodings.8-bit
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -38,7 +38,7 @@ IN: io.encodings.8-bit
|
||||||
2dup swap length <= [ tail ] [ drop ] if ;
|
2dup swap length <= [ tail ] [ drop ] if ;
|
||||||
|
|
||||||
: process-contents ( lines -- assoc )
|
: process-contents ( lines -- assoc )
|
||||||
[ "#" split first ] map
|
[ "#" split1 drop ] map
|
||||||
[ empty? not ] subset
|
[ empty? not ] subset
|
||||||
[ "\t" split 2 head [ 2 tail-if hex> ] map ] map ;
|
[ "\t" split 2 head [ 2 tail-if hex> ] map ] map ;
|
||||||
|
|
||||||
|
@ -77,4 +77,8 @@ M: 8-bit decode-char
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
[ mappings [ full-path define-8-bit-encoding ] assoc-each ] with-compilation-unit
|
[
|
||||||
|
"io.encodings.8-bit" in [
|
||||||
|
mappings [ full-path define-8-bit-encoding ] assoc-each
|
||||||
|
] with-variable
|
||||||
|
] with-compilation-unit
|
||||||
|
|
Loading…
Reference in New Issue