(tagName string)
| 209 | } |
| 210 | |
| 211 | func (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 | |
| 244 | func (s *scanner) scanToken() bool { |
| 245 | switch s.nextTokenID { |
no test coverage detected