letrec + typechecking core

This commit is contained in:
crumbtoo
2024-02-08 18:40:46 -07:00
parent a2b4bd2afc
commit 17058d3f8c
6 changed files with 47 additions and 24 deletions

View File

@@ -62,6 +62,7 @@ import Compiler.Types
infixr { Located _ TokenInfixR }
infix { Located _ TokenInfix }
let { Located _ TokenLet }
letrec { Located _ TokenLetrec }
in { Located _ TokenIn }
%nonassoc '='
@@ -190,7 +191,8 @@ AppExpr :: { RlpExpr' RlpcPs }
| AppExpr Expr1 { AppE <<~ $1 <~> $2 }
LetExpr :: { RlpExpr' RlpcPs }
: let layout1(Binding) in Expr { $1 \$> LetE $2 $4 }
: let layout1(Binding) in Expr { $1 \$> LetE $2 $4 }
| letrec layout1(Binding) in Expr { $1 \$> LetrecE $2 $4 }
CaseExpr :: { RlpExpr' RlpcPs }
: case Expr of layout0(CaseAlt)