fix: don`t overlap "close"

This commit is contained in:
2025-12-26 01:03:06 -05:00
parent c2ec9127e8
commit fa44051dec
2 changed files with 24 additions and 23 deletions

View File

@@ -72,11 +72,11 @@ func ParseExpression(i *iterator.Iterator[tokenizer.Token]) (lambda.Expression,
args = append(args, arg)
}
close, closeErr := i.Next()
if closeErr != nil {
return nil, fmt.Errorf("could not parse call terminating parenthesis: %w", closeErr)
} else if close.Type != tokenizer.TokenCloseParen {
return nil, fmt.Errorf("expected call terminating parenthesis, got '%v' (column %v)", close.Value, close.Index)
closing, closingErr := i.Next()
if closingErr != nil {
return nil, fmt.Errorf("could not parse call terminating parenthesis: %w", closingErr)
} else if closing.Type != tokenizer.TokenCloseParen {
return nil, fmt.Errorf("expected call terminating parenthesis, got '%v' (column %v)", closing.Value, closing.Index)
}
// Construction.