laika.template

TemplateParsers

trait TemplateParsers extends InlineParsers

Provides parsers for the default template format.

Linear Supertypes
InlineParsers, MarkupParsers, BaseParsers, RegexParsers, Parsers, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TemplateParsers
  2. InlineParsers
  3. MarkupParsers
  4. BaseParsers
  5. RegexParsers
  6. Parsers
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Elem = Char

    Definition Classes
    RegexParsers → Parsers
  2. case class Error extends NoSuccess with Product with Serializable

    Definition Classes
    Parsers
  3. case class Failure extends NoSuccess with Product with Serializable

    Definition Classes
    Parsers
  4. type Input = Reader[Elem]

    Definition Classes
    Parsers
  5. class MarkupParserException extends RuntimeException

    Exception thrown when parsing a text markup document or fragment fails.

  6. sealed abstract class NoSuccess extends ParseResult[Nothing]

    Definition Classes
    Parsers
  7. trait OnceParser[+T] extends Parser[T]

    Definition Classes
    Parsers
  8. sealed abstract class ParseResult[+T] extends AnyRef

    Definition Classes
    Parsers
  9. abstract class Parser[+T] extends (Input) ⇒ ParseResult[T]

    Definition Classes
    Parsers
  10. class ParserOps[A] extends AnyRef

    Provides additional combinator methods to parsers via implicit conversion.

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

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

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

    ResultBuilder that produces a list of spans.

  13. case class Success[+T] extends ParseResult[T] with Product with Serializable

    Definition Classes
    Parsers
  14. class TextBuilder extends ResultBuilder[String, String]

    ResultBuilder that produces a String.

  15. class TextParser extends Parser[String]

    API for specifying further constraints on the parsers provided by this base trait.

  16. case class ~[+a, +b] extends Product with Serializable

    Definition Classes
    Parsers

Abstract Value Members

  1. abstract def prepareSpanParsers: Map[Char, Parser[Span]]

    Extension hook for modifying the default span parser map.

    Extension hook for modifying the default span parser map. The default implementation returns the specified parser unchanged.

    Attributes
    protected
    Definition Classes
    InlineParsers

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object NoSuccess

    Definition Classes
    Parsers
  7. def OnceParser[T](f: (Input) ⇒ ParseResult[T]): Parser[T] with OnceParser[T]

    Definition Classes
    Parsers
  8. def Parser[T](f: (Input) ⇒ ParseResult[T]): Parser[T]

    Definition Classes
    Parsers
  9. def accept[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  10. def accept[ES](es: ES)(implicit arg0: (ES) ⇒ List[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  11. implicit def accept(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  12. def acceptIf(p: (Elem) ⇒ Boolean)(err: (Elem) ⇒ String): Parser[Elem]

    Definition Classes
    Parsers
  13. def acceptMatch[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  14. def acceptSeq[ES](es: ES)(implicit arg0: (ES) ⇒ Iterable[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  15. val any: TextParser

    Consumes any kind of input, always succeeds.

    Consumes any kind of input, always succeeds. This parser would consume the entire input unless a max constraint is specified.

    Definition Classes
    MarkupParsers
  16. def anyBut(chars: Char*): TextParser

    Consumes any number of consecutive characters that are not one of the specified characters.

    Consumes any number of consecutive characters that are not one of the specified characters. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  17. def anyIn(ranges: Traversable[Char]*): TextParser

    Consumes any number of consecutive characters that are in one of the specified character ranges.

    Consumes any number of consecutive characters that are in one of the specified character ranges. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  18. def anyOf(chars: Char*): TextParser

    Consumes any number of consecutive occurrences of the specified characters.

    Consumes any number of consecutive occurrences of the specified characters. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  19. def anyUntil(until: ⇒ Parser[Any]): TextParser

    Consumes any number of characters for which the specified parser fails on the corresponding offset.

    Consumes any number of characters for which the specified parser fails on the corresponding offset. This parser fails if the end of input is reached without the specified parser ever succeeding or if the parser causes an Error result instead of a plain Failure or Success. Further constraints like minimum or maximum number of required matching characters can be specified through the API of the returned TextParser instance.

    Definition Classes
    MarkupParsers
  20. def anyUntil(chars: Char*): TextParser

    Consumes any number of consecutive characters that are not one of the specified characters.

    Consumes any number of consecutive characters that are not one of the specified characters.

    This parser is identical to the anyBut parser except for two differences: this parser fails if it reaches the end of the input without seeing any of the specified characters and it also consumes this final character, without adding it to the result. This parser is usually used when a construct like a span enclosed between two characters needs to be parsed.

    Definition Classes
    MarkupParsers
  21. def anyWhile(p: (Char) ⇒ Boolean): TextParser

    Consumes any number of consecutive characters which satisfy the specified predicate.

    Consumes any number of consecutive characters which satisfy the specified predicate. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  22. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  23. val atStart: Parser[Parser[Unit]]

    Succeeds at the start of the input.

    Succeeds at the start of the input.

    Definition Classes
    MarkupParsers
  24. def chainl1[T, U](first: ⇒ Parser[T], p: ⇒ Parser[U], q: ⇒ Parser[(T, U) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  25. def chainl1[T](p: ⇒ Parser[T], q: ⇒ Parser[(T, T) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  26. def chainr1[T, U](p: ⇒ Parser[T], q: ⇒ Parser[(T, U) ⇒ U], combine: (T, U) ⇒ U, first: U): Parser[U]

    Definition Classes
    Parsers
  27. implicit def charToTraversalble(char: Char): Traversable[Char]

    Implicit conversion that allows to pass a single character to the range-based anyIn parser.

    Implicit conversion that allows to pass a single character to the range-based anyIn parser.

    Definition Classes
    MarkupParsers
  28. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def commit[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  30. def elem(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  31. def elem(kind: String, p: (Elem) ⇒ Boolean): Parser[Elem]

    Definition Classes
    Parsers
  32. def eof: Parser[String]

    Succeeds at the end of the input.

    Succeeds at the end of the input.

    Definition Classes
    MarkupParsers
  33. def eol: Parser[String]

    Succeeds at the end of a line, including the end of the input.

    Succeeds at the end of a line, including the end of the input. Produces an empty string as a result and consumes any new line characters.

    Definition Classes
    MarkupParsers
  34. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  36. def err(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  37. def failure(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  38. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  40. def guard[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  41. def handleWhiteSpace(source: CharSequence, offset: Int): Int

    Attributes
    protected
    Definition Classes
    RegexParsers
  42. def hashCode(): Int

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

    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

    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

    Definition Classes
    InlineParsers
  44. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  45. implicit def literal(s: String): Parser[String]

    Definition Classes
    RegexParsers
  46. def log[T](p: ⇒ Parser[T])(name: String): Parser[T]

    Definition Classes
    Parsers
  47. def lookBehind[T](offset: Int, parser: ⇒ Parser[T]): Parser[T]

    Applies the specified parser at the specified offset behind the current position.

    Applies the specified parser at the specified offset behind the current position. Never consumes any input.

    Definition Classes
    BaseParsers
  48. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

    Definition Classes
    Parsers
  49. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  50. def not[T](p: ⇒ Parser[T]): Parser[Unit]

    Definition Classes
    Parsers
  51. final def notify(): Unit

    Definition Classes
    AnyRef
  52. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  53. def opt[T](p: ⇒ Parser[T]): Parser[Option[T]]

    Definition Classes
    Parsers
  54. def optimizedCharLookup(chars: Char*): (Char) ⇒ Boolean

    Returns an optimized, Array-based lookup function for the specified characters.

    Returns an optimized, Array-based lookup function for the specified characters.

    Attributes
    protected
    Definition Classes
    MarkupParsers
  55. def optimizedRangeLookup(ranges: Traversable[Char]*): (Char) ⇒ Boolean

    Returns an optimized, Array-based lookup function for the specified ranges of characters.

    Returns an optimized, Array-based lookup function for the specified ranges of characters.

    Attributes
    protected
    Definition Classes
    MarkupParsers
  56. def parse[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  57. def parse[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  58. def parse[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  59. def parseAll[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  60. def parseAll[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  61. def parseAll[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  62. def parseInline(source: String): List[Span]

    Fully parses the input string and produces a list of spans, using the default span parsers returned by the spanParsers method.

    Fully parses the input string and produces a list of spans, using the default span parsers returned by the spanParsers method.

    This function is expected to always succeed, errors would be considered a bug of this library, as the parsers treat all unknown or malformed markup as regular text. Some parsers might additionally insert system message elements in case of markup errors.

    source

    the input to parse

    returns

    the result of the parser in form of a list of spans

    Definition Classes
    InlineParsers
  63. def parseInline(source: String, spanParsers: Map[Char, Parser[Span]]): List[Span]

    Fully parses the input string and produces a list of spans.

    Fully parses the input string and produces a list of spans.

    This function is expected to always succeed, errors would be considered a bug of this library, as the parsers treat all unknown or malformed markup as regular text. Some parsers might additionally insert system message elements in case of markup errors.

    source

    the input to parse

    spanParsers

    a mapping from the start character of a span to the corresponding parser

    returns

    the result of the parser in form of a list of spans

    Definition Classes
    InlineParsers
  64. def parseMarkup[T](parser: Parser[T], reader: Reader[Char]): T

    Fully parses the input from the specified reader and returns the result.

    Fully parses the input from the specified reader and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.

    Definition Classes
    MarkupParsers
  65. def parseMarkup[T](parser: Parser[T], source: String): T

    Fully parses the specified input string and returns the result.

    Fully parses the specified input string and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.

    Definition Classes
    MarkupParsers
  66. def phrase[T](p: Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  67. def positioned[T <: Positional](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  68. def reference[T](f: (String) ⇒ T): Parser[T]

    Parses a reference enclosed between {{ and }}.

  69. implicit def regex(r: Regex): Parser[String]

    Definition Classes
    RegexParsers
  70. def rep[T](first: ⇒ Parser[T], next: (T) ⇒ Parser[T]): Parser[List[T]]

    A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.

    A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.

    first

    the parser to use for the first piece of input

    next

    a function that determines the next parser based on the result of the previous

    Definition Classes
    BaseParsers
  71. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  72. def rep1[T](first: ⇒ Parser[T], p0: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.

  73. def rep1[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  74. def rep1sep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  75. def repMax[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Uses the parser for at most the specified number of repetitions, always succeeds.

    Uses the parser for at most the specified number of repetitions, always succeeds. The result is the list of results from applying the parser repeatedly.

    Definition Classes
    BaseParsers
  76. def repMin[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Uses the parser for at least the specified number of repetitions or otherwise fails.

    Uses the parser for at least the specified number of repetitions or otherwise fails. Continues to apply the parser after the minimum has been reached until if fails. The result is the list of results from applying the parser repeatedly.

    Definition Classes
    BaseParsers
  77. def repN[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  78. def repsep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  79. def skipWhitespace: Boolean

    Definition Classes
    MarkupParsers → RegexParsers
  80. final lazy val spanParsers: Map[Char, Parser[Span]]

    The mapping of markup start characters to their corresponding span parsers.

    The mapping of markup start characters to their corresponding span parsers.

    A parser mapped to a start character is not required to successfully parse the subsequent input. If it fails the character that triggered the parser invocation will be treated as normal text. The mapping is merely used as a performance optimization. The parser will be invoked with the input offset pointing to the character after the one specified as the key for the mapping.

    Definition Classes
    InlineParsers
  81. def spans(parser: ⇒ TextParser, spanParsers: ⇒ Map[Char, Parser[Span]]): Parser[List[Span]]

    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

    returns

    the resulting parser

    Definition Classes
    InlineParsers
  82. def success[T](v: T): Parser[T]

    Definition Classes
    Parsers
  83. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  84. def text(parser: ⇒ TextParser, nested: ⇒ Map[Char, Parser[String]]): Parser[String]

    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

    Definition Classes
    InlineParsers
  85. implicit def toParserOps[A](parser: Parser[A]): ParserOps[A]

    Definition Classes
    BaseParsers
  86. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  90. val whiteSpace: Regex

    Attributes
    protected
    Definition Classes
    RegexParsers
  91. def ws: TextParser

    Parses horizontal whitespace (space and tab).

    Parses horizontal whitespace (space and tab). Always succeeds, consuming all whitespace found.

    Definition Classes
    MarkupParsers

Deprecated Value Members

  1. def lastNoSuccess: NoSuccess

    Definition Classes
    Parsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0

  2. def lastNoSuccess_=(x: NoSuccess): Unit

    Definition Classes
    Parsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0

Inherited from InlineParsers

Inherited from MarkupParsers

Inherited from BaseParsers

Inherited from RegexParsers

Inherited from Parsers

Inherited from AnyRef

Inherited from Any

Ungrouped