Treat reduce actions with different production IDs as distinct
This commit is contained in:
parent
2c2c567a29
commit
75f31a79a3
18 changed files with 40492 additions and 31041 deletions
|
|
@ -69,14 +69,13 @@ ParseAction ParseAction::Reduce(Symbol symbol, size_t consumed_symbol_count,
|
|||
}
|
||||
|
||||
bool ParseAction::operator==(const ParseAction &other) const {
|
||||
bool types_eq = type == other.type;
|
||||
bool symbols_eq = symbol == other.symbol;
|
||||
bool state_indices_eq = state_index == other.state_index;
|
||||
bool consumed_symbol_counts_eq =
|
||||
consumed_symbol_count == other.consumed_symbol_count;
|
||||
bool precedences_eq = precedence_range == other.precedence_range;
|
||||
return types_eq && symbols_eq && state_indices_eq &&
|
||||
consumed_symbol_counts_eq && precedences_eq;
|
||||
return (
|
||||
type == other.type &&
|
||||
symbol == other.symbol &&
|
||||
state_index == other.state_index &&
|
||||
production == other.production &&
|
||||
consumed_symbol_count == other.consumed_symbol_count
|
||||
);
|
||||
}
|
||||
|
||||
bool ParseAction::operator<(const ParseAction &other) const {
|
||||
|
|
@ -92,6 +91,10 @@ bool ParseAction::operator<(const ParseAction &other) const {
|
|||
return true;
|
||||
if (other.state_index < state_index)
|
||||
return false;
|
||||
if (production < other.production)
|
||||
return true;
|
||||
if (other.production < production)
|
||||
return false;
|
||||
return consumed_symbol_count < other.consumed_symbol_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue