Skip to content

Commit 2aaf9b9

Browse files
committed
style fix for antlr ErrorStrategy
1 parent aa15dab commit 2aaf9b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/PythonErrorStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ private static String getTokeLineText(Parser recognizer, Token token) {
8686
return token.getInputStream().getText(Interval.of(start, stop));
8787
}
8888

89-
private void handlePythonSyntaxError(Parser recognizer, RecognitionException e) {
89+
private static void handlePythonSyntaxError(Parser recognizer, RecognitionException e) {
9090
Token offendingToken = e.getOffendingToken();
9191
String lineText = getTokeLineText(recognizer, offendingToken);
9292
String errorMarker = new String(new char[offendingToken.getCharPositionInLine() + 1]).replace('\0', ' ') + "^";
9393
String pythonSyntaxErrorMessage = "\n" + LINE_PADDING + lineText + "\n" + LINE_PADDING + errorMarker;
9494

9595
RecognitionException re = e;
9696
// the error message in some cases is not set properly producing an annoying "null" in the
97-
// final message, we replace the error with a copy of itself but, no message
97+
// final message, we replace the error with a copy of itself and an empty message
9898
if (re.getMessage() == null) {
9999
re = new RecognitionException("", e.getRecognizer(), e.getInputStream(), (ParserRuleContext) e.getCtx());
100100
}

0 commit comments

Comments
 (0)