feat: improved logging for current procedure
This commit is contained in:
parent
1f0e2724db
commit
0046edaa4b
@ -47,7 +47,7 @@ pub fn parse(lexer: lexer::Lexer) -> Result<f64> {
|
||||
}
|
||||
|
||||
pub fn s_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
println!("Proc S");
|
||||
println!("╔═ S");
|
||||
let result = a_proc(tbox)?;
|
||||
match tbox.read_token()? {
|
||||
None => Ok(result),
|
||||
@ -56,7 +56,7 @@ pub fn s_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
}
|
||||
|
||||
fn a_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
println!("Proc A");
|
||||
println!("╠╦ A");
|
||||
let result = m_proc(tbox)?;
|
||||
match &tbox.read_token()? {
|
||||
Some(Token::OP(_, OpType::ADD)) => Ok(result + a_proc(tbox)?),
|
||||
@ -70,7 +70,7 @@ fn a_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
}
|
||||
|
||||
fn m_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
println!("Proc M");
|
||||
println!("║╠╦ M");
|
||||
let result = g_proc(tbox)?;
|
||||
match &tbox.read_token()? {
|
||||
Some(Token::OP(_, OpType::MUL)) => Ok(result * m_proc(tbox)?),
|
||||
@ -84,7 +84,7 @@ fn m_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
}
|
||||
|
||||
fn g_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
println!("Proc G");
|
||||
println!("║║╠╦ G");
|
||||
let result = p_proc(tbox)?;
|
||||
match tbox.read_token()? {
|
||||
Some(Token::OP(_, OpType::POW)) => Ok(result.powf(g_proc(tbox)?)),
|
||||
@ -97,7 +97,7 @@ fn g_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
}
|
||||
|
||||
fn p_proc(tbox: &mut TokenBox) -> Result<f64> {
|
||||
println!("Proc P");
|
||||
println!("║║║╚ P");
|
||||
match expect_token(tbox.read_token()?)? {
|
||||
Token::OBR(_) => {
|
||||
let result = a_proc(tbox)?;
|
||||
|
Loading…
Reference in New Issue
Block a user