]> Repositorios git - scryer-prolog.git/commitdiff
map single character atoms down to characters in constant_index
authorMark Thom <[email protected]>
Fri, 1 May 2020 07:34:09 +0000 (01:34 -0600)
committerMark Thom <[email protected]>
Fri, 1 May 2020 07:34:09 +0000 (01:34 -0600)
src/prolog/machine/machine_indices.rs

index 3c585d76638d368a87b4390cdbda7ad612e09883..f35e76f6e21378508c039ae258ccdecd755745b7 100644 (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) => {