Fix handling of invalid HexIntegerLiterals in lexer.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov 2015-07-14 15:58:31 +03:00
parent 69655f4456
commit f3ef9afb91

View File

@ -849,16 +849,20 @@ lexer_parse_number (void)
consume_char ();
consume_char ();
new_token ();
while (true)
c = LA (0);
if (!lit_char_is_hex_digit (c))
{
c = LA (0);
if (!lit_char_is_hex_digit (c))
{
break;
}
consume_char ();
PARSE_ERROR ("Invalid HexIntegerLiteral", lit_utf8_iterator_get_pos (&src_iter));
}
do
{
consume_char ();
c = LA (0);
}
while (lit_char_is_hex_digit (c));
if (lexer_is_char_can_be_identifier_start (c))
{
PARSE_ERROR ("Identifier just after integer literal", lit_utf8_iterator_get_pos (&src_iter));