aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.moon
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-11 18:28:10 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-11 18:28:34 -0800
commit171e9d674e4ae85e303c90679ad47bceda3b3810 (patch)
tree5d3175abeea4135ba994b2645e0ae0f9d9a0be77 /nomsu_compiler.moon
parent3c7a0ff2ea81c0530d0168c4b9f4326a6200b781 (diff)
Re-implemented nomsu -> lua comment translation and added file chunk
comments.
Diffstat (limited to 'nomsu_compiler.moon')
-rw-r--r--nomsu_compiler.moon7
1 files changed, 1 insertions, 6 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon
index c71ee1d..497d210 100644
--- a/nomsu_compiler.moon
+++ b/nomsu_compiler.moon
@@ -270,10 +270,6 @@ compile = setmetatable({
i += 1
lua\append "\n return comprehension\nend)()"
return lua
- --lua = LuaCode\from tree.source, "#{tree.type}{"
- --lua\concat_append([compile(e) for e in *tree when e.type != 'Comment'], ", ", ",\n ")
- --lua\append "}"
- --return lua
when "DictEntry"
key, value = tree[1], tree[2]
@@ -323,8 +319,7 @@ compile = setmetatable({
"compilation depends on the earlier chunks")
when "Comment"
- -- TODO: implement?
- return LuaCode\from(tree.source, "")
+ return LuaCode\from(tree.source, "-- ", (tree[1]\gsub('\n', '\n-- ')))
when "Error"
error("Can't compile errors")