fix the many-body-script and lex-singlet problems

Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
Ava Hahn 2023-03-01 12:20:43 -08:00
parent bc09cb07b1
commit 914bf1303f
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
3 changed files with 20 additions and 27 deletions

View file

@ -59,8 +59,14 @@ pub fn configure(filename: String, syms: &mut SymTable) -> Result<(), String> {
},
);
let config_document =
fs::read_to_string(filename).unwrap_or_else(|err: io::Error| err.to_string());
let mut config_document = fs::read_to_string(filename)
.unwrap_or_else(|err: io::Error| {
eprintln!("{}", err.to_string());
"".to_string()
}) + ")";
config_document = "(".to_string() + &config_document;
let config_tree = lex(&config_document)?;
let config_result = eval(&config_tree, syms)?;