Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ uuid = "=0.8.*"
byteorder = "^1"
murmur3 = "=0.4" # 0.5 is incompatible currently
bit-set = "=0.5.*"
once_cell = "^1.2"
#backtrace = "=0.3"
typed-arena = "^2.0"
better_any = "0.2.0-dev.1"
Expand All @@ -37,4 +36,4 @@ parking_lot = "0.11"

[profile.release]
#opt-level = 3
#debug = true
#debug = true
10 changes: 5 additions & 5 deletions src/atn_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Debug;

use once_cell::sync::OnceCell;
use std::sync::OnceLock;

use crate::interval_set::IntervalSet;
use crate::transition::Transition;
Expand Down Expand Up @@ -73,7 +73,7 @@ pub trait ATNState: Sync + Send + Debug {
fn get_rule_index(&self) -> usize;
fn set_rule_index(&self, v: usize);

fn get_next_tokens_within_rule(&self) -> &OnceCell<IntervalSet>;
fn get_next_tokens_within_rule(&self) -> &OnceLock<IntervalSet>;
// fn set_next_token_within_rule(&mut self, v: IntervalSet);

fn get_state_type(&self) -> &ATNStateType;
Expand All @@ -91,7 +91,7 @@ pub trait ATNState: Sync + Send + Debug {

#[derive(Debug)]
pub struct BaseATNState {
next_tokens_within_rule: OnceCell<IntervalSet>,
next_tokens_within_rule: OnceLock<IntervalSet>,

// atn: Box<ATN>,
epsilon_only_transitions: bool,
Expand All @@ -110,7 +110,7 @@ pub struct BaseATNState {
impl BaseATNState {
pub fn new_base_atnstate() -> BaseATNState {
BaseATNState {
next_tokens_within_rule: OnceCell::new(),
next_tokens_within_rule: OnceLock::new(),
epsilon_only_transitions: false,
rule_index: 0,
state_number: 0,
Expand All @@ -133,7 +133,7 @@ impl ATNState for BaseATNState {
unimplemented!()
}

fn get_next_tokens_within_rule(&self) -> &OnceCell<IntervalSet> {
fn get_next_tokens_within_rule(&self) -> &OnceLock<IntervalSet> {
&self.next_tokens_within_rule
}

Expand Down