Sha256: f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0

Contents?: true

Size: 443 Bytes

Versions: 6943

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

module Parser

  class VariablesStack
    def initialize
      @stack = []
      push
    end

    def empty?
      @stack.empty?
    end

    def push
      @stack << Set.new
    end

    def pop
      @stack.pop
    end

    def reset
      @stack.clear
    end

    def declare(name)
      @stack.last << name.to_sym
    end

    def declared?(name)
      @stack.last.include?(name.to_sym)
    end
  end

end

Version data entries

6,943 entries across 6,934 versions & 41 rubygems

Version Path
ory-client-0.0.1.alpha129 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha128 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha127 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha126 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha125 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha124 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha123 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha122 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha121 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha120 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha119 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha118 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha117 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha116 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha115 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
primary_connect_proto-0.6.0 vendor/bundle/ruby/2.6.0/gems/parser-3.0.2.0/lib/parser/variables_stack.rb
ory-keto-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha113 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha112 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb
ory-client-0.0.1.alpha111 vendor/bundle/ruby/2.5.0/gems/parser-3.1.1.0/lib/parser/variables_stack.rb