add unmatch handler
This commit is contained in:
parent
aec33d59da
commit
d2a06d8efa
11
src/read.c
11
src/read.c
|
@ -658,6 +658,15 @@ read_label(pic_state *pic, struct pic_port *port, int c)
|
||||||
read_error(pic, "broken label expression");
|
read_error(pic, "broken label expression");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static pic_value
|
||||||
|
read_unmatch(pic_state *pic, struct pic_port *port, int c)
|
||||||
|
{
|
||||||
|
UNUSED(port);
|
||||||
|
UNUSED(c);
|
||||||
|
|
||||||
|
read_error(pic, "unmatched parenthesis");
|
||||||
|
}
|
||||||
|
|
||||||
static pic_value
|
static pic_value
|
||||||
read_dispatch(pic_state *pic, struct pic_port *port, int c)
|
read_dispatch(pic_state *pic, struct pic_port *port, int c)
|
||||||
{
|
{
|
||||||
|
@ -699,7 +708,7 @@ read_nullable(pic_state *pic, struct pic_port *port, int c)
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case ')':
|
case ')':
|
||||||
read_error(pic, "unmatched parenthesis");
|
return read_unmatch(pic, port, c);
|
||||||
case ';':
|
case ';':
|
||||||
return read_comment(pic, port, c);
|
return read_comment(pic, port, c);
|
||||||
case '#':
|
case '#':
|
||||||
|
|
Loading…
Reference in New Issue