Support labelled statements.

Related issue: #52

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-03 20:57:15 +03:00
parent 2de49cdba7
commit d99d779486
11 changed files with 1014 additions and 297 deletions
+20
View File
@@ -1596,6 +1596,26 @@ lexer_set_strict_mode (bool is_strict)
strict_mode = is_strict;
}
/**
* Check whether the identifier tokens represent the same identifiers
*
* Note:
* As all literals represent unique strings,
* it is sufficient to just check if literal indices
* in the tokens are equal.
*
* @return true / false
*/
bool
lexer_are_tokens_with_same_identifier (token id1, /**< identifier token (TOK_NAME) */
token id2) /**< identifier token (TOK_NAME) */
{
JERRY_ASSERT (id1.type == TOK_NAME);
JERRY_ASSERT (id2.type == TOK_NAME);
return (id1.uid == id2.uid);
} /* lexer_are_tokens_with_same_identifier */
void
lexer_init (const char *source, size_t source_size, bool show_opcodes)
{