From 6728587dfc6a5f4090f2673113ffedb2be924daf Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 20 Jul 2018 20:27:15 -0700 Subject: Auto-formatted and auto-upgraded everything! --- lib/training_wheels.nom | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/training_wheels.nom') diff --git a/lib/training_wheels.nom b/lib/training_wheels.nom index 2845768..100927c 100644 --- a/lib/training_wheels.nom +++ b/lib/training_wheels.nom @@ -1,9 +1,10 @@ -#!/usr/bin/env nomsu -V2.4.4.3 +#!/usr/bin/env nomsu -V2.5.4.3 # This file contains a set of definitions that bring some familiar language features from other languages into nomsu (e.g. "==" and "continue") use "core" + parse [%a == %b] as (%a = %b) parse [%a == %b] as (%a is %b) parse [%a ~= %b, %a != %b, %a <> %b] as (%a is not %b) @@ -35,11 +36,13 @@ compile [function %args %body, lambda %args %body] to: to %lua write ")\n " %body = (%body as lua) lua> "\%body:convert_to_statements('return ');" - for % in %args.value: lua> "\%body:remove_free_vars(\%);" + for % in %args.value: + lua> "\%body:remove_free_vars(\%);" + to %lua write %body to %lua write "\nend)" return %lua parse [function %name %args %body] as (%name = (function %args %body)) compile [call %fn %args] to (..) - Lua value "\(%fn as lua expr)(unpack(\(%args as lua expr)))" \ No newline at end of file + Lua value "\(%fn as lua expr)(unpack(\(%args as lua expr)))" -- cgit v1.2.3