diff options
Diffstat (limited to 'src/parse.zig')
-rw-r--r-- | src/parse.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parse.zig b/src/parse.zig index 1aa5d07..e22397f 100644 --- a/src/parse.zig +++ b/src/parse.zig @@ -184,7 +184,7 @@ const ParseError = error{ ExpectedRightParen, UnexpectedToken, InvalidAssignTarget, - ExprStatementMustBeCall, + ExprStatementMustBeCallOrIf, }; pub fn file(allocator: Allocator, lexer: *Lexer) !File { @@ -256,8 +256,8 @@ fn parseStatement(allocator: Allocator, lexer: *Lexer) ParseError!Stmt { .loc = lhs.loc.combine(value.loc), .type = .{ .assign_var = .{ .ident = lhs.loc, .is_decl = colon != null, .value = value } }, }; - } else if (lhs.type != .call) { - return error.ExprStatementMustBeCall; + } else if (lhs.type != .call and lhs.type != .@"if") { + return error.ExprStatementMustBeCallOrIf; } return .{ .loc = lhs.loc, |