Commit 9f34c20f authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Fixed #16 (multiple bindings of a variable in a do-sequence cause abortion)

parent 2dece67e
......@@ -113,12 +113,14 @@ by which the variables get renamed.
> inNestedEnv :: SCM a -> SCM a
> inNestedEnv act = do
> oldEnv <- getRenameEnv
> modifyRenameEnv nestEnv
> incId
> incNesting
> res <- act
> modifyRenameEnv $ const oldEnv
> return res
> incNesting :: SCM ()
> incNesting = modifyRenameEnv nestEnv >> incId
> report :: Message -> SCM ()
> report msg = S.modify $ \ s -> s { errors = msg : errors s }
......@@ -778,11 +780,12 @@ checkParen
> checkStatement p (StmtBind pos t e) =
> liftM2 (flip (StmtBind pos)) (checkExpr p e) (checkArg p t)
> checkStatement _ (StmtDecl ds) =
> StmtDecl `liftM` checkDeclGroup bindVarDecl ds
> StmtDecl `liftM` (incNesting >> checkDeclGroup bindVarDecl ds)
> checkArg :: Position -> ConstrTerm -> SCM ConstrTerm
> checkArg p t = do
> t' <- checkConstrTerm p t
> incNesting
> checkExprVariables t'
> return t'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment