File: range.rb

package info (click to toggle)
ruby-sass 3.7.4-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,396 kB
  • sloc: ruby: 32,443; sh: 26; makefile: 25
file content (41 lines) | stat: -rw-r--r-- 1,262 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Sass::Source
  class Range
    # The starting position of the range in the document (inclusive).
    #
    # @return [Sass::Source::Position]
    attr_accessor :start_pos

    # The ending position of the range in the document (exclusive).
    #
    # @return [Sass::Source::Position]
    attr_accessor :end_pos

    # The file in which this source range appears. This can be nil if the file
    # is unknown or not yet generated.
    #
    # @return [String]
    attr_accessor :file

    # The importer that imported the file in which this source range appears.
    # This is nil for target ranges.
    #
    # @return [Sass::Importers::Base]
    attr_accessor :importer

    # @param start_pos [Sass::Source::Position] See \{#start_pos}
    # @param end_pos [Sass::Source::Position] See \{#end_pos}
    # @param file [String] See \{#file}
    # @param importer [Sass::Importers::Base] See \{#importer}
    def initialize(start_pos, end_pos, file, importer = nil)
      @start_pos = start_pos
      @end_pos = end_pos
      @file = file
      @importer = importer
    end

    # @return [String] A string representation of the source range.
    def inspect
      "(#{start_pos.inspect} to #{end_pos.inspect}#{" in #{@file}" if @file})"
    end
  end
end