TagParser

case class TagParser(tagCategory: String => CodeCategory, start: String, end: String, tagName: PrefixedParser[String], embedded: Seq[CodeSpanParser]) extends CodeParserBase

Configurable base parser for tags in formats like HTML or XML.

Companion:
object
trait Serializable
trait Product
trait Equals
class Parser[Seq[CodeSpan]]
class Object
trait Matchable
class Any

Value members

Concrete methods

def embed(childSpans: CodeSpanParser*): TagParser

Embeds the specified parsers for child spans inside a tag.

Embeds the specified parsers for child spans inside a tag.

This is usually used for the detection of attribute names or entity references.

Inherited methods

def *: Repeat[Seq[CodeSpan]]

Returns a parser that repeatedly applies this parser. It will always succeed, potentially with an empty list as the result.

Returns a parser that repeatedly applies this parser. It will always succeed, potentially with an empty list as the result.

Inherited from:
Parser
def +: Repeat[Seq[CodeSpan]]

Returns a parser that repeatedly applies this parser (at least once).

Returns a parser that repeatedly applies this parser (at least once).

Inherited from:
Parser

Merges the parsers of this collection with those of the specified other collection. The order of parsers is relevant, since they will be applied in the specified order. If any parser successfully produces a result, the subsequent parsers will not be invoked

Merges the parsers of this collection with those of the specified other collection. The order of parsers is relevant, since they will be applied in the specified order. If any parser successfully produces a result, the subsequent parsers will not be invoked

Inherited from:
CodeSpanParser
override def <~(value: String): PrefixedParser[Seq[CodeSpan]]
Definition Classes
Inherited from:
PrefixedParser
override def <~[U](p: Parser[U]): PrefixedParser[Seq[CodeSpan]]
Definition Classes
Inherited from:
PrefixedParser
override def >>[U](fq: Seq[CodeSpan] => Parser[U]): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
def ?: Parser[Option[Seq[CodeSpan]]]

Returns a parser that optionally parses what this parser parses.

Returns a parser that optionally parses what this parser parses.

Inherited from:
Parser
override def ^^[U](f: Seq[CodeSpan] => U): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
override def as[U](v: => U): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
override def collect[U, V >: Seq[CodeSpan]](f: PartialFunction[Seq[CodeSpan], U], error: V => String): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
def count: Parser[Int]

Returns a parser that produces the number of characters consumed by this parser while discarding the original result.

Returns a parser that produces the number of characters consumed by this parser while discarding the original result.

Inherited from:
Parser
Definition Classes
Inherited from:
PrefixedParser
override def evalMap[U](f: Seq[CodeSpan] => Either[String, U]): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
override def flatMap[U](f: Seq[CodeSpan] => Parser[U]): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
def handleErrorWith[U >: Seq[CodeSpan]](f: Failure => Parser[U]): Parser[U]

Handle any error, potentially recovering from it, by mapping it to a new parser that will be applied at the same starting position than the failing parser.

Handle any error, potentially recovering from it, by mapping it to a new parser that will be applied at the same starting position than the failing parser.

This is similar to the orElse or | method, but allows the alternative parser to inspect the error of the preceding one.

See also:

recoverWith to recover from only certain errors.

Inherited from:
Parser
override def map[U](f: Seq[CodeSpan] => U): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser
def orElse[U >: Seq[CodeSpan]](p: => PrefixedParser[U]): PrefixedParser[U]

Applies the specified parser when this parser fails.

Applies the specified parser when this parser fails.

a.orElse(b) succeeds if either of the parsers succeeds.

This is a specialized variant of the orElse method of the base trait that preserves the nature of the PrefixedParser if both original parsers implement this trait.

Inherited from:
PrefixedParser
def orElse[U >: Seq[CodeSpan]](p0: => Parser[U]): Parser[U]

Applies the specified parser when this parser fails.

Applies the specified parser when this parser fails.

a orElse b succeeds if either of the parsers succeeds.

In case both parsers fail, the Failure instance will be from the parser with the most successfully read characters. In the case of multiple failures having the same number of characters, the one with the highest precedence (this parser) will be chosen.

Implementation note: The parameter is by-name to allow the definition of recursive parsers. In contrast to the former SDK parser combinators this is the only place where a parser with a by-name parameter is used whereas in all other places the additional cost is avoided.

Inherited from:
Parser
Inherited from:
PrefixedParser
def parse(in: String): Parsed[Seq[CodeSpan]]

Parses the specified string and returns the result.

Parses the specified string and returns the result.

Inherited from:
Parser
Definition Classes
Inherited from:
CodeParserBase
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product
def recoverWith[U >: Seq[CodeSpan]](pf: PartialFunction[Failure, Parser[U]]): Parser[U]

Handle certain errors, potentially recovering from it, by mapping them to a new parser that will be applied at the same starting position than the failing parser.

Handle certain errors, potentially recovering from it, by mapping them to a new parser that will be applied at the same starting position than the failing parser.

See also:

handleErrorWith to handle any/all errors.

Inherited from:
Parser
def rep(separator: String): Repeat[Seq[CodeSpan]]

Returns a parser that repeatedly applies this parser with the specified separator string between those invocations.

Returns a parser that repeatedly applies this parser with the specified separator string between those invocations.

p.rep(sep).min(1) is equivalent to (p ~ (sep ~> p).rep).concat.

The returned parser offers an API to specify further constraints like min or max.

Inherited from:
Parser
def rep(separator: Parser[Unit]): Repeat[Seq[CodeSpan]]

Returns a parser that repeatedly applies this parser with the specified separator parser between those invocations.

Returns a parser that repeatedly applies this parser with the specified separator parser between those invocations.

p.rep(sep).min(1) is equivalent to (p ~ (sep ~> p).rep).concat.

The returned parser offers an API to specify further constraints like min or max.

Inherited from:
Parser
def rep: Repeat[Seq[CodeSpan]]

Returns a parser that repeatedly applies this parser. The returned parser offers an API to specify further constraints like min or max.

Returns a parser that repeatedly applies this parser. The returned parser offers an API to specify further constraints like min or max.

Inherited from:
Parser
def repUntil[U](endCondition: Parser[U]): Parser[(List[Seq[CodeSpan]], Option[U])]

Returns a parser that repeatedly applies this parser until either this parser fails or the specified end condition is met. The end condition will be applied after each successful invocation of this parser.

Returns a parser that repeatedly applies this parser until either this parser fails or the specified end condition is met. The end condition will be applied after each successful invocation of this parser.

The result of the returned parser is a tuple consisting of the list containing the result of the invocations of this parser plus the result of the end condition. The latter is returned as an Option as it might be empty when the parsing finished because of this parser failing.

Note that it is more convenient to include the end condition in the repeating parser itself and use the simpler rep method. This combinator is an alternative if you need to know the result of the end condition.

Inherited from:
Parser
def repWith[U >: Seq[CodeSpan]](next: U => Parser[U]): Parser[List[U]]

Returns a parser that invokes the specified function repeatedly, passing the result of this parser if it succeeds, to produce new parsers that get applied until one of them fails.

Returns a parser that invokes the specified function repeatedly, passing the result of this parser if it succeeds, to produce new parsers that get applied until one of them fails.

The result of the returned parser is a list containing the result of this parser (if it succeeds) plus the results of successful invocations of the parsers returned by the specified function.

Inherited from:
Parser
override def source: PrefixedParser[String]
Definition Classes
Inherited from:
PrefixedParser
override def startChars: Type[Char]
Definition Classes
Inherited from:
CodeParserBase
def void: Parser[Unit]

Discards the result of a successful parser.

Discards the result of a successful parser.

Inherited from:
Parser
Definition Classes
Inherited from:
PrefixedParser
def withFailureMessage(msg: String): Parser[Seq[CodeSpan]]

Changes the failure message produced by a parser.

Changes the failure message produced by a parser.

Inherited from:
Parser
override def |(value: String)(implicit ev: Seq[CodeSpan] <:< String): PrefixedParser[String]
Definition Classes
Inherited from:
PrefixedParser
def |[U >: Seq[CodeSpan]](p: => PrefixedParser[U]): PrefixedParser[U]

Applies the specified parser when this parser fails.

Applies the specified parser when this parser fails.

a | b succeeds if either of the parsers succeeds.

This is a specialized variant of the | method of the base trait that preserves the nature of the PrefixedParser if both original parsers implement this trait.

Inherited from:
PrefixedParser
def |[U >: Seq[CodeSpan]](p: => Parser[U]): Parser[U]

Applies the specified parser when this parser fails.

Applies the specified parser when this parser fails.

a | b succeeds if either of the parsers succeeds.

Implementation note: The parameter is by-name to allow the definition of recursive parsers. In contrast to the former SDK parser combinators this is the only place where a parser with a by-name parameter is used whereas in all other places the additional cost is avoided.

Inherited from:
Parser
override def ~(value: String): PrefixedParser[Seq[CodeSpan] ~ String]
Definition Classes
Inherited from:
PrefixedParser
override def ~[U](p: Parser[U]): PrefixedParser[Seq[CodeSpan] ~ U]
Definition Classes
Inherited from:
PrefixedParser
override def ~>(value: String): PrefixedParser[String]
Definition Classes
Inherited from:
PrefixedParser
override def ~>[U](p: Parser[U]): PrefixedParser[U]
Definition Classes
Inherited from:
PrefixedParser