Skip to content

Commit

Permalink
wrap max_tokens in Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Jul 30, 2024
1 parent 761a0cd commit e49b2ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser/src/earley/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct RowInfo {
lexeme: Lexeme,
token_idx_start: usize,
token_idx_stop: usize,
max_tokens: HashMap<LexemeIdx, usize>,
max_tokens: Arc<HashMap<LexemeIdx, usize>>,
}

impl RowInfo {
Expand Down Expand Up @@ -728,7 +728,7 @@ impl ParserState {
start_byte_idx: 0,
token_idx_start: self.token_idx,
token_idx_stop: self.token_idx,
max_tokens: HashMap::default(),
max_tokens: Arc::new(HashMap::default()),
});

for idx in 0..self.num_rows() {
Expand Down Expand Up @@ -1257,7 +1257,7 @@ impl ParserState {
token_idx_start: self.token_idx,
token_idx_stop: self.token_idx,
start_byte_idx: self.byte_idx,
max_tokens: max_tokens_map,
max_tokens: Arc::new(max_tokens_map),
});
// debug!(" push: {idx} {} {}", self.rows.len(), self.row_infos.len());
}
Expand Down

0 comments on commit e49b2ba

Please sign in to comment.