@Override protected void reportError(SourcePosition location, String message) { // In normal usage, only the first parse error should be reported, but // sometimes it is useful to keep going. if (reportAllErrors || !errorSeen) { errorSeen = true; this.reporter.error( message, location.source.name, location.line + 1, location.column); } }
@Override public void reportWarning(SourcePosition location, String message) { this.reporter.warning( message, location.source.name, location.line + 1, location.column); } }
private void replay(AbstractCompiler compiler, ParseResult result) { ErrorReporter reporter = compiler.getDefaultErrorReporter(); for (RhinoError error : result.errors) { reporter.error(error.message, error.sourceName, error.line, error.lineOffset); } for (RhinoError warning : result.warnings) { reporter.warning(warning.message, warning.sourceName, warning.line, warning.lineOffset); } }
private void replay(AbstractCompiler compiler, ParseResult result) { ErrorReporter reporter = compiler.getDefaultErrorReporter(); for (RhinoError error : result.errors) { reporter.error(error.message, error.sourceName, error.line, error.lineOffset); } for (RhinoError warning : result.warnings) { reporter.warning(warning.message, warning.sourceName, warning.line, warning.lineOffset); } }
@Override public void reportError(SourcePosition location, String message) { // In normal usage, only the first parse error should be reported, but // sometimes it is useful to keep going. if (reportAllErrors || !errorSeen) { errorSeen = true; this.reporter.error( message, location.source.name, location.line + 1, location.column); } }
@Override protected void reportWarning(SourcePosition location, String message) { this.reporter.warning( message, location.source.name, location.line + 1, location.column); } }
@Override public void error(String message, String sourceName, int line, int lineOffset) { errors.add(new RhinoError(message, sourceName, line, lineOffset)); delegateReporter.error(message, sourceName, line, lineOffset); } }
void warning(ErrorReporter reporter, String message) { reporter.warning(message, sourceName, lineno, charno); }
v = (v * 8) + octaldigit(digit); } else { errorReporter.error(INVALID_OCTAL_DIGIT, sourceName, lineno(location.start), charno(location.start)); return 0; errorReporter.error(INVALID_ES5_STRICT_OCTAL, sourceName, lineno(location.start), charno(location.start)); } else { errorReporter.warning(INVALID_ES5_STRICT_OCTAL, sourceName, lineno(location.start), charno(location.start)); errorReporter.error(INVALID_OCTAL_DIGIT, sourceName, lineno(location.start), charno(location.start)); return 0;
@Override public void error(String message, String sourceName, int line, int lineOffset) { errors.add(new RhinoError(message, sourceName, line, lineOffset)); delegateReporter.error(message, sourceName, line, lineOffset); } }
void warning(ErrorReporter reporter, String message) { reporter.warning(message, sourceName, lineno, charno); }
features = features.require(Feature.STRING_CONTINUATION); if (isEs5OrBetterMode()) { errorReporter.warning(STRING_CONTINUATION_WARNING, sourceName, lineno(token.location.start), charno(token.location.start)); } else { errorReporter.error(STRING_CONTINUATION_ERROR, sourceName, lineno(token.location.start), charno(token.location.start)); errorReporter.warning(OCTAL_STRING_LITERAL_WARNING, sourceName, lineno(token.location.start), charno(token.location.start));
void recordTypeSyntax(SourceRange location) { if (hasJsDocTypeAnnotations) { errorReporter.error("Can only have JSDoc or inline type annotations, not both", sourceName, lineno(location.start), charno(location.start)); } }
@Override public void warning(String message, String sourceName, int line, int lineOffset) { warnings.add(new RhinoError(message, sourceName, line, lineOffset)); delegateReporter.warning(message, sourceName, line, lineOffset); }
features = features.require(Feature.BINARY_LITERALS); if (!isEs6Mode()) { errorReporter.warning(BINARY_NUMBER_LITERAL_WARNING, sourceName, lineno(token.location.start), charno(token.location.start)); features = features.require(Feature.OCTAL_LITERALS); if (!isEs6Mode()) { errorReporter.warning(OCTAL_NUMBER_LITERAL_WARNING, sourceName, lineno(token.location.start), charno(token.location.start)); v = (v * 8) + octaldigit(digit); } else { errorReporter.error(INVALID_OCTAL_DIGIT, sourceName, lineno(location.start), charno(location.start)); return 0; errorReporter.warning(INVALID_ES5_STRICT_OCTAL, sourceName, lineno(location.start), charno(location.start)); return v; } else { errorReporter.warning(INVALID_ES5_STRICT_OCTAL, sourceName, lineno(location.start), charno(location.start)); return Double.valueOf(value); errorReporter.error(INVALID_OCTAL_DIGIT, sourceName, lineno(location.start), charno(location.start));
Node processIllegalToken(ParseTree node) { errorReporter.error( "Unsupported syntax: " + node.type, sourceName, lineno(node), 0); return newNode(Token.EMPTY); }
@Override public void warning(String message, String sourceName, int line, int lineOffset) { warnings.add(new RhinoError(message, sourceName, line, lineOffset)); delegateReporter.warning(message, sourceName, line, lineOffset); }
Node processIllegalToken(ParseTree node) { errorReporter.error( "Unsupported syntax: " + node.type, sourceName, lineno(node), 0); return newNode(Token.EMPTY); }
private void addMissingTypeWarning(int lineno, int charno) { errorReporter.warning("Missing type declaration.", getSourceName(), lineno, charno); }