Rework simple arrow function scanning. (#3148)
The resulting code unifies the scanning of the two different argument definition of arrow functions. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
053b05f185
commit
5c7df1cb2d
@@ -1360,9 +1360,11 @@ bool
|
||||
lexer_check_next_character (parser_context_t *context_p, /**< context */
|
||||
lit_utf8_byte_t character) /**< specified character */
|
||||
{
|
||||
lexer_skip_spaces (context_p);
|
||||
|
||||
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
|
||||
if (!(context_p->token.flags & LEXER_NO_SKIP_SPACES))
|
||||
{
|
||||
lexer_skip_spaces (context_p);
|
||||
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
|
||||
}
|
||||
|
||||
return (context_p->source_p < context_p->source_end_p
|
||||
&& context_p->source_p[0] == (uint8_t) character);
|
||||
@@ -1378,9 +1380,11 @@ lexer_check_next_character (parser_context_t *context_p, /**< context */
|
||||
bool
|
||||
lexer_check_arrow (parser_context_t *context_p) /**< context */
|
||||
{
|
||||
lexer_skip_spaces (context_p);
|
||||
|
||||
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
|
||||
if (!(context_p->token.flags & LEXER_NO_SKIP_SPACES))
|
||||
{
|
||||
lexer_skip_spaces (context_p);
|
||||
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
|
||||
}
|
||||
|
||||
return (!(context_p->token.flags & LEXER_WAS_NEWLINE)
|
||||
&& context_p->source_p + 2 <= context_p->source_end_p
|
||||
|
||||
Reference in New Issue
Block a user