commonMain.org.intellij.markdown.parser.sequentialparsers.SequentialParserManager.kt Maven / Gradle / Ivy
package org.intellij.markdown.parser.sequentialparsers
abstract class SequentialParserManager {
abstract fun getParserSequence(): List
fun runParsingSequence(tokensCache: TokensCache, rangesToParse: List): Collection {
val result = ArrayList()
var parsingSpaces = ArrayList>()
parsingSpaces.add(rangesToParse)
for (sequentialParser in getParserSequence()) {
val nextLevelSpaces = ArrayList>()
for (parsingSpace in parsingSpaces) {
val currentResult = sequentialParser.parse(tokensCache, parsingSpace)
result.addAll(currentResult.parsedNodes)
nextLevelSpaces.addAll(currentResult.rangesToProcessFurther)
}
parsingSpaces = nextLevelSpaces
}
return result
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy