Skip to content

Commit

Permalink
chore: remove backtrace as a dependency
Browse files Browse the repository at this point in the history
The functionality previously provided here is now more ergonomically
available via `tracing`
  • Loading branch information
FreeMasen committed Nov 24, 2022
1 parent 523f584 commit 82c153b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ categories = ["parsing", "text-processing", "web-programming"]
edition = "2018"

[dependencies]
backtrace = "0.3"
ress = "0.11"
resast = "0.5"
log = "0.4"
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
extern crate ress;
#[macro_use]
extern crate log;
extern crate backtrace;

use ress::prelude::*;
pub use ress::Span;
Expand Down
24 changes: 0 additions & 24 deletions src/spanned/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6747,10 +6747,6 @@ where
}

fn expected_token_error<T>(&self, item: &Item<&'b str>, expectation: &[&str]) -> Res<T> {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
let pos = item.location.start;
let expectation = expectation
.iter()
Expand All @@ -6770,10 +6766,6 @@ where
))
}
fn unexpected_token_error<T>(&self, item: &Item<&'b str>, msg: &str) -> Res<T> {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
let pos = item.location.start;

let name = self.scanner.string_for(&item.span).unwrap_or_default();
Expand All @@ -6784,34 +6776,18 @@ where
}
fn tolerate_error(&self, err: Error) -> Result<(), Error> {
if !self.config.tolerant {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
Err(err)
} else {
Ok(())
}
}
fn op_error(&self, msg: &str) -> Error {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
Error::OperationError(self.current_position, msg.to_owned())
}
fn redecl_error(&self, name: &str) -> Error {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
Error::Redecl(self.current_position, name.to_owned())
}
fn reinterpret_error(&self, from: &str, to: &str) -> Error {
if cfg!(feature = "error_backtrace") {
let bt = backtrace::Backtrace::new();
error!("{:?}", bt);
}
Error::UnableToReinterpret(self.current_position, from.to_owned(), to.to_owned())
}

Expand Down

0 comments on commit 82c153b

Please sign in to comment.