Sha256: d849ad1f499b4fac3fcdb00eb575c32c34db530d4f81c38598907ab200935b7c
Contents?: true
Size: 635 Bytes
Versions: 38
Compression:
Stored size: 635 Bytes
Contents
# frozen_string_literal: true module GraphQL module Language # Emitted by the lexer and passed to the parser. # Contains type, value and position data. class Token # @return [Symbol] The kind of token this is attr_reader :name, :prev_token, :line def initialize(value:, name:, line:, col:, prev_token:) @name = name @value = value @line = line @col = col @prev_token = prev_token end def to_s; @value; end def to_i; @value.to_i; end def to_f; @value.to_f; end def line_and_column [@line, @col] end end end end
Version data entries
38 entries across 38 versions & 1 rubygems