Next returns the next rune while advancing the scanner. Returns false if there are no more runes.
()
| 45 | |
| 46 | // Next returns the next rune while advancing the scanner. Returns false if there are no more runes. |
| 47 | func (scanner *Scanner) Next() (rune, bool) { |
| 48 | if scanner.sourceIdx+1 >= len(scanner.source) { |
| 49 | return 0, false |
| 50 | } |
| 51 | scanner.sourceIdx++ |
| 52 | return scanner.source[scanner.sourceIdx], true |
| 53 | } |
| 54 | |
| 55 | // Peek returns the next rune. Does not advance the scanner. Returns false if there are no more runes. |
| 56 | func (scanner *Scanner) Peek() (rune, bool) { |
no outgoing calls