Fix string result in readback error

This commit is contained in:
imaqtkatt 2024-01-24 14:40:09 -03:00
parent 312c3c54b2
commit 09c5da06dd
2 changed files with 6 additions and 2 deletions

View File

@ -296,7 +296,11 @@ impl<'a> Reader<'a> {
recover_string_cons(str_term, string.clone());
rd.error(ReadbackError::InvalidStrTerm(string))
},
_ => rd.error(ReadbackError::InvalidStrTerm(*arg.clone())),
_ => {
let arg = std::mem::take(arg.as_mut());
recover_string_cons(str_term, arg.clone());
rd.error(ReadbackError::InvalidStrTerm(arg))
}
}
}
Term::App { fun, arg, .. } => {

View File

@ -6,4 +6,4 @@ Invalid readback:
Invalid String Character value '(*, 4)'
Invalid String Character value '*'
""
(SCons (*, 4) (SCons * SNil))