lib/sfrp/mono/expression.rb
# Note that the expression this returns is not wrapped by ().
Note that the expression this returns is not wrapped by ().
Note that the expression this returns is not wrapped by () .
def to_low(set, env)
        check_completeness(set)
        tmp_var_str = env.new_var(@left_exp.type_str)
        left_let_exp = "#{tmp_var_str} = #{@left_exp.to_low(set, env)}"
        case_exp = L.if_chain_exp do |i|
          @cases.each do |c|
            cond_exps = c.pattern.low_cond_exps(set, tmp_var_str)
            let_exps = c.pattern.low_let_exps(set, tmp_var_str, env)
            exp = (let_exps + [c.exp.to_low(set, env)]).join(', ')
            i.finish(exp) if cond_exps.empty?
            i.append_case(cond_exps.join(' && '), exp)
          end
        end
        "#{left_let_exp}, #{case_exp}"
      end
def to_low ( set , env ) check_completeness ( set ) tmp_var_str = env . new_var ( @left_exp . type_str ) left_let_exp = "#{tmp_var_str} = #{@left_exp.to_low(set, env)}" case_exp = L . if_chain_exp do | i | @cases . each do | c | cond_exps = c . pattern . low_cond_exps ( set , tmp_var_str ) let_exps = c . pattern . low_let_exps ( set , tmp_var_str , env ) exp = ( let_exps + [ c . exp . to_low ( set , env ) ] ) . join ( ', ' ) i . finish ( exp ) if cond_exps . empty? i . append_case ( cond_exps . join ( ' && ' ) , exp ) end end "#{left_let_exp}, #{case_exp}" end
Note that the expression this returns is not wrapped by ().
Note that the expression this returns is not wrapped by () .
set
env