@ -65,16 +65,11 @@ module.exports = grammar({
conflicts : $ => [
[ $ . tuple _type , $ . parameter _types ] ,
[ $ . binding , $ . _simple _expression ] ,
[ $ . binding , $ . ascription _expression ] ,
[ $ . binding , $ . _type _identifier ] ,
[ $ . if _expression , $ . expression ] ,
[ $ . while _expression , $ . _simple _expression ] ,
[ $ . for _expression , $ . infix _expression ] ,
[ $ . _indentable _expression , $ . do _while _expression ] ,
[ $ . if _expression ] ,
[ $ . match _expression ] ,
[ $ . _function _constructor , $ . _type _identifier ] ,
[ $ . _type _identifier , $ . identifier ] ,
[ $ . instance _expression ] ,
// In case of: 'extension' _indent '{' 'case' operator_identifier 'if' operator_identifier • '=>' …
// we treat `operator_identifier` as `simple_expression`
@ -91,7 +86,10 @@ module.exports = grammar({
[ $ . _full _enum _def ] ,
// _start_val identifier ',' identifier • ':' …
[ $ . identifiers , $ . val _declaration ] ,
// 'enum' operator_identifier _automatic_semicolon '(' ')' • ':' …
[ $ . class _parameters ] ,
// 'for' operator_identifier ':' _annotated_type • ':' …
[ $ . _type , $ . compound _type ]
] ,
word : $ => $ . _alpha _identifier ,
@ -375,19 +373,19 @@ module.exports = grammar({
* /
template _body : $ =>
choice (
prec. left ( PREC . control , $. _indented _template _body ) ,
prec. left ( PREC . control , $. _braced _template _body ) ,
$. _indented _template _body ,
$. _braced _template _body ,
) ,
_indented _template _body : $ =>
seq( ":" , $ . _indent , optional ( $ . self _type ) , $ . _block , $ . _outdent ) ,
prec. left ( PREC . control , seq( ":" , $ . _indent , optional ( $ . self _type ) , $ . _block , $ . _outdent ) ) ,
_braced _template _body : $ =>
seq(
prec. left ( PREC . control , seq(
"{" ,
optional ( choice ( $ . _braced _template _body1 , $ . _braced _template _body2 ) ) ,
"}" ,
) ,
) ) ,
_braced _template _body1 : $ => seq ( optional ( $ . self _type ) , $ . _block ) ,
_braced _template _body2 : $ =>
@ -812,7 +810,7 @@ module.exports = grammar({
repeat1 ( seq ( "with" , field ( "extra" , $ . _annotated _type ) ) ) ,
) ,
) ,
prec . left ( - 1 , seq ( field ( "base" , $ . _annotated _type ) , $ . _refinement ) ) ,
prec . left ( seq ( field ( "base" , $ . _annotated _type ) , $ . _refinement ) ) ,
prec . left (
- 1 ,
seq (