Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* fixed all warnings. tests are running in verbose mode now. #685

Merged
merged 3 commits into from May 5, 2020

Conversation

iliabylich
Copy link
Collaborator

  1. added if false; testEof; end at the bottom of Lexer#advance to prevent warnings about unused variable testEof. It has 0 runtime cost.
  2. fixed formatting in a few places
  3. changed test task definition to run tests in verbose mode (like ruby -w would do)
  4. For some reason "" % {} gives a warning (same with Kernel#sprintf, no idea why). Added a utility method to perform interpolation on messages only if there's something to interpolate.
  5. added parentheses to all m /regex/ calls
  6. added _ prefix to unused variables.

I'm getting 0 warnings locally when running rake test/rake test_cov

Closes #684

lib/parser/messages.rb Outdated Show resolved Hide resolved
@iliabylich iliabylich changed the title Fix all warnings, run tests in verbose mode (like ruby -w) * fixed all warnings. tests are running in verbose mode now. May 5, 2020
@iliabylich iliabylich merged commit 21581a2 into whitequark:master May 5, 2020
@iliabylich iliabylich deleted the fix-all-warnings branch May 5, 2020 10:53
@@ -283,6 +283,13 @@ class Parser::Lexer
%% write exec;
# %

# Ragel creates a local variable called `testEof` but it doesn't use
# it in any assignment. This dead code is here to swallow the warning.
# It has no runtime cost because Ruby doesn't produce any instructions from it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until ruby starts warning about if false as a redundant construct ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parser emitting warnings
3 participants