summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz PluciƄski <mplucinski@mplucinski.com>2014-07-25 18:36:05 +0200
committerWill Estes <westes575@gmail.com>2014-11-26 15:31:53 -0500
commitf2aa9e112fd0753e62630d811db5b78475d668d4 (patch)
tree2f9b2e13f5daff5ca97bd5539efd920ea74cae23
parenta13574440bbda9c07e3a4dab5ca187efa0095d64 (diff)
Fix `label unused` warning
-rw-r--r--src/gen.c7
-rw-r--r--src/scan.l2
-rw-r--r--tests/bison_nr_parser.y4
-rw-r--r--tests/bison_yylloc_parser.y4
-rw-r--r--tests/bison_yylval_parser.y4
-rw-r--r--tests/multiple_scanners_nr_main.c21
6 files changed, 9 insertions, 33 deletions
diff --git a/src/gen.c b/src/gen.c
index fc1c4a6..049cbfe 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -528,11 +528,8 @@ void gen_find_action (void)
indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);");
indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];");
- if (!variable_trailing_context_rules)
- outn ("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
- outn ("find_rule: /* we branch to this label when backing up */");
- if (!variable_trailing_context_rules)
- outn ("]])\n");
+ if(reject_really_used)
+ outn ("find_rule: /* we branch to this label when backing up */");
indent_puts
("for ( ; ; ) /* until we find what rule we matched */");
diff --git a/src/scan.l b/src/scan.l
index 9ff9d74..9eb857a 100644
--- a/src/scan.l
+++ b/src/scan.l
@@ -95,7 +95,7 @@ extern const char *escaped_qstart, *escaped_qend;
%}
-%option caseless nodefault stack noyy_top_state
+%option caseless nodefault noreject stack noyy_top_state
%option nostdinit
%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE
diff --git a/tests/bison_nr_parser.y b/tests/bison_nr_parser.y
index 57e5c6c..3021048 100644
--- a/tests/bison_nr_parser.y
+++ b/tests/bison_nr_parser.y
@@ -30,8 +30,8 @@
#include <stdlib.h>
#include <string.h>
#include "config.h"
-#include "parser.h"
-#include "scanner.h"
+#include "bison_nr_parser.h"
+#include "bison_nr_scanner.h"
#define YYERROR_VERBOSE 1
/* #define YYPARSE_PARAM scanner */
diff --git a/tests/bison_yylloc_parser.y b/tests/bison_yylloc_parser.y
index 6cff424..8737291 100644
--- a/tests/bison_yylloc_parser.y
+++ b/tests/bison_yylloc_parser.y
@@ -33,8 +33,8 @@
#include <stdlib.h>
#include <string.h>
#include "config.h"
-#include "parser.h"
-#include "scanner.h"
+#include "bison_yylloc_parser.h"
+#include "bison_yylloc_scanner.h"
int yyerror(YYLTYPE *location, void* scanner, const char* msg);
diff --git a/tests/bison_yylval_parser.y b/tests/bison_yylval_parser.y
index ca8c8da..4159d7b 100644
--- a/tests/bison_yylval_parser.y
+++ b/tests/bison_yylval_parser.y
@@ -32,8 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include "config.h"
-#include "parser.h"
-#include "scanner.h"
+#include "bison_yylval_parser.h"
+#include "bison_yylval_scanner.h"
#define YYERROR_VERBOSE 1
diff --git a/tests/multiple_scanners_nr_main.c b/tests/multiple_scanners_nr_main.c
index bfdd12a..497bd9f 100644
--- a/tests/multiple_scanners_nr_main.c
+++ b/tests/multiple_scanners_nr_main.c
@@ -21,8 +21,6 @@
* PURPOSE.
*/
-#include <assert.h>
-
#include "multiple_scanners_nr_1.h"
#include "multiple_scanners_nr_2.h"
@@ -32,27 +30,11 @@ main ( int argc, char** argv )
(void)argc;
(void)argv;
-<<<<<<< HEAD:tests/multiple_scanners_nr_main.c
int S1_ok=1, S2_ok=1;
YY_BUFFER_STATE buff1, buff2;
S1_out = S2_out = stdout;
buff1 = S1__scan_string("foo on bar off");
buff2 = S2__scan_string("on blah blah off foo on bar off");
-=======
- yyscan_t scanner;
- FILE *fp;
- char * extra = "EXTRA";
-
- testlex_init(&scanner);
- testset_in(stdin,scanner);
- testset_out(stdout,scanner);
- testset_extra(extra,scanner);
-
- fp = testget_in(scanner);
- assert(fp == stdin);
- fp = testget_out(scanner);
- assert(fp == stdout);
->>>>>>> Remove a few `unused variable` warnings:tests/test-linedir-r/main.c
/* scan simultaneously. */
while(S1_ok || S2_ok)
@@ -67,6 +49,3 @@ main ( int argc, char** argv )
printf("TEST RETURNING OK.\n");
return 0;
}
-
-
-/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */