From 652c29bdef1f0991cc13bef59d6dc78b657ae9a4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 8 Nov 2018 15:23:22 -0800 Subject: Major overhaul, splitting nomsu_compiler into nomsu_environment, nomsu_compiler, and nomsu_decompiler. Also added comprehensions. --- core/io.nom | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/io.nom') diff --git a/core/io.nom b/core/io.nom index 6b67b50..e12e4eb 100644 --- a/core/io.nom +++ b/core/io.nom @@ -4,7 +4,9 @@ use "core/metaprogramming.nom" -(say %message) compiles to (..) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(say %message) compiles to: lua> "\ ..if \%message.type == "Text" then return LuaCode(tree.source, "print(", \(%message as lua expr), ");"); @@ -12,7 +14,7 @@ use "core/metaprogramming.nom" return LuaCode(tree.source, "print(tostring(", \(%message as lua expr), "));"); end" -(ask %prompt) compiles to (..) +(ask %prompt) compiles to: lua> "\ ..if \%prompt.type == "Text" then return LuaCode.Value(tree.source, "(io.write(", \(%prompt as lua expr), ") and io.read())"); -- cgit v1.2.3