Backup moves the position pointer back by the length of the previous rune in the input string.
()
| 97 | // Backup moves the position pointer back by the length of the |
| 98 | // previous rune in the input string. |
| 99 | func (s *stringLexer) Backup() { |
| 100 | if s.done || s.pos <= 0 { |
| 101 | return |
| 102 | } |
| 103 | _, l := utf8.DecodeLastRuneInString(s.str[:s.pos]) |
| 104 | s.pos -= l |
| 105 | } |
| 106 | |
| 107 | // Peek returns the next rune in the input string without advancing |
| 108 | // the position pointer |
no outgoing calls
no test coverage detected