diff options
author | Jemma Issroff <[email protected]> | 2023-08-29 12:27:00 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-29 09:27:00 -0700 |
commit | 535045ab3b27dd42030e837bcd83b74ff075b84b (patch) | |
tree | 6150360f5171eb7598435f708e3be201fa7230d7 /iseq.c | |
parent | 36e210718cc0242d3d1a043bd32b4618db592024 (diff) |
[YARP] Compile basic types (#8311)
* Add a compile_context arg to yp_compile_node
The compile_context will allow us to pass around the parser, and
the constants and lookup table (to be used in future commits).
* Compile yp_program_node_t and yp_statements_node_t
Add the compilation for program and statements node so that we can
successfully compile an empty program with YARP.
* Helper functions for parsing numbers, strings, and symbols
* Compile basic numeric / boolean node types in YARP
* Compile StringNode and SymbolNodes in YARP
* Compile several basic node types in YARP
* Added error return for missing node
Notes
Notes:
Merged-By: jemmaissroff
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -45,8 +45,6 @@ #include "insns_info.inc" #include "yarp/yarp.h" -VALUE rb_iseq_compile_yarp_node(rb_iseq_t * iseq, const yp_node_t * yarp_pointer); - VALUE rb_cISeq; static VALUE iseqw_new(const rb_iseq_t *iseq); static const rb_iseq_t *iseqw_check(VALUE iseqw); @@ -944,6 +942,8 @@ rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE rea return iseq_translate(iseq); } +VALUE rb_iseq_compile_yarp_node(rb_iseq_t * iseq, const yp_node_t * yarp_pointer, yp_parser_t *parser); + rb_iseq_t * rb_iseq_new_with_callback( const struct rb_iseq_new_with_callback_callback_func * ifunc, @@ -1404,8 +1404,9 @@ iseqw_s_compile_yarp(int argc, VALUE *argv, VALUE self) prepare_iseq_build(iseq, name, file, path, first_lineno, &node_location, node_id, parent, 0, (enum rb_iseq_type)iseq_type, Qnil, &option); - rb_iseq_compile_yarp_node(iseq, node); + rb_iseq_compile_yarp_node(iseq, node, &parser); + finish_iseq_build(iseq); yp_node_destroy(&parser, node); yp_parser_free(&parser); |