diff --git a/lib/lrama/grammar/type.rb b/lib/lrama/grammar/type.rb index 6861d9f8..6b4b0961 100644 --- a/lib/lrama/grammar/type.rb +++ b/lib/lrama/grammar/type.rb @@ -1,6 +1,18 @@ module Lrama class Grammar - class Type < Struct.new(:id, :tag, keyword_init: true) + class Type + attr_reader :id, :tag + + def initialize(id:, tag:) + @id = id + @tag = tag + end + + def ==(other) + self.class == other.class && + self.id == other.id && + self.tag == other.tag + end end end end