summaryrefslogtreecommitdiffhomepage
path: root/src/dump.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-03-01 14:57:58 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-03-01 14:57:58 +0900
commit55ac5dba868c317e6ae7f7284fe783fce8bc823a (patch)
treeecf0002f21ff807c011c131bdbd337bed395aecc /src/dump.c
parent37e206472a0d0f605a94f32eb85522bdd65d1d97 (diff)
downloadmruby-55ac5dba868c317e6ae7f7284fe783fce8bc823a.tar.gz
mruby-55ac5dba868c317e6ae7f7284fe783fce8bc823a.zip
dump.c: remove operator_table if `MRB_NO_STDIO` is defined.
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/dump.c b/src/dump.c
index e3f3320ea..51e8dca4e 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -23,45 +23,6 @@ static size_t get_irep_record_size_1(mrb_state *mrb, const mrb_irep *irep);
# error This code cannot be built on your environment.
#endif
-#define OPERATOR_SYMBOL(sym_name, name) {name, sym_name, sizeof(sym_name)-1}
-struct operator_symbol {
- const char *name;
- const char *sym_name;
- uint16_t sym_name_len;
-};
-static const struct operator_symbol operator_table[] = {
- OPERATOR_SYMBOL("!", "not"),
- OPERATOR_SYMBOL("%", "mod"),
- OPERATOR_SYMBOL("&", "and"),
- OPERATOR_SYMBOL("*", "mul"),
- OPERATOR_SYMBOL("+", "add"),
- OPERATOR_SYMBOL("-", "sub"),
- OPERATOR_SYMBOL("/", "div"),
- OPERATOR_SYMBOL("<", "lt"),
- OPERATOR_SYMBOL(">", "gt"),
- OPERATOR_SYMBOL("^", "xor"),
- OPERATOR_SYMBOL("`", "tick"),
- OPERATOR_SYMBOL("|", "or"),
- OPERATOR_SYMBOL("~", "neg"),
- OPERATOR_SYMBOL("!=", "neq"),
- OPERATOR_SYMBOL("!~", "nmatch"),
- OPERATOR_SYMBOL("&&", "andand"),
- OPERATOR_SYMBOL("**", "pow"),
- OPERATOR_SYMBOL("+@", "plus"),
- OPERATOR_SYMBOL("-@", "minus"),
- OPERATOR_SYMBOL("<<", "lshift"),
- OPERATOR_SYMBOL("<=", "le"),
- OPERATOR_SYMBOL("==", "eq"),
- OPERATOR_SYMBOL("=~", "match"),
- OPERATOR_SYMBOL(">=", "ge"),
- OPERATOR_SYMBOL(">>", "rshift"),
- OPERATOR_SYMBOL("[]", "aref"),
- OPERATOR_SYMBOL("||", "oror"),
- OPERATOR_SYMBOL("<=>", "cmp"),
- OPERATOR_SYMBOL("===", "eqq"),
- OPERATOR_SYMBOL("[]=", "aset"),
-};
-
static size_t
get_irep_header_size(mrb_state *mrb)
{
@@ -1035,6 +996,45 @@ sym_name_cvar_p(const char *name, mrb_int len)
return len >= 3 && name[0] == '@' && sym_name_ivar_p(name+1, len-1);
}
+#define OPERATOR_SYMBOL(sym_name, name) {name, sym_name, sizeof(sym_name)-1}
+struct operator_symbol {
+ const char *name;
+ const char *sym_name;
+ uint16_t sym_name_len;
+};
+static const struct operator_symbol operator_table[] = {
+ OPERATOR_SYMBOL("!", "not"),
+ OPERATOR_SYMBOL("%", "mod"),
+ OPERATOR_SYMBOL("&", "and"),
+ OPERATOR_SYMBOL("*", "mul"),
+ OPERATOR_SYMBOL("+", "add"),
+ OPERATOR_SYMBOL("-", "sub"),
+ OPERATOR_SYMBOL("/", "div"),
+ OPERATOR_SYMBOL("<", "lt"),
+ OPERATOR_SYMBOL(">", "gt"),
+ OPERATOR_SYMBOL("^", "xor"),
+ OPERATOR_SYMBOL("`", "tick"),
+ OPERATOR_SYMBOL("|", "or"),
+ OPERATOR_SYMBOL("~", "neg"),
+ OPERATOR_SYMBOL("!=", "neq"),
+ OPERATOR_SYMBOL("!~", "nmatch"),
+ OPERATOR_SYMBOL("&&", "andand"),
+ OPERATOR_SYMBOL("**", "pow"),
+ OPERATOR_SYMBOL("+@", "plus"),
+ OPERATOR_SYMBOL("-@", "minus"),
+ OPERATOR_SYMBOL("<<", "lshift"),
+ OPERATOR_SYMBOL("<=", "le"),
+ OPERATOR_SYMBOL("==", "eq"),
+ OPERATOR_SYMBOL("=~", "match"),
+ OPERATOR_SYMBOL(">=", "ge"),
+ OPERATOR_SYMBOL(">>", "rshift"),
+ OPERATOR_SYMBOL("[]", "aref"),
+ OPERATOR_SYMBOL("||", "oror"),
+ OPERATOR_SYMBOL("<=>", "cmp"),
+ OPERATOR_SYMBOL("===", "eqq"),
+ OPERATOR_SYMBOL("[]=", "aset"),
+};
+
static const char*
sym_operator_name(const char *sym_name, mrb_int len)
{