Module: ATP::AST::Factories
Instance Method Summary collapse
Instance Method Details
#n(type, *children) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/atp/ast/factories.rb', line 4 def n(type, *children) = children.last.is_a?(Hash) ? children.pop : {} [:file] ||= .delete(:source_file) || try(:source_file) [:line_number] ||= .delete(:source_line_number) || try(:source_line_number) [:description] ||= .delete(:description) || try(:description) ATP::AST::Node.new(type, children, ) end |
#n0(type, options = {}) ⇒ Object
12 13 14 |
# File 'lib/atp/ast/factories.rb', line 12 def n0(type, = {}) n(type, ) end |