SyntaxErr creates a generic syntax error which explains what was found and what was expected.
(expected string)
| 232 | // SyntaxErr creates a generic syntax error which explains what was |
| 233 | // found and what was expected. |
| 234 | func (d *Dispenser) SyntaxErr(expected string) error { |
| 235 | msg := fmt.Sprintf("%s:%d - Syntax error: Unexpected token '%s', expecting '%s'", d.File(), d.Line(), d.Val(), expected) |
| 236 | return errors.New(msg) |
| 237 | } |
| 238 | |
| 239 | // EOFErr returns an error indicating that the dispenser reached |
| 240 | // the end of the input when searching for the next token. |