aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-14 15:24:24 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-14 15:24:31 -0700
commit7112af7cb6ee52f4ef9664db9c03db52d8c73ac9 (patch)
tree9d0218229db4ab396286638958353ce523ee3985 /nomsu_compiler.lua
parent626b6cab7988e26766ba64178dd67e4093494552 (diff)
Fixed comments in nomsu codegen.
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index c7b7dc6..f01edf7 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -1078,7 +1078,7 @@ do
comments = _accum_0
end
table.sort(comments, function(a, b)
- return (a.pos > b.pos)
+ return (a.source.start > b.source.start)
end)
pop_comments = function(pos, prefix, suffix)
if prefix == nil then
@@ -1089,11 +1089,11 @@ do
end
local nomsu = NomsuCode(tree.source)
for i = #comments, 1, -1 do
- if comments[i].pos > pos then
+ if comments[i].source.start > pos then
break
end
local comment
- comment, comments[i] = comments[i].comment, nil
+ comment, comments[i] = comments[i][1], nil
nomsu:append("#" .. (gsub(comment, "\n", "\n ")) .. "\n")
if comment:match("^\n.") then
nomsu:append("\n")