An “indexed” set. All items must respond to :ident.
# File ruby-3.1.2/lib/racc/iset.rb, line 28 def [](key) @set[key.ident] end
# File ruby-3.1.2/lib/racc/iset.rb, line 32 def []=(key, val) @set[key.ident] = val end
# File ruby-3.1.2/lib/racc/iset.rb, line 24 def add(i) @set[i.ident] = i end
# File ruby-3.1.2/lib/racc/iset.rb, line 54 def delete(key) i = @set[key.ident] @set[key.ident] = nil i end
# File ruby-3.1.2/lib/racc/iset.rb, line 86 def dup ISet.new(@set.dup) end
# File ruby-3.1.2/lib/racc/iset.rb, line 60 def each(&block) @set.compact.each(&block) end
# File ruby-3.1.2/lib/racc/iset.rb, line 78 def empty? @set.nitems == 0 end
# File ruby-3.1.2/lib/racc/iset.rb, line 68 def to_s "[#{@set.compact.join(' ')}]" end