From 47c1a9a2804ebbc5acb83ab40ef75beb319f28e3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Feb 2021 13:01:02 +0200 Subject: fix(tazjin/rlox): Fix selection of next parser precedence rule Without this fix we would keep parsing in the same precedence level and get weird things like: 10 - -10 + 10 => 10 Change-Id: If2bed4569fbf566027011037165a9b3c09b7427c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2567 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/rlox/src/bytecode/compiler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'users/tazjin/rlox/src') diff --git a/users/tazjin/rlox/src/bytecode/compiler.rs b/users/tazjin/rlox/src/bytecode/compiler.rs index ca56bfe7cf50..4c6a99a181c6 100644 --- a/users/tazjin/rlox/src/bytecode/compiler.rs +++ b/users/tazjin/rlox/src/bytecode/compiler.rs @@ -166,7 +166,7 @@ impl> Compiler { // Compile the right operand let rule: ParseRule = rule_for(&operator); - self.parse_precedence(rule.precedence)?; + self.parse_precedence(rule.precedence.next())?; // Emit operator instruction match operator { -- cgit 1.4.1