@@ -17,10 +17,8 @@ export const _term = <RuleName extends string>($: GrammarSymbols<RuleName>) =>
1717 Prec . Term ,
1818 choice (
1919 $ . block ,
20- $ . sequence ,
2120 $ . abstraction ,
2221 $ . application ,
23- $ . prefix_application ,
2422 $ . infix_application ,
2523 $ . _section ,
2624 $ . access ,
@@ -50,10 +48,6 @@ export const _term = <RuleName extends string>($: GrammarSymbols<RuleName>) =>
5048export const block = < RuleName extends string > ( $ : GrammarSymbols < RuleName > ) =>
5149 buildBlock ( $ , field ( 'term' , $ . _term ) )
5250
53- export const sequence = < RuleName extends string > (
54- $ : GrammarSymbols < RuleName > ,
55- ) => seq ( 'do' , buildBlock ( $ , field ( 'term' , $ . _term ) ) )
56-
5751export const export_ = < RuleName extends string > ( $ : GrammarSymbols < RuleName > ) =>
5852 seq ( 'export' , field ( 'declaration' , $ . assignment ) )
5953
@@ -95,7 +89,11 @@ export const instance = <RuleName extends string>(
9589
9690export const argument = < RuleName extends string > (
9791 $ : GrammarSymbols < RuleName > ,
98- ) => prec . left ( choice ( field ( 'placeholder' , '?' ) , field ( 'value' , $ . _element ) ) )
92+ ) =>
93+ prec . left (
94+ Prec . Argument ,
95+ choice ( field ( 'placeholder' , '?' ) , field ( 'value' , $ . _element ) ) ,
96+ )
9997
10098export const abstraction = < RuleName extends string > (
10199 $ : GrammarSymbols < RuleName > ,
@@ -112,19 +110,14 @@ export const abstraction = <RuleName extends string>(
112110export const application = < RuleName extends string > (
113111 $ : GrammarSymbols < RuleName > ,
114112) =>
115- prec (
113+ prec . left (
116114 Prec . Application ,
117- seq ( field ( 'name' , $ . _term ) , buildTuple ( $ , $ . argument , false , true ) ) ,
118- )
119-
120- export const prefix_application = < RuleName extends string > (
121- $ : GrammarSymbols < RuleName > ,
122- ) =>
123- prec . right (
124- Prec . PrefixApplication ,
125115 seq (
126- field ( 'name' , alias ( $ . _operator , $ . identifier ) ) ,
127- field ( 'value' , $ . _term ) ,
116+ field ( 'name' , $ . _term ) ,
117+ choice (
118+ prec ( Prec . Argument , buildTuple ( $ , $ . argument , false , true ) ) ,
119+ field ( 'element' , $ . _term ) ,
120+ ) ,
128121 ) ,
129122 )
130123
@@ -483,7 +476,10 @@ export const type_hint = <RuleName extends string>(
483476 )
484477
485478export const hole = < RuleName extends string > ( $ : GrammarSymbols < RuleName > ) =>
486- seq ( '?' , field ( 'name' , alias ( $ . identifier , $ . identifier_pattern_name ) ) )
479+ prec (
480+ Prec . Hole ,
481+ seq ( '?' , field ( 'name' , alias ( $ . identifier , $ . identifier_pattern_name ) ) ) ,
482+ )
487483
488484export const _identifier_without_operators = ( ) => IDENTIFIER
489485
@@ -494,4 +490,4 @@ export const identifier = <RuleName extends string>(
494490) => choice ( $ . _operator , $ . _identifier_without_operators )
495491
496492export const group = < RuleName extends string > ( $ : GrammarSymbols < RuleName > ) =>
497- seq ( '(' , field ( 'term' , $ . _term ) , ')' )
493+ prec ( Prec . Group , seq ( '(' , field ( 'term' , $ . _term ) , ')' ) )
0 commit comments