TOK_ERROR returned after a scanner failure was still sent to the
parser, forcing a parse error as well. While this didn't have any
ill effects, it's better to disentangle the two.
---
src/compiler/parser_helper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/compiler/parser_helper.c b/src/compiler/parser_helper.c
index c5762db..c959282 100644
--- a/src/compiler/parser_helper.c
+++ b/src/compiler/parser_helper.c
@@ -48,13 +48,13 @@ int fpvm_parse(const char *expr, int start_token, union
parser_comm *comm)
} else {
identifier->label = get_token(s);
}
- Parse(p, tok, identifier, &state);
if(tok == TOK_ERROR) {
printf("FPVM: scan error\n");
ParseFree(p, free);
delete_scanner(s);
return 0;
}
+ Parse(p, tok, identifier, &state);
tok = scan(s);
}
Parse(p, TOK_EOF, NULL, &state);
--
1.7.1
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode