Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8229815: Upgrade Jline to 3.12.1
Backport-of: a9952bb
  • Loading branch information
Ekaterina Vergizova authored and Yuri Nesterenko committed Feb 12, 2021
1 parent 4273ff4 commit 8519133
Show file tree
Hide file tree
Showing 103 changed files with 1,380 additions and 620 deletions.
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.keymap;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.keymap;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,11 +4,12 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

import java.io.IOException;
import java.nio.file.Path;
import java.time.Instant;
import java.util.Iterator;
import java.util.ListIterator;
Expand Down Expand Up @@ -41,6 +42,26 @@ public interface History extends Iterable<History.Entry>
*/
void save() throws IOException;

/**
* Write history to the file. If incremental only the events that are new since the last incremental operation to
* the file are added.
* @throws IOException if a problem occurs
*/
void write(Path file, boolean incremental) throws IOException;

/**
* Append history to the file. If incremental only the events that are new since the last incremental operation to
* the file are added.
* @throws IOException if a problem occurs
*/
void append(Path file, boolean incremental) throws IOException;

/**
* Read history from the file. If incremental only the events that are not contained within the internal list are added.
* @throws IOException if a problem occurs
*/
void read(Path file, boolean incremental) throws IOException;

/**
* Purge history.
* @throws IOException if a problem occurs
Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down Expand Up @@ -95,7 +95,10 @@ public interface LineReader {
String CALLBACK_FINISH = "callback-finish";
String CALLBACK_KEYMAP = "callback-keymap";

String ACCEPT_AND_INFER_NEXT_HISTORY = "accept-and-infer-next-history";
String ACCEPT_AND_HOLD = "accept-and-hold";
String ACCEPT_LINE = "accept-line";
String ACCEPT_LINE_AND_DOWN_HISTORY = "accept-line-and-down-history";
String ARGUMENT_BASE = "argument-base";
String BACKWARD_CHAR = "backward-char";
String BACKWARD_DELETE_CHAR = "backward-delete-char";
Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down Expand Up @@ -85,7 +85,7 @@ public LineReaderBuilder highlighter(Highlighter highlighter) {
public LineReaderBuilder parser(Parser parser) {
if (parser != null) {
try {
if (!Boolean.parseBoolean(LineReader.PROP_SUPPORT_PARSEDLINE)
if (!Boolean.getBoolean(LineReader.PROP_SUPPORT_PARSEDLINE)
&& !(parser.parse("", 0) instanceof CompletingParsedLine)) {
Log.warn("The Parser of class " + parser.getClass().getName() + " does not support the CompletingParsedLine interface. " +
"Completion with escaped or quoted words won't work correctly.");
Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand All @@ -16,6 +16,10 @@ default ParsedLine parse(String line, int cursor) throws SyntaxError {
return parse(line, cursor, ParseContext.UNSPECIFIED);
}

default boolean isEscapeChar(char ch) {
return ch == '\\';
}

enum ParseContext {
UNSPECIFIED,

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader.impl;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader.impl;

Expand Down
Expand Up @@ -4,7 +4,7 @@
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader.impl;

Expand Down

1 comment on commit 8519133

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.