LA implements (antlr.CharStream).LA.
(offset int)
| 36 | |
| 37 | // LA implements (antlr.CharStream).LA. |
| 38 | func (c *charStream) LA(offset int) int { |
| 39 | if offset == 0 { |
| 40 | return 0 |
| 41 | } |
| 42 | if offset < 0 { |
| 43 | offset++ |
| 44 | } |
| 45 | pos := c.pos + offset - 1 |
| 46 | if pos < 0 || pos >= c.buf.Len() { |
| 47 | return antlr.TokenEOF |
| 48 | } |
| 49 | return int(c.buf.Get(pos)) |
| 50 | } |
| 51 | |
| 52 | // LT mimics (*antlr.InputStream).LT. |
| 53 | func (c *charStream) LT(offset int) int { |
no test coverage detected