Skip to content

Commit

Permalink
update syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijian committed Oct 13, 2023
1 parent 84599f3 commit be19947
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fun_header:


%inline block_expr: "{" ls=list_semis_rev(statement_expr) "}" {}
%inline error_block: error {}

val_header : pub=ioption("pub") "let" binder=binder t=opt_annot {}
structure : list_semis(structure_item) EOF {}
structure_item:
Expand Down Expand Up @@ -217,21 +217,17 @@ statement_expr:
while_expr:
| "while" cond=infix_expr b=block_expr
{}
| "while" cond=infix_expr b=error_block
{}


if_expr:
| "if" b=infix_expr ifso=block_expr "else" ifnot=block_expr
| "if" b=infix_expr ifso=block_expr "else" ifnot=if_expr {}
| "if" b=infix_expr ifso=block_expr {}
| "if" b=infix_expr ifso=error_block {}


match_expr:
| "match" e=infix_expr "{" mat=non_empty_list_semis( pattern "=>" expr {}) "}" {}
| "match" e=infix_expr "{""}" {}
| "match" e=infix_expr error {}

expr:
| infix_expr
Expand Down

0 comments on commit be19947

Please sign in to comment.