summaryrefslogtreecommitdiff
path: root/src/ast_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_utils.h')
-rw-r--r--src/ast_utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ast_utils.h b/src/ast_utils.h
index 5cda48578..55499d808 100644
--- a/src/ast_utils.h
+++ b/src/ast_utils.h
@@ -32,6 +32,12 @@ struct BreakSeeker : public PostWalker<BreakSeeker, Visitor<BreakSeeker>> {
if (curr->name == target) found++;
}
+ void visitSwitch(Switch *curr) {
+ for (auto name : curr->targets) {
+ if (name == target) found++;
+ }
+ }
+
static bool has(Expression* tree, Name target) {
BreakSeeker breakSeeker(target);
breakSeeker.walk(tree);