Update dependencies (and fix unrelated build warning)

This commit is contained in:
NGnius (Graham) 2022-02-26 20:07:26 -05:00
parent 4e5d7474b3
commit 260ea03727
5 changed files with 7 additions and 24 deletions

2
Cargo.lock generated
View file

@ -124,7 +124,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bliss-audio"
version = "0.4.4"
version = "0.4.6"
dependencies = [
"anyhow",
"bliss-audio-aubio-rs",

@ -1 +1 @@
Subproject commit 1f101b5975f923d3a13a9d122c0f19a91e6d0b82
Subproject commit 8517c49caf3a636798411da3c0a3d80b2cf268d5

View file

@ -2,9 +2,7 @@ use std::collections::VecDeque;
//use std::fmt::{Debug, Display, Error, Formatter};
use std::marker::PhantomData;
#[cfg(debug_assertions)]
use crate::lang::utility::assert_empty;
use crate::lang::utility::{assert_token, assert_token_raw, assert_token_raw_back};
use crate::lang::utility::{assert_token, assert_token_raw};
use crate::lang::MpsLanguageDictionary;
use crate::lang::SyntaxError;
use crate::lang::{BoxedMpsOpFactory, MpsOp};
@ -68,10 +66,10 @@ impl<Op: MpsOp + 'static, F: MpsFunctionFactory<Op> + 'static> BoxedMpsOpFactory
tokens,
)?;
assert_token_raw(MpsToken::OpenBracket, tokens)?;
assert_token_raw_back(MpsToken::CloseBracket, tokens)?;
let end_tokens = tokens.split_off(tokens.len()-1);
let func = self.op_factory.build_function_params(name, tokens, dict)?;
#[cfg(debug_assertions)]
assert_empty(tokens)?;
tokens.extend(end_tokens);
assert_token_raw(MpsToken::CloseBracket, tokens)?;
Ok(Box::new(func))
}
}

View file

@ -169,17 +169,6 @@ pub fn assert_type(tokens: &mut VecDeque<MpsToken>) -> Result<MpsTypePrimitive,
}
}
pub fn assert_empty(tokens: &mut VecDeque<MpsToken>) -> Result<(), SyntaxError> {
match tokens.pop_front() {
None => Ok(()),
Some(t) => Err(SyntaxError {
line: 0,
token: MpsToken::Name("{nothing}".into()),
got: Some(t),
}),
}
}
pub fn music_folder() -> PathBuf {
dirs::home_dir()
.unwrap_or_else(|| PathBuf::from("./"))

View file

@ -5,8 +5,6 @@ use std::iter::Iterator;
use crate::tokens::MpsToken;
use crate::MpsContext;
#[cfg(debug_assertions)]
use crate::lang::utility::assert_empty;
use crate::lang::MpsLanguageDictionary;
use crate::lang::{MpsFunctionFactory, MpsFunctionStatementFactory, MpsIteratorItem, MpsOp};
use crate::lang::{RuntimeError, SyntaxError};
@ -72,12 +70,10 @@ impl MpsFunctionFactory<EmptyStatement> for EmptyFunctionFactory {
fn build_function_params(
&self,
_name: String,
#[allow(unused_variables)] tokens: &mut VecDeque<MpsToken>,
_tokens: &mut VecDeque<MpsToken>,
_dict: &MpsLanguageDictionary,
) -> Result<EmptyStatement, SyntaxError> {
// empty()
#[cfg(debug_assertions)]
assert_empty(tokens)?;
Ok(EmptyStatement { context: None })
}
}