diff --git a/crates/bevy_plugin/tests/test_asset_provider.rs b/crates/bevy_plugin/tests/test_asset_provider.rs index 023baf68..3bd4f6b7 100644 --- a/crates/bevy_plugin/tests/test_asset_provider.rs +++ b/crates/bevy_plugin/tests/test_asset_provider.rs @@ -3,7 +3,6 @@ use anyhow::{bail, Result}; use bevy::prelude::*; use bevy::utils::Instant; use bevy_yarnspinner::prelude::*; -use bevy_yarnspinner::UnderlyingYarnLine; use utils::prelude::*; mod utils; @@ -198,22 +197,3 @@ fn does_not_load_asset_with_invalid_type() -> Result<()> { assert!(asset.is_none()); Ok(()) } - -trait AssetProviderExt { - fn get_assets_for_id(&self, id: &str) -> LineAssets; -} - -impl AssetProviderExt for T -where - T: AssetProvider + ?Sized, -{ - fn get_assets_for_id(&self, id: &str) -> LineAssets { - let line_id = LineId(id.to_owned()); - let yarn_line = UnderlyingYarnLine { - id: line_id, - text: String::new(), - attributes: vec![], - }; - T::get_assets(self, &yarn_line) - } -} diff --git a/crates/compiler/src/compiler/antlr_rust_ext.rs b/crates/compiler/src/compiler/antlr_rust_ext.rs index 08beae0a..d50abc73 100644 --- a/crates/compiler/src/compiler/antlr_rust_ext.rs +++ b/crates/compiler/src/compiler/antlr_rust_ext.rs @@ -1,15 +1,11 @@ //! Contains functionality provided in the C# implementation of ANTLR but not (yet?) in antlr4rust. -use crate::parser::generated::yarnspinnerparser::YarnSpinnerParserContextType; use crate::parser::ActualTokenStream; use crate::prelude::generated::yarnspinnerparser::YarnSpinnerParserContext; -use crate::prelude::ContextRefExt; use antlr_rust::int_stream::IntStream; -use antlr_rust::rule_context::RuleContext; use antlr_rust::token::{CommonToken, Token, TOKEN_DEFAULT_CHANNEL}; use antlr_rust::token_factory::{CommonTokenFactory, TokenFactory}; use antlr_rust::token_stream::TokenStream; -use antlr_rust::tree::ErrorNode; use antlr_rust::InputStream; use better_any::TidExt; use std::rc::Rc; @@ -209,17 +205,6 @@ pub(crate) trait YarnSpinnerParserContextExt<'input>: .filter_map(|child| child.downcast_rc::().ok()) .nth(pos) } - - /// Adapted from - fn add_error_node( - &self, - bad_token: CommonToken<'input>, - ) -> Rc> { - let error_node = Rc::new(ErrorNode::new(Box::new(bad_token))); - error_node.set_parent(&Some(self.ref_to_rc())); - self.add_child(error_node.clone()); - error_node - } } impl<'input, T: YarnSpinnerParserContext<'input> + ?Sized> YarnSpinnerParserContextExt<'input> for T