this class is a hack to support [1 … 4] array initializer it stores the effects of subsequent initializers (eg [1 … 4].toto.bla[2 … 57] = 12) which are later played back on the range
# File metasm/parse_c.rb, line 681 def initialize @log = [] end
# File metasm/parse_c.rb, line 690 def [](idx) @log[idx] end
# File metasm/parse_c.rb, line 685 def []=(idx, val) val = self.class.new if val == [] @log[idx] = val end
# File metasm/parse_c.rb, line 701 def playback(ary=[]) @log.each_with_index { |v, i| ary[i] = playback_idx(i) } ary end
# File metasm/parse_c.rb, line 694 def playback_idx(i) case v = @log[i] when self.class; v.playback else v end end