Skip to content

Commit

Permalink
Merge pull request ruby#323 from yui-knk/plain_object_type
Browse files Browse the repository at this point in the history
Make Type to be plain object
  • Loading branch information
yui-knk authored Dec 26, 2023
2 parents a56b791 + e8e7779 commit fbfbf0c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/lrama/grammar/type.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fbfbf0c

Please sign in to comment.