(lastProp string)
| 61 | } |
| 62 | |
| 63 | func (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 | |
| 87 | func (p *Parser) parseValue(propName string) (string, error) { |
| 88 | start := p.Pos |
no test coverage detected