MCPcopy
hub / github.com/valyala/quicktemplate / emitText

Method emitText

parser/parser.go:770–781  ·  view source on GitHub ↗
(text []byte)

Source from the content-addressed store, hash-verified

768}
769
770func (p *parser) emitText(text []byte) {
771 for len(text) > 0 {
772 n := bytes.IndexByte(text, '`')
773 if n < 0 {
774 p.Printf("qw%s.N().S(`%s`)", mangleSuffix, text)
775 return
776 }
777 p.Printf("qw%s.N().S(`%s`)", mangleSuffix, text[:n])
778 p.Printf("qw%s.N().S(\"`\")", mangleSuffix)
779 text = text[n+1:]
780 }
781}
782
783func (p *parser) emitFuncStart(f *funcType) {
784 p.Printf("func %s {", f.DefStream("qw"+mangleSuffix))

Callers 7

parseFuncMethod · 0.95
parseForMethod · 0.95
parseDefaultMethod · 0.95
parseCaseMethod · 0.95
parseCatMethod · 0.95
parseSwitchMethod · 0.95
parseIfMethod · 0.95

Calls 1

PrintfMethod · 0.95

Tested by

no test coverage detected