Skip to content

Commit

Permalink
skip extra whitespace in execution, respect quotes in greedy strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Sep 22, 2024
1 parent 891cb88 commit 420d747
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private boolean tryParse(
MutableExecutionContext<A> context
) {
if (input.hasRemaining() && input.peek() == ' ')
input.moveForward();
input.skipWhitespace();
int pos = input.position();
if (node instanceof LiteralNodeImpl<A> l) {
String value = input.readUnquotedString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public boolean tryParse() {
while (input.hasRemaining()) {
int start = input.position();
if (input.peek() == ' ')
input.moveForward();
input.skipWhitespace();
String next = input.peekUnquotedString();
if (next.startsWith(LONG_FORMAT_PREFIX)) {
String flagName = next.substring(LONG_FORMAT_PREFIX.length());
Expand Down Expand Up @@ -113,7 +113,7 @@ private void parseNext(MutableExecutionContext<A> context, ParameterNode<A, Obje
} else {
if (input.hasFinished() || input.peek() != ' ')
throw new InputParseException(InputParseException.Cause.EXPECTED_WHITESPACE);
input.moveForward();
input.skipWhitespace();
parseFlag(context, parameter, input);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private List<Object> parseList(@NotNull MutableStringStream input, @NotNull Exec
elements.add(el);
if (input.hasRemaining()) {
if (input.peek() == delimiter)
input.moveForward();
input.skipWhitespace();
else
throw new InputParseException(InputParseException.Cause.EXPECTED_WHITESPACE);
}
Expand Down

0 comments on commit 420d747

Please sign in to comment.