class LineTokenizer extends Parsers
Chops the input into lines and turns those lines into line tokens. Also takes care of preprocessing link definitions and xml blocks.
- Alphabetic
- By Inheritance
- LineTokenizer
- Parsers
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new LineTokenizer()
Type Members
- type Elem = String
we munch whole lines (OM NOM NOM)
we munch whole lines (OM NOM NOM)
- Definition Classes
- LineTokenizer → Parsers
- case class Error extends NoSuccess with Product with Serializable
- Definition Classes
- Parsers
- case class Failure extends NoSuccess with Product with Serializable
- Definition Classes
- Parsers
- type Input = Reader[Elem]
- Definition Classes
- Parsers
- sealed abstract class NoSuccess extends ParseResult[Nothing]
- Definition Classes
- Parsers
- trait OnceParser[+T] extends Parser[T]
- Definition Classes
- Parsers
- sealed abstract class ParseResult[+T] extends AnyRef
- Definition Classes
- Parsers
- abstract class Parser[+T] extends (Input) => ParseResult[T]
- Definition Classes
- Parsers
- case class Success[+T] extends ParseResult[T] with Product with Serializable
- Definition Classes
- Parsers
- case class ~[+a, +b] extends Product with Serializable
- Definition Classes
- Parsers
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def OnceParser[T](f: (Input) => ParseResult[T]): Parser[T] with OnceParser[T]
- Definition Classes
- Parsers
- def Parser[T](f: (Input) => ParseResult[T]): Parser[T]
- Definition Classes
- Parsers
- def accept[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]
- Definition Classes
- Parsers
- def accept[ES](es: ES)(implicit f: (ES) => List[Elem]): Parser[List[Elem]]
- Definition Classes
- Parsers
- implicit def accept(e: Elem): Parser[Elem]
- Definition Classes
- Parsers
- def acceptIf(p: (Elem) => Boolean)(err: (Elem) => String): Parser[Elem]
- Definition Classes
- Parsers
- def acceptMatch[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]
- Definition Classes
- Parsers
- def acceptSeq[ES](es: ES)(implicit f: (ES) => Iterable[Elem]): Parser[List[Elem]]
- Definition Classes
- Parsers
- def allowXmlBlocks: Boolean
Determines if xml blocks may be included verbatim.
Determines if xml blocks may be included verbatim. If true, they are passed through, else they are escaped and turned into paragraphs
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def chainl1[T, U](first: => Parser[T], p: => Parser[U], q: => Parser[(T, U) => T]): Parser[T]
- Definition Classes
- Parsers
- def chainl1[T](p: => Parser[T], q: => Parser[(T, T) => T]): Parser[T]
- Definition Classes
- Parsers
- def chainr1[T, U](p: => Parser[T], q: => Parser[(T, U) => U], combine: (T, U) => U, first: U): Parser[U]
- Definition Classes
- Parsers
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def commit[T](p: => Parser[T]): Parser[T]
- Definition Classes
- Parsers
- def elem(e: Elem): Parser[Elem]
- Definition Classes
- Parsers
- def elem(kind: String, p: (Elem) => Boolean): Parser[Elem]
- Definition Classes
- Parsers
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def err(msg: String): Parser[Nothing]
- Definition Classes
- Parsers
- def failure(msg: String): Parser[Nothing]
- Definition Classes
- Parsers
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def firstChar(line: String): Char
Returns the first char in the given string or a newline if the string is empty.
Returns the first char in the given string or a newline if the string is empty. This is done to speed up header parsing. Used to speed up line tokenizing substantially by using the first char in a line as lookahead for which parsers to even try.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def guard[T](p: => Parser[T]): Parser[T]
- Definition Classes
- Parsers
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def indicatorChar(line: String): Char
Finds the char in the given line that is the best indication of what kind of markdown line this is.
Finds the char in the given line that is the best indication of what kind of markdown line this is. The “special” Markdown lines all start with up to three spaces. Those are skipped if present. The first char after those (up to)three spaces or a newline is returned.
- def innerTokenize(lines: List[String], lookup: Map[String, LinkDefinition]): MarkdownLineReader
Turns a list of inner lines (the payloads of the lines making up the block) into line tokens.
Turns a list of inner lines (the payloads of the lines making up the block) into line tokens. Does not check for XML chunks or link definitions.
- def innerTokens(lookup: Map[String, LinkDefinition]): Parser[MarkdownLineReader]
Parses tokens that may occur inside a block.
Parses tokens that may occur inside a block. Works like the normal token parser except that it does not check for link definitions and verbatim XML.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lineToken: Parser[MarkdownLine]
Parses Markdown Lines.
Parses Markdown Lines. Always succeeds.
- def linkDefinition: Parser[LinkDefinition]
Parses a link definition.
- def log[T](p: => Parser[T])(name: String): Parser[T]
- Definition Classes
- Parsers
- def maybeUrlInNextLine(prev: (LinkDefinitionStart, Option[String])): Parser[LinkDefinition]
Tries to parse an URL from the next line if necessary.
Tries to parse an URL from the next line if necessary. The passed tuple is the result from a previous parser and used to decide how to continue parsing.
- def mkList[T]: (~[T, List[T]]) => List[T]
- Definition Classes
- Parsers
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def not[T](p: => Parser[T]): Parser[Unit]
- Definition Classes
- Parsers
- def notXmlChunkEnd: Parser[String]
Parses any line that does not start with a closing XML element.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def opt[T](p: => Parser[T]): Parser[Option[T]]
- Definition Classes
- Parsers
- def p[T](parser: lineParsers.Parser[T]): Parser[T]
Returns a parser based on the given line parser.
Returns a parser based on the given line parser. The resulting parser succeeds if the given line parser consumes the whole String.
- def phrase[T](p: Parser[T]): Parser[T]
- Definition Classes
- Parsers
- def positioned[T <: Positional](p: => Parser[T]): Parser[T]
- Definition Classes
- Parsers
- def preprocessToken: Parser[Product with Serializable]
Parses link definitions and verbatim xml blocks
- def rep[T](p: => Parser[T]): Parser[List[T]]
- Definition Classes
- Parsers
- 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
p0call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
- def rep1[T](p: => Parser[T]): Parser[List[T]]
- Definition Classes
- Parsers
- def rep1sep[T](p: => Parser[T], q: => Parser[Any]): Parser[List[T]]
- Definition Classes
- Parsers
- def repN[T](num: Int, p: => Parser[T]): Parser[List[T]]
- Definition Classes
- Parsers
- def repsep[T](p: => Parser[T], q: => Parser[Any]): Parser[List[T]]
- Definition Classes
- Parsers
- def splitLines(s: String): List[String]
Simple preprocessing: split the input at each newline.
Simple preprocessing: split the input at each newline. These whole lines are then fed to the actual Tokenizer.
- def success[T](v: T): Parser[T]
- Definition Classes
- Parsers
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tokenize(lines: Reader[String]): MarkdownLineReader
Tokenizes preprocessed lines read from a line reader.
- def tokenize(lines: List[String]): MarkdownLineReader
Tokenizes a preprocessed Markdown document.
- def tokenize(s: String): MarkdownLineReader
Tokenizes a whole Markdown document.
- def tokens: Parser[MarkdownLineReader]
Parses first level line tokens, i.e.
Parses first level line tokens, i.e. Markdown lines, XML chunks and link definitions.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def xmlChunk: Parser[XmlChunk]
Very dumb parser for XML chunks.
- def xmlChunkEnd: Parser[String]
Parses a line beginning with a closing XML tag.
- def xmlChunkStart: Parser[String]
The start of a verbatim XML chunk: any line starting directly with an XML element
- object lineParsers extends LineParsers