Fix raise of syntax errors for unmatched braces.

Related issue: #43, #183

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-25 00:09:58 +03:00
parent 4ff9e79b02
commit d7ecd4a467
2 changed files with 69 additions and 0 deletions
+13
View File
@@ -1218,6 +1218,19 @@ lexer_next_token (void)
goto end;
}
/**
* FIXME:
* The way to raise syntax errors for unexpected EOF
* should be reworked so that EOF would be checked by
* caller of the routine, and the following condition
* would be checked as assertion in the routine.
*/
if (prev_token.type == TOK_EOF
&& sent_token.type == TOK_EOF)
{
PARSE_ERROR ("Unexpected EOF", buffer - buffer_start);
}
prev_token = sent_token;
sent_token = lexer_next_token_private ();