Skip to content

Commit 478e9ba

Browse files
committed
bug fix #15 StackOverflowError
1 parent fbca54e commit 478e9ba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

EmmyLua-Common/src/main/java/com/tang/intellij/lua/psi/LuaDeclarationTree.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ private abstract class LuaDeclarationTreeBase(val file: PsiFile) : LuaRecursiveV
236236
}
237237
}, psi)
238238
}
239+
if (psi is LuaForBStat) { // for _, a in ipairs(a) do end
240+
return push(object : Scope(this, pos, curScope){
241+
override fun walkUp(pos: Int, lev: Int, process: (declaration: Declaration) -> Boolean) {
242+
if (lev == 0) {
243+
this.parent?.walkUp(pos, lev, process)
244+
} else super.walkUp(pos, lev, process)
245+
}
246+
}, psi)
247+
}
239248
return push(Scope(this, pos, curScope), psi)
240249
}
241250

0 commit comments

Comments
 (0)