[FIR] Implement light tree VAL_VAR strategy as an example

This commit is contained in:
Mikhail Glukhikh
2020-11-17 13:13:07 +03:00
parent 1795c4f3e5
commit 8320a2966a
5 changed files with 92 additions and 31 deletions
@@ -188,7 +188,13 @@ sealed class FirPsiSourceElement<out P : PsiElement>(val psi: P) : FirSourceElem
node.unwrap().psi.parent?.node?.let { TreeBackedLighterAST.wrap(it) }
override fun getChildren(node: LighterASTNode, nodesRef: Ref<Array<LighterASTNode>>): Int {
val children = node.unwrap().psi.children
val psi = node.unwrap().psi
val children = mutableListOf<PsiElement>()
var child = psi.firstChild
while (child != null) {
children += child
child = child.nextSibling
}
if (children.isEmpty()) {
nodesRef.set(LighterASTNode.EMPTY_ARRAY)
} else {