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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'opal/lib/opal/nodes/literal.rb', line 63

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