Fix errors

db4
Slava Pestov 2008-03-20 14:25:08 -05:00
parent 0c490161b4
commit e20762e0cb
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,7 @@ strings io.styles vectors words system splitting math.parser
tuples continuations continuations.private combinators tuples continuations continuations.private combinators
generic.math io.streams.duplex classes compiler.units generic.math io.streams.duplex classes compiler.units
generic.standard vocabs threads threads.private init generic.standard vocabs threads threads.private init
kernel.private libc ; kernel.private libc io.encodings ;
IN: debugger IN: debugger
GENERIC: error. ( error -- ) GENERIC: error. ( error -- )
@ -282,6 +282,10 @@ M: thread error-in-thread ( error thread -- )
] bind ] bind
] if ; ] if ;
M: encode-error summary drop "Character encoding error" ;
M: decode-error summary drop "Character decoding error" ;
<PRIVATE <PRIVATE
: init-debugger ( -- ) : init-debugger ( -- )

View File

@ -18,13 +18,13 @@ TUPLE: utf16 ;
over [ 8 shift bitor ] [ 2drop replacement-char ] if ; over [ 8 shift bitor ] [ 2drop replacement-char ] if ;
: double-be ( stream byte -- stream char ) : double-be ( stream byte -- stream char )
over stream-read1 prepend-nums ; over stream-read1 swap append-nums ;
: quad-be ( stream byte -- stream char ) : quad-be ( stream byte -- stream char )
double-be over stream-read1 [ double-be over stream-read1 [
dup -2 shift BIN: 110111 number= [ dup -2 shift BIN: 110111 number= [
>r 2 shift r> BIN: 11 bitand bitor >r 2 shift r> BIN: 11 bitand bitor
over stream-read1 prepend-nums HEX: 10000 + over stream-read1 swap append-nums HEX: 10000 +
] [ 2drop dup stream-read1 drop replacement-char ] if ] [ 2drop dup stream-read1 drop replacement-char ] if
] when* ; ] when* ;