summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2023-06-29 19:09:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-01 23:17:57 +0900
commit3fd1968d6f10579a36f77eb3838f6c62a3e9f205 (patch)
treee5a8e0392dfc51519def730777395d2aa6a09ac5 /parse.y
parenta70320b8cd2c8590fb01607cca354a9bc57dde0a (diff)
Introduce script_lines function for refactor script_lines_defined and script_lines_get functions
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7990
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 9 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index abc980d6fc..e09144748a 100644
--- a/parse.y
+++ b/parse.y
@@ -149,22 +149,24 @@ literal_hash(VALUE a)
return rb_iseq_cdhash_hash(a);
}
-static int
-script_lines_defined(void)
+static ID
+script_lines(void)
{
ID script_lines;
CONST_ID(script_lines, "SCRIPT_LINES__");
+ return script_lines;
+}
- return rb_const_defined_at(rb_cObject, script_lines);
+static int
+script_lines_defined(void)
+{
+ return rb_const_defined_at(rb_cObject, script_lines());
}
static VALUE
script_lines_get(void)
{
- ID script_lines;
- CONST_ID(script_lines, "SCRIPT_LINES__");
-
- return rb_const_get_at(rb_cObject, script_lines);
+ return rb_const_get_at(rb_cObject, script_lines());
}
static VALUE