2#include "internal/array.h"
7#include "miniprelude.c"
10prelude_ast_value(
VALUE name,
VALUE code,
int line)
13 VALUE ast_value = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
14 ast = rb_ruby_ast_data_get(ast_value);
15 if (!ast || !ast->body.root) {
16 if (ast) rb_ast_dispose(ast);
17 rb_exc_raise(rb_errinfo());
25 pm_options_line_set(&result->
options, line);
26 VALUE error = pm_parse_string(result, code, name, NULL);
29 pm_parse_result_free(result);
40 VALUE code = rb_builtin_find(feature_name, &name_str, &start_line);
42 rb_fatal(
"builtin_iseq_load: can not find %s; "
43 "probably miniprelude.c is out of date",
49 .inline_const_cache = TRUE,
50 .peephole_optimization = TRUE,
51 .tailcall_optimization = FALSE,
52 .specialized_instruction = TRUE,
53 .operands_unification = TRUE,
54 .instructions_unification = TRUE,
55 .frozen_string_literal = TRUE,
56 .debug_frozen_string_literal = FALSE,
57 .coverage_enabled = FALSE,
61 if (rb_ruby_prism_p()) {
63 pm_prelude_load(&result, name_str, code, start_line);
65 vm->builtin_function_table = table;
67 iseq = pm_iseq_new_with_opt(&result.
node, name_str, name_str,
Qnil, 0, NULL, 0, ISEQ_TYPE_TOP, &optimization, &error_state);
69 vm->builtin_function_table = NULL;
70 pm_parse_result_free(&result);
74 rb_jump_tag(error_state);
78 VALUE ast_value = prelude_ast_value(name_str, code, start_line);
79 rb_ast_t *ast = rb_ruby_ast_data_get(ast_value);
81 vm->builtin_function_table = table;
82 iseq = rb_iseq_new_with_opt(ast_value, name_str, name_str,
Qnil, 0, NULL, 0, ISEQ_TYPE_TOP, &optimization,
Qnil);
84 vm->builtin_function_table = NULL;
89 if (0 && strcmp(
"prelude", feature_name) == 0) {
93 BUILTIN_LOADED(feature_name, iseq);
99rb_load_with_builtin_functions(
const char *feature_name,
const struct rb_builtin_function *table)
101 const rb_iseq_t *iseq = builtin_iseq_load(feature_name, table);
#define RUBY_ASSERT(...)
Asserts that the given expression is truthy if and only if RUBY_DEBUG is truthy.
#define Qnil
Old name of RUBY_Qnil.
#define NIL_P
Old name of RB_NIL_P.
VALUE rb_stdout
STDOUT constant.
Defines RBIMPL_HAS_BUILTIN.
pm_scope_node_t node
The resulting scope node that will hold the generated AST.
pm_options_t options
The options that will be passed to the parser.
uintptr_t VALUE
Type that represents a Ruby object.