mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Merge branch 'geppetto'
This commit is contained in:
commit
177a2d1382
@ -53,6 +53,7 @@ typedef enum
|
||||
ERR_INT_LITERAL = -7,
|
||||
ERR_STRING = -8,
|
||||
ERR_PARSER = -9,
|
||||
ERR_MEMORY = -10,
|
||||
ERR_GENERAL = -255
|
||||
} jerry_status_t;
|
||||
|
||||
|
||||
@ -277,6 +277,8 @@ current_token (void)
|
||||
JERRY_ASSERT (token_start <= buffer);
|
||||
size_t length = (size_t) (buffer - token_start);
|
||||
char *res = (char *) mem_heap_alloc_block (length + 1, MEM_HEAP_ALLOC_SHORT_TERM);
|
||||
if (res == NULL)
|
||||
parser_fatal (ERR_MEMORY);
|
||||
__strncpy (res, token_start, length);
|
||||
res[length] = '\0';
|
||||
token_start = NULL;
|
||||
|
||||
@ -66,6 +66,9 @@ jerry_exit( jerry_status_t code) /**< status code */
|
||||
case ERR_PARSER:
|
||||
__printf("ERR_PARSER\n");
|
||||
break;
|
||||
case ERR_MEMORY:
|
||||
__printf("ERR_MEMORY\n");
|
||||
break;
|
||||
case ERR_GENERAL:
|
||||
__printf("ERR_GENERAL\n");
|
||||
break;
|
||||
|
||||
@ -181,6 +181,6 @@ main(void)
|
||||
const size_t source_size = sizeof(generated_source);
|
||||
|
||||
jerry_run( source_p,
|
||||
source_size);
|
||||
source_size, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user