Class: Parser::Source::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/opal/parser/patch.rb

Direct Known Subclasses

Opal::Parser::SourceBuffer

Instance Method Summary collapse

Instance Method Details

#source_linesObject



40
41
42
43
44
45
46
# File 'lib/opal/parser/patch.rb', line 40

def source_lines
  @lines ||= begin
    lines = @source.lines.to_a
    lines << '' if @source.end_with?("\n")
    lines.map { |line| line.chomp("\n") }
  end
end