SNRK-71: buildDependencyNode is implemented

This commit is contained in:
liubar.pa 2023-05-05 21:21:46 +03:00
parent eda376d51d
commit ff84d2e87b

View File

@ -14,5 +14,29 @@ public suspend fun parseMd(mdFile: ByteArray): MdAstRoot {
} }
public suspend fun buildDependencyGraphNode(mdFile: ByteArray): DependencyGraphNode { public suspend fun buildDependencyGraphNode(mdFile: ByteArray): DependencyGraphNode {
val treeRoot = parseMd(mdFile)
val dependencies = mutableListOf<DependencyGraphEdge>()
fillDependencies(treeRoot, dependencies)
return DependencyGraphNode(treeRoot, dependencies)
}
private suspend fun fillDependencies(
currentNode: MdAstElement,
dependencies: MutableList<DependencyGraphEdge>) {
// when (currentNode) {
// is MdAstParent -> {
// val iterator = currentNode.children.listIterator()
// while (iterator.hasNext()) {
// iterator.next()
// }
// }
// else -> {}
// }
TODO() TODO()
} }