Ensure that reductions are ordered by child count in parse table
This commit is contained in:
parent
00a0939504
commit
6d40e317df
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue