parseSelectorGroup parses a group of selectors, separated by commas.
()
| 871 | |
| 872 | // parseSelectorGroup parses a group of selectors, separated by commas. |
| 873 | func (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 | } |
no test coverage detected