Skip to content

Commit e94d8a1

Browse files
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#L291
1 parent 60d59c1 commit e94d8a1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

gems/parser/3.2/parser.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ module Parser
113113
def decompose_position: (Integer) -> [Integer, Integer]
114114
def source_lines: () -> Array[String]
115115
def source_line: (Integer) -> String
116-
def line_range: (Integer) -> ::Range[Integer]
117-
def source_range: () -> ::Range[Integer]
116+
def line_range: (Integer) -> Range
117+
def source_range: () -> Range
118118
def last_line: () -> Integer
119119
end
120120

0 commit comments

Comments
 (0)