From 7afc08af473294fa9be4c49e345131a02c22994d Mon Sep 17 00:00:00 2001 From: bakaq Date: Fri, 16 Aug 2024 00:01:25 -0300 Subject: [PATCH] Represent atom [] as empty list --- src/machine/parsed_results.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/machine/parsed_results.rs b/src/machine/parsed_results.rs index 06a8873b..305e6a4d 100644 --- a/src/machine/parsed_results.rs +++ b/src/machine/parsed_results.rs @@ -302,7 +302,12 @@ impl Value { */ if arity == 0 { - term_stack.push(Value::Atom(name.as_str().to_string())); + let atom_name = name.as_str().to_string(); + if atom_name == "[]" { + term_stack.push(Value::List(vec![])); + } else { + term_stack.push(Value::Atom(atom_name)); + } } else { let subterms = term_stack .drain(term_stack.len() - arity ..) -- 2.54.0