block comment reader must not consume the character right after the
comment end
This commit is contained in:
parent
0b85e251a2
commit
e1ca64b56e
10
src/read.c
10
src/read.c
|
@ -69,24 +69,22 @@ static pic_value
|
||||||
read_block_comment(pic_state *pic, struct pic_port *port, char c)
|
read_block_comment(pic_state *pic, struct pic_port *port, char c)
|
||||||
{
|
{
|
||||||
char x, y;
|
char x, y;
|
||||||
int i;
|
int i = 1;
|
||||||
|
|
||||||
UNUSED(pic);
|
UNUSED(pic);
|
||||||
UNUSED(c);
|
UNUSED(c);
|
||||||
|
|
||||||
x = next(port);
|
|
||||||
y = next(port);
|
y = next(port);
|
||||||
|
|
||||||
i = 1;
|
while (y != EOF && i > 0) {
|
||||||
while (x != EOF && y != EOF && i > 0) {
|
x = y;
|
||||||
|
y = next(port);
|
||||||
if (x == '|' && y == '#') {
|
if (x == '|' && y == '#') {
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
if (x == '#' && y == '|') {
|
if (x == '#' && y == '|') {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
x = y;
|
|
||||||
y = next(port);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pic_undef_value();
|
return pic_undef_value();
|
||||||
|
|
Loading…
Reference in New Issue