Added new assignment routine

This commit is contained in:
2023-08-03 14:28:22 -07:00
parent 83f00c761b
commit bc3bd3d1fc
2 changed files with 137 additions and 0 deletions

View File

@ -37,6 +37,18 @@ impl Context {
}
pub fn valid_varible(&self, s: &str) -> bool {
if {
Function::from_string(s).is_some() ||
Constant::from_string(s).is_some()
} { return false }
for c in s.to_lowercase().chars() {
if !"abcdefghijklmnopqrtstuvwxyz_".contains(c) {
return false;
}
}
return match s {
"ans" => false,
_ => true