class

Hecr::Compiler::Tokenizer

Inherits Reference < Object

Single-pass template tokenizer. Produces a flat token stream; the Parser builds and validates the tree.

Behaviors are pinned to HEEx's tokenizer (phoenix_live_view v1.1.31 tokenizer_test.exs) except where docs/dialect.md documents deliberate divergences (verbatim HTML comments, HTML-spec void list, Crystal expression validation at template time).

Constants

BANG = '!'.ord.to_u8
DQUOTE = '"'.ord.to_u8
EQUALS = '='.ord.to_u8
GT = '>'.ord.to_u8
HASH = '#'.ord.to_u8
LBRACE = '{'.ord.to_u8
LT = '<'.ord.to_u8
NO_CURLY_ATTR = "hecr-no-curly-interpolation"
PCT = '%'.ord.to_u8
SLASH = '/'.ord.to_u8
SQUOTE = '\''.ord.to_u8
UNTERMINATED_EXPR = "expected closing `}` for expression\n\nIn case you don't want `{` to begin a new interpolation, you may write it using `&lbrace;` or using `<%= \"{\" %>`"
VOID_ELEMENTS = Set {"area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"}

HTML-spec void elements. Deliberately differs from HEEx's list: includes embed/track/wbr, drops the obsolete command/keygen.

Constructors

new(source : String, file : String = "nofile", preserve : Bool = false)
Source

Instance methods

tokenize
Source