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

Method LastError

parser/scanner.go:410–426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

408}
409
410func (s *scanner) LastError() error {
411 if s.err == nil {
412 return nil
413 }
414 if s.err == io.ErrUnexpectedEOF && s.t.ID == text {
415 if s.collapseSpaceDepth > 0 {
416 return fmt.Errorf("missing endcollapsespace tag at %s", s.Context())
417 }
418 if s.stripSpaceDepth > 0 {
419 return fmt.Errorf("missing endstripspace tag at %s", s.Context())
420 }
421 return nil
422 }
423
424 return fmt.Errorf("error when reading %s at %s: %s",
425 tokenIDToStr(s.t.ID), s.Context(), s.err)
426}
427
428func (s *scanner) appendByte() {
429 s.t.Value = append(s.t.Value, s.c)

Callers 11

parseTemplateMethod · 0.80
parseFuncMethod · 0.80
parseForMethod · 0.80
parseDefaultMethod · 0.80
parseCaseMethod · 0.80
parseSwitchMethod · 0.80
parseIfMethod · 0.80
skipAfterTagMethod · 0.80
expectTokenFunction · 0.80
testScannerFailureFunction · 0.80
testScannerSuccessFunction · 0.80

Calls 2

ContextMethod · 0.95
tokenIDToStrFunction · 0.85

Tested by 2

testScannerFailureFunction · 0.64
testScannerSuccessFunction · 0.64