MCPcopy Index your code
hub / github.com/expr-lang/expr / parseArguments

Method parseArguments

parser/parser.go:647–666  ·  view source on GitHub ↗
(arguments []Node)

Source from the content-addressed store, hash-verified

645}
646
647func (p *Parser) parseArguments(arguments []Node) []Node {
648 // If pipe operator is used, the first argument is the left-hand side
649 // of the operator, so we do not parse it as an argument inside brackets.
650 offset := len(arguments)
651
652 p.expect(Bracket, "(")
653 for !p.current.Is(Bracket, ")") && p.err == nil {
654 if len(arguments) > offset {
655 p.expect(Operator, ",")
656 }
657 if p.current.Is(Bracket, ")") {
658 break
659 }
660 node := p.parseExpression(0)
661 arguments = append(arguments, node)
662 }
663 p.expect(Bracket, ")")
664
665 return arguments
666}
667
668func (p *Parser) parsePredicate() Node {
669 startToken := p.current

Callers 2

parseCallMethod · 0.95

Calls 3

expectMethod · 0.95
parseExpressionMethod · 0.95
IsMethod · 0.80

Tested by

no test coverage detected