code.push(Self::add_index(is_initial_index, index));
}
&Term::Constant(_, ref constant) => {
+ if let Constant::Atom(ref name, _) = constant {
+ if !name.as_str().is_empty() && name.as_str().chars().skip(1).next().is_none() {
+ let c = name.as_str().chars().next().unwrap();
+ let code = self.constants.entry(Constant::Char(c)).or_insert(vec![]);
+
+ code.push(Self::add_index(code.is_empty(), index));
+ }
+ }
+
let code = self.constants.entry(constant.clone()).or_insert(Vec::new());
let is_initial_index = code.is_empty();
let a1 = self.registers[1].clone();
let addr = self.store(self.deref(a1));
- let offset = match addr {
+ let offset = match addr {
Addr::Con(constant) => match hm.get(&constant) {
Some(offset) => *offset,
_ => 0,