Skip to content

Commit

Permalink
src/parse/parser.ypp: use %empty token for empty rule
Browse files Browse the repository at this point in the history
New `bison --warnings` gives the following helpful diagnostic:

      GEN      src/parse/parser.cc
    src/parse/parser.ypp:60.2: warning: empty rule without %empty [-Wempty-rule]
       60 | : /* empty */
          |  ^
          |  %empty

%empty was introduced in bison-2.7.90 around 2013.
  • Loading branch information
trofi authored and skvadrik committed Sep 3, 2022
1 parent 67a5841 commit 7e7c4b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse/parser.ypp
Expand Up @@ -57,7 +57,7 @@ extern "C" {
%%

spec
: /* empty */
: %empty
| spec TOKEN_BLOCK {
if (use_block(context, ast.temp_blockname) != Ret::OK) YYABORT;
ast.temp_blockname.clear();
Expand Down

0 comments on commit 7e7c4b9

Please sign in to comment.