InlineParsers

Provides base parsers that abstract aspects of inline parsing common to most lightweight markup languages.

It contains helper parsers that abstract the typical logic required for parsing nested spans. In many cases a parser has to recognize the end of the span as well as potentially the start of a nested span. These two concerns are usually unrelated.

This object offers helpers that simplify creating these types of parsers and also optimize performance of inline parsing. Due to the nature of lightweight text markup inline parsing would usually require trying a long list of choices on each input character, which is slow. These base parsers work based on mappings from the first character of an inline span to the corresponding full parser.

Companion:
object
class Object
trait Matchable
class Any
object builders.type
object InlineParsers.type

Value members

Concrete methods

def spans(parser: => DelimitedText): InlineParser[Span, List[Span]]

Creates a new parser that reads input until the delimiters in the specified parser are detected.

Creates a new parser that reads input until the delimiters in the specified parser are detected.

The returned parser allows to register parsers for child spans with its embed method. Without calling it, the result of this parser would always just be a single span of type Text.

def text(parser: => DelimitedText): InlineParser[String, String]

Creates a new parser that reads text until the delimiters in the specified parser are detected.

Creates a new parser that reads text until the delimiters in the specified parser are detected.

The returned parser allows to register parsers for child spans with its embed method, for example for reading escape sequences.