scanDigits consumes a contiguous series of digits.
()
| 289 | |
| 290 | // scanDigits consumes a contiguous series of digits. |
| 291 | func (s *scanner) scanDigits() string { |
| 292 | var buf bytes.Buffer |
| 293 | for { |
| 294 | ch, _ := s.r.read() |
| 295 | if !isDigit(ch) { |
| 296 | s.r.unread() |
| 297 | break |
| 298 | } |
| 299 | _, _ = buf.WriteRune(ch) |
| 300 | } |
| 301 | return buf.String() |
| 302 | } |
| 303 | |
| 304 | // scanBareIdent reads bare identifier from a rune reader. |
| 305 | func scanBareIdent(r io.RuneScanner) string { |
no test coverage detected