Ensure that reductions are ordered by child count in parse table

This commit is contained in:
Max Brunsfeld 2016-06-10 13:11:52 -07:00
parent 00a0939504
commit 6d40e317df

View file

@ -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;
}