From 6d40e317df906dc04295a4465b5944db94f4821e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 10 Jun 2016 13:11:52 -0700 Subject: [PATCH] Ensure that reductions are ordered by child count in parse table --- src/compiler/build_tables/parse_item.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/build_tables/parse_item.cc b/src/compiler/build_tables/parse_item.cc index 8c4dfe40..470200a6 100644 --- a/src/compiler/build_tables/parse_item.cc +++ b/src/compiler/build_tables/parse_item.cc @@ -25,14 +25,14 @@ bool ParseItem::operator==(const ParseItem &other) const { } bool ParseItem::operator<(const ParseItem &other) const { - if (variable_index < other.variable_index) - return true; - if (variable_index > other.variable_index) - return false; if (step_index < other.step_index) return true; if (step_index > other.step_index) return false; + if (variable_index < other.variable_index) + return true; + if (variable_index > other.variable_index) + return false; return production < other.production; }