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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'opal/lib/opal/nodes/literal.rb', line 80

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