From fb4e394b36d971691feedc2d371906546ac3554e Mon Sep 17 00:00:00 2001 From: Robin Jadoul Date: Sun, 22 Jan 2017 15:37:47 +0100 Subject: [PATCH] Precedence fix --- include/Parsodus/lrtables/generator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Parsodus/lrtables/generator.h b/include/Parsodus/lrtables/generator.h index 5fb0cd4..576e03f 100644 --- a/include/Parsodus/lrtables/generator.h +++ b/include/Parsodus/lrtables/generator.h @@ -140,7 +140,7 @@ LRTable Generator::generate() { if (leftPrec.first > rightTokenIt->second.first) { // Keep the shift handled = true; - } else if (leftPrec.first > rightTokenIt->second.first) { + } else if (leftPrec.first < rightTokenIt->second.first) { // replace with a reduce table.act[curIdx][term] = {Action::REDUCE, rule_applied}; handled = true;