class

Marten::Template::Parser

Inherits Reference / Object

The Marten template parser.

This class allows to parse a raw template in order to produce a node set. Under the hood, the parser will leverage a lexer (Marten::Template::Parser::Lexer) in order to generate a Marten::Template::NodeSet object, which contains the set of nodes that were generated from the parsing process. These nodes are all able to be rendered in order to then generate a final output for a given context.

Constructors

new(source : String)
Source

Instance methods

encountered_block_names
Source
parse(up_to : Array(String) | Nil | Tuple = nil) : NodeSet

Generates a set of nodes from the lexical tokens.

Source
shift_token

Extracts the next token from the available lexical tokens.

Source

Nested types