summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua4
-rw-r--r--script/parser/luadoc.lua3
2 files changed, 6 insertions, 1 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 3f68ccd2..7a9cb875 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -478,7 +478,9 @@ function m.getLocal(source, name, pos)
if not block then
return nil
end
- if block.start <= pos and block.finish >= pos then
+ if block.start <= pos
+ and block.finish >= pos
+ and blockTypes[block.type] then
break
end
block = block.parent
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 420e78cd..c4f40ac4 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1661,6 +1661,9 @@ return function (state)
end
end
+ ast.docs.start = ast.start
+ ast.docs.finish = ast.finish
+
if #ast.docs == 0 then
return
end