clear binders after each definition (!!!)
This commit is contained in:
parent
9afa90d3af
commit
58168e461d
1 changed files with 2 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ pVar :: Parser Expr
|
||||||
pVar = label "variable" $ lexeme $ do
|
pVar = label "variable" $ lexeme $ do
|
||||||
name <- pIdentifier
|
name <- pIdentifier
|
||||||
binders <- view bindsL <$> get
|
binders <- view bindsL <$> get
|
||||||
pure (Var name . fromIntegral <$> elemIndex name binders ?: Free name)
|
pure $ Var name . fromIntegral <$> elemIndex name binders ?: Free name
|
||||||
|
|
||||||
defChoice :: NonEmpty Text -> Parser ()
|
defChoice :: NonEmpty Text -> Parser ()
|
||||||
defChoice options = lexeme $ label (T.unpack $ head options) $ void $ choice $ fmap chunk options
|
defChoice options = lexeme $ label (T.unpack $ head options) $ void $ choice $ fmap chunk options
|
||||||
|
|
@ -179,7 +179,7 @@ pBody params ident ascription = do
|
||||||
eat ";"
|
eat ";"
|
||||||
|
|
||||||
pDef :: Parser ()
|
pDef :: Parser ()
|
||||||
pDef = lexeme $ label "definition" $ do
|
pDef = lexeme $ label "definition" $ withBinders $ do
|
||||||
skipSpace
|
skipSpace
|
||||||
ident <- pIdentifier
|
ident <- pIdentifier
|
||||||
params <- pManyParams
|
params <- pManyParams
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue