From f1bb7fab522abbfe6f19cde051a27f33c9108ea5 Mon Sep 17 00:00:00 2001 From: Mario Herzog Date: Thu, 12 Dec 2024 12:18:55 +0100 Subject: [PATCH] cleanup for orphaned imports --- src/common_token_stream.rs | 1 - src/input_stream.rs | 1 - src/parser.rs | 2 +- src/rule_context.rs | 2 +- src/token_factory.rs | 2 +- src/token_stream.rs | 1 - src/tree.rs | 4 +--- 7 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/common_token_stream.rs b/src/common_token_stream.rs index a56ddc7..57bed9d 100644 --- a/src/common_token_stream.rs +++ b/src/common_token_stream.rs @@ -6,7 +6,6 @@ use crate::token::{Token, TOKEN_DEFAULT_CHANNEL, TOKEN_INVALID_TYPE}; use crate::token_factory::TokenFactory; use crate::token_source::TokenSource; use crate::token_stream::{TokenStream, UnbufferedTokenStream}; -use better_any::{Tid, TidAble}; /// Default token stream that skips token that not correspond to current channel. #[derive(Debug)] diff --git a/src/input_stream.rs b/src/input_stream.rs index 2373a9d..3a20977 100644 --- a/src/input_stream.rs +++ b/src/input_stream.rs @@ -5,7 +5,6 @@ use crate::char_stream::{CharStream, InputData}; use crate::int_stream::IntStream; use std::ops::Deref; -use better_any::TidAble; /// Default rust target input stream. /// diff --git a/src/parser.rs b/src/parser.rs index e5cf988..aaf0784 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -23,7 +23,7 @@ use crate::tree::{ErrorNode, Listenable, ParseTreeListener, TerminalNode}; use crate::utils::cell_update; use crate::vocabulary::Vocabulary; use crate::{CoerceFrom, CoerceTo}; -use better_any::{Tid, TidAble}; +use better_any::TidAble; /// parser functionality required for `ParserATNSimulator` to work #[allow(missing_docs)] // todo rewrite it so downstream crates actually could meaningfully implement it diff --git a/src/rule_context.rs b/src/rule_context.rs index 57be242..7ce1410 100644 --- a/src/rule_context.rs +++ b/src/rule_context.rs @@ -11,7 +11,7 @@ use crate::parser::ParserNodeType; use crate::parser_rule_context::ParserRuleContext; use crate::token_factory::TokenFactory; use crate::tree::{ParseTree, Tree}; -use better_any::{Tid, TidAble}; +use better_any::TidAble; use std::any::type_name; //pub trait RuleContext:RuleNode { diff --git a/src/token_factory.rs b/src/token_factory.rs index 286d6f9..7c8d1e1 100644 --- a/src/token_factory.rs +++ b/src/token_factory.rs @@ -12,7 +12,7 @@ use typed_arena::Arena; use crate::char_stream::{CharStream, InputData}; use crate::token::Token; use crate::token::{CommonToken, OwningToken, TOKEN_INVALID_TYPE}; -use better_any::{Tid, TidAble}; +use better_any::TidAble; lazy_static! { pub(crate) static ref COMMON_TOKEN_FACTORY_DEFAULT: Box = diff --git a/src/token_stream.rs b/src/token_stream.rs index 9623c72..badc8e0 100644 --- a/src/token_stream.rs +++ b/src/token_stream.rs @@ -8,7 +8,6 @@ use crate::int_stream::{IntStream, IterWrapper}; use crate::token::{OwningToken, Token, TOKEN_EOF, TOKEN_INVALID_TYPE}; use crate::token_factory::TokenFactory; use crate::token_source::TokenSource; -use better_any::{Tid, TidAble}; use std::fmt::{Debug, Formatter}; /// An `IntSteam` of `Token`s diff --git a/src/tree.rs b/src/tree.rs index fce1359..d27e641 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -8,18 +8,16 @@ use std::marker::PhantomData; use std::ops::Deref; use std::rc::Rc; -use crate::atn::INVALID_ALT; use crate::char_stream::InputData; use crate::int_stream::EOF; use crate::interval_set::Interval; use crate::parser::ParserNodeType; -use crate::parser_rule_context::{ParserRuleContext, RuleContextExt}; +use crate::parser_rule_context::ParserRuleContext; use crate::recognizer::Recognizer; use crate::rule_context::{CustomRuleContext, RuleContext}; use crate::token::Token; use crate::token_factory::TokenFactory; use crate::{interval_set, trees, CoerceTo}; -use better_any::{Tid, TidAble}; use std::mem; //todo try to make in more generic