aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-12-14 21:58:12 +0000
committergingerBill <bill@gingerbill.org>2018-12-14 21:58:12 +0000
commit9d6666f333cd427a720c639ee0b9b513d79fe8a0 (patch)
tree6516a49a891bc1983703703aaf485d549ec0c668 /src/parser.cpp
parentd29335ececec993c8df336b6482a6b213bc13361 (diff)
Disallow casting between `cstring` and `[]u8`
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index dc1a22780..f42cfaa32 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1686,7 +1686,14 @@ Ast *parse_operand(AstFile *f, bool lhs) {
operand = ast_bad_expr(f, token, f->curr_token);
}
warning(token, "#run is not yet implemented");
- } else if (name.string == "file") { return ast_basic_directive(f, token, name.string);
+ } /* else if (name.string == "no_deferred") {
+ operand = parse_expr(f, false);
+ if (unparen_expr(operand)->kind != Ast_CallExpr) {
+ syntax_error(operand, "#no_deferred can only be applied to procedure calls");
+ operand = ast_bad_expr(f, token, f->curr_token);
+ }
+ operand->stmt_state_flags |= StmtStateFlag_no_deferred;
+ } */ else if (name.string == "file") { return ast_basic_directive(f, token, name.string);
} else if (name.string == "line") { return ast_basic_directive(f, token, name.string);
} else if (name.string == "procedure") { return ast_basic_directive(f, token, name.string);
} else if (name.string == "caller_location") { return ast_basic_directive(f, token, name.string);
@@ -3887,7 +3894,10 @@ Ast *parse_stmt(AstFile *f) {
} else if (tag == "assert") {
Ast *t = ast_basic_directive(f, hash_token, tag);
return ast_expr_stmt(f, parse_call_expr(f, t));
- }
+ } /* else if (name.string == "no_deferred") {
+ s = parse_stmt(f);
+ s->stmt_state_flags |= StmtStateFlag_no_deferred;
+ } */
if (tag == "include") {
syntax_error(token, "#include is not a valid import declaration kind. Did you mean 'import'?");