Commit e94d8a1
authored
parser: Fix return type of Buffer#line_range and #source_range (#1017)
The return type of Parser::Source::Buffer#line_range and #source_range
are `Parser::Source::Range` from parser gem, not built-in `Range`.
This is a verification script to confirm the return type of them:
```ruby
require 'parser/ruby34'
source = "hello\nworld\n"
buffer = Parser::Source::Buffer.new('(test)', source: source)
line_range = buffer.line_range(1)
p line_range.class
source_range = buffer.source_range
p source_range.class
```
ref: https://github.com/whitequark/parser/blob/v3.2.2.4/lib/parser/source/buffer.rb#L2911 parent 60d59c1 commit e94d8a1
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments