From 5059c081ac624ede925d5256885509ddd17181c6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 30 Dec 2018 23:58:47 -0800 Subject: Auto-upgraded code. --- lib/file_hash.nom | 2 +- lib/object.nom | 2 +- lib/things.nom | 15 +++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/file_hash.nom b/lib/file_hash.nom index a45b684..67b4569 100644 --- a/lib/file_hash.nom +++ b/lib/file_hash.nom @@ -25,7 +25,7 @@ test: ) != "inf" assume ((hash "\000") != (hash "\000\000\000\000\000")) or barf - .."Incorrect hashing of null strings" + "Incorrect hashing of null strings" if $use_sha1: assume ((hash "hello world") == "Kq5sNclPz7QV2+lfQIuc6R7oRu0=") diff --git a/lib/object.nom b/lib/object.nom index 72e1588..0cede18 100644 --- a/lib/object.nom +++ b/lib/object.nom @@ -81,7 +81,7 @@ test: (object $classname extends $parent $class_body) compiles to: unless ($classname.type == "Action"): compile error at $classname - .."Expected this to be an action, not a \$classname.type" + "Expected this to be an action, not a \$classname.type" for $ in $classname: unless ($ is text): diff --git a/lib/things.nom b/lib/things.nom index e10b9eb..cf5a53f 100644 --- a/lib/things.nom +++ b/lib/things.nom @@ -106,14 +106,14 @@ externally (a class named $classname with $members ((initialize $it)'s meaning)) barf "Cannot set \$key, it's not one of the allowed member fields." set $class's metatable to { - .__tostring = ($class -> $class.__type), .__call = ( + .__tostring = ($class -> $class.__type) + .__call = for ($class with $initial_values): if ($initial_values == (nil)): return $class set $initial_values's metatable to $class if $initial_values.set_up: $initial_values, set up return $initial_values - ) } if ((initialize)'s meaning): @@ -136,8 +136,15 @@ externally (a class named $classname with $members ((initialize $it)'s meaning)) return Lua (" - \$class_id = a_class_named_1_with(\(quote $classname.stub), \($members as lua)\((Lua ", function(\$class_id)\n \$body_lua\nend") if $class_body else "")\ - ..) + \$class_id = a_class_named_1_with(\(quote $classname.stub), \($members as lua)\( + ( + Lua (" + , function(\$class_id) + \$body_lua + end + ") + ) if $class_body else "" + )) a_\$class_id = function(initial_values) return \($classname.stub, as lua id)(initial_values \ ..or {}) end an_\$class_id, a_\($class_id)_with, an_\($class_id)_with = a_\$class_id, a_\$class_id, a_\$class_id -- cgit v1.2.3