laika.parse.text
Members list
Type members
Classlikes
Common groups of characters as input for parser definitions.
Common groups of characters as input for parser definitions.
These groups are all in the ASCII range. For dealing with the entire unicode range you can use the generic anyWhile
parser that accepts a Char => Boolean
predicate.
Attributes
- Source
- CharGroup.scala
- Supertypes
- Self type
-
CharGroup.type
Optimized parser for character input.
Optimized parser for character input.
Attributes
- Companion
- object
- Source
- Characters.scala
- Supertypes
Companion with factory methods for creating optimized character parsers.
Companion with factory methods for creating optimized character parsers.
Attributes
- Companion
- class
- Source
- Characters.scala
- Supertypes
- Self type
-
Characters.type
A parser for text that ends with a specific delimiter condition, either marking the end of the text span or the start of an embedded inner span.
A parser for text that ends with a specific delimiter condition, either marking the end of the text span or the start of an embedded inner span.
Attributes
- Companion
- object
- Source
- DelimitedText.scala
- Supertypes
Attributes
- Companion
- class
- Source
- DelimitedText.scala
- Supertypes
- Self type
-
DelimitedText.type
A parser that simplifies the expression of typical conditions for start and end delimiters of inline spans.
A parser that simplifies the expression of typical conditions for start and end delimiters of inline spans.
It allows to specify conditions for the immediately preceding and following character of the parsed delimiter.
As an example, the following parser is only composed of base combinators
lookBehind(1, not(' ')) ~ "**" ~ lookAhead(not(' '))
It looks for the string "**" as a delimiter and does not allow any space character before or after the delimiter
With this API it can be rewritten as:
delimiter("**").prevNot(' ').nextNot(' ')
The only characters that this parser will consume and return as a result are those of the delimiter itself, not the surrounding characters that it validated.
Attributes
- Source
- DelimiterParser.scala
- Supertypes
A variant of the Characters type that can be used as a stable prefix for an optimized span parser as it is always non-empty.
A variant of the Characters type that can be used as a stable prefix for an optimized span parser as it is always non-empty.
Attributes
- Source
- PrefixCharacters.scala
- Supertypes
A parser that is associated with a non-empty set of trigger characters for performance optimizations.
A parser that is associated with a non-empty set of trigger characters for performance optimizations.
There is usually no need to create such a parser manually, as some of the basic building blocks in TextParsers
create such a parser (e.g. the literal
, oneOf
or someOf
parsers).
This set only has only an effect when this parser is used in an optimized parser for recursive spans, meaning it is either registered as a top-level parser (with SpanParser.standalone
or SpanParser.recursive
) or passed to a custom span parser with InlineParser.embed
. In all other use cases this parser behaves just like plain parser.
Attributes
- Companion
- object
- Source
- PrefixedParser.scala
- Supertypes
- Known subtypes
- Self type
Factories and utilities for creating or processing PrefixedParser instances.
Factories and utilities for creating or processing PrefixedParser instances.
Attributes
- Companion
- trait
- Source
- PrefixedParser.scala
- Supertypes
- Self type
-
PrefixedParser.type
Base text parsers that provide optimized low-level parsers for typical requirements of text markup parsers.
Base text parsers that provide optimized low-level parsers for typical requirements of text markup parsers. In particular they are meant as an efficient replacement for scenarios where usually regex parsers are used. In cases where different parsers need to be tried for relatively short input sequences, regex parsers tend to be less efficient. Furthermore, these base parsers may also improve readability, as it allows to combine simple low-level parsers to higher-level parsers based on the Laika combinator API, instead of producing long regexes which may be hard to read.
Attributes
- Companion
- object
- Source
- TextParsers.scala
- Supertypes
- Known subtypes
-
object TextParsers.typeobject builders.type
Instance that allows to import all text parsers in isolation.
Instance that allows to import all text parsers in isolation.
Usually it is more convenient to import laika.parse.api._ to get all parser builders with one import.
Attributes
- Companion
- trait
- Source
- TextParsers.scala
- Supertypes
- Self type
-
TextParsers.type
Processes whitespace, removing or replacing most whitespace characters except for newline and space.
Processes whitespace, removing or replacing most whitespace characters except for newline and space.
It modifies string input in the following ways:
- Replaces all occurrences of tabs with the corresponding number of spaces, depending on the column the tab is placed in and the configured tabStops
value.
- Removes any return character.
- Replaces form feed and vertical tab with spaces.
The processor should run on text input before it is passed to the actual parsers as they would not be able to deal with tabs properly.
Attributes
- Companion
- object
- Source
- WhitespacePreprocessor.scala
- Supertypes
Companion for creating instances of WhitespacePreprocessor.
Companion for creating instances of WhitespacePreprocessor.
Attributes
- Companion
- class
- Source
- WhitespacePreprocessor.scala
- Supertypes
- Self type