file/line info passed to codegen; argument type of mrb_generate_code() has changed

This commit is contained in:
Yukihiro Matsumoto
2012-08-22 22:36:44 +09:00
parent 655518f38a
commit 15725eb4f6
4 changed files with 31 additions and 9 deletions
+2 -1
View File
@@ -33,6 +33,7 @@ const char *mrbc_filename(mrb_state *mrb, mrbc_context *c, const char *s);
/* AST node structure */
typedef struct mrb_ast_node {
struct mrb_ast_node *car, *cdr;
int lineno;
} mrb_ast_node;
/* lexer states */
@@ -107,7 +108,7 @@ void mrb_parser_parse(struct mrb_parser_state*,mrbc_context*);
struct mrb_parser_state* mrb_parse_file(mrb_state*,FILE*,mrbc_context*);
struct mrb_parser_state* mrb_parse_string(mrb_state*,const char*,mrbc_context*);
struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,int,mrbc_context*);
int mrb_generate_code(mrb_state*, mrb_ast_node*);
int mrb_generate_code(mrb_state*, struct mrb_parser_state*);
/* program load functions */
mrb_value mrb_load_file(mrb_state*,FILE*);