Sha256: 615ce281279a19314987732bcf10725cbfa42f111e75daff77b7fa4c059a0345

Contents?: true

Size: 1.29 KB

Versions: 14

Compression:

Stored size: 1.29 KB

Contents

module JMESPath
  # @api private
  class Token < Struct.new(:type, :value, :position, :binding_power)

    NULL_TOKEN = Token.new(:eof, '', nil)

    BINDING_POWER = {
      Lexer::T_UNKNOWN           => 0,
      Lexer::T_EOF               => 0,
      Lexer::T_QUOTED_IDENTIFIER => 0,
      Lexer::T_IDENTIFIER        => 0,
      Lexer::T_RBRACKET          => 0,
      Lexer::T_RPAREN            => 0,
      Lexer::T_COMMA             => 0,
      Lexer::T_RBRACE            => 0,
      Lexer::T_NUMBER            => 0,
      Lexer::T_CURRENT           => 0,
      Lexer::T_EXPREF            => 0,
      Lexer::T_COLON             => 0,
      Lexer::T_PIPE              => 1,
      Lexer::T_OR                => 2,
      Lexer::T_AND               => 3,
      Lexer::T_COMPARATOR        => 5,
      Lexer::T_FLATTEN           => 9,
      Lexer::T_STAR              => 20,
      Lexer::T_FILTER            => 21,
      Lexer::T_DOT               => 40,
      Lexer::T_NOT               => 45,
      Lexer::T_LBRACE            => 50,
      Lexer::T_LBRACKET          => 55,
      Lexer::T_LPAREN            => 60,
    }

    # @param [Symbol] type
    # @param [Mixed] value
    # @param [Integer] position
    def initialize(type, value, position)
      super(type, value, position, BINDING_POWER[type])
    end

  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
jmespath-1.6.1 lib/jmespath/token.rb
jmespath-1.6.0 lib/jmespath/token.rb
jmespath-1.5.0 lib/jmespath/token.rb
jmespath-1.4.0 lib/jmespath/token.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/jmespath-1.3.1/lib/jmespath/token.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/jmespath-1.3.1/lib/jmespath/token.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/jmespath-1.3.1/lib/jmespath/token.rb
jmespath-1.3.1 lib/jmespath/token.rb
jmespath-1.3.0 lib/jmespath/token.rb
jmespath-1.2.4 lib/jmespath/token.rb
jmespath-1.2.3 lib/jmespath/token.rb
jmespath-1.2.2 lib/jmespath/token.rb
jmespath-1.2.1 lib/jmespath/token.rb
jmespath-1.2 lib/jmespath/token.rb