Disambiguate Parser.y so we don't need to rely on operator precedences.

This commit is contained in:
Brian Huffman 2019-06-25 09:54:23 -07:00
parent 5b912afe5a
commit f53c1f8777

View File

@ -148,12 +148,6 @@ import Paths_cryptol
%right '->'
%right '#'
%left '+' '-'
%left '*'
%right '^^'
%right NEG '~'
%left '@'
%left OP
%%
@ -658,8 +652,11 @@ tysyn_params :: { [TParam PName] }
| tysyn_params tysyn_param { $2 : $1 }
type :: { Type PName }
: app_type '->' type { at ($1,$3) $ TFun $1 $3 }
| type op app_type { at ($1,$3) $ TInfix $1 $2 defaultFixity $3 }
: infix_type '->' type { at ($1,$3) $ TFun $1 $3 }
| infix_type { $1 }
infix_type :: { Type PName }
: infix_type op app_type { at ($1,$3) $ TInfix $1 $2 defaultFixity $3 }
| app_type { $1 }
app_type :: { Type PName }