diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index 5ed4fd2..8edff5b 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -249,9 +249,12 @@ sw buf_inspect_call (s_buf *buf, const s_call *call)
return buf_inspect_call_brackets(buf, call);
if (call->ident.sym == sym_1("cast"))
return buf_inspect_cast(buf, call);
- if (operator_find(&call->ident, 1))
+ if (operator_find(&call->ident) &&
+ operator_arity(&call->ident) == 1)
return buf_inspect_call_op_unary(buf, call);
- if ((op_precedence = operator_precedence(&call->ident, 2)) > 0)
+ if (operator_find(&call->ident) &&
+ operator_arity(&call->ident) == 2 &&
+ (op_precedence = operator_precedence(&call->ident)) > 0)
return buf_inspect_call_op(buf, call, op_precedence);
if ((r = buf_inspect_ident(buf, &call->ident)) < 0)
return r;
@@ -349,8 +352,10 @@ sw buf_inspect_call_op (s_buf *buf, const s_call *call, s8 op_precedence)
s_tag *right;
left = &call->arguments->tag;
right = &list_next(call->arguments)->tag;
- if (left->type == TAG_CALL &&
- (precedence = operator_precedence(&left->data.call.ident, 2))
+ if (left->type == TAG_CALL &&
+ operator_find(&left->data.call.ident) &&
+ operator_arity(&left->data.call.ident) == 2 &&
+ (precedence = operator_precedence(&left->data.call.ident))
< op_precedence) {
paren = true;
if ((r = buf_write_1(buf, "(")) < 0)
@@ -376,8 +381,10 @@ sw buf_inspect_call_op (s_buf *buf, const s_call *call, s8 op_precedence)
if ((r = buf_write_1(buf, " ")) < 0)
return r;
result += r;
- if (right->type == TAG_CALL &&
- (precedence = operator_precedence(&right->data.call.ident, 2))
+ if (right->type == TAG_CALL &&
+ operator_find(&right->data.call.ident) &&
+ operator_arity(&right->data.call.ident) == 2 &&
+ (precedence = operator_precedence(&right->data.call.ident))
< op_precedence) {
paren = true;
if ((r = buf_write_1(buf, "(")) < 0)
@@ -451,9 +458,12 @@ sw buf_inspect_call_size (const s_call *call)
s8 op_precedence;
sw r;
sw result = 0;
- if (operator_find(&call->ident, 1))
+ if (operator_find(&call->ident) &&
+ operator_arity(&call->ident) == 1)
return buf_inspect_call_op_unary_size(call);
- if ((op_precedence = operator_precedence(&call->ident, 2)) > 0)
+ if (operator_find(&call->ident) &&
+ operator_arity(&call->ident) == 2 &&
+ (op_precedence = operator_precedence(&call->ident)) > 0)
return buf_inspect_call_op_size(call, op_precedence);
if ((r = buf_inspect_ident_size(&call->ident)) < 0)
return r;
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 10878e8..c6cc8ee 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -595,8 +595,8 @@ sw buf_parse_call_op (s_buf *buf, s_call *dest)
result += r;
if ((r = buf_parse_ident_peek(buf, &next_op)) <= 0)
goto restore;
- if (! operator_find(&next_op, 2) ||
- operator_precedence(&next_op, 2) < 0) {
+ if (! operator_resolve(&next_op, 2, &next_op) ||
+ operator_precedence(&next_op) < 0) {
r = 0;
goto restore;
}
@@ -641,8 +641,8 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
tag_copy(&dest->arguments->tag, left);
if ((r = buf_parse_ident_peek(buf, &next_op)) <= 0)
goto restore;
- if (! operator_find(&next_op, 2) ||
- (op_precedence = operator_precedence(&next_op, 2)) < 0) {
+ if (! operator_resolve(&next_op, 2, &next_op) ||
+ (op_precedence = operator_precedence(&next_op)) < 0) {
r = 0;
goto restore;
}
@@ -650,8 +650,9 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
if ((r = buf_parse_ident(buf, &next_op)) <= 0)
goto restore;
result += r;
+ if (! operator_resolve(&next_op, 2, &next_op))
+ goto restore;
op = next_op;
- operator_call_ident(&op, 2, &tmp.ident);
if ((r = buf_ignore_spaces(buf)) < 0)
goto restore;
result += r;
@@ -668,14 +669,19 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
r = buf_parse_ident_peek(buf, &next_op);
if (r <= 0)
break;
- next_op_precedence = operator_precedence(&next_op, 2);
- while (r > 0 && operator_find(&next_op, 2) &&
+ if (! operator_resolve(&next_op, 2, &next_op))
+ break;
+ next_op_precedence = operator_precedence(&next_op);
+ while (r > 0 && operator_arity(&next_op) == 2 &&
(next_op_precedence >= op_precedence ||
- (operator_is_right_associative(&next_op, 2) &&
+ (operator_is_right_associative(&next_op) &&
next_op_precedence == op_precedence))) {
call_init_op(&tmp2);
tmp2.arguments->tag = *right;
- if ((r = buf_parse_call_op_rec(buf, &tmp2, (next_op_precedence > op_precedence) ? op_precedence + 1 : op_precedence)) <= 0) {
+ if ((r = buf_parse_call_op_rec(buf, &tmp2,
+ (next_op_precedence > op_precedence) ?
+ op_precedence + 1 :
+ op_precedence)) <= 0) {
tmp2.arguments->tag.type = TAG_VOID;
call_clean(&tmp2);
break;
@@ -692,13 +698,17 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
break;
}
r = buf_parse_ident_peek(buf, &next_op);
- if (r > 0)
- next_op_precedence = operator_precedence(&next_op, 2);
+ if (r > 0) {
+ if (! operator_resolve(&next_op, 2, &next_op))
+ break;
+ if ((next_op_precedence = operator_precedence(&next_op)) < 0)
+ break;
+ }
}
if (r <= 0 || (op_precedence = next_op_precedence) < min_precedence)
break;
call_init_op(&tmp3);
- operator_call_ident(&op, 2, &tmp3.ident);
+ tmp3.ident = op;
tmp3.arguments->tag = *left;
list_next(tmp3.arguments)->tag = *right;
tag_init_call(left, &tmp3);
@@ -728,7 +738,7 @@ sw buf_parse_call_op_unary (s_buf *buf, s_call *dest)
if ((r = buf_parse_ident(buf, &tmp.ident)) <= 0)
goto restore;
result += r;
- if (! operator_find(&tmp.ident, 1))
+ if (! operator_resolve(&tmp.ident, 1, &tmp.ident))
goto restore;
if ((r = buf_ignore_spaces(buf)) < 0)
goto restore;
@@ -737,7 +747,6 @@ sw buf_parse_call_op_unary (s_buf *buf, s_call *dest)
goto restore;
result += r;
*dest = tmp;
- operator_call_ident(&tmp.ident, 1, &dest->ident);
r = result;
goto clean;
restore:
diff --git a/libc3/env.c b/libc3/env.c
index 5ca70d0..3a1d493 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -30,6 +30,7 @@
#include "error.h"
#include "error_handler.h"
#include "facts.h"
+#include "facts_cursor.h"
#include "facts_with.h"
#include "facts_with_cursor.h"
#include "file.h"
@@ -750,173 +751,101 @@ bool env_module_maybe_reload (const s_sym *module, s_env *env,
return r;
}
-s_ident * env_operator_call_ident (s_env *env, const s_ident *op,
- u8 arity, s_ident *dest)
+s8 env_operator_arity (s_env *env, const s_ident *op)
{
- s_facts_with_cursor cursor;
+ s_facts_cursor cursor;
+ s8 r = -1;
+ s_tag tag_op;
s_tag tag_arity;
- s_tag tag_arity_u8;
- s_tag tag_is_a;
- s_tag tag_module;
- s_tag tag_module_name;
- s_tag tag_operator;
- s_tag tag_operator_var;
- s_tag tag_sym;
- s_tag tag_symbol;
- s_ident tmp;
- tmp = *op;
- ident_resolve_module(&tmp, env);
- tag_init_1( &tag_arity, ":arity");
- tag_init_u8( &tag_arity_u8, arity);
- tag_init_1( &tag_is_a, ":is_a");
- tag_init_1( &tag_module, ":module");
- tag_init_sym(&tag_module_name, tmp.module);
- tag_init_1( &tag_operator, ":operator");
- tag_init_var(&tag_operator_var);
- tag_init_sym(&tag_sym, tmp.sym);
- tag_init_1( &tag_symbol, ":symbol");
- facts_with(&env->facts, &cursor, (t_facts_spec) {
- &tag_module_name, &tag_is_a, &tag_module,
- &tag_operator, &tag_operator_var, NULL, /* module exports operator */
- &tag_operator_var, &tag_symbol, &tag_sym,
- &tag_arity, &tag_arity_u8,
- NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
- if (tag_operator_var.type == TAG_IDENT) {
- *dest = tag_operator_var.data.ident;
- facts_with_cursor_clean(&cursor);
- return dest;
- }
+ s_tag tag_var;
+ assert(env);
+ assert(op);
+ tag_init_ident(&tag_op, op);
+ tag_init_1( &tag_arity, ":arity");
+ tag_init_var( &tag_var);
+ facts_with_tags(&env->facts, &cursor, &tag_op, &tag_arity, &tag_var);
+ if (facts_cursor_next(&cursor) &&
+ tag_var.type == TAG_U8) {
+ r = tag_var.data.u8;
}
- warnx("env_operator_call_ident: operator %s/%d not found in module %s",
- tmp.sym->str.ptr.ps8,
- arity,
- tmp.module->str.ptr.ps8);
- facts_with_cursor_clean(&cursor);
- return NULL;
+ else
+ warnx("env_operator_arity: "
+ "arity for operator %s not found in module %s",
+ op->sym->str.ptr.ps8,
+ op->module->str.ptr.ps8);
+ facts_cursor_clean(&cursor);
+ return r;
}
-bool env_operator_find (s_env *env, const s_ident *op, u8 arity)
+bool env_operator_find (s_env *env, const s_ident *op)
{
- s_facts_with_cursor cursor;
- p_facts_spec spec;
- s_tag tag_arity;
- s_tag tag_arity_u8;
s_tag tag_is_a;
- s_tag tag_module;
- s_tag tag_module_name;
+ s_tag tag_op;
s_tag tag_operator;
- s_tag tag_operator_var;
- s_tag tag_symbol;
- s_tag tag_sym;
- s_ident tmp;
assert(env);
assert(op);
- tmp = *op;
- ident_resolve_module(&tmp, env);
- tag_init_1( &tag_arity, ":arity");
- tag_init_u8( &tag_arity_u8, arity);
- tag_init_1( &tag_is_a, ":is_a");
- tag_init_1( &tag_module, ":module");
- tag_init_sym(&tag_module_name, tmp.module);
- tag_init_1( &tag_operator, ":operator");
- tag_init_var(&tag_operator_var);
- tag_init_1( &tag_symbol, ":symbol");
- tag_init_sym(&tag_sym, tmp.sym);
- spec = (p_facts_spec) & (t_facts_spec) {
- &tag_module_name, &tag_is_a, &tag_module,
- &tag_operator, &tag_operator_var, NULL,
- &tag_operator_var, &tag_is_a, &tag_operator,
- &tag_symbol, &tag_sym,
- &tag_arity, &tag_arity_u8,
- NULL, NULL };
- facts_with(&env->facts, &cursor, spec);
- if (facts_with_cursor_next(&cursor)) {
- facts_with_cursor_clean(&cursor);
- return true;
- }
-#ifdef DEBUG_OPERATOR_FIND
- warnx("env_operator_find: operator %s not found in module %s",
- tmp.sym->str.ptr.ps8,
- tmp.module->str.ptr.ps8);
-#endif
- return false;
+ tag_init_1( &tag_is_a, ":is_a");
+ tag_init_ident(&tag_op, op);
+ tag_init_1( &tag_operator, ":operator");
+ return facts_find_fact_by_tags(&env->facts, &tag_op, &tag_is_a,
+ &tag_operator) ? 1 : 0;
}
-bool env_operator_is_right_associative (s_env *env, const s_ident *op,
- u8 arity)
+bool env_operator_is_right_associative (s_env *env, const s_ident *op)
{
- s_facts_with_cursor cursor;
- s_tag tag_arity;
- s_tag tag_arity_u8;
- s_tag tag_is_a;
- s_tag tag_module;
- s_tag tag_module_name;
- s_tag tag_operator;
- s_tag tag_operator_assoc;
- s_tag tag_operator_assoc_var;
- s_tag tag_operator_var;
- s_tag tag_symbol;
- s_tag tag_sym;
- s_ident tmp;
+ s_tag tag_assoc;
+ s_tag tag_op;
+ s_tag tag_right;
assert(env);
assert(op);
- tmp = *op;
- ident_resolve_module(&tmp, env);
- tag_init_1( &tag_arity, ":arity");
- tag_init_u8( &tag_arity_u8, arity);
- tag_init_1( &tag_is_a, ":is_a");
- tag_init_1( &tag_module, ":module");
- tag_init_sym(&tag_module_name, tmp.module);
- tag_init_1( &tag_operator, ":operator");
- tag_init_1( &tag_operator_assoc, ":operator_associativity");
- tag_init_var(&tag_operator_assoc_var);
- tag_init_var(&tag_operator_var);
- tag_init_1( &tag_symbol, ":symbol");
- tag_init_sym(&tag_sym, tmp.sym);
- facts_with(&env->facts, &cursor, (t_facts_spec) {
- &tag_module_name, &tag_is_a, &tag_module,
- &tag_operator, &tag_operator_var, NULL,
- &tag_operator_var, &tag_is_a, &tag_operator,
- &tag_symbol, &tag_sym,
- &tag_arity, &tag_arity_u8,
- &tag_operator_assoc, &tag_operator_assoc_var,
- NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
- if (tag_operator_assoc_var.type == TAG_SYM &&
- tag_operator_assoc_var.data.sym == sym_1("right")) {
- facts_with_cursor_clean(&cursor);
- return true;
- }
- facts_with_cursor_clean(&cursor);
- return false;
+ tag_init_1( &tag_assoc, ":operator_associativity");
+ tag_init_ident(&tag_op, op);
+ tag_init_1( &tag_right, ":right");
+ return facts_find_fact_by_tags(&env->facts, &tag_op, &tag_assoc,
+ &tag_right) ? 1 : 0;
+}
+
+s8 env_operator_precedence (s_env *env, const s_ident *op)
+{
+ s_facts_cursor cursor;
+ s8 r = -1;
+ s_tag tag_op;
+ s_tag tag_precedence;
+ s_tag tag_var;
+ assert(env);
+ assert(op);
+ tag_init_ident(&tag_op, op);
+ tag_init_1( &tag_precedence, ":operator_precedence");
+ tag_init_var( &tag_var);
+ facts_with_tags(&env->facts, &cursor, &tag_op, &tag_precedence,
+ &tag_var);
+ if (facts_cursor_next(&cursor) &&
+ tag_var.type == TAG_U8) {
+ r = tag_var.data.u8;
}
- warnx("env_operator_is_right_associative: "
- "operator %s not found in module %s",
- tmp.sym->str.ptr.ps8,
- tmp.module->str.ptr.ps8);
- facts_with_cursor_clean(&cursor);
- return false;
+ else
+ warnx("env_operator_precedence: "
+ "precedence for operator %s not found in module %s",
+ op->sym->str.ptr.ps8,
+ op->module->str.ptr.ps8);
+ facts_cursor_clean(&cursor);
+ return r;
}
-s8 env_operator_precedence (s_env *env, const s_ident *op, u8 arity)
+s_ident * env_operator_resolve (s_env *env, const s_ident *op,
+ u8 arity, s_ident *dest)
{
s_facts_with_cursor cursor;
- s8 r = -1;
s_tag tag_arity;
s_tag tag_arity_u8;
s_tag tag_is_a;
s_tag tag_module;
s_tag tag_module_name;
s_tag tag_operator;
- s_tag tag_operator_precedence;
- s_tag tag_operator_precedence_var;
- s_tag tag_operator_var;
- s_tag tag_symbol;
+ s_tag tag_var;
s_tag tag_sym;
+ s_tag tag_symbol;
s_ident tmp;
- assert(env);
- assert(op);
tmp = *op;
ident_resolve_module(&tmp, env);
tag_init_1( &tag_arity, ":arity");
@@ -925,30 +854,29 @@ s8 env_operator_precedence (s_env *env, const s_ident *op, u8 arity)
tag_init_1( &tag_module, ":module");
tag_init_sym(&tag_module_name, tmp.module);
tag_init_1( &tag_operator, ":operator");
- tag_init_1( &tag_operator_precedence, ":operator_precedence");
- tag_init_var(&tag_operator_precedence_var);
- tag_init_var(&tag_operator_var);
- tag_init_1( &tag_symbol, ":symbol");
+ tag_init_var(&tag_var);
tag_init_sym(&tag_sym, tmp.sym);
+ tag_init_1( &tag_symbol, ":symbol");
facts_with(&env->facts, &cursor, (t_facts_spec) {
&tag_module_name, &tag_is_a, &tag_module,
- &tag_operator, &tag_operator_var, NULL,
- &tag_operator_var, &tag_is_a, &tag_operator,
- &tag_symbol, &tag_sym,
- &tag_operator_precedence, &tag_operator_precedence_var,
+ &tag_operator, &tag_var, NULL, /* module exports operator */
+ &tag_var, &tag_symbol, &tag_sym,
+ &tag_arity, &tag_arity_u8,
NULL, NULL });
- if (facts_with_cursor_next(&cursor) &&
- tag_operator_precedence_var.type == TAG_U8) {
- r = tag_operator_precedence_var.data.u8;
+ if (facts_with_cursor_next(&cursor)) {
+ if (tag_var.type == TAG_IDENT) {
+ *dest = tag_var.data.ident;
+ facts_with_cursor_clean(&cursor);
+ return dest;
+ }
}
- else
- warnx("env_operator_precedence: "
- "operator %s/%d not found in module %s",
+ if (false)
+ warnx("env_operator_resolve: operator %s/%d not found in module %s",
tmp.sym->str.ptr.ps8,
arity,
tmp.module->str.ptr.ps8);
facts_with_cursor_clean(&cursor);
- return r;
+ return NULL;
}
void env_pop_error_handler (s_env *env)
diff --git a/libc3/env.h b/libc3/env.h
index ac51116..5f6b753 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -57,14 +57,13 @@ bool env_module_load (const s_sym *module, s_env *env,
s_facts *facts);
bool env_module_maybe_reload (const s_sym *module, s_env *env,
s_facts *facts);
-s_ident * env_operator_call_ident (s_env *env, const s_ident *op,
- u8 arity, s_ident *dest);
-bool env_operator_find (s_env *env, const s_ident *op, u8 arity);
+s8 env_operator_arity (s_env *env, const s_ident *op);
+bool env_operator_find (s_env *env, const s_ident *op);
bool env_operator_is_right_associative (s_env *env,
- const s_ident *op,
- u8 arity);
-s8 env_operator_precedence (s_env *env, const s_ident *op,
- u8 arity);
+ const s_ident *op);
+s8 env_operator_precedence (s_env *env, const s_ident *op);
+s_ident * env_operator_resolve (s_env *env, const s_ident *op,
+ u8 arity, s_ident *dest);
bool env_tag_ident_is_bound (const s_env *env, const s_tag *tag,
s_facts *facts);
diff --git a/libc3/facts.c b/libc3/facts.c
index 1916662..381125d 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -177,6 +177,14 @@ s_fact * facts_find_fact (s_facts *facts, const s_fact *fact)
return result;
}
+s_fact * facts_find_fact_by_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object)
+{
+ s_fact f = {subject, predicate, object, 0};
+ return facts_find_fact(facts, &f);
+}
+
s_tag * facts_find_tag (s_facts *facts, const s_tag *tag)
{
s_set_item__tag *item;
diff --git a/libc3/facts.h b/libc3/facts.h
index d741c7e..3d45038 100644
--- a/libc3/facts.h
+++ b/libc3/facts.h
@@ -57,6 +57,9 @@ bool facts_unref_tag (s_facts *facts, const s_tag *tag);
sw facts_dump (s_facts *facts, s_buf *buf);
sw facts_dump_file (s_facts *facts, const s8 *path);
s_fact * facts_find_fact (s_facts *facts, const s_fact *fact);
+s_fact * facts_find_fact_by_tags (s_facts *facts, const s_tag *subject,
+ const s_tag *predicate,
+ const s_tag *object);
s_tag * facts_find_tag (s_facts *facts, const s_tag *tag);
sw facts_log_add (s_log *log, const s_fact *fact);
sw facts_log_remove (s_log *log, const s_fact *fact);
diff --git a/libc3/operator.c b/libc3/operator.c
index 890bfb7..27a95f7 100644
--- a/libc3/operator.c
+++ b/libc3/operator.c
@@ -13,23 +13,28 @@
#include <assert.h>
#include "c3.h"
-s_ident * operator_call_ident (const s_ident *op, u8 arity,
- s_ident *dest)
+s8 operator_arity (const s_ident *op)
{
- return env_operator_call_ident(&g_c3_env, op, arity, dest);
+ return env_operator_arity(&g_c3_env, op);
}
-bool operator_find (const s_ident *op, u8 arity)
+bool operator_find (const s_ident *op)
{
- return env_operator_find(&g_c3_env, op, arity);
+ return env_operator_find(&g_c3_env, op);
}
-bool operator_is_right_associative (const s_ident *op, u8 arity)
+bool operator_is_right_associative (const s_ident *op)
{
- return env_operator_is_right_associative(&g_c3_env, op, arity);
+ return env_operator_is_right_associative(&g_c3_env, op);
}
-s8 operator_precedence (const s_ident *op, u8 arity)
+s8 operator_precedence (const s_ident *op)
{
- return env_operator_precedence(&g_c3_env, op, arity);
+ return env_operator_precedence(&g_c3_env, op);
+}
+
+s_ident * operator_resolve (const s_ident *op, u8 arity,
+ s_ident *dest)
+{
+ return env_operator_resolve(&g_c3_env, op, arity, dest);
}
diff --git a/libc3/operator.h b/libc3/operator.h
index 3bf2e37..548ebfe 100644
--- a/libc3/operator.h
+++ b/libc3/operator.h
@@ -16,10 +16,11 @@
#include "types.h"
/* Observers */
-s_ident * operator_call_ident (const s_ident *op, u8 arity,
- s_ident *dest);
-bool operator_find (const s_ident *op, u8 arity);
-bool operator_is_right_associative (const s_ident *op, u8 arity);
-s8 operator_precedence (const s_ident *op, u8 arity);
+s8 operator_arity (const s_ident *op);
+bool operator_find (const s_ident *op);
+bool operator_is_right_associative (const s_ident *op);
+s8 operator_precedence (const s_ident *op);
+s_ident * operator_resolve (const s_ident *ident, u8 arity,
+ s_ident *dest);
#endif /* OPERATOR_H */
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index 0e70809..64e3e92 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -114,7 +114,6 @@ TEST_CASE(facts_cursor_next)
s_facts_cursor cursor;
uw i = 0;
s8 *p[24] = {
- "a",
"-0x10000000000000000",
"-0x100000000",
"-0x10000",
@@ -133,10 +132,11 @@ TEST_CASE(facts_cursor_next)
"\"a\"",
"A",
":a",
- "{a, b}",
"{:a, :b}",
- "{{a, b}, {c, d}}",
"{{:a, :b}, {:c, :d}}",
+ "{{a, b}, {c, d}}",
+ "{a, b}",
+ "a",
NULL
};
s_fact fact[24];
diff --git a/test/facts_test_dump_file.expected.facts b/test/facts_test_dump_file.expected.facts
index 2eb5553..4d3a9e9 100644
--- a/test/facts_test_dump_file.expected.facts
+++ b/test/facts_test_dump_file.expected.facts
@@ -1,6 +1,5 @@
%{module: C3.Facts.Dump,
version: 1}
-add {a, a, a}
add {-18446744073709551616, -18446744073709551616, -18446744073709551616}
add {-4294967296, -4294967296, -4294967296}
add {-65536, -65536, -65536}
@@ -19,7 +18,8 @@ add {((), ()), ((), ()), ((), ())}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
-add {{a, b}, {a, b}, {a, b}}
add {{:a, :b}, {:a, :b}, {:a, :b}}
-add {{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
add {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
+add {{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
+add {{a, b}, {a, b}, {a, b}}
+add {a, a, a}
diff --git a/test/facts_test_save.expected.facts b/test/facts_test_save.expected.facts
index 2eb5553..4d3a9e9 100644
--- a/test/facts_test_save.expected.facts
+++ b/test/facts_test_save.expected.facts
@@ -1,6 +1,5 @@
%{module: C3.Facts.Dump,
version: 1}
-add {a, a, a}
add {-18446744073709551616, -18446744073709551616, -18446744073709551616}
add {-4294967296, -4294967296, -4294967296}
add {-65536, -65536, -65536}
@@ -19,7 +18,8 @@ add {((), ()), ((), ()), ((), ())}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
-add {{a, b}, {a, b}, {a, b}}
add {{:a, :b}, {:a, :b}, {:a, :b}}
-add {{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
add {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
+add {{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
+add {{a, b}, {a, b}, {a, b}}
+add {a, a, a}