Class: TPPlus::Nodes::CallNode
- Defined in:
- lib/tp_plus/nodes/call_node.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #args_string(context) ⇒ Object
- #async? ⇒ Boolean
- #can_be_inlined? ⇒ Boolean
- #eval(context, options = {}) ⇒ Object
-
#initialize(program_name, args, options = {}) ⇒ CallNode
constructor
A new instance of CallNode.
- #requires_mixed_logic?(context) ⇒ Boolean
Constructor Details
#initialize(program_name, args, options = {}) ⇒ CallNode
Returns a new instance of CallNode.
5 6 7 8 9 |
# File 'lib/tp_plus/nodes/call_node.rb', line 5 def initialize(program_name, args, ={}) @program_name = program_name @args = args @async = [:async] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/tp_plus/nodes/call_node.rb', line 4 def args @args end |
Instance Method Details
#args_string(context) ⇒ Object
19 20 21 22 23 |
# File 'lib/tp_plus/nodes/call_node.rb', line 19 def args_string(context) return "" unless @args.any? "(" + @args.map {|a| a.eval(context) }.join(",") + ")" end |
#async? ⇒ Boolean
15 16 17 |
# File 'lib/tp_plus/nodes/call_node.rb', line 15 def async? @async end |
#can_be_inlined? ⇒ Boolean
25 26 27 |
# File 'lib/tp_plus/nodes/call_node.rb', line 25 def can_be_inlined? true end |
#eval(context, options = {}) ⇒ Object
29 30 31 |
# File 'lib/tp_plus/nodes/call_node.rb', line 29 def eval(context,={}) "#{async? ? "RUN" : "CALL"} #{@program_name.upcase}#{args_string(context)}" end |
#requires_mixed_logic?(context) ⇒ Boolean
11 12 13 |
# File 'lib/tp_plus/nodes/call_node.rb', line 11 def requires_mixed_logic?(context) false end |