lib/haxor/compiler/unit.rb in haxor-0.2.0 vs lib/haxor/compiler/unit.rb in haxor-0.3.0

- old
+ new

@@ -1,16 +1,19 @@ module Haxor module Compiler class Unit attr_reader :section + attr_reader :hash - def initialize + def initialize(filename) @section = :text @sections = { text: [], data: [], bss: [] } + @filename = filename + @hash = Digest::SHA1.hexdigest filename end def add(item) @sections[@section] << item end