diff options
author | Kevin Newton <[email protected]> | 2024-01-31 12:17:31 -0500 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-01-31 13:41:36 -0500 |
commit | 610636fd6bb435769d0359b251a5cd00733755f6 (patch) | |
tree | 96e03bba212886dac9942f5d492422c40e3000ef /compile.c | |
parent | 21031f0a8427d857f1d0c9c1653eea3a9db87e88 (diff) |
[PRISM] Mirror iseq APIs
Before this commit, we were mixing a lot of concerns with the prism
compile between RubyVM::InstructionSequence and the general entry
points to the prism parser/compiler.
This commit makes all of the various prism-related APIs mirror
their corresponding APIs in the existing parser/compiler. This means
we now have the correct frame naming, and it's much easier to follow
where the logic actually flows. Furthermore this consolidates a lot
of the prism initialization, making it easier to see where we could
potentially be raising errors.
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -26,6 +26,7 @@ #include "internal/error.h" #include "internal/gc.h" #include "internal/hash.h" +#include "internal/io.h" #include "internal/numeric.h" #include "internal/object.h" #include "internal/rational.h" @@ -980,20 +981,6 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node) return iseq_setup(iseq, ret); } -static VALUE rb_translate_prism(pm_parser_t *parser, rb_iseq_t *iseq, pm_scope_node_t *scope_node, LINK_ANCHOR *const ret); - -VALUE -rb_iseq_compile_prism_node(rb_iseq_t * iseq, pm_scope_node_t *scope_node, pm_parser_t *parser) -{ - DECL_ANCHOR(ret); - INIT_ANCHOR(ret); - - CHECK(rb_translate_prism(parser, iseq, scope_node, ret)); - - CHECK(iseq_setup_insn(iseq, ret)); - return iseq_setup(iseq, ret); -} - static int rb_iseq_translate_threaded_code(rb_iseq_t *iseq) { |