MCPcopy
hub / github.com/wavetermdev/waveterm / parseIdentifierColon

Method parseIdentifierColon

pkg/vdom/cssparser/cssparser.go:63–85  ·  view source on GitHub ↗
(lastProp string)

Source from the content-addressed store, hash-verified

61}
62
63func (p *Parser) parseIdentifierColon(lastProp string) (string, error) {
64 start := p.Pos
65 for !p.eof() {
66 c := p.peekChar()
67 if isIdentChar(c) || c == '-' {
68 p.advance()
69 } else {
70 break
71 }
72 }
73 attrName := p.Input[start:p.Pos]
74 p.skipWhitespace()
75 if p.eof() {
76 return "", fmt.Errorf("bad style attribute, expected colon after property %q, got EOF, at pos %d", attrName, p.Pos+1)
77 }
78 if attrName == "" {
79 return "", fmt.Errorf("bad style attribute, invalid property name after property %q, at pos %d", lastProp, p.Pos+1)
80 }
81 if !p.expectChar(':') {
82 return "", fmt.Errorf("bad style attribute, bad property name starting with %q, expected colon, got %q, at pos %d", attrName, string(p.Input[p.Pos]), p.Pos+1)
83 }
84 return attrName, nil
85}
86
87func (p *Parser) parseValue(propName string) (string, error) {
88 start := p.Pos

Callers 1

ParseMethod · 0.95

Calls 6

eofMethod · 0.95
peekCharMethod · 0.95
advanceMethod · 0.95
skipWhitespaceMethod · 0.95
expectCharMethod · 0.95
isIdentCharFunction · 0.85

Tested by

no test coverage detected