Line gets the line number of the current token. If there is no token loaded, it returns 0.
()
| 249 | // Line gets the line number of the current token. |
| 250 | // If there is no token loaded, it returns 0. |
| 251 | func (d *Dispenser) Line() int { |
| 252 | if d.cursor < 0 || d.cursor >= len(d.tokens) { |
| 253 | return 0 |
| 254 | } |
| 255 | return d.tokens[d.cursor].Line |
| 256 | } |
| 257 | |
| 258 | // File gets the filename where the current token originated. |
| 259 | func (d *Dispenser) File() string { |