Class: Hamli::Parser
- Inherits:
-
Temple::Parser
- Object
- Temple::Parser
- Hamli::Parser
- Defined in:
- lib/hamli/parser.rb
Instance Method Summary collapse
- #call(source) ⇒ Array
-
#initialize(_options = {}) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(_options = {}) ⇒ Parser
11 12 13 14 |
# File 'lib/hamli/parser.rb', line 11 def initialize( = {}) super @file_path = [:file] || '(__TEMPLATE__)' end |
Instance Method Details
#call(source) ⇒ Array
18 19 20 21 22 23 24 |
# File 'lib/hamli/parser.rb', line 18 def call(source) @stacks = [i[multi]] @indents = [] @scanner = ::StringScanner.new(source) parse_block until @scanner.eos? @stacks[0] end |