summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-02-16 14:17:51 +0900
committerNobuyoshi Nakada <[email protected]>2024-02-16 15:26:10 +0900
commit81752d20976f51381983dc58d924d63c697f69da (patch)
treef1ac5973ab35c445a89b7a7297d9b0137f9460fc /ruby.c
parenta64e93a8964f970015323b3a02e74ab04e31bc23 (diff)
Abort when streaming code from stdin with Prism
Do not read STDIN as a String instance.
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ruby.c b/ruby.c
index b3d7a01dcc..5dda452c89 100644
--- a/ruby.c
+++ b/ruby.c
@@ -2095,12 +2095,7 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
VALUE error;
if (strcmp(opt->script, "-") == 0) {
- int xflag = opt->xflag;
- VALUE rb_source = open_load_file(opt->script_name, &xflag);
- opt->xflag = xflag != 0;
-
- rb_warn("Prism support for streaming code from stdin is not currently supported");
- error = pm_parse_string(result, rb_source, opt->script_name);
+ rb_raise(rb_eRuntimeError, "Prism support for streaming code from stdin is not currently supported");
}
else if (opt->e_script) {
error = pm_parse_string(result, opt->e_script, rb_str_new2("-e"));