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

Method readTagName

parser/scanner.go:299–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297}
298
299func (s *scanner) readTagName() bool {
300 s.skipSpace()
301 s.t.init(tagName, s.line, s.pos())
302 for {
303 if s.isSpace() || s.c == '%' {
304 if s.c == '%' {
305 s.unreadByte('~')
306 }
307 s.nextTokenID = tagContents
308 return true
309 }
310 if (s.c >= 'a' && s.c <= 'z') || (s.c >= 'A' && s.c <= 'Z') || (s.c >= '0' && s.c <= '9') || s.c == '=' || s.c == '.' {
311 s.appendByte()
312 if !s.nextByte() {
313 return false
314 }
315 continue
316 }
317 if s.c == '-' {
318 s.unreadByte(s.c)
319 s.nextTokenID = tagContents
320 return true
321 }
322 s.err = fmt.Errorf("unexpected character: '%c'", s.c)
323 s.unreadByte('~')
324 return false
325 }
326}
327
328func (s *scanner) readTagContents() bool {
329 s.skipSpace()

Callers 2

skipUntilTagMethod · 0.95
scanTokenMethod · 0.95

Calls 7

skipSpaceMethod · 0.95
posMethod · 0.95
isSpaceMethod · 0.95
unreadByteMethod · 0.95
appendByteMethod · 0.95
nextByteMethod · 0.95
initMethod · 0.80

Tested by

no test coverage detected