fail method
Implementation
ParseError fail({Token? tok, String? expected, String? message}) {
tok ??= token;
if (message == null) {
if (expected != null) {
message = "Expected $expected but found $tok";
} else {
message = "Unexpected token $tok";
}
}
throw ParseError(
message, filename, tok!.line, tok.startOffset, tok.endOffset);
}