Module: Opal::Nodes::XStringLineSplitter

Included in:
DynamicXStringNode, XStringNode
Defined in:
opal/lib/opal/nodes/literal.rb

Instance Method Summary collapse

Instance Method Details

#compile_split_lines(value, sexp) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'opal/lib/opal/nodes/literal.rb', line 59

def compile_split_lines(value, sexp)
  idx = 0
  value.each_line do |line|
    if idx == 0
      push line
    else
      line_sexp = s()
      line_sexp.source = [sexp.line + idx, 0]
      frag = Fragment.new(line, line_sexp)
      push frag
    end

    idx += 1
  end
end