MCPcopy
hub / github.com/golang/net / parse

Method parse

html/parse.go:2223–2246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2221}
2222
2223func (p *parser) parse() (err error) {
2224 defer func() {
2225 if panicErr := recover(); panicErr != nil {
2226 err = fmt.Errorf("%s", panicErr)
2227 }
2228 }()
2229 // Iterate until EOF. Any other error will cause an early return.
2230 for err != io.EOF {
2231 // CDATA sections are allowed only in foreign content.
2232 n := p.oe.top()
2233 p.tokenizer.AllowCDATA(n != nil && n.Namespace != "")
2234 // Read and parse the next token.
2235 p.tokenizer.Next()
2236 p.tok = p.tokenizer.Token()
2237 if p.tok.Type == ErrorToken {
2238 err = p.tokenizer.Err()
2239 if err != nil && err != io.EOF {
2240 return err
2241 }
2242 }
2243 p.parseCurrentToken()
2244 }
2245 return nil
2246}
2247
2248// Parse returns the parse tree for the HTML from the given Reader.
2249//

Callers 8

ParseWithOptionsFunction · 0.95
ParseFragmentWithOptionsFunction · 0.95
genianaFunction · 0.80
ParseMethod · 0.80
mainFunction · 0.80
genianaFunction · 0.80
ParseMethod · 0.80
ParseRIBFunction · 0.80

Calls 7

parseCurrentTokenMethod · 0.95
AllowCDATAMethod · 0.80
ErrorfMethod · 0.65
topMethod · 0.45
NextMethod · 0.45
TokenMethod · 0.45
ErrMethod · 0.45

Tested by

no test coverage detected