trait BlockParsers extends AnyRef
Provides base parsers that abstract aspects of block parsing common to most lightweight markup languages.
A block parser in Laika can always safely assume that it is invoked at the start of the current line and that the line is not empty.
- Alphabetic
- By Inheritance
- BlockParsers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
block(firstLinePrefix: Parser[Any], linePrefix: ⇒ Parser[Any], nextBlockPrefix: ⇒ Parser[Any]): Parser[BlockSource]
Parses a full block based on the specified helper parsers.
Parses a full block based on the specified helper parsers.
The result of this parser will not contain the characters consumed by any of the specified prefix parsers. The block source returned by this method maintains x-offsets for each individual line so that it can be passed down to recursive block or span parsers without losing position tracking.
- firstLinePrefix
parser that recognizes the start of the first line of this block
- linePrefix
parser that recognizes the start of subsequent lines that still belong to the same block
- nextBlockPrefix
parser that recognizes whether a line after one or more blank lines still belongs to the same block
-
def
block(firstLinePrefix: Parser[Any], linePrefix: ⇒ Parser[Any]): Parser[BlockSource]
Parses a full block based on the specified helper parsers.
Parses a full block based on the specified helper parsers.
The string result of this parser will not contain the characters consumed by any of the specified prefix parsers.
- firstLinePrefix
parser that recognizes the start of the first line of this block
- linePrefix
parser that recognizes the start of subsequent lines that still belong to the same block
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
indentedBlock(minIndent: Int = 1, linePredicate: ⇒ Parser[Any] = success(()), endsOnBlankLine: Boolean = false, firstLineIndented: Boolean = false, maxIndent: Int = Int.MaxValue): Parser[BlockSource]
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first.
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first. The indentation may vary between the parts of the indented block, so that this parser only cuts off the minimum indentation shared by all lines, but each line must have at least the specified minimum indentation.
- minIndent
the minimum indentation that each line in this block must have
- linePredicate
parser that recognizes the start of subsequent lines that still belong to the same block
- endsOnBlankLine
indicates whether parsing should end on the first blank line
- firstLineIndented
indicates whether the first line is expected to be indented, too
- maxIndent
the maximum indentation that will get dropped from the start of each line of the result
- returns
a parser that produces the raw text of the parsed block with the indentation removed
-
def
indentedBlockWithLevel(minIndent: Int = 1, linePredicate: ⇒ Parser[Any] = success(()), endsOnBlankLine: Boolean = false, firstLineIndented: Boolean = false, maxIndent: Int = Int.MaxValue): Parser[(BlockSource, Int)]
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first.
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first. The indentation may vary between the parts of the indented block, so that this parser only cuts off the minimum indentation shared by all lines, but each line must have at least the specified minimum indentation.
- minIndent
the minimum indentation that each line in this block must have
- linePredicate
parser that recognizes the start of subsequent lines that still belong to the same block
- endsOnBlankLine
indicates whether parsing should end on the first blank line
- firstLineIndented
indicates whether the first line is expected to be indented, too
- maxIndent
the maximum indentation that will get dropped from the start of each line of the result
- returns
a parser that produces the raw text of the parsed block with the indentation removed and the indentation level (number of whitespace characters removed from the text lines)
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()