diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-08 15:23:22 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-08 15:24:15 -0800 |
| commit | 652c29bdef1f0991cc13bef59d6dc78b657ae9a4 (patch) | |
| tree | 8e335399e77b1893657b9fa985db0738034daac3 /core/io.nom | |
| parent | 1f3660f393c1a17988a15b89f18686b28e51a9e7 (diff) | |
Major overhaul, splitting nomsu_compiler into nomsu_environment,
nomsu_compiler, and nomsu_decompiler. Also added comprehensions.
Diffstat (limited to 'core/io.nom')
| -rw-r--r-- | core/io.nom | 6 |
1 files changed, 4 insertions, 2 deletions
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())"); |
