Add custom configuration to jerry_parse and its variants (#4620)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-03-10 09:56:48 +01:00
committed by GitHub
parent 7a2665621b
commit 546422161e
45 changed files with 658 additions and 596 deletions
+18
View File
@@ -3694,6 +3694,24 @@ lexer_compare_literal_to_string (parser_context_t *context_p, /**< context */
&& memcmp (context_p->token.lit_location.char_p, string_p, string_length) == 0);
} /* lexer_compare_literal_to_string */
/**
* Initialize line info to its default value
*/
void
lexer_init_line_info (parser_context_t *context_p) /**< context */
{
context_p->line = 1;
context_p->column = 1;
const ecma_parse_options_t *options_p = context_p->options_p;
if (options_p != NULL && (options_p->options & ECMA_PARSE_HAS_START))
{
context_p->line = (options_p->start_line > 0) ? options_p->start_line : 1;
context_p->column = (options_p->start_column > 0) ? options_p->start_column : 1;
}
} /* lexer_init_line_info */
/**
* Convert binary lvalue token to binary token
* e.g. += -> +