aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index 6dbe4c4..788d9a0 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -725,11 +725,13 @@ do
local _accum_0 = { }
local _len_0 = 1
for p, c in pairs(tree.comments or { }) do
- _accum_0[_len_0] = {
- comment = c,
- pos = p
- }
- _len_0 = _len_0 + 1
+ if tree.source.start <= p and p <= tree.source.stop then
+ _accum_0[_len_0] = {
+ comment = c,
+ pos = p
+ }
+ _len_0 = _len_0 + 1
+ end
end
comments = _accum_0
end