Object

laika.parse.markup

InlineParsers

Related Doc: package markup

Permalink

object 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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. InlineParsers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait ResultBuilder[Elem, +To] extends AnyRef

    Permalink

    Abstracts the internal process of building up the result of an inline parser.

    Abstracts the internal process of building up the result of an inline parser. Since some inline parser produce a tree of nested spans whereas others may only produce a text result, they often require the same logic in how they deal with nested constructs.

  2. class SpanBuilder extends ResultBuilder[Span, List[Span]]

    Permalink

    ResultBuilder that produces a list of spans.

  3. class TextBuilder extends ResultBuilder[String, String]

    Permalink

    ResultBuilder that produces a String.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. def inline[Elem, To](text: ⇒ DelimitedText[String], nested: ⇒ Map[Char, Parser[Elem]], resultBuilder: ⇒ ResultBuilder[Elem, To]): Parser[To]

    Permalink

    Generic base parser that parses inline elements based on the specified helper parsers.

    Generic base parser that parses inline elements based on the specified helper parsers. Usually not used directly by parser implementations, this is the base parser the other inline parsers of this trait delegate to.

    Elem

    the element type produced by a single parser for a nested span

    To

    the type of the result this parser produces

    text

    the parser for the text of the current span element

    nested

    a mapping from the start character of a span to the corresponding parser for nested span elements

    resultBuilder

    responsible for building the final result of this parser based on the results of the helper parsers

    returns

    the resulting parser

  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. def spans(parser: ⇒ DelimitedText[String], spanParsers: ⇒ Map[Char, Parser[Span]]): Parser[List[Span]]

    Permalink

    Parses a list of spans based on the specified helper parsers.

    Parses a list of spans based on the specified helper parsers.

    parser

    the parser for the text of the current span element

    spanParsers

    a mapping from the start character of a span to the corresponding parser for nested span elements

    returns

    the resulting parser

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. def text(parser: ⇒ DelimitedText[String], nested: ⇒ Map[Char, Parser[String]]): Parser[String]

    Permalink

    Parses text based on the specified helper parsers.

    Parses text based on the specified helper parsers.

    parser

    the parser for the text of the current element

    nested

    a mapping from the start character of a span to the corresponding parser for nested span elements

    returns

    the resulting parser

  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped