Class: Hamlit::Block::Compiler

Inherits:
Compiler
  • Object
show all
Defined in:
lib/hamlit/block/compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Compiler

Returns a new instance of Compiler.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/hamlit/block/compiler.rb', line 7

def initialize(options = {})
  super

  # Re-generate identity for Hamlit::Block and share it
  identity = Identity.new
  @tag_compiler = ::Hamlit::Compiler::TagCompiler.new(identity, options)

  # Replace internal compilers with Hamlit::Block's ones.
  @script_compiler        = ::Hamlit::Block::ScriptCompiler.new(identity)
  @silent_script_compiler = ::Hamlit::Block::SilentScriptCompiler.new(identity)
end