Class: TPPlus::Nodes::TerminationNode

Inherits:
Object
  • Object
show all
Defined in:
lib/tp_plus/nodes/termination_node.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ TerminationNode

Returns a new instance of TerminationNode.



4
5
6
# File 'lib/tp_plus/nodes/termination_node.rb', line 4

def initialize(value)
  @value = value
end

Instance Method Details

#eval(context) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tp_plus/nodes/termination_node.rb', line 8

def eval(context)
  val = @value.eval(context)
  case val
  when Integer
    "CNT#{val}"
  else
    if val[0] == "R"
      "CNT #{val}"
    else
      "FINE"
    end
  end
end