Skip to content

Commit fc4d7bd

Browse files
committed
fix(cli): dedup preceding_auxiliary_symbols
1 parent ff8b50c commit fc4d7bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/src/generate/build_tables/build_parse_table.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type SymbolSequence = Vec<Symbol>;
3232
type AuxiliarySymbolSequence = Vec<AuxiliarySymbolInfo>;
3333
pub type ParseStateInfo<'a> = (SymbolSequence, ParseItemSet<'a>);
3434

35-
#[derive(Clone)]
35+
#[derive(Clone, PartialEq)]
3636
struct AuxiliarySymbolInfo {
3737
auxiliary_symbol: Symbol,
3838
parent_symbols: Vec<Symbol>,
@@ -193,7 +193,7 @@ impl<'a> ParseTableBuilder<'a> {
193193
fn add_actions(
194194
&mut self,
195195
mut preceding_symbols: SymbolSequence,
196-
mut preceding_auxiliary_symbols: Vec<AuxiliarySymbolInfo>,
196+
mut preceding_auxiliary_symbols: AuxiliarySymbolSequence,
197197
state_id: ParseStateId,
198198
item_set: &ParseItemSet<'a>,
199199
) -> Result<()> {
@@ -311,6 +311,8 @@ impl<'a> ParseTableBuilder<'a> {
311311
}
312312
}
313313

314+
preceding_auxiliary_symbols.dedup();
315+
314316
// Having computed the successor item sets for each symbol, add a new
315317
// parse state for each of these item sets, and add a corresponding Shift
316318
// action to this state.

0 commit comments

Comments
 (0)