Implement binding pattern support for rest argument and for statement. (#3327)
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
a7d129c8b2
commit
bf630c0c54
@@ -1406,6 +1406,28 @@ lexer_check_next_character (parser_context_t *context_p, /**< context */
|
||||
&& context_p->source_p[0] == (uint8_t) character);
|
||||
} /* lexer_check_next_character */
|
||||
|
||||
/**
|
||||
* Checks whether the next token starts with either specified characters.
|
||||
*
|
||||
* @return true - if the next is the specified character
|
||||
* false - otherwise
|
||||
*/
|
||||
bool
|
||||
lexer_check_next_characters (parser_context_t *context_p, /**< context */
|
||||
lit_utf8_byte_t character1, /**< first alternative character */
|
||||
lit_utf8_byte_t character2) /**< second alternative character */
|
||||
{
|
||||
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) character1
|
||||
|| context_p->source_p[0] == (uint8_t) character2));
|
||||
} /* lexer_check_next_characters */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user