Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
RubyVM::InstructionSequence.compile_file_prism
compile_file_prism(p1, *args, p3 = {})
iseq.c
View on GitHub ↗
static VALUE
iseqw_s_compile_file_prism(int argc, VALUE *argv, VALUE self)
{
VALUE file = Qnil, opt = Qnil;
int i;
i = rb_scan_args(argc, argv, "1*:", &file, NULL, &opt);
if (i > 1+NIL_P(opt)) rb_error_arity(argc, 1, 5);
switch (i) {
case 2: opt = argv[--i];
}
FilePathValue(file);
file = rb_fstring(file); /* rb_io_t->pathv gets frozen anyways */
pm_string_t input;
pm_string_mapped_init(&input, RSTRING_PTR(file));
pm_options_t options = { 0 };
pm_options_filepath_set(&options, RSTRING_PTR(file));
pm_parser_t parser;
pm_parser_init(&parser, pm_string_source(&input), pm_string_length(&input), &options);
rb_iseq_t *iseq = iseq_alloc();
iseqw_s_compile_prism_compile(&parser, opt, iseq, file, rb_realpath_internal(Qnil, file, 1), 1);
pm_parser_free(&parser);
pm_string_free(&input);
pm_options_free(&options);
return iseqw_new(iseq);
}
No documentation available