Support parsing of scripts / functions stored in string values (#4728)

Function arguments must be passed as string values.
Snapshots are generated from compiled code rather than source code.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-08-11 17:37:12 +02:00
committed by GitHub
parent b7dead7b05
commit 3ed93cfb51
24 changed files with 601 additions and 696 deletions
+10 -3
View File
@@ -192,11 +192,18 @@ typedef enum
*/
typedef uint32_t parser_line_counter_t;
/**
* Source code as character data.
*/
typedef struct
{
const uint8_t *source_p; /**< valid UTF-8 source code */
size_t source_size; /**< size of the source code */
} parser_source_char_t;
/* Note: source must be a valid UTF-8 string */
ecma_compiled_code_t *
parser_parse_script (const uint8_t *arg_list_p, size_t arg_list_size,
const uint8_t *source_p, size_t source_size,
uint32_t parse_opts, const jerry_parse_options_t *options_p);
parser_parse_script (void *source_p, uint32_t parse_opts, const jerry_parse_options_t *options_p);
#if JERRY_ERROR_MESSAGES
const char *parser_error_to_string (parser_error_t);