diff options
author | Kevin Newton <[email protected]> | 2024-07-03 11:23:17 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-07-11 14:25:54 -0400 |
commit | aa473489a2ff5e5ed6d3536466e6108539c97a8b (patch) | |
tree | c628ff4d6e08926e06c29b56ac0fa2b7acdf9d5b /lib/prism/parse_result/errors.rb | |
parent | 2bf9ae3fa1b5dec1c63176f39db84d697ede3581 (diff) |
[ruby/prism] Various cleanup for initializers and typechecks
https://github.com/ruby/prism/commit/86cf82794a
Diffstat (limited to 'lib/prism/parse_result/errors.rb')
-rw-r--r-- | lib/prism/parse_result/errors.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/prism/parse_result/errors.rb b/lib/prism/parse_result/errors.rb index 1eaeebee6e..847a8442fe 100644 --- a/lib/prism/parse_result/errors.rb +++ b/lib/prism/parse_result/errors.rb @@ -32,19 +32,19 @@ module Prism io = StringIO.new source_lines.each.with_index(1) do |line, line_number| io.puts(line) - + (error_lines.delete(line_number) || []).each do |error| location = error.location - + case line_number when location.start_line io.print(" " * location.start_column + "^") - + if location.start_line == location.end_line if location.start_column != location.end_column io.print("~" * (location.end_column - location.start_column - 1)) end - + io.puts(" " + error.message) else io.puts("~" * (line.bytesize - location.start_column)) @@ -56,7 +56,7 @@ module Prism end end end - + io.puts io.string end |