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

Method parseClassSelector

parser.go:335–350  ·  view source on GitHub ↗

parseClassSelector parses a selector that matches by class attribute.

()

Source from the content-addressed store, hash-verified

333
334// parseClassSelector parses a selector that matches by class attribute.
335func (p *parser) parseClassSelector() (classSelector, error) {
336 if p.i >= len(p.s) {
337 return classSelector{}, fmt.Errorf("expected class selector (.class), found EOF instead")
338 }
339 if p.s[p.i] != '.' {
340 return classSelector{}, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i])
341 }
342
343 p.i++
344 class, err := p.parseIdentifier()
345 if err != nil {
346 return classSelector{}, err
347 }
348
349 return classSelector{class: class}, nil
350}
351
352// parseAttributeSelector parses a selector that matches by attribute value.
353func (p *parser) parseAttributeSelector() (attrSelector, error) {

Callers 1

Calls 1

parseIdentifierMethod · 0.95

Tested by

no test coverage detected