@Override public Validation<List<JSXValidationErrorType>, SExpressionListType> quotedString(final SExpressionQuotedStringType ex) throws UnreachableCodeException { final StringBuilder sb = new StringBuilder(128); sb.append("Expected a list but got a quoted string."); sb.append(System.lineSeparator()); sb.append(" Expected: A list"); sb.append(System.lineSeparator()); sb.append(" Received: A quoted string \""); sb.append(ex); sb.append("\""); sb.append(System.lineSeparator()); return Validation.invalid(List.of( JSXValidationError.of(ex.lexical(), sb.toString()))); }
@Override public Validation<List<JSXValidationErrorType>, SExpressionSymbolType> quotedString(final SExpressionQuotedStringType ex) throws UnreachableCodeException { final StringBuilder sb = new StringBuilder(128); sb.append("Expected a symbol but got a quoted string."); sb.append(System.lineSeparator()); sb.append(" Expected: A symbol"); sb.append(System.lineSeparator()); sb.append(" Received: A quoted string \""); sb.append(ex); sb.append("\""); sb.append(System.lineSeparator()); return Validation.invalid( List.of(JSXValidationError.of(ex.lexical(), sb.toString()))); }
/** * @param e The expression * * @return A parser exception * * @see JPRAParseErrorCode#EXPECTED_LIST_GOT_QUOTED_STRING */ public static JPRACompilerParseException expectedListGotQuotedString( final SExpressionQuotedStringType e) { final StringBuilder mb = new StringBuilder(256); mb.append(" Expected: A list"); mb.append(System.lineSeparator()); mb.append(" Got: A quoted string '"); mb.append(e.text()); mb.append("'"); final String m = NullCheck.notNull(mb.toString(), "Message"); return new JPRACompilerParseException( e.lexical().map(LexicalPosition::copyOf), JPRAParseErrorCode.EXPECTED_LIST_GOT_QUOTED_STRING, m); }
/** * @param e The expression * * @return A parser exception * * @see JPRAParseErrorCode#EXPECTED_SYMBOL_GOT_QUOTED_STRING */ public static JPRACompilerParseException expectedSymbolGotQuotedString( final SExpressionQuotedStringType e) { final StringBuilder mb = new StringBuilder(256); mb.append(" Expected: A symbol"); mb.append(System.lineSeparator()); mb.append(" Got: A quoted string '"); mb.append(e.text()); mb.append("'"); final String m = NullCheck.notNull(mb.toString(), "Message"); return new JPRACompilerParseException( e.lexical().map(LexicalPosition::copyOf), JPRAParseErrorCode.EXPECTED_SYMBOL_GOT_QUOTED_STRING, m); }
/** * @param e The expression * * @return A parser exception * * @see JPRAParseErrorCode#EXPECTED_SYMBOL_OR_LIST_GOT_QUOTED_STRING */ public static JPRACompilerParseException expectedSymbolOrListGotQuotedString( final SExpressionQuotedStringType e) { final StringBuilder mb = new StringBuilder(256); mb.append(" Expected: A list or a symbol"); mb.append(System.lineSeparator()); mb.append(" Got: A quoted string '"); mb.append(e.text()); mb.append("'"); final String m = NullCheck.notNull(mb.toString(), "Message"); return new JPRACompilerParseException( e.lexical().map(LexicalPosition::copyOf), JPRAParseErrorCode.EXPECTED_SYMBOL_OR_LIST_GOT_QUOTED_STRING, m); }
JSXValidationError.of(s.lexical(), sb.toString()))); });
JSXValidationError.of(s.lexical(), sb.toString()))); });