diff --git a/lib/core/errors.nom b/lib/core/errors.nom index e24c012..e1dd9d4 100644 --- a/lib/core/errors.nom +++ b/lib/core/errors.nom @@ -23,8 +23,8 @@ use "core/control_flow" do local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) if _a ~= _b then - _a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) - _b = type_of(_b) == 'Text' and _b:as_lua() or tostring(_b) + _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a) + _b = type_of(_b) == 'Text' and _b:as_lua() or _1_as_text(_b) at_1_fail(\(quote "\($condition.1.source)"), "Assumption failed: This value was ".._a.." but it was expected to be ".._b..".") end @@ -36,7 +36,7 @@ use "core/control_flow" do local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) if _a == _b then - _a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) + _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a) at_1_fail(\(quote "\($condition.1.source)"), "Assumption failed: This value was ".._a.." but it wasn't expected to be.") end @@ -48,8 +48,8 @@ use "core/control_flow" do local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) if _a ~= _b then - _a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) - _b = type_of(_b) == 'Text' and _b:as_lua() or tostring(_b) + _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a) + _b = type_of(_b) == 'Text' and _b:as_lua() or _1_as_text(_b) at_1_fail(\(quote "\($condition.1.source)"), "Assumption failed: This value was ".._a..", but it was expected to be \($condition.3)".._b..".") end