Fix: Replace non-existent SEPERATED_LIST with pattern

This commit is contained in:
2025-09-26 08:41:03 -07:00
parent d17d098e24
commit 6e51b569da

View File

@@ -67,13 +67,25 @@ class HiParser extends CstParser {
$.RULE('arrayLiteral', () => {
$.CONSUME(T.LBracket);
$.OPTION(() => $.SEPERATED_LIST($.expression, T.Comma));
$.OPTION(() => {
$.SUBRULE($.expression);
$.MANY(() => {
$.CONSUME(T.Comma);
$.SUBRULE2($.expression);
});
});
$.CONSUME(T.RBracket);
});
$.RULE('parameterList', () => {
$.CONSUME(T.LParen);
$.OPTION(() => $.SEPERATED_LIST(T.Identifier, T.Comma));
$.OPTION(() => {
$.CONSUME(T.Identifier);
$.MANY(() => {
$.CONSUME(T.Comma);
$.CONSUME2(T.Identifier);
});
});
$.CONSUME(T.RParen);
});
@@ -114,7 +126,13 @@ class HiParser extends CstParser {
});
});
$.RULE('argumentList', () => $.SEPERATED_LIST($.expression, T.Comma));
$.RULE('argumentList', () => {
$.SUBRULE($.expression);
$.MANY(() => {
$.CONSUME(T.Comma);
$.SUBRULE2($.expression);
});
});
// Binary Expressions are defined with a helper.
const buildBinaryExpressionRule = (name, higherPrecRule, operators) => {