Sha256: f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0

Contents?: true

Size: 443 Bytes

Versions: 6898

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,898 entries across 6,889 versions & 40 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/parser-3.3.7.0/lib/parser/variables_stack.rb
parser-3.3.7.0 lib/parser/variables_stack.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/parser-3.1.2.0/lib/parser/variables_stack.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/parser-3.3.6.0/lib/parser/variables_stack.rb