mirror of
https://github.com/hi-language/transpiler.git
synced 2026-01-14 00:28:05 +00:00
Fix: Replace non-existent SEPERATED_LIST with pattern
This commit is contained in:
@@ -67,13 +67,25 @@ class HiParser extends CstParser {
|
|||||||
|
|
||||||
$.RULE('arrayLiteral', () => {
|
$.RULE('arrayLiteral', () => {
|
||||||
$.CONSUME(T.LBracket);
|
$.CONSUME(T.LBracket);
|
||||||
$.OPTION(() => $.SEPERATED_LIST($.expression, T.Comma));
|
$.OPTION(() => {
|
||||||
|
$.SUBRULE($.expression);
|
||||||
|
$.MANY(() => {
|
||||||
|
$.CONSUME(T.Comma);
|
||||||
|
$.SUBRULE2($.expression);
|
||||||
|
});
|
||||||
|
});
|
||||||
$.CONSUME(T.RBracket);
|
$.CONSUME(T.RBracket);
|
||||||
});
|
});
|
||||||
|
|
||||||
$.RULE('parameterList', () => {
|
$.RULE('parameterList', () => {
|
||||||
$.CONSUME(T.LParen);
|
$.CONSUME(T.LParen);
|
||||||
$.OPTION(() => $.SEPERATED_LIST(T.Identifier, T.Comma));
|
$.OPTION(() => {
|
||||||
|
$.CONSUME(T.Identifier);
|
||||||
|
$.MANY(() => {
|
||||||
|
$.CONSUME(T.Comma);
|
||||||
|
$.CONSUME2(T.Identifier);
|
||||||
|
});
|
||||||
|
});
|
||||||
$.CONSUME(T.RParen);
|
$.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.
|
// Binary Expressions are defined with a helper.
|
||||||
const buildBinaryExpressionRule = (name, higherPrecRule, operators) => {
|
const buildBinaryExpressionRule = (name, higherPrecRule, operators) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user