Skip to content

Commit

Permalink
Added derived form for datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Dec 31, 2019
1 parent 0743fdc commit 72a32ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ rule token = parse
| "_" { HOLE }
| "and" { AND }
| "as" { AS }
| "data" { DATA }
| "do" { DO }
| "else" { ELSE }
| "end" { END }
Expand Down
3 changes: 3 additions & 0 deletions parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ let parse_error s = raise (Source.Error (Source.nowhere_region, s))
%token LBRACE RBRACE
%token DOT AT TICK
%token COMMA SEMI
%token DATA

%token EOF

Expand Down Expand Up @@ -321,6 +322,8 @@ annexp :
exp :
| annexp
{ $1 }
| DATA name typparamlist COLON typ SEAL LBRACE dec RBRACE
{ StrE(EmptyB@@at())@@at() }
| FUN param paramlist DARROW exp
{ funE($2::$3, $5)@@at() }
| IF exp THEN exp ELSE infexp COLON typ
Expand Down

0 comments on commit 72a32ca

Please sign in to comment.