Reinforce sequence of variable symbols to not conflict with constructor symbols
Constructor symbols always being with ':', so to prevent conflicts with variable symbols, the variable symbol production requires a non ':' leading character for a variable symbol.
@@ -150,7 +150,13 @@ module.exports = grammar({
_parenthesized_variable_symbol: $ => seq(
'(',
- repeat1(choice($.variable_symbol, $._extra_variable_symbol)),
+ seq(
+ $.variable_symbol,
+ repeat(choice($.variable_symbol, $._extra_variable_symbol))
+ ),
+ ')'
+ ),
+
_parenthesized_constructor_symbol: $ => seq(
'(',
$.constructor_symbol,
@@ -495,6 +501,9 @@ module.exports = grammar({
)
),
+ variable_symbol: $ => prec.right(seq(
+ $._variable_symbol,
+ repeat($._variable_symbol, $._extra_variable_symbol)
)),
constructor_symbol: $ => prec.right(seq(':', repeat($._constructor_symbol))),
