We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e4c4fe commit 49cf042Copy full SHA for 49cf042
ruby.c
@@ -2134,6 +2134,13 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
2134
2135
ruby_opt_init(opt);
2136
error = pm_parse_stdin(result);
2137
+
2138
+ // If we found an __END__ marker, then we're going to define a global
2139
+ // DATA constant that is a file object that can be read to read the
2140
+ // contents after the marker.
2141
+ if (NIL_P(error) && result->parser.data_loc.start != NULL) {
2142
+ rb_define_global_const("DATA", rb_stdin);
2143
+ }
2144
}
2145
else if (opt->e_script) {
2146
command_line |= PM_OPTIONS_COMMAND_LINE_E;
0 commit comments