rustfmt on recent additions
Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
parent
f22d807b57
commit
f8ab31e9aa
6 changed files with 12 additions and 9 deletions
|
|
@ -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 only tracks the state of incomplete TODO items. Having everything on here would be cluttered.
|
||||
|
||||
*** TODO Eval function
|
||||
*** TODO Input function
|
||||
*** TODO Env function
|
||||
*** TODO Load (load a script) function
|
||||
Pull/Refactor the logic out of the configure functions.
|
||||
Optionally return a list of new variables and/or functions?
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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()),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ impl fmt::Display for ValueType {
|
|||
}
|
||||
write!(f, "\nform: {}", form.ast)?;
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue