Class: C::Call
- Inherits:
-
PostfixExpression
- Object
- Node
- Expression
- UnaryExpression
- PostfixExpression
- C::Call
- Defined in:
- lib/cast/to_s.rb,
lib/cast/c_nodes.rb,
lib/cast/c_nodes.rb
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from Expression
Methods inherited from Node
#==, #=~, abstract, add_field, #assert_invariants, #attached?, child, #clone, #depth_first, #detach, #detached?, #dup, #each, #eql?, field, #fields, fields, #hash, inherited, initializer, #insert_next, #insert_prev, #inspect, inspect1, #list_next, #list_prev, #match?, #method_missing, new_at, #next, #node_after, #node_before, #postorder, #preorder, #prev, #remove_node, #replace_node, #replace_with, #reverse_depth_first, #reverse_each, #reverse_postorder, #reverse_preorder, subclasses_recursive, #swap_with
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class C::Node
Instance Method Details
#to_s ⇒ Object
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/cast/to_s.rb', line 406 def to_s argstrs = args.map do |arg| if arg.is_a? Comma "(#{arg})" else "#{arg}" end end if expr.to_s_precedence < self.to_s_precedence exprstr = "(#{expr})" else exprstr = "#{expr}" end "#{exprstr}(#{argstrs.join(', ')})" end |