aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-01-13 17:33:19 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-01-13 17:33:19 -0500
commit0c1800a9c9507dd1b06c70cb8950b13afe09f758 (patch)
treead3f30397b6d83be6b8eb7ad6d62bab2e626f1dd /src/parser.cpp
parent83f1a6fae24b9fa74ced6f8022f38be08d27a0c0 (diff)
downloadzig-0c1800a9c9507dd1b06c70cb8950b13afe09f758.tar.gz
zig-0c1800a9c9507dd1b06c70cb8950b13afe09f758.zip
fix some stuff when llvm has assertions on
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index a27927cb05..6b602c122f 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -598,6 +598,7 @@ static AstNode *ast_parse_goto_expr(ParseContext *pc, size_t *token_index, bool
*token_index += 2;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordGoto);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -607,6 +608,7 @@ static AstNode *ast_parse_goto_expr(ParseContext *pc, size_t *token_index, bool
*token_index += 1;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordGoto);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1605,6 +1607,7 @@ static AstNode *ast_parse_while_expr(ParseContext *pc, size_t *token_index, bool
*token_index += 2;
} else if (mandatory) {
ast_expect_token(pc, while_token, TokenIdKeywordWhile);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1614,6 +1617,7 @@ static AstNode *ast_parse_while_expr(ParseContext *pc, size_t *token_index, bool
*token_index += 1;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordWhile);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1663,6 +1667,7 @@ static AstNode *ast_parse_for_expr(ParseContext *pc, size_t *token_index, bool m
*token_index += 2;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordFor);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1672,6 +1677,7 @@ static AstNode *ast_parse_for_expr(ParseContext *pc, size_t *token_index, bool m
*token_index += 1;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordFor);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1726,6 +1732,7 @@ static AstNode *ast_parse_switch_expr(ParseContext *pc, size_t *token_index, boo
*token_index += 2;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordSwitch);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -1735,6 +1742,7 @@ static AstNode *ast_parse_switch_expr(ParseContext *pc, size_t *token_index, boo
*token_index += 1;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordSwitch);
+ zig_unreachable();
} else {
return nullptr;
}
@@ -2112,6 +2120,7 @@ static AstNode *ast_parse_fn_proto(ParseContext *pc, size_t *token_index, bool m
*token_index += 1;
} else if (mandatory) {
ast_expect_token(pc, first_token, TokenIdKeywordFn);
+ zig_unreachable();
} else {
return nullptr;
}