MCPcopy Create free account
hub / github.com/brimdata/super / incChoiceAltCnt

Method incChoiceAltCnt

compiler/parser/parser.go:25494–25507  ·  view source on GitHub ↗
(ch *choiceExpr, altI int)

Source from the content-addressed store, hash-verified

25492}
25493
25494func (p *parser) incChoiceAltCnt(ch *choiceExpr, altI int) {
25495 choiceIdent := fmt.Sprintf("%s %d:%d", p.rstack[len(p.rstack)-1].name, ch.pos.line, ch.pos.col)
25496 m := p.ChoiceAltCnt[choiceIdent]
25497 if m == nil {
25498 m = make(map[string]int)
25499 p.ChoiceAltCnt[choiceIdent] = m
25500 }
25501 // We increment altI by 1, so the keys do not start at 0
25502 alt := strconv.Itoa(altI + 1)
25503 if altI == choiceNoMatch {
25504 alt = p.choiceNoMatch
25505 }
25506 m[alt]++
25507}
25508
25509func (p *parser) parseChoiceExpr(ch *choiceExpr) (any, bool) {
25510 if p.debug {

Callers 1

parseChoiceExprMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected