mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add RB_DEFAULT_PARSER preprocessor macro
This way there is one place to change for switching the default. This also allows for building the same commit with different cppflags.
This commit is contained in:
parent
1729f47e72
commit
f2ac013009
Notes:
git
2024-08-27 23:15:57 +00:00
Merged: https://github.com/ruby/ruby/pull/11473 Merged-By: XrXr
3 changed files with 10 additions and 5 deletions
6
ruby.c
6
ruby.c
|
@ -1428,10 +1428,10 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char **
|
|||
}
|
||||
else if (is_option_with_arg("parser", Qfalse, Qtrue)) {
|
||||
if (strcmp("prism", s) == 0) {
|
||||
(*rb_ruby_prism_ptr()) = true;
|
||||
*rb_ruby_prism_ptr() = true;
|
||||
}
|
||||
else if (strcmp("parse.y", s) == 0) {
|
||||
// default behavior
|
||||
*rb_ruby_prism_ptr() = false;
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eRuntimeError, "unknown parser %s", s);
|
||||
|
@ -3114,8 +3114,6 @@ ruby_process_options(int argc, char **argv)
|
|||
VALUE iseq;
|
||||
const char *script_name = (argc > 0 && argv[0]) ? argv[0] : ruby_engine;
|
||||
|
||||
(*rb_ruby_prism_ptr()) = false;
|
||||
|
||||
if (!origarg.argv || origarg.argc <= 0) {
|
||||
origarg.argc = argc;
|
||||
origarg.argv = argv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue