Sha256: 9e66c482bbaf6eba9dba475255f90bf472700161e73f03f6618e91770c8406c8

Contents?: true

Size: 464 Bytes

Versions: 15

Compression:

Stored size: 464 Bytes

Contents

# encoding: utf-8

module RuboCop
  # A basic wrapper around Parser's tokens.
  class Token
    attr_reader :pos, :type, :text

    def self.from_parser_token(parser_token)
      type, details = *parser_token
      text, range = *details
      new(range, type, text)
    end

    def initialize(pos, type, text)
      @pos, @type, @text = pos, type, text
    end

    def to_s
      "[[#{@pos.line}, #{@pos.column}], #{@type}, #{@text.inspect}]"
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/token.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/token.rb
rubocop-0.30.1 lib/rubocop/token.rb
rubocop-0.30.0 lib/rubocop/token.rb
rubocop-0.29.1 lib/rubocop/token.rb
rubocop-0.29.0 lib/rubocop/token.rb
rubocop-0.28.0 lib/rubocop/token.rb
rubocop-0.27.1 lib/rubocop/token.rb
rubocop-0.27.0 lib/rubocop/token.rb
rubocop-0.26.1 lib/rubocop/token.rb
rubocop-0.26.0 lib/rubocop/token.rb
rubocop-0.25.0 lib/rubocop/token.rb
rubocop-0.24.1 lib/rubocop/token.rb
rubocop-0.24.0 lib/rubocop/token.rb
rubocop-0.23.0 lib/rubocop/token.rb