Utilities for parsing HEEx templates into a small :element tree.
Provides tokenize/2 (parses to the new LV 1.2 Parser node tree) and
parse/1 (converts that tree into a simpler {:element, tag, attrs, children, meta} form that the rest of lavash's compile-time analysis
pipeline consumes).
Summary
Functions
Converts a LV 1.2 node tree (or %Parser{}) into the legacy :element
tree shape
Parses HEEx source to the LV 1.2 node tree (%Parser{} or just the
nodes list, depending on :return).
Functions
Converts a LV 1.2 node tree (or %Parser{}) into the legacy :element
tree shape:
{:element, tag, attrs, children, meta}for HTML elements{:text, content}for text nodes{:expr, code, meta}for Elixir expressions
Components and slots are skipped (they aren't consumed downstream).
Parses HEEx source to the LV 1.2 node tree (%Parser{} or just the
nodes list, depending on :return).
Options:
:line- starting line number (default 1):file- source file path for error messages (default "nofile"):indentation- indentation level (default 0):return-:nodes(default) returns the bare node list,:parserreturns the full%Parser{}struct