Skip to content

Commit

Permalink
Fix arrow associativity
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3kk1d committed Dec 13, 2024
1 parent 97dd32d commit abfccdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/haz3lmenhir/Parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ open AST


%left COLON
%left DASH_ARROW
%right DASH_ARROW

(* Int op precedences *)
%left DOUBLE_EQUAL NOT_EQUAL LESS_THAN_EQUAL GREATER_THAN_EQUAL
Expand Down
22 changes: 11 additions & 11 deletions test/Test_Menhir.re
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ let alco_check = exp_typ |> Alcotest.check;
let strip_parens =
Exp.map_term(
~f_exp=
(cont: TermBase.exp_t => TermBase.exp_t, e2: TermBase.exp_t) =>
switch (e2.term) {
(cont: TermBase.exp_t => TermBase.exp_t, e: TermBase.exp_t) =>
switch (e.term) {
| Parens(e) => cont(e)
| _ => cont(e2)
| _ => cont(e)
},
~f_pat=
(cont, e2) =>
switch (e2.term) {
(cont, e) =>
switch (e.term) {
| Parens(e) => cont(e)
| _ => cont(e2)
| _ => cont(e)
},
~f_typ=
(cont, e2) =>
switch (e2.term) {
(cont, e) =>
switch (e.term) {
| Parens(e) => cont(e)
| _ => cont(e2)
| _ => cont(e)
},
_,
);
Expand Down Expand Up @@ -563,7 +563,7 @@ let tests = [
"-num*1",
),
menhir_maketerm_equivalent_test("Concatenation association", "1::2::3::[]"),
menhir_doesnt_crash_test(
menhir_maketerm_equivalent_test(
"Altered Documentation Buffer: Basic Reference",
{|
let empty_hole = ? in
Expand Down Expand Up @@ -646,7 +646,7 @@ let poly_id: (forall a -> (a -> a)) =
(typfun a -> (fun (x : a) -> x))
in
let apply_both:
forall a -> forall b -> (forall c -> (c -> c)) -> ((a, b) -> (a, b)) =
forall a -> forall b -> (forall c -> c -> c) -> ((a, b) -> (a, b)) =
typfun a -> typfun b ->
fun (f : forall c -> (c -> c)) ->
fun ((x, y) : (a, b)) -> (f@<a>(x), f@<b>(y))
Expand Down

0 comments on commit abfccdf

Please sign in to comment.