Closed unasuke closed 4 years ago
I'm not well-versed in this code to be honest. Does this variant work as well?
case elem
when Class
…
when /…/
…
end
That would read better to me.
@judofyr It seems better than my patch. Thanks!
If use case-when clause, it doesn't call =~
method, use ===
method internally.
So when Class
clause is unneeded I thought.
In
Temple::Mixins::GrammerDSL::Value#Rule
, call=~
method toClass
class then that causes a warning message. This behavior introduced from ruby 2.6 with-W
option. (And ruby 2.7 always show a warning message)https://bugs.ruby-lang.org/issues/15231 https://github.com/ruby/ruby/commit/ebff9dc10
~Therefore if "elem" is
Class
class, skip calling=~
method.~ Therefore use case-when-else clause to avoid warning.