aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-11 10:37:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-11 10:37:40 +0900
commita84d0945faa499351e9d11f649e9c132c540eb46 (patch)
tree44e6fe6a97d9cf456e5372cba135c91483b22593 /parse.y
parent4d0a619f712bfd189dcedcf9998b143a731a2211 (diff)
downloadruby-a84d0945faa499351e9d11f649e9c132c540eb46.tar.gz
Semicolon after `SWITCH_BY_COND_TYPE` for auto-indent [ci skip]
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y15
1 files changed, 8 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index 29e41e0f2a..ef7e6631c9 100644
--- a/parse.y
+++ b/parse.y
@@ -14064,12 +14064,13 @@ enum cond_type {
COND_IN_FF
};
-#define SWITCH_BY_COND_TYPE(t, w, arg) \
+#define SWITCH_BY_COND_TYPE(t, w, arg) do { \
switch (t) { \
case COND_IN_OP: break; \
case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
- }
+ } \
+} while (0)
static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
@@ -14101,11 +14102,11 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
case NODE_DSTR:
case NODE_EVSTR:
case NODE_STR:
- SWITCH_BY_COND_TYPE(type, warn, "string ")
+ SWITCH_BY_COND_TYPE(type, warn, "string ");
break;
case NODE_DREGX:
- if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
+ if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ");
return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
@@ -14129,12 +14130,12 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
case NODE_DSYM:
warn_symbol:
- SWITCH_BY_COND_TYPE(type, warning, "symbol ")
+ SWITCH_BY_COND_TYPE(type, warning, "symbol ");
break;
case NODE_LIT:
if (RB_TYPE_P(RNODE_LIT(node)->nd_lit, T_REGEXP)) {
- if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
+ if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ");
nd_set_type(node, NODE_MATCH);
}
else if (RNODE_LIT(node)->nd_lit == Qtrue ||
@@ -14145,7 +14146,7 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
goto warn_symbol;
}
else {
- SWITCH_BY_COND_TYPE(type, warning, "")
+ SWITCH_BY_COND_TYPE(type, warning, "");
}
default:
break;