diff --git a/grammar/precedences.js b/grammar/precedences.js index 7fabcd63..bb38f456 100644 --- a/grammar/precedences.js +++ b/grammar/precedences.js @@ -12,8 +12,8 @@ module.exports = { 'prefix', 'apply', 'negation-reduce', - 'infix-reduce', 'infix', + 'infix-reduce', 'fun', 'implicit', 'annotated', diff --git a/test/corpus/exp.txt b/test/corpus/exp.txt index 3db7f262..228d5cf4 100644 --- a/test/corpus/exp.txt +++ b/test/corpus/exp.txt @@ -296,15 +296,15 @@ a = (+ a A.+ a) (exp_section_right (operator) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable))))) + (variable)))))) (function (variable) (exp_section_right @@ -442,19 +442,19 @@ a = (a A.A.+ a A.A.+) (variable) (exp_section_left (exp_infix + (exp_name + (variable)) + (operator) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable))) - (operator) - (exp_name - (variable))) + (variable))))) (operator))) (function (variable) @@ -619,19 +619,19 @@ a = (a + a) (function (variable) (exp_infix + (exp_name + (constructor)) + (operator) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix - (exp_name - (constructor)) + (exp_literal + (string)) (operator) (exp_name - (variable))) - (operator) - (exp_literal - (string))) - (operator) - (exp_name - (variable)))) + (variable)))))) (function (variable) (exp_do @@ -677,27 +677,27 @@ a = a . a $ a (function (variable) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable)))) + (variable))))) (function (variable) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable)))))) + (variable))))))) ================================================================================ exp: infix con/var @@ -838,15 +838,15 @@ a = \ a a a -> a <$> a <*> a (pat_name (variable))) (exp_infix + (exp_name + (variable)) + (constructor_operator) (exp_infix (exp_name (variable)) (constructor_operator) (exp_name - (variable))) - (constructor_operator) - (exp_name - (variable))))) + (variable)))))) (function (variable) (exp_lambda @@ -858,15 +858,15 @@ a = \ a a a -> a <$> a <*> a (pat_name (variable))) (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable))))))) + (variable)))))))) ================================================================================ exp: parenthesized infix diff --git a/test/corpus/pat.txt b/test/corpus/pat.txt index 68f7af32..c0feb2de 100644 --- a/test/corpus/pat.txt +++ b/test/corpus/pat.txt @@ -15,15 +15,15 @@ a a (a:a : as) (a, a, (a, [a])) = a (variable)) (pat_parens (pat_infix - left_operand: (pat_infix + left_operand: (pat_name + (variable)) + operator: (constructor_operator) + right_operand: (pat_infix left_operand: (pat_name (variable)) operator: (constructor_operator) right_operand: (pat_name - (variable))) - operator: (constructor_operator) - right_operand: (pat_name - (variable)))) + (variable))))) (pat_tuple (pat_name (variable)) @@ -589,16 +589,16 @@ a == a + a = a (declarations (top_splice (exp_infix - (exp_infix - (exp_name - (variable)) - (operator) - (exp_name - (variable))) + (exp_name + (variable)) (operator) (exp_apply - (exp_name - (variable)) + (exp_infix + (exp_name + (variable)) + (operator) + (exp_name + (variable))) (ERROR) (exp_name (variable))))))) @@ -1356,6 +1356,12 @@ a (A a A.:++ A a) = a (patterns (pat_parens (pat_infix + (pat_name + (variable)) + (qualified_operator + (module) + (module) + (constructor_operator)) (pat_infix (pat_name (variable)) @@ -1364,13 +1370,7 @@ a (A a A.:++ A a) = a (module) (constructor_operator)) (pat_name - (variable))) - (qualified_operator - (module) - (module) - (constructor_operator)) - (pat_name - (variable))))) + (variable)))))) (exp_name (variable))) (function diff --git a/test/corpus/prec.txt b/test/corpus/prec.txt index ff11b48e..35b15528 100644 --- a/test/corpus/prec.txt +++ b/test/corpus/prec.txt @@ -1476,6 +1476,12 @@ a = a a + a a - a a (function (variable) (exp_infix + (exp_apply + (exp_name + (variable)) + (exp_name + (variable))) + (operator) (exp_infix (exp_apply (exp_name @@ -1487,13 +1493,7 @@ a = a a + a a - a a (exp_name (variable)) (exp_name - (variable)))) - (operator) - (exp_apply - (exp_name - (variable)) - (exp_name - (variable))))) + (variable)))))) (function (variable) (exp_infix @@ -1698,6 +1698,21 @@ a = A.A.a A.A.a A.A.+++ A.A.a A.A.a A.A.+++ A.A.a A.A.a (function (variable) (exp_infix + (exp_apply + (exp_name + (qualified_variable + (module) + (module) + (variable))) + (exp_name + (qualified_variable + (module) + (module) + (variable)))) + (qualified_operator + (module) + (module) + (operator)) (exp_infix (exp_apply (exp_name @@ -1724,19 +1739,4 @@ a = A.A.a A.A.a A.A.+++ A.A.a A.A.a A.A.+++ A.A.a A.A.a (qualified_variable (module) (module) - (variable))))) - (qualified_operator - (module) - (module) - (operator)) - (exp_apply - (exp_name - (qualified_variable - (module) - (module) - (variable))) - (exp_name - (qualified_variable - (module) - (module) - (variable)))))))) + (variable))))))))) diff --git a/test/corpus/th.txt b/test/corpus/th.txt index 235a2d1c..a204ae22 100644 --- a/test/corpus/th.txt +++ b/test/corpus/th.txt @@ -86,15 +86,15 @@ f = $(a . a $ a) (splice (exp_parens (exp_infix + (exp_name + (variable)) + (operator) (exp_infix (exp_name (variable)) (operator) (exp_name - (variable))) - (operator) - (exp_name - (variable)))))))) + (variable))))))))) ================================================================================ th: inline typed splice