Method: Parser::Source::Buffer#source_lines
- Defined in:
- lib/parser/source/buffer.rb
#source_lines ⇒ Array<String>
Return an Array
of source code lines.
257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/parser/source/buffer.rb', line 257 def source_lines @lines ||= begin lines = @source.lines.to_a lines << ''.dup if @source.end_with?("\n".freeze) lines.each do |line| line.chomp!("\n".freeze) line.freeze end lines.freeze end end |