Progression on type checker ;)

This commit is contained in:
sebastianselander 2023-02-13 19:03:06 +01:00
parent 73dc2e4b6a
commit c10d7703ad
5 changed files with 126 additions and 82 deletions

View file

@ -7,16 +7,19 @@ EAnn. Exp5 ::= Exp5 ":" Type ;
EId. Exp4 ::= Ident;
EConst. Exp4 ::= Const;
EApp. Exp3 ::= Exp3 Exp4;
ELet. Exp2 ::= "let" Bind "in" Exp;
EAdd. Exp1 ::= Exp1 "+" Exp2;
ELet. Exp ::= "let" Ident "=" Exp "in" Exp;
EAbs. Exp ::= "\\" Ident "." Exp;
CInt. Const ::= Integer ;
CStr. Const ::= String ;
TMono. Type1 ::= Ident ;
TPoly. Type1 ::= Ident ;
TFun. Type ::= Type1 "->" Type ;
TMono. Type1 ::= UIdent ;
TPoly. Type1 ::= LIdent ;
TArrow. Type ::= Type "->" Type1 ;
token UIdent (upper (letter | digit | '_')*) ;
token LIdent (lower (letter | digit | '_')*) ;
separator Bind ";";
separator Ident " ";