Skip to content

Commit

Permalink
Unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
stargazing-dino committed May 4, 2024
1 parent 1505756 commit cabef38
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
20 changes: 0 additions & 20 deletions crates/bevy_plugin/tests/test_asset_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<T> 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)
}
}
15 changes: 0 additions & 15 deletions crates/compiler/src/compiler/antlr_rust_ext.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -209,17 +205,6 @@ pub(crate) trait YarnSpinnerParserContextExt<'input>:
.filter_map(|child| child.downcast_rc::<T>().ok())
.nth(pos)
}

/// Adapted from <https://github.com/antlr/antlr4/blob/8dcc6526cfb154d688497f31cf1e0904801c6df2/runtime/CSharp/src/ParserRuleContext.cs#L220>
fn add_error_node(
&self,
bad_token: CommonToken<'input>,
) -> Rc<ErrorNode<'input, YarnSpinnerParserContextType>> {
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
Expand Down

0 comments on commit cabef38

Please sign in to comment.