Class: Idl::FunctionDefSyntaxNode

Inherits:
Treetop::Runtime::SyntaxNode show all
Defined in:
lib/idl/ast.rb

Instance Method Summary collapse

Instance Method Details

#to_astObject



4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
# File 'lib/idl/ast.rb', line 4822

def to_ast
  FunctionDefAst.new(
    input,
    interval,
    function_name.text_value,
    targs.empty? ? [] : [targs.first.to_ast] + targs.rest.elements.map { |r| r.single_declaration.to_ast },
    ret.empty? ? [] : [ret.first.to_ast] + ret.rest.elements.map { |r| r.type_name.to_ast },
    args.empty? ? [] : [args.first.to_ast] + args.rest.elements.map { |r| r.single_declaration.to_ast},
    desc.text_value,
    respond_to?(:body_block) ? body_block.function_body.to_ast : nil
  )
end