cleanup pic_read
This commit is contained in:
parent
5138ab4a8c
commit
f6a727beb4
|
@ -857,21 +857,18 @@ pic_read(pic_state *pic, struct pic_port *port)
|
||||||
{
|
{
|
||||||
size_t ai = pic_gc_arena_preserve(pic);
|
size_t ai = pic_gc_arena_preserve(pic);
|
||||||
pic_value val;
|
pic_value val;
|
||||||
int c = next(pic, port);
|
int c;
|
||||||
|
|
||||||
retry:
|
|
||||||
c = skip(pic, port, c);
|
|
||||||
|
|
||||||
if (c == EOF) {
|
|
||||||
return pic_eof_object();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
while ((c = skip(pic, port, next(pic, port))) != EOF) {
|
||||||
val = read_nullable(pic, port, c);
|
val = read_nullable(pic, port, c);
|
||||||
|
|
||||||
if (pic_invalid_p(val)) {
|
if (! pic_invalid_p(val)) {
|
||||||
c = next(pic, port);
|
break;
|
||||||
|
}
|
||||||
pic_gc_arena_restore(pic, ai);
|
pic_gc_arena_restore(pic, ai);
|
||||||
goto retry;
|
}
|
||||||
|
if (c == EOF) {
|
||||||
|
return pic_eof_object();
|
||||||
}
|
}
|
||||||
|
|
||||||
pic_gc_arena_restore(pic, ai);
|
pic_gc_arena_restore(pic, ai);
|
||||||
|
|
Loading…
Reference in New Issue