From cea3e47938322b97c318dea38dc0d649e196dc1b Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 16 Aug 2022 23:03:27 -0400 Subject: Refactor to add backtracking support This probably doesn't help w/ error messages, but it enables some cool ideas where syntax can be reused in cases where it would otherwise be invalid --- JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java') diff --git a/JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java b/JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java index da587c1..ff370d0 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/impls/PostfixCommand.java @@ -2,6 +2,7 @@ package bjc.pratt.commands.impls; import bjc.pratt.ParserContext; import bjc.pratt.commands.BinaryPostCommand; +import bjc.pratt.commands.CommandResult; import bjc.pratt.tokens.Token; import bjc.data.Tree; import bjc.data.SimpleTree; @@ -33,8 +34,8 @@ public class PostfixCommand extends BinaryPostCommand { } @Override - public Tree> denote(final Tree> operand, final Token operator, + public CommandResult denote(final Tree> operand, final Token operator, final ParserContext ctx) throws ParserException { - return new SimpleTree<>(operator, operand); + return CommandResult.success(new SimpleTree<>(operator, operand)); } } \ No newline at end of file -- cgit v1.2.3