Parser 2.0 (Major Delezer) #52
|
|
@ -123,7 +123,7 @@ export class Parser {
|
|||
|
||||
// check for parens function call
|
||||
// ex: (ref my-func) my-arg
|
||||
if (expr.type.is('ParenExpr') && !this.isExprEnd() && !this.is($T.Operator, '|'))
|
||||
if (expr.type.is('ParenExpr') && !this.isExprEnd())
|
||||
expr = this.functionCall(expr)
|
||||
|
||||
// if dotget is followed by binary operator, continue parsing as binary expression
|
||||
|
|
@ -588,7 +588,7 @@ export class Parser {
|
|||
const ident = fn ?? this.identifier()
|
||||
|
||||
const args: SyntaxNode[] = []
|
||||
while (!this.isExprEnd() && !this.is($T.Operator, '|'))
|
||||
while (!this.isExprEnd())
|
||||
args.push(this.is($T.NamedArgPrefix) ? this.namedArg() : this.arg())
|
||||
|
||||
const node = new SyntaxNode('FunctionCall', ident.from, (args.at(-1) || ident).to)
|
||||
|
|
@ -869,6 +869,7 @@ export class Parser {
|
|||
|
||||
isExprEnd(): boolean {
|
||||
return this.isAny($T.Colon, $T.Semicolon, $T.Newline, $T.CloseParen, $T.CloseBracket) ||
|
||||
this.is($T.Operator, '|') ||
|
||||
this.isExprEndKeyword() || !this.current()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user