class Tildeath::ASTNodes::Statements
Public Class Methods
new(statements=[])
click to toggle source
# File lib/tildeath/ast_nodes/statements.rb, line 4 def initialize(statements=[]) @statements = statements end
Public Instance Methods
execute(context)
click to toggle source
# File lib/tildeath/ast_nodes/statements.rb, line 8 def execute(context) return unless context[:THIS].alive? @statements.each do |statement| return unless context[:THIS].alive? statement.execute(context) end end
to_s()
click to toggle source
# File lib/tildeath/ast_nodes/statements.rb, line 16 def to_s @statements.reduce('') do |memo, stmt| memo << stmt.to_s << ";\n" end end