class RBX::Parser
Parser breaks down templates into a tree like data structure
Constants
- Node
-
Is a struct for a single node in an AST type structure returned from the parser. This struct consists of:
-
kind: raw, attribute, expression, expr_group, html, component -
name: If it is a component or html element this will be the tag name and the name of an element attribute if the node is an attribute. -
attributes: For tag, or components these are the attributes and their values. -
content: For tag, or components this will be any nested child nodes, for raw or expressions, this will be a string of raw output. -
void: marks if an element has nested content or expects nested content.
-
Public Class Methods
Source
# File rbxrb/lib/rbx/parser.rb, line 62 def self.parse(filename, template) new(filename, template).parse end
Reads a template, lexes tokens, and builds an AST from the tokens.