CodeSpanParser

Companion with a range of convenient constructors for creating CodeSpanParsers instances, based on existing parser instances or simple specifications of start and end delimiters.

Companion:
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(category: CodeCategory, start: String, end: String): CodeSpanParser

Parses a single span delimited by the specified start and end strings and associates it with the given code category.

Parses a single span delimited by the specified start and end strings and associates it with the given code category.

def apply(category: CodeCategory)(parser: PrefixedParser[String]): CodeSpanParser

Parses a single text span and associates it with the given code category.

Parses a single text span and associates it with the given code category.

Parses a sequence of code spans.

Parses a sequence of code spans.

Parses code spans that can only start on a new line or at the start of the input.

Parses code spans that can only start on a new line or at the start of the input.

def onLineStart(category: CodeCategory)(parser: Parser[String]): CodeSpanParser

Parses a single code span that can only start on a new line or at the start of the input and associates it with the given code category.

Parses a single code span that can only start on a new line or at the start of the input and associates it with the given code category.

Lazily initializes the specified parser for recursive application.

Lazily initializes the specified parser for recursive application.

Standard constructors avoid the cost of by-name arguments, but this factory method can be used for the cases where recursive embedding of a syntax needs to occur.