Skip to content

Commit

Permalink
List concat/cons precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3kk1d committed Dec 20, 2024
1 parent cfda148 commit 88341f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/haz3lmenhir/Parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ open AST

%left GREATER_THAN LESS_THAN DOUBLE_EQUAL NOT_EQUAL LESS_THAN_EQUAL GREATER_THAN_EQUAL NOT_EQUAL_FLOAT LESS_THAN_FLOAT LESS_THAN_EQUAL_FLOAT GREATER_THAN_FLOAT GREATER_THAN_EQUAL_FLOAT DOUBLE_EQUAL_FLOAT STRING_EQUAL
%right STRING_CONCAT
%right CONS
%left PLUS MINUS PLUS_FLOAT MINUS_FLOAT
%left DIVIDE TIMES TIMES_FLOAT DIVIDE_FLOAT
%right CONS

%left AT_SYMBOL PLUS MINUS PLUS_FLOAT MINUS_FLOAT
%left DIVIDE TIMES TIMES_FLOAT DIVIDE_FLOAT

%right POWER POWER_FLOAT

%left OPEN_CURLY

%left IN
%left DOLLAR_SIGN

%left AT_SYMBOL
%nonassoc TYP_AP_SYMBOL

%left OPEN_PAREN CLOSE_PAREN
Expand Down Expand Up @@ -331,7 +332,7 @@ exp:
| E_EXP; s = STRING; { InvalidExp(s) }
| WILD {Deferral}
| e = exp; TYP_AP_SYMBOL; ty = typ; GREATER_THAN; {TypAp(e, ty)}
| TYP; tp = tpat; SINGLE_EQUAL; ty = typ; IN; e = exp {TyAlias(tp, ty, e)}
| TYP; tp = tpat; SINGLE_EQUAL; ty = typ; IN; e = exp {TyAlias(tp, ty, e)} %prec LET_EXP
| LESS_THAN; LESS_THAN; e = exp; QUESTION; s = SEXP_STRING; GREATER_THAN; GREATER_THAN {DynamicErrorHole(e, s)}
| b = BUILTIN; {BuiltinFun(b)}
| UNDEF; {Undefined}
Expand Down

0 comments on commit 88341f3

Please sign in to comment.