small fixes to the parser

This commit is contained in:
DanielGavin
2020-12-09 21:33:10 +01:00
parent b6aa549eb8
commit 934809397f
4 changed files with 13 additions and 4 deletions
+2 -1
View File
@@ -325,6 +325,7 @@ If_Stmt :: struct {
init: ^Stmt,
cond: ^Expr,
body: ^Stmt,
else_pos: tokenizer.Pos,
else_stmt: ^Stmt,
}
@@ -490,7 +491,7 @@ unparen_expr :: proc(expr: ^Expr) -> (val: ^Expr) {
}
for {
e, ok := val.derived.(Paren_Expr);
if !ok {
if !ok || e.expr == nil {
break;
}
val = e.expr;