Closed mortenpi closed 2 years ago
Unsure about overloading ==
here, perhaps it would make sense to just have a separate internal function for checking whether a rule already exists.
Unsure about overloading == here, perhaps it would make sense to just have a separate internal function for checking whether a rule already exists.
That also crossed my mind, will change to that.
Updated. Added a function is_same_rule
that could be overloaded if need be, but I assume the default implementation should work for all the current rules. Do you want me to add override!
right away too?
I believe this should fix #45.
However, in order to use
in
to determine if a particular rule is present inp.rules
, I also have to add some overloads for==
for the*Rule
s that have some internal fields. I assume it is fine to consider two e.g.FootnoteRules
equal, even in their caches differ? For now, I only added the overloads forFootnoteRule
andTableRule
, but if these overloads are fine, I can also add them to other rules that have fields.