Class: Walrus::Compiler

Inherits:
Object
  • Object
show all
Defined in:
lib/walrus/compiler.rb

Defined Under Namespace

Classes: Instance

Constant Summary collapse

BODY_INDENT =
' ' * 8
OUTSIDE_INDENT =
' ' * 6
DEFAULT_CLASS =
'DocumentSubclass'

Instance Method Summary collapse

Instance Method Details

#compile(tree, options = {}) ⇒ Object

Walks the Abstract Syntax Tree, tree, that represents a parsed Walrus template.

Returns a String that defines a Document subclass corresponding to the compiled version of the tree.



137
138
139
# File 'lib/walrus/compiler.rb', line 137

def compile(tree, options = {})
  Instance.new(options).compile(tree)
end