@Override public ParsedLine parse(final String line, final int cursor, final ParseContext context) { final ParsedLine parsed = delegate.parse(line, cursor, context); if (context != ParseContext.ACCEPT_LINE) { return parsed; } final String bare = CommentStripper.strip(parsed.line()); if (bare.isEmpty()) { return parsed; } if (cliCmdPredicate.test(bare)) { return parsed; } if (!bare.endsWith(TERMINATION_CHAR)) { throw new EOFError(-1, -1, "Missing termination char", "termination char"); } return parsed; } }
@Override public ParsedLine parse(String line, int cursor, ParseContext context) { if (!line.trim().endsWith(EOF_CHARACTER) && context != ParseContext.COMPLETE) { throw new EOFError( -1, -1, "New line without EOF character.", NEW_LINE_PROMPT); } final ArgumentList parsedLine = (ArgumentList) super.parse(line, cursor, context); return new SqlArgumentList( parsedLine.line(), parsedLine.words(), parsedLine.wordIndex(), parsedLine.wordCursor(), parsedLine.cursor(), null, parsedLine.rawWordCursor(), parsedLine.rawWordLength()); }
throw new EOFError(-1, -1, "Escaped new line", getPaddedPrompt("newline")); throw new EOFError(-1, -1, "Missing closing quote", getPaddedPrompt(getQuoteWaitingPattern(line, quoteStart))); throw new EOFError(-1, -1, "Missing end of comment", getPaddedPrompt("*/")); throw new EOFError(-1, -1, "Round brackets balance fails", getPaddedPrompt( roundBracketsBalance[0] == 0 ? "extra ')'" : ")")); throw new EOFError(-1, -1, "Square brackets balance fails", getPaddedPrompt( squareBracketsBalance[0] == 0 ? "extra ']'" : "]")); && !isLineFinishedWithSemicolon( lastNonQuoteCommentIndex1, line)) { throw new EOFError(-1, -1, "Missing semicolon at the end", getPaddedPrompt("semicolon"));
throw new EOFError(-1, -1, "Escaped new line", getPaddedPrompt("newline")); throw new EOFError(-1, -1, "Missing closing quote", getPaddedPrompt(getQuoteWaitingPattern(line, quoteStart))); throw new EOFError(-1, -1, "Missing end of comment", getPaddedPrompt("*/")); throw new EOFError(-1, -1, "Round brackets balance fails", getPaddedPrompt( roundBracketsBalance[0] == 0 ? "extra ')'" : ")")); throw new EOFError(-1, -1, "Square brackets balance fails", getPaddedPrompt( squareBracketsBalance[0] == 0 ? "extra ']'" : "]")); && !isLineFinishedWithSemicolon( lastNonQuoteCommentIndex1, line)) { throw new EOFError(-1, -1, "Missing semicolon at the end", getPaddedPrompt("semicolon"));
public ParsedLine parse(String line, int cursor, ParseContext context) throws org.jline.reader.SyntaxError { try { return doParse(line, cursor, context); } catch (EOFError e) { throw new org.jline.reader.EOFError(e.line(), e.column(), e.getMessage(), e.missing()); } catch (SyntaxError e) { throw new org.jline.reader.SyntaxError(e.line(), e.column(), e.getMessage()); } }
@Override public ParsedLine parse(String line, int cursor, ParseContext parseContext) throws SyntaxError { try { return doParse(line, cursor, parseContext); } catch (EOFError e) { throw new org.jline.reader.EOFError(e.line(), e.column(), e.getMessage(), e.missing()); } catch (SyntaxError e) { throw new org.jline.reader.SyntaxError(e.line(), e.column(), e.getMessage()); } }
@Override public ParsedLine parse(String line, int cursor, ParseContext parseContext) throws SyntaxError { try { return doParse(line, cursor, parseContext); } catch (EOFError e) { throw new org.jline.reader.EOFError(e.line(), e.column(), e.getMessage(), e.missing()); } catch (SyntaxError e) { throw new org.jline.reader.SyntaxError(e.line(), e.column(), e.getMessage()); } }