mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
reduce node size
This commit is contained in:
@@ -37,8 +37,7 @@ void mrbc_partial_hook(mrb_state *mrb, mrbc_context *c, int (*partial_hook)(stru
|
||||
/* AST node structure */
|
||||
typedef struct mrb_ast_node {
|
||||
struct mrb_ast_node *car, *cdr;
|
||||
uint16_t lineno;
|
||||
char const* filename;
|
||||
uint16_t lineno, filename;
|
||||
} mrb_ast_node;
|
||||
|
||||
/* lexer states */
|
||||
@@ -144,6 +143,10 @@ struct mrb_parser_state {
|
||||
struct mrb_parser_message error_buffer[10];
|
||||
struct mrb_parser_message warn_buffer[10];
|
||||
|
||||
mrb_sym* filename_table;
|
||||
size_t filename_table_length;
|
||||
int current_filename_index;
|
||||
|
||||
jmp_buf jmp;
|
||||
};
|
||||
|
||||
@@ -152,6 +155,7 @@ void mrb_parser_free(struct mrb_parser_state*);
|
||||
void mrb_parser_parse(struct mrb_parser_state*,mrbc_context*);
|
||||
|
||||
void mrb_parser_set_filename(struct mrb_parser_state*, char const*);
|
||||
char const* mrb_parser_get_filename(struct mrb_parser_state*, uint16_t idx);
|
||||
|
||||
/* utility functions */
|
||||
#ifdef ENABLE_STDIO
|
||||
|
||||
Reference in New Issue
Block a user