summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-02-14 14:17:32 -0500
committerKevin Newton <[email protected]>2024-02-14 15:29:26 -0500
commit9933377c343e45a2294fff7199255bfc00c8ef1a (patch)
treefc1a26240122571d4a8f5136eac20cc9197a68ca /ruby.c
parent1d3b306753baf05642836cc6f17015c9309c1420 (diff)
[PRISM] Correctly hook up line numbers for eval
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index ad53737aa3..9b049b93b6 100644
--- a/ruby.c
+++ b/ruby.c
@@ -2347,6 +2347,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
if (dump & (DUMP_BIT(prism_parsetree))) {
pm_parse_result_t result = { 0 };
+ result.options.line = 1;
+
VALUE error;
if (strcmp(opt->script, "-") == 0) {
@@ -2413,7 +2415,10 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
if ((*rb_ruby_prism_ptr())) {
ruby_opt_init(opt);
+
pm_parse_result_t result = { 0 };
+ result.options.line = 1;
+
VALUE error;
if (strcmp(opt->script, "-") == 0) {