map single character atoms down to characters in constant_index

This commit is contained in:
Mark Thom
2020-05-01 01:34:09 -06:00
parent a346493de1
commit 847a92f580

View File

@@ -248,7 +248,10 @@ impl Addr {
}
&Addr::Con(h) => {
match &machine_st.heap[h] {
&HeapCellValue::Atom(ref name, ref op) => {
&HeapCellValue::Atom(ref name, _) if name.is_char() => {
Some(Constant::Char(name.as_str().chars().next().unwrap()))
}
&HeapCellValue::Atom(ref name, _) => {
Some(Constant::Atom(name.clone(), None))
}
&HeapCellValue::Integer(ref n) => {