MCPcopy Create free account
hub / github.com/andybalholm/cascadia / parseSelectorGroup

Method parseSelectorGroup

parser.go:873–898  ·  view source on GitHub ↗

parseSelectorGroup parses a group of selectors, separated by commas.

()

Source from the content-addressed store, hash-verified

871
872// parseSelectorGroup parses a group of selectors, separated by commas.
873func (p *parser) parseSelectorGroup() (SelectorGroup, error) {
874 if p.depth > maxParseDepth {
875 return nil, fmt.Errorf("selector nesting too deep (max %d)", maxParseDepth)
876 }
877 p.depth++
878 defer func() { p.depth-- }()
879
880 current, err := p.parseSelector()
881 if err != nil {
882 return nil, err
883 }
884 result := SelectorGroup{current}
885
886 for p.i < len(p.s) {
887 if p.s[p.i] != ',' {
888 break
889 }
890 p.i++
891 c, err := p.parseSelector()
892 if err != nil {
893 return nil, err
894 }
895 result = append(result, c)
896 }
897 return result, nil
898}

Callers 3

ParseGroupFunction · 0.95

Calls 1

parseSelectorMethod · 0.95

Tested by

no test coverage detected