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

Method parseClassSelector

parser.go:311–326  ·  view source on GitHub ↗

parseClassSelector parses a selector that matches by class attribute.

()

Source from the content-addressed store, hash-verified

309
310// parseClassSelector parses a selector that matches by class attribute.
311func (p *parser) parseClassSelector() (Selector, error) {
312 if p.i >= len(p.s) {
313 return nil, fmt.Errorf("expected class selector (.class), found EOF instead")
314 }
315 if p.s[p.i] != '.' {
316 return nil, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i])
317 }
318
319 p.i++
320 class, err := p.parseIdentifier()
321 if err != nil {
322 return nil, err
323 }
324
325 return attributeIncludesSelector("class", class), nil
326}
327
328// parseAttributeSelector parses a selector that matches by attribute value.
329func (p *parser) parseAttributeSelector() (Selector, error) {

Callers 1

Calls 2

parseIdentifierMethod · 0.95

Tested by

no test coverage detected