MCPcopy Create free account
hub / github.com/antchfx/xpath / parseUnionExpr

Method parseUnionExpr

parse.go:316–329  ·  view source on GitHub ↗

UnionExpr ::= PathExpr | UnionExpr '|' PathExpr

(n node)

Source from the content-addressed store, hash-verified

314
315// UnionExpr ::= PathExpr | UnionExpr '|' PathExpr
316func (p *parser) parseUnionExpr(n node) node {
317 opnd := p.parsePathExpr(n)
318Loop:
319 for {
320 if p.r.typ != itemUnion {
321 break Loop
322 }
323 p.next()
324 opnd2 := p.parsePathExpr(n)
325 // Checking the node type that must be is node set type?
326 opnd = newOperatorNode("|", opnd, opnd2)
327 }
328 return opnd
329}
330
331// PathExpr ::= LocationPath | FilterExpr | FilterExpr '/' RelativeLocationPath | FilterExpr '//' RelativeLocationPath
332func (p *parser) parsePathExpr(n node) node {

Callers 1

parseUnaryExprMethod · 0.95

Calls 3

parsePathExprMethod · 0.95
nextMethod · 0.95
newOperatorNodeFunction · 0.85

Tested by

no test coverage detected