lib/parser/source/range.rb in parser-2.0.0.pre2 vs lib/parser/source/range.rb in parser-2.0.0.pre3

- old
+ new

@@ -1,8 +1,11 @@ module Parser module Source + ## + # @api public + # class Range attr_reader :source_buffer attr_reader :begin_pos, :end_pos def initialize(source_buffer, begin_pos, end_pos) @@ -60,9 +63,13 @@ def to_s line, column = @source_buffer.decompose_position(@begin_pos) [@source_buffer.name, line, column + 1].join(':') + end + + def resize(new_size) + Range.new(@source_buffer, @begin_pos, @begin_pos + new_size) end def join(other) Range.new(@source_buffer, [@begin_pos, other.begin_pos].min,