File gets the filename of the current token. If there is no token loaded, it returns the filename originally given when parsing started.
()
| 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. |
| 175 | func (d *Dispenser) File() string { |
| 176 | if d.cursor < 0 || d.cursor >= len(d.tokens) { |
| 177 | return d.filename |
| 178 | } |
| 179 | if tokenFilename := d.tokens[d.cursor].File; tokenFilename != "" { |
| 180 | return tokenFilename |
| 181 | } |
| 182 | return d.filename |
| 183 | } |
| 184 | |
| 185 | // Args is a convenience function that loads the next arguments |
| 186 | // (tokens on the same line) into an arbitrary number of strings |
no outgoing calls
no test coverage detected