|
1 | 1 | require_relative "version" |
2 | 2 |
|
3 | 3 | module ErrorHighlight |
4 | | - # Identify the code fragment at that a given exception occurred. |
| 4 | + # Identify the code fragment where a given exception occurred. |
5 | 5 | # |
6 | 6 | # Options: |
7 | 7 | # |
8 | 8 | # point_type: :name | :args |
9 | | - # :name (default) points the method/variable name that the exception occurred. |
10 | | - # :args points the arguments of the method call that the exception occurred. |
| 9 | + # :name (default) points to the method/variable name where the exception occurred. |
| 10 | + # :args points to the arguments of the method call where the exception occurred. |
11 | 11 | # |
12 | 12 | # backtrace_location: Thread::Backtrace::Location |
13 | 13 | # It locates the code fragment of the given backtrace_location. |
@@ -113,7 +113,7 @@ def initialize(node, point_type: :name, name: nil) |
113 | 113 | snippet = @node.script_lines[lineno - 1 .. last_lineno - 1].join("") |
114 | 114 | snippet += "\n" unless snippet.end_with?("\n") |
115 | 115 |
|
116 | | - # It require some work to support Unicode (or multibyte) characters. |
| 116 | + # It requires some work to support Unicode (or multibyte) characters. |
117 | 117 | # Tentatively, we stop highlighting if the code snippet has non-ascii characters. |
118 | 118 | # See https://github.com/ruby/error_highlight/issues/4 |
119 | 119 | raise NonAscii unless snippet.ascii_only? |
@@ -504,7 +504,6 @@ def spot_fcall_for_name |
504 | 504 | def spot_fcall_for_args |
505 | 505 | _mid, nd_args = @node.children |
506 | 506 | if nd_args && nd_args.first_lineno == nd_args.last_lineno |
507 | | - # binary operator |
508 | 507 | fetch_line(nd_args.first_lineno) |
509 | 508 | @beg_column = nd_args.first_column |
510 | 509 | @end_column = nd_args.last_column |
|
0 commit comments