Fixing trailing parenthesis problem in loading files

Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
teo3300
2024-01-17 13:27:32 +09:00
parent cf08b7e65a
commit c8ccb16c90

View File

@ -129,7 +129,11 @@ impl Reader {
/// Create anew Reader with the tokens
/// Call read_from with the reader instance
pub fn read_str(reader: &Reader) -> MalRet {
reader.read_form()
let mut ret = Nil;
while !reader.ended() {
ret = reader.read_form()?;
}
Ok(ret)
}
/// Read a string and return a list of tokens in it (following regex in README)