Disallow procedure calls with an associated deferred procedure to be used in logical binary expressions (short-circuiting)

This commit is contained in:
gingerBill
2019-12-15 11:10:50 +00:00
parent 8bec324779
commit 7f5021c8e9
5 changed files with 104 additions and 33 deletions

View File

@@ -14,7 +14,6 @@ Token ast_token(Ast *node) {
return node->CompoundLit.open;
case Ast_TagExpr: return node->TagExpr.token;
case Ast_RunExpr: return node->RunExpr.token;
case Ast_BadExpr: return node->BadExpr.begin;
case Ast_UnaryExpr: return node->UnaryExpr.op;
case Ast_BinaryExpr: return ast_token(node->BinaryExpr.left);
@@ -155,9 +154,6 @@ Ast *clone_ast(Ast *node) {
case Ast_TagExpr:
n->TagExpr.expr = clone_ast(n->TagExpr.expr);
break;
case Ast_RunExpr:
n->RunExpr.expr = clone_ast(n->RunExpr.expr);
break;
case Ast_UnaryExpr:
n->UnaryExpr.expr = clone_ast(n->UnaryExpr.expr);
break;
@@ -458,15 +454,6 @@ Ast *ast_tag_expr(AstFile *f, Token token, Token name, Ast *expr) {
return result;
}
Ast *ast_run_expr(AstFile *f, Token token, Token name, Ast *expr) {
Ast *result = alloc_ast_node(f, Ast_RunExpr);
result->RunExpr.token = token;
result->RunExpr.name = name;
result->RunExpr.expr = expr;
return result;
}
Ast *ast_tag_stmt(AstFile *f, Token token, Token name, Ast *stmt) {
Ast *result = alloc_ast_node(f, Ast_TagStmt);
result->TagStmt.token = token;