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

Method skipUntilTag

parser/scanner.go:211–242  ·  view source on GitHub ↗
(tagName string)

Source from the content-addressed store, hash-verified

209}
210
211func (s *scanner) skipUntilTag(tagName string) bool {
212 ok := false
213 for {
214 if !s.nextByte() {
215 break
216 }
217 if s.c != '{' {
218 continue
219 }
220 if !s.nextByte() {
221 break
222 }
223 if s.c != '%' {
224 s.unreadByte('~')
225 continue
226 }
227 ok = s.readTagName()
228 s.nextTokenID = text
229 if !ok {
230 s.err = nil
231 continue
232 }
233 if string(s.t.Value) == tagName {
234 ok = s.readTagContents()
235 break
236 }
237 }
238 if !ok {
239 s.err = fmt.Errorf("cannot find %q tag: %s", tagName, s.err)
240 }
241 return ok
242}
243
244func (s *scanner) scanToken() bool {
245 switch s.nextTokenID {

Callers 2

readPlainMethod · 0.95
skipCommentMethod · 0.95

Calls 4

nextByteMethod · 0.95
unreadByteMethod · 0.95
readTagNameMethod · 0.95
readTagContentsMethod · 0.95

Tested by

no test coverage detected