aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/astgen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-10-03 23:43:09 -0400
committerGitHub <noreply@github.com>2022-10-03 23:43:09 -0400
commitff534d22676b8a934acf1931f91d70c554a4bdca (patch)
treed04b360f7831f6428d13a85d9d9c0d7c04fc1079 /src/stage1/astgen.cpp
parent9d5462dcb5b4b4601bdf2e628b9d80fb74000cb2 (diff)
parent17eea918aee98ca29c3762a7ecd568d2f14f66ef (diff)
downloadzig-ff534d22676b8a934acf1931f91d70c554a4bdca.tar.gz
zig-ff534d22676b8a934acf1931f91d70c554a4bdca.zip
Merge pull request #12979 from Vexu/inline-switch
Implement inline switch cases
Diffstat (limited to 'src/stage1/astgen.cpp')
-rw-r--r--src/stage1/astgen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stage1/astgen.cpp b/src/stage1/astgen.cpp
index 54d9c969a5..9eea2e650e 100644
--- a/src/stage1/astgen.cpp
+++ b/src/stage1/astgen.cpp
@@ -6987,6 +6987,12 @@ static bool astgen_switch_prong_expr(Stage1AstGen *ag, Scope *scope, AstNode *sw
assert(switch_node->type == NodeTypeSwitchExpr);
assert(prong_node->type == NodeTypeSwitchProng);
+ if (prong_node->data.switch_prong.is_inline) {
+ exec_add_error_node(ag->codegen, ag->exec, prong_node,
+ buf_sprintf("inline switch cases not supported by stage1"));
+ return ag->codegen->invalid_inst_src;
+ }
+
AstNode *expr_node = prong_node->data.switch_prong.expr;
AstNode *var_symbol_node = prong_node->data.switch_prong.var_symbol;
Scope *child_scope;