Class: Fast::Builder

Inherits:
Astrolabe::Builder
  • Object
show all
Defined in:
lib/fast.rb

Overview

Custom builder allow us to set a buffer name for each Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#buffer_name=(value) ⇒ Object (writeonly)

Sets the attribute buffer_name

Parameters:

  • value

    the value to set the attribute buffer_name to.



123
124
125
# File 'lib/fast.rb', line 123

def buffer_name=(value)
  @buffer_name = value
end

Instance Method Details

#n(type, children, source_map) ⇒ Node

Generates Node from the given information.

Returns:

  • (Node)

    the generated node



127
128
129
# File 'lib/fast.rb', line 127

def n(type, children, source_map)
  Node.new(type, children, location: source_map, buffer_name: @buffer_name)
end