All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.intellij.markdown.parser.sequentialparsers.SequentialParserManager.kt Maven / Gradle / Ivy

There is a newer version: 0.7.3
Show newest version
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