Line gets the line number of the current token. If there is no token loaded, it returns 0.
()
| 164 | // Line gets the line number of the current token. If there is no token |
| 165 | // loaded, it returns 0. |
| 166 | func (d *Dispenser) Line() int { |
| 167 | if d.cursor < 0 || d.cursor >= len(d.tokens) { |
| 168 | return 0 |
| 169 | } |
| 170 | return d.tokens[d.cursor].Line |
| 171 | } |
| 172 | |
| 173 | // File gets the filename of the current token. If there is no token loaded, |
| 174 | // it returns the filename originally given when parsing started. |