diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-14 14:52:28 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-14 14:53:03 -0700 |
| commit | c9ff0ff04b2d1922bcfe5b1106b9979c29b167a2 (patch) | |
| tree | 76616ba5dddc1d4b11c88fa16460ae673e2969a0 /nomsu_compiler.lua | |
| parent | d535dc57940f6c9558d3b588d53b44a87b2a8ed2 (diff) | |
Fixed up some edge cases with parsing and comments.
Diffstat (limited to 'nomsu_compiler.lua')
| -rw-r--r-- | nomsu_compiler.lua | 12 |
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 |
