DirectiveParsers

Parsers for all types of custom directives that can be used in templates or as inline or block elements in markup documents.

class Object
trait Matchable
class Any

Type members

Classlikes

case class DirectiveSpec(name: String, fence: String)
case class ParsedDirective(name: String, attributes: ObjectBuilderValue, body: Option[SourceFragment])

Represents the parsed but unprocessed content of a directive.

Represents the parsed but unprocessed content of a directive.

case class Part(key: AttributeKey, content: String)

Represents one part of a directive (an attribute or a body element).

Represents one part of a directive (an attribute or a body element).

Value members

Concrete methods

def declarationParser(escapedText: EscapedTextParsers, supportsCustomFence: Boolean): Parser[(String, ObjectBuilderValue, String)]

Parses a full directive declaration, containing all its attributes, but not the body elements.

Parses a full directive declaration, containing all its attributes, but not the body elements.

def directiveParser(bodyContent: BodyParserBuilder, escapedText: EscapedTextParsers, supportsCustomFence: Boolean): Parser[ParsedDirective]

Parses one directive instance containing its name declaration, all attributes and all body elements.

Parses one directive instance containing its name declaration, all attributes and all body elements.

Value parameters:
bodyContent

the parser for the body content which is different for a block directive than for a span or template directive

escapedText

the parser for escape sequences according to the rules of the host markup language

supportsCustomFence

indicates whether the directive declaration allows the addition of a custom closing fence

def hoconReference[T](f: (Key, Boolean, SourceFragment) => T, e: InvalidSpan => T): PrefixedParser[T]

Parses a HOCON-style reference enclosed between ${ and } that may be marked as optional (${?some.param}).

Parses a HOCON-style reference enclosed between ${ and } that may be marked as optional (${?some.param}).

Concrete fields

lazy val nameDecl: Parser[String]

Parses a name declaration that start with a letter and continues with letters, numbers or the symbols '-' or '_'.

Parses a name declaration that start with a letter and continues with letters, numbers or the symbols '-' or '_'.

lazy val wsOrNl: Parser[String]

Parses horizontal whitespace or newline characters.

Parses horizontal whitespace or newline characters.