parseCurrentToken runs the current token through the parsing routines until it is consumed.
()
| 2200 | // parseCurrentToken runs the current token through the parsing routines |
| 2201 | // until it is consumed. |
| 2202 | func (p *parser) parseCurrentToken() { |
| 2203 | if p.tok.Type == SelfClosingTagToken { |
| 2204 | p.hasSelfClosingToken = true |
| 2205 | p.tok.Type = StartTagToken |
| 2206 | } |
| 2207 | |
| 2208 | consumed := false |
| 2209 | for !consumed { |
| 2210 | if p.inForeignContent() { |
| 2211 | consumed = parseForeignContent(p) |
| 2212 | } else { |
| 2213 | consumed = p.im(p) |
| 2214 | } |
| 2215 | } |
| 2216 | |
| 2217 | if p.hasSelfClosingToken { |
| 2218 | // This is a parse error, but ignore it. |
| 2219 | p.hasSelfClosingToken = false |
| 2220 | } |
| 2221 | } |
| 2222 | |
| 2223 | func (p *parser) parse() (err error) { |
| 2224 | defer func() { |
no test coverage detected