Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project. As discussed in the #2520 issue there are a few awkward constructs. Main changes: * Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format. * The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins. * Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format. * The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins. * Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. * All options (in this change) can have a value of 0 or 1. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. JERRY_REGEXP_STRICT_MODE is set to 0 by default. * Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point number. By default the 64-bit floating point number mode is enabled. * All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to test if the feature is enabled or not. * Added/replaced a few config.h includes to correctly propagate the macro values. * Added sanity checks for each macro to avoid incorrectly set values. * Updated profile documentation. * The CMake feature names are not updated at this point. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Robert Fancsik
parent
722d092528
commit
40f7b1c27f
@@ -35,18 +35,18 @@ typedef enum
|
||||
{
|
||||
SCAN_MODE_PRIMARY_EXPRESSION, /**< scanning primary expression */
|
||||
SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW, /**< scanning primary expression after new */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
SCAN_MODE_ARROW_FUNCTION, /**< arrow function might follows */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
SCAN_MODE_POST_PRIMARY_EXPRESSION, /**< scanning post primary expression */
|
||||
SCAN_MODE_PRIMARY_EXPRESSION_END, /**< scanning primary expression end */
|
||||
SCAN_MODE_STATEMENT, /**< scanning statement */
|
||||
SCAN_MODE_FUNCTION_ARGUMENTS, /**< scanning function arguments */
|
||||
SCAN_MODE_PROPERTY_NAME, /**< scanning property name */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
SCAN_MODE_CLASS_DECLARATION, /**< scanning class declaration */
|
||||
SCAN_MODE_CLASS_METHOD, /**< scanning class method */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
} scan_modes_t;
|
||||
|
||||
/**
|
||||
@@ -64,19 +64,19 @@ typedef enum
|
||||
SCAN_STACK_BLOCK_STATEMENT, /**< block statement group */
|
||||
SCAN_STACK_BLOCK_EXPRESSION, /**< block expression group */
|
||||
SCAN_STACK_BLOCK_PROPERTY, /**< block property group */
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
|
||||
SCAN_STACK_COMPUTED_PROPERTY, /**< computed property name */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
#ifndef CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS
|
||||
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
#if ENABLED (JERRY_ES2015_TEMPLATE_STRINGS)
|
||||
SCAN_STACK_TEMPLATE_STRING, /**< template string */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#endif /* ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) */
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
SCAN_STACK_CLASS, /**< class language element */
|
||||
SCAN_STACK_CLASS_EXTENDS, /**< class extends expression */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
#if ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER)
|
||||
SCAN_STACK_FUNCTION_PARAMETERS, /**< function parameter initializer */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) */
|
||||
} scan_stack_modes_t;
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ parser_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_PROPERTY_NAME;
|
||||
return true;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS
|
||||
#if ENABLED (JERRY_ES2015_TEMPLATE_STRINGS)
|
||||
case LEXER_TEMPLATE_LITERAL:
|
||||
{
|
||||
if (context_p->source_p[-1] != LIT_CHAR_GRAVE_ACCENT)
|
||||
@@ -141,9 +141,9 @@ parser_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
/* The string is a normal string literal. */
|
||||
/* FALLTHRU */
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS */
|
||||
#endif /* ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) */
|
||||
case LEXER_LITERAL:
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
{
|
||||
bool is_ident = (context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
|
||||
|
||||
@@ -151,7 +151,7 @@ parser_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
: SCAN_MODE_POST_PRIMARY_EXPRESSION);
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
case LEXER_KEYW_THIS:
|
||||
case LEXER_LIT_TRUE:
|
||||
case LEXER_LIT_FALSE:
|
||||
@@ -160,14 +160,14 @@ parser_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case LEXER_KEYW_CLASS:
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_EXPRESSION);
|
||||
*mode = SCAN_MODE_CLASS_DECLARATION;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
case LEXER_RIGHT_SQUARE:
|
||||
{
|
||||
if (stack_top != SCAN_STACK_SQUARE_BRACKETED_EXPRESSION)
|
||||
@@ -189,11 +189,11 @@ parser_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
case LEXER_RIGHT_PAREN:
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
*mode = SCAN_MODE_ARROW_FUNCTION;
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* !ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
if (stack_top == SCAN_STACK_PAREN_STATEMENT)
|
||||
{
|
||||
@@ -336,29 +336,29 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
|
||||
if ((type == LEXER_RIGHT_SQUARE && stack_top == SCAN_STACK_SQUARE_BRACKETED_EXPRESSION)
|
||||
|| (type == LEXER_RIGHT_PAREN && stack_top == SCAN_STACK_PAREN_EXPRESSION)
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
|| (type == LEXER_LEFT_BRACE && stack_top == SCAN_STACK_CLASS_EXTENDS)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|| (type == LEXER_RIGHT_BRACE && stack_top == SCAN_STACK_OBJECT_LITERAL))
|
||||
{
|
||||
parser_stack_pop_uint8 (context_p);
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (type == LEXER_RIGHT_PAREN)
|
||||
{
|
||||
*mode = SCAN_MODE_ARROW_FUNCTION;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (stack_top == SCAN_STACK_CLASS_EXTENDS)
|
||||
{
|
||||
*mode = SCAN_MODE_CLASS_METHOD;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS
|
||||
#if ENABLED (JERRY_ES2015_TEMPLATE_STRINGS)
|
||||
if (type == LEXER_RIGHT_BRACE && stack_top == SCAN_STACK_TEMPLATE_STRING)
|
||||
{
|
||||
context_p->source_p--;
|
||||
@@ -376,7 +376,7 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS */
|
||||
#endif /* ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) */
|
||||
|
||||
*mode = SCAN_MODE_STATEMENT;
|
||||
if (type == LEXER_RIGHT_PAREN && stack_top == SCAN_STACK_PAREN_STATEMENT)
|
||||
@@ -385,7 +385,7 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_RIGHT_SQUARE && stack_top == SCAN_STACK_COMPUTED_PROPERTY)
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
@@ -421,9 +421,9 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_RIGHT_PAREN && stack_top == SCAN_STACK_FUNCTION_PARAMETERS)
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
@@ -437,15 +437,15 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_STATEMENT;
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) */
|
||||
|
||||
/* Check whether we can enter to statement mode. */
|
||||
if (stack_top != SCAN_STACK_BLOCK_STATEMENT
|
||||
&& stack_top != SCAN_STACK_BLOCK_EXPRESSION
|
||||
&& stack_top != SCAN_STACK_BLOCK_PROPERTY
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
&& stack_top != SCAN_STACK_CLASS
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
&& !(stack_top == SCAN_STACK_HEAD && end_type == LEXER_SCAN_SWITCH))
|
||||
{
|
||||
parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
|
||||
@@ -569,9 +569,9 @@ parser_scan_statement (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
if (stack_top == SCAN_STACK_BLOCK_STATEMENT
|
||||
|| stack_top == SCAN_STACK_BLOCK_EXPRESSION
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
|| stack_top == SCAN_STACK_CLASS
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|| stack_top == SCAN_STACK_BLOCK_PROPERTY)
|
||||
{
|
||||
parser_stack_pop_uint8 (context_p);
|
||||
@@ -580,12 +580,12 @@ parser_scan_statement (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
else if (stack_top == SCAN_STACK_CLASS)
|
||||
{
|
||||
*mode = SCAN_MODE_CLASS_METHOD;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
else if (stack_top == SCAN_STACK_BLOCK_PROPERTY)
|
||||
{
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
@@ -612,14 +612,14 @@ parser_scan_statement (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_FUNCTION_ARGUMENTS;
|
||||
return false;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case LEXER_KEYW_CLASS:
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_STATEMENT);
|
||||
*mode = SCAN_MODE_CLASS_DECLARATION;
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -637,11 +637,11 @@ parser_scan_statement (parser_context_t *context_p, /**< context */
|
||||
*mode = SCAN_MODE_STATEMENT;
|
||||
return false;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
*mode = SCAN_MODE_ARROW_FUNCTION;
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* !ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
*mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -724,7 +724,7 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case SCAN_MODE_CLASS_DECLARATION:
|
||||
{
|
||||
if (context_p->token.type == LEXER_LITERAL && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
|
||||
@@ -777,8 +777,8 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
mode = SCAN_MODE_FUNCTION_ARGUMENTS;
|
||||
continue;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case SCAN_MODE_ARROW_FUNCTION:
|
||||
{
|
||||
if (type == LEXER_ARROW)
|
||||
@@ -801,7 +801,7 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
/* FALLTHRU */
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
case SCAN_MODE_POST_PRIMARY_EXPRESSION:
|
||||
{
|
||||
if (parser_scan_post_primary_expression (context_p, type, &mode))
|
||||
@@ -836,16 +836,16 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
case SCAN_MODE_FUNCTION_ARGUMENTS:
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
JERRY_ASSERT (stack_top == SCAN_STACK_BLOCK_STATEMENT
|
||||
|| stack_top == SCAN_STACK_BLOCK_EXPRESSION
|
||||
|| stack_top == SCAN_STACK_CLASS
|
||||
|| stack_top == SCAN_STACK_BLOCK_PROPERTY);
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
JERRY_ASSERT (stack_top == SCAN_STACK_BLOCK_STATEMENT
|
||||
|| stack_top == SCAN_STACK_BLOCK_EXPRESSION
|
||||
|| stack_top == SCAN_STACK_BLOCK_PROPERTY);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
if (context_p->token.type == LEXER_LITERAL
|
||||
&& (context_p->token.lit_location.type == LEXER_IDENT_LITERAL
|
||||
@@ -865,12 +865,12 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER
|
||||
#if ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER)
|
||||
if (context_p->token.type == LEXER_THREE_DOTS)
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER */
|
||||
#endif /* ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) */
|
||||
|
||||
if (context_p->token.type != LEXER_LITERAL
|
||||
|| context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
|
||||
@@ -887,14 +887,14 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_ASSIGN)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_FUNCTION_PARAMETERS);
|
||||
mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) */
|
||||
|
||||
if (context_p->token.type != LEXER_RIGHT_PAREN)
|
||||
{
|
||||
@@ -916,14 +916,14 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
|
||||
lexer_scan_identifier (context_p, true);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_LEFT_SQUARE)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_COMPUTED_PROPERTY);
|
||||
mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
|
||||
if (context_p->token.type == LEXER_RIGHT_BRACE)
|
||||
{
|
||||
@@ -939,14 +939,14 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_PROPERTY);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_LEFT_SQUARE)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_COMPUTED_PROPERTY);
|
||||
mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
|
||||
if (context_p->token.type != LEXER_LITERAL)
|
||||
{
|
||||
@@ -959,7 +959,7 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
|
||||
lexer_next_token (context_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
|
||||
if (context_p->token.type == LEXER_LEFT_PAREN)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_PROPERTY);
|
||||
@@ -978,7 +978,7 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
|
||||
if (context_p->token.type != LEXER_COLON)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user