class SFRP::Low::Block

Public Class Methods

new(kind_str, cond_exp, stmts) click to toggle source
# File lib/sfrp/low/element.rb, line 20
def initialize(kind_str, cond_exp, stmts)
  @kind_str = kind_str
  @cond_exp = cond_exp
  @stmts = stmts
end

Public Instance Methods

pretty_code(indent = 0) click to toggle source
# File lib/sfrp/low/element.rb, line 26
def pretty_code(indent = 0)
  inner = @stmts.map { |s| s.pretty_code(indent + 1) + "\n" }.join
  space = '  ' * indent
  "#{space}#{@kind_str} (#{@cond_exp}) {\n#{inner}#{space}}"
end