Sha256: aa965087f1d9e995e2bb44a0e19486fbf39772c89a920340ccc38318e867bf52
Contents?: true
Size: 784 Bytes
Versions: 64
Compression:
Stored size: 784 Bytes
Contents
# frozen_string_literal: true module RuboCop module AST module Ext # Extensions to Parser::AST::Range module Range # @return [Range] the range of line numbers for the node # If `exclude_end` is `true`, then the range will be exclusive. # # Assume that `node` corresponds to the following array literal: # # [ # :foo, # :bar # ] # # node.loc.begin.line_span # => 1..1 # node.loc.expression.line_span(exclude_end: true) # => 1...4 def line_span(exclude_end: false) ::Range.new(first_line, last_line, exclude_end) end end end end end ::Parser::Source::Range.include ::RuboCop::AST::Ext::Range
Version data entries
64 entries across 60 versions & 9 rubygems