RecursiveParserBase

abstract class RecursiveParserBase(terminateParser: IMfmParser) : IMfmParser

Base implementation for detecting nested MFM forms within MFM forms. Parse recursively until terminateParser is satisfied. Note that the IMfmParsers registered in IMfmParserContext.excludeParsers, which are passed to IMfmParser.find, are not used during analysis.

Inheritors

Constructors

Link copied to clipboard
constructor(terminateParser: IMfmParser)

Properties

Link copied to clipboard
protected abstract val foundType: FoundType
Link copied to clipboard
protected abstract val parsers: List<IMfmParser>

Functions

Link copied to clipboard
open override fun find(input: String, startAt: Int, context: IMfmParserContext): IMfmParserResult

Finds a substring in the input string starting from a given index.

Link copied to clipboard
open fun not(): IMfmParser

Returns a negative (not) version of the current MFM parser. A negative parser will return a failure result if the substring is found.

Link copied to clipboard
open fun optional(): IMfmParser

Returns an optional version of the current substring parser. An optional parser will return a successful result even if the substring is not found.