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

@ -139,8 +139,8 @@ This contains any executable target of this project. Notably the main shell file
Note: this section will not show the status of each item unless you are viewing it with a proper orgmode viewer. Note: this section will not show the status of each item unless you are viewing it with a proper orgmode viewer.
Note: this section only tracks the state of incomplete TODO items. Having everything on here would be cluttered. Note: this section only tracks the state of incomplete TODO items. Having everything on here would be cluttered.
*** TODO Eval function
*** TODO Input function *** TODO Input function
*** TODO Env function
*** TODO Load (load a script) function *** TODO Load (load a script) function
Pull/Refactor the logic out of the configure functions. Pull/Refactor the logic out of the configure functions.
Optionally return a list of new variables and/or functions? Optionally return a list of new variables and/or functions?

View file

@ -215,7 +215,8 @@ pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
Ok(()) 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> { fn _echo_callback(ast: &Seg, _syms: &mut SymTable) -> Result<Ctr, String> {
if ast.len() == 1 { if ast.len() == 1 {

View file

@ -17,7 +17,8 @@
use crate::segment::{Ctr, Seg}; use crate::segment::{Ctr, Seg};
use crate::sym::{SymTable, ValueType}; 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. starts with arg1 AND arg2, and then calculates prev_result AND next_arg.
returns final result."; 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. starts with arg1 OR arg2, and then calculates prev_result OR next_arg.
returns final result."; 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. 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."; 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> { pub fn toggle_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, String> {
let var_name: String; let var_name: String;
if let Ctr::Symbol(ref s) = *ast.car { 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::segment::{Ctr, Seg};
use crate::sym::{Args, SymTable, Symbol, ValueType}; 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 true, the first consequence is evaluated.
If the condition is evaluated to false, the second consequence is evaluated. If the condition is evaluated to false, the second consequence is evaluated.
Otherwise, an error is thrown. Otherwise, an error is thrown.

View file

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

View file

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