Next returns the current token and advances cursor to next one
()
| 92 | |
| 93 | // Next returns the current token and advances cursor to next one |
| 94 | func (m *LexTokenPager) Next() lex.Token { |
| 95 | m.lexNext() |
| 96 | m.cursor++ |
| 97 | if m.cursor+1 > len(m.tokens) { |
| 98 | //u.Warnf("Next() CRAP? increment cursor: %v of %v %v", m.cursor, len(m.tokens)) |
| 99 | return eoft |
| 100 | } |
| 101 | return m.tokens[m.cursor-1] |
| 102 | } |
| 103 | |
| 104 | // Returns the current token, does not advance |
| 105 | func (m *LexTokenPager) Cur() lex.Token { |