Sha256: bdd10a8ac35d8fa02689b77eecfa4ee9602557259e38ea5659ef752effa8112b
Contents?: true
Size: 399 Bytes
Versions: 33
Compression:
Stored size: 399 Bytes
Contents
# frozen_string_literal: true module Parser class VariablesStack def initialize @stack = [] push 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
33 entries across 30 versions & 6 rubygems