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

Method readTagContents

parser/scanner.go:328–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326}
327
328func (s *scanner) readTagContents() bool {
329 s.skipSpace()
330 s.t.init(tagContents, s.line, s.pos())
331 for {
332 if s.c != '%' {
333 s.appendByte()
334 if !s.nextByte() {
335 return false
336 }
337 continue
338 }
339 if !s.nextByte() {
340 s.appendByte()
341 return false
342 }
343 if s.c == '}' {
344 if bytes.HasSuffix(s.t.Value, []byte("-")) {
345 s.t.Value = s.t.Value[:len(s.t.Value)-1]
346 s.stripToNewLine = true
347 }
348 s.nextTokenID = text
349 s.t.Value = stripTrailingSpace(s.t.Value)
350 return true
351 }
352 s.unreadByte('%')
353 s.appendByte()
354 if !s.nextByte() {
355 return false
356 }
357 }
358}
359
360func (s *scanner) skipSpace() {
361 for s.nextByte() && s.isSpace() {

Callers 5

NextMethod · 0.95
readPlainMethod · 0.95
skipCommentMethod · 0.95
skipUntilTagMethod · 0.95
scanTokenMethod · 0.95

Calls 7

skipSpaceMethod · 0.95
posMethod · 0.95
appendByteMethod · 0.95
nextByteMethod · 0.95
unreadByteMethod · 0.95
stripTrailingSpaceFunction · 0.85
initMethod · 0.80

Tested by

no test coverage detected