fail method

dynamic fail({
  1. Token? tok,
  2. String? expected,
  3. String? message,
})

Implementation

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