Add warning output when using %require, which exists only for compatibility with Bison#478
Add warning output when using %require, which exists only for compatibility with Bison#478ydah merged 3 commits intoruby:masterfrom
Conversation
…bility with Bison This PR adds a warning output when using %require, which exists only for compatibility with Bison. see: https://www.gnu.org/software/bison/manual/html_node/Require-Decl.html
|
Right now, I don't have any concrete direction about |
|
@yui-knk Thank you feedback. If I had one concern, it would be that when considering Lrama not as a parser generator for only CRuby but as a Bison-compatible parser generator, users might mistakenly believe they can control it with For example, how about the following message? "currently, |
|
The new message seems fine to me because it only explains current status. |
|
@yui-knk I updated message. Thank you. |
spec/lrama/warnings/required_spec.rb
Outdated
| logger = Lrama::Logger.new | ||
| allow(logger).to receive(:warn) | ||
| Lrama::Warnings.new(logger, false).warn(grammar, states) | ||
| expect(logger).not_to have_received(:warn).with("currently, %require is simply valid as a grammar but does nothing") |
There was a problem hiding this comment.
It's better to check logger#warn is not called regardless its message otherwise the test case will pass when different message is send.
This PR adds a warning output when using %require, which exists only for compatibility with Bison.
see: https://www.gnu.org/software/bison/manual/html_node/Require-Decl.html