rustfmt on recent additions

Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
Ava Hahn 2023-03-06 15:52:09 -08:00
parent f22d807b57
commit f8ab31e9aa
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
6 changed files with 12 additions and 9 deletions

View file

@ -215,7 +215,8 @@ pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
Ok(())
}
pub const ECHO_DOCSTRING: &str = "traverses any number of arguments. Prints their evaluated values on a new line for each.";
pub const ECHO_DOCSTRING: &str =
"traverses any number of arguments. Prints their evaluated values on a new line for each.";
fn _echo_callback(ast: &Seg, _syms: &mut SymTable) -> Result<Ctr, String> {
if ast.len() == 1 {

View file

@ -17,7 +17,8 @@
use crate::segment::{Ctr, Seg};
use crate::sym::{SymTable, ValueType};
pub const AND_DOCSTRING: &str = "traverses a list of N arguments, all of which are expected to be boolean.
pub const AND_DOCSTRING: &str =
"traverses a list of N arguments, all of which are expected to be boolean.
starts with arg1 AND arg2, and then calculates prev_result AND next_arg.
returns final result.";
@ -40,7 +41,8 @@ pub fn and_callback(ast: &Seg, _syms: &mut SymTable) -> Result<Ctr, String> {
}
}
pub const OR_DOCSTRING: &str = "traverses a list of N arguments, all of which are expected to be boolean.
pub const OR_DOCSTRING: &str =
"traverses a list of N arguments, all of which are expected to be boolean.
starts with arg1 OR arg2, and then calculates prev_result OR next_arg.
returns final result.";
@ -89,7 +91,6 @@ pub const TOGGLE_DOCSTRING: &str = "switches a boolean symbol between true or fa
Takes a single argument (a symbol). Looks it up in the variable table.
Either sets the symbol to true if it is currently false, or vice versa.";
pub fn toggle_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, String> {
let var_name: String;
if let Ctr::Symbol(ref s) = *ast.car {

View file

@ -19,7 +19,8 @@ use crate::eval::eval;
use crate::segment::{Ctr, Seg};
use crate::sym::{Args, SymTable, Symbol, ValueType};
pub const IF_DOCSTRING: &str = "accepts three bodies, a condition, an unevaluated consequence, and an alternative consequence.
pub const IF_DOCSTRING: &str =
"accepts three bodies, a condition, an unevaluated consequence, and an alternative consequence.
If the condition is evaluated to true, the first consequence is evaluated.
If the condition is evaluated to false, the second consequence is evaluated.
Otherwise, an error is thrown.
@ -94,7 +95,7 @@ pub fn if_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, String> {
}
}
pub const LET_DOCSTRING: &str = "creates a stack of local variables for a sequence of operations.
pub const LET_DOCSTRING: &str = "creates a stack of local variables for a sequence of operations.
returns the result of the final operation.
example: (let ((step1 'hello')

View file

@ -200,7 +200,7 @@ pub fn env_callback(_ast: &Seg, syms: &mut SymTable) -> Result<Ctr, String> {
match val.value {
ValueType::VarForm(_) => {
println!(" {}: {}", &name, val.value);
},
}
_ => functions.push(name.clone()),
}
}

View file

@ -238,7 +238,7 @@ impl fmt::Display for ValueType {
}
write!(f, "\nform: {}", form.ast)?;
Ok(())
},
}
}
}
}