Improve expected identifier checks. (#3064)

Checks for "of" or "from" does not accept quoted strings.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-09-05 11:42:17 +02:00
committed by Robert Fancsik
parent 086c4ebf13
commit 96edec1a62
8 changed files with 71 additions and 50 deletions
+6
View File
@@ -47,6 +47,7 @@
*/
typedef enum
{
/* The LEXER_IS_IDENT_OR_STRING macro must be updated if the order is changed. */
LEXER_IDENT_LITERAL = 0, /**< identifier literal */
LEXER_STRING_LITERAL = 1, /**< string literal */
LEXER_NUMBER_LITERAL = 2, /**< number literal */
@@ -56,6 +57,11 @@ typedef enum
used by the byte code generator. */
} lexer_literal_type_t;
/**
* Checks whether the literal type is identifier or string.
*/
#define LEXER_IS_IDENT_OR_STRING(literal_type) ((literal_type) <= LEXER_STRING_LITERAL)
/**
* Flag bits for status_flags member of lexer_literal_t.
*/