Skip to content

Commit

Permalink
fix: env returns to original state after Block
Browse files Browse the repository at this point in the history
  • Loading branch information
oriollinan committed Jan 7, 2025
1 parent 552ef53 commit 668c8c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Ast/Parser/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ parseWhile = do
body <- parseBlock
return $ AT.While {AT.whileLoc = srcLoc, AT.whileCond = cond, AT.whileBody = body}

-- TODO: manage new state in blocks

parseBlock :: PU.Parser AT.Expr
parseBlock = do
env <- S.get
es <- M.between (PU.symbol "{") (PU.symbol "}") $ M.many $ PU.lexeme parseExpr
S.modify $ const env
return $ AT.Block es

parseReturn :: PU.Parser AT.Expr
Expand Down

0 comments on commit 668c8c4

Please # to comment.