/** * Report a syntax error using the given DiagnosticPosition object and * arguments, unless one was already reported at the same position. */ private void reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, String key, Object... args) { int pos = diagPos.getPreferredPosition(); if (pos > S.errPos() || pos == Position.NOPOS) { if (token.kind == EOF) { error(diagPos, "premature.eof"); } else { error(diagPos, key, args); } } S.errPos(pos); if (token.pos == errorPos) nextToken(); // guarantee progress errorPos = token.pos; }
/** * Report a syntax error using the given DiagnosticPosition object and * arguments, unless one was already reported at the same position. */ private void reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, String key, Object... args) { int pos = diagPos.getPreferredPosition(); if (pos > S.errPos() || pos == Position.NOPOS) { if (token.kind == EOF) { error(diagPos, "premature.eof"); } else { error(diagPos, key, args); } } S.errPos(pos); if (token.pos == errorPos) nextToken(); // guarantee progress errorPos = token.pos; }
/** * Report a syntax error at given position using the given * argument unless one was already reported at the same position. */ private void reportSyntaxError(int pos, String key, Object... arg) { if (pos > S.errPos() || pos == Position.NOPOS) { if (S.token() == EOF) log.error(pos, "premature.eof"); else log.error(pos, key, arg); } S.errPos(pos); if (S.pos() == errorPos) S.nextToken(); // guarantee progress errorPos = S.pos(); }
/** * Report a syntax error at given position using the given * argument unless one was already reported at the same position. */ private void reportSyntaxError(int pos, String key, Object... arg) { if (pos > S.errPos() || pos == Position.NOPOS) { if (S.token() == EOF) log.error(pos, "premature.eof"); else log.error(pos, key, arg); } S.errPos(pos); if (S.pos() == errorPos) S.nextToken(); // guarantee progress errorPos = S.pos(); }