if (syntaxErrorState instanceof SyntaxErrorState) { SyntaxErrorState errorState = (SyntaxErrorState) syntaxErrorState; String[] expectedValues = errorState.expected(); String found = errorState.found(); if (found != null) { buffer.append(JRubyParser.found).append(" ").append(reformatValue(found)).append("; "); }
if (found != null) { buffer.append(JRubyParser.found).append(" ").append(reformatValue(found)).append("; ");
    private String formatErrorMessage(String message, Object syntaxErrorState) {        if (message.equals("syntax error")) {            message = "";        } else {            message += ": ";        }        StringBuffer buffer = new StringBuffer(message);        if (syntaxErrorState instanceof SyntaxErrorState) {            SyntaxErrorState errorState = (SyntaxErrorState) syntaxErrorState;            String[] expectedValues = errorState.expected();            String found = errorState.found();            if (found != null) {                buffer.append(JRubyParser.found).append(" ").append(reformatValue(found)).append("; ");            }            buffer.append(expected).append(" ");            if (expectedValues.length == 0) {                buffer.append(nothing);            } else {                for (String value : expectedValues) {                    value = reformatValue(value);                    buffer.append(value).append(", ");                }            }        }        return buffer.toString();    }