static InvalidSyntaxRuntimeException unexpectedCharacterInvalidSyntaxRuntimeException(final String expectation, final char actual, final ThingWithPosition thingWithPosition) {
return new InvalidSyntaxRuntimeException(expectation, thingWithPosition) {
@Override
public InvalidSyntaxException asInvalidSyntaxException() {
final String message = expectation + (END_OF_STREAM == actual ? " but reached end of input." : " but got [" + actual + "].");
return new InvalidSyntaxException(message, thingWithPosition.getRow(), thingWithPosition.getColumn());
}
};
}