aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-25 08:02:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-25 08:02:29 +0000
commit012368007f0a7fce81a0083c96aa549c21141d05 (patch)
tree2c59db60dae0dbf87eab110fa9b7ed80e516a3d1 /ruby.c
parent9b7d4d470965b8e750a80de4faf60ec892d1c99b (diff)
downloadruby-012368007f0a7fce81a0083c96aa549c21141d05.tar.gz
iseq.h: rename member
* iseq.h (rb_compile_option_struct): rename the member frozen_string_literal_debug as debug_frozen_string_literal. [Feature #11725] * ruby.c (proc_options): do not set $DEBUG and $VERBOSE only if no arguments is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ruby.c b/ruby.c
index c6add52bd8..6468ef9710 100644
--- a/ruby.c
+++ b/ruby.c
@@ -69,10 +69,12 @@ enum feature_flag_bits {
feature_did_you_mean,
feature_rubyopt,
feature_frozen_string_literal,
- feature_frozen_string_literal_debug,
+ feature_debug_frozen_string_literal,
feature_flag_count
};
+#define DEBUG_BIT(bit) (1U << feature_debug_##bit)
+
#define DUMP_BIT(bit) (1U << dump_##bit)
enum dump_flag_bits {
dump_version,
@@ -118,7 +120,7 @@ enum {
COMPILATION_FEATURES = (
0
| FEATURE_BIT(frozen_string_literal)
- | FEATURE_BIT(frozen_string_literal_debug)
+ | FEATURE_BIT(debug_frozen_string_literal)
),
DEFAULT_FEATURES = (
~0U
@@ -126,7 +128,7 @@ enum {
& ~FEATURE_BIT(gems)
#endif
& ~FEATURE_BIT(frozen_string_literal)
- & ~FEATURE_BIT(frozen_string_literal_debug)
+ & ~FEATURE_BIT(debug_frozen_string_literal)
)
};
@@ -780,7 +782,7 @@ static void
debug_option(const char *str, int len, void *arg)
{
#define SET_WHEN_DEBUG(t, bit) SET_WHEN(#bit, t##_BIT(bit), str, len)
- SET_WHEN_DEBUG(FEATURE, frozen_string_literal_debug);
+ SET_WHEN_DEBUG(DEBUG, frozen_string_literal);
rb_warn("unknown argument for --debug: `%.*s'", len, str);
}
@@ -1113,8 +1115,10 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
if (s && *s) {
ruby_each_words(s, debug_option, &opt->features);
}
- ruby_debug = Qtrue;
- ruby_verbose = Qtrue;
+ else {
+ ruby_debug = Qtrue;
+ ruby_verbose = Qtrue;
+ }
}
else if (is_option_with_arg("enable", Qtrue, Qtrue)) {
ruby_each_words(s, enable_option, &opt->features);
@@ -1501,7 +1505,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
rb_hash_aset((h), ID2SYM(rb_intern_const(#name)), \
((o)->features & FEATURE_BIT(name) ? Qtrue : Qfalse));
SET_COMPILE_OPTION(option, opt, frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, frozen_string_literal_debug);
+ SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
rb_funcallv(rb_cISeq, rb_intern_const("compile_option="), 1, &option);
#undef SET_COMPILE_OPTION
}