summaryrefslogtreecommitdiff
path: root/template/prelude.c.tmpl
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2024-05-03 08:57:55 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2024-05-03 12:40:35 +0900
commit899d9f79dde0e2dbb2da3a6ec7c1cbf1023cc56d (patch)
treeab7c9a58f20afec022d74c2a45fcd09c0c05d82c /template/prelude.c.tmpl
parente1905ca18047e2dff73115f432ddfa532f7d396e (diff)
Rename `vast` to `ast_value`
There is an English word "vast". This commit changes the name to be more clear name to avoid confusion.
Diffstat (limited to 'template/prelude.c.tmpl')
-rw-r--r--template/prelude.c.tmpl24
1 files changed, 12 insertions, 12 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index 386511f20c..e17a75da79 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -142,16 +142,16 @@ COMPILER_WARNING_POP
#define PRELUDE_CODE(n) rb_utf8_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n))
static VALUE
-prelude_vast(VALUE name, VALUE code, int line)
+prelude_ast_value(VALUE name, VALUE code, int line)
{
rb_ast_t *ast;
- VALUE vast = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
- ast = rb_ruby_ast_data_get(vast);
+ VALUE ast_value = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
+ ast = rb_ruby_ast_data_get(ast_value);
if (!ast || !ast->body.root) {
if (ast) rb_ast_dispose(ast);
rb_exc_raise(rb_errinfo());
}
- return vast;
+ return ast_value;
}
% end
@@ -159,21 +159,21 @@ prelude_vast(VALUE name, VALUE code, int line)
#define PRELUDE_VAST(n, name_str, start_line) \
(((sizeof(prelude_name<%='##'%><%=%>n) - prefix_len - 2) == namelen) && \
(strncmp(prelude_name<%='##'%><%=%>n + prefix_len, feature_name, namelen) == 0) ? \
- prelude_vast((name_str) = PRELUDE_NAME(n), PRELUDE_CODE(n), start_line) : Qnil)
+ prelude_ast_value((name_str) = PRELUDE_NAME(n), PRELUDE_CODE(n), start_line) : Qnil)
VALUE
-rb_builtin_vast(const char *feature_name, VALUE *name_str)
+rb_builtin_ast_value(const char *feature_name, VALUE *name_str)
{
const size_t prefix_len = rb_strlen_lit("<internal:");
size_t namelen = strlen(feature_name);
- VALUE vast = Qnil;
+ VALUE ast_value = Qnil;
% @preludes.each_value do |i, prelude, lines, sub, start_line|
% if sub
- if (!NIL_P(vast = PRELUDE_VAST(<%=i%><%=%>, *name_str, <%=start_line%>))) return vast;
+ if (!NIL_P(ast_value = PRELUDE_VAST(<%=i%><%=%>, *name_str, <%=start_line%>))) return ast_value;
% end
% end
- return vast;
+ return ast_value;
}
% end
@@ -199,9 +199,9 @@ prelude_eval(VALUE code, VALUE name, int line)
};
rb_ast_t *ast;
- VALUE vast = prelude_vast(name, code, line);
- ast = rb_ruby_ast_data_get(vast);
- rb_iseq_eval(rb_iseq_new_with_opt(vast, name, name, Qnil, line,
+ VALUE ast_value = prelude_ast_value(name, code, line);
+ ast = rb_ruby_ast_data_get(ast_value);
+ rb_iseq_eval(rb_iseq_new_with_opt(ast_value, name, name, Qnil, line,
NULL, 0, ISEQ_TYPE_TOP, &optimization,
Qnil));
rb_ast_dispose(ast);