Class: RubyUIConverter::Parser
- Inherits:
-
Object
- Object
- RubyUIConverter::Parser
- Defined in:
- lib/ruby_ui_converter/parser.rb
Overview
Builds a unified HTML + ERB tree from a source template.
The tricky part is that HTML nesting (tags) and Ruby nesting (if/each/do … end) interleave. We track both on a single stack and pop tolerantly so that well-formed templates produce a correct tree and slightly malformed ones degrade gracefully instead of raising.
Instance Method Summary collapse
-
#initialize(source) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(source) ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/ruby_ui_converter/parser.rb', line 11 def initialize(source) @html, @registry = Lexer.new(source).tokenize_with_placeholders end |