summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2026-03-19 16:37:30 -0400
committernagachika <nagachika@ruby-lang.org>2026-05-05 16:53:12 +0900
commit97aba937ce4cef0eac4e36109f0f3ed974029674 (patch)
tree4f1eb388a12e30c8686a35a687cbdd4ada94a886
parent469d90739a3f623648feeac3c93b961ac8fe20a2 (diff)
ISeq.compile_file was not switching on parser
-rw-r--r--iseq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 98d64d4dda..c26826b026 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1710,6 +1710,8 @@ iseqw_s_compile_prism(int argc, VALUE *argv, VALUE self)
return iseqw_s_compile_parser(argc, argv, self, true);
}
+static VALUE iseqw_s_compile_file_prism(int argc, VALUE *argv, VALUE self);
+
/*
* call-seq:
* InstructionSequence.compile_file(file[, options]) -> iseq
@@ -1733,6 +1735,10 @@ iseqw_s_compile_prism(int argc, VALUE *argv, VALUE self)
static VALUE
iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
{
+ if (rb_ruby_prism_p()) {
+ return iseqw_s_compile_file_prism(argc, argv, self);
+ }
+
VALUE file, opt = Qnil;
VALUE parser, f, exc = Qnil, ret;
rb_ast_t *ast;