Don't remove from queue on failure in quoted string parser

This commit is contained in:
Jason Penilla 2021-12-15 19:56:24 -08:00 committed by Jason
parent 484c97ca98
commit 18fc685c70

View file

@ -360,11 +360,13 @@ public final class StringArgument<C> extends CommandArgument<C, String> {
inputQueue.remove();
}
} else {
inner = inputQueue.remove();
inner = inputQueue.peek();
if (inner.startsWith("\"") || inner.startsWith("'")) {
return ArgumentParseResult.failure(new StringParseException(sj.toString(),
StringMode.QUOTED, commandContext
));
} else {
inputQueue.remove();
}
}