]> granicus.if.org Git - flex/commitdiff
Fix `label unused` warning
authorMariusz Pluciński <mplucinski@mplucinski.com>
Fri, 25 Jul 2014 16:36:05 +0000 (18:36 +0200)
committerWill Estes <westes575@gmail.com>
Wed, 26 Nov 2014 20:31:53 +0000 (15:31 -0500)
src/gen.c
src/scan.l
tests/bison_nr_parser.y
tests/bison_yylloc_parser.y
tests/bison_yylval_parser.y
tests/multiple_scanners_nr_main.c

index fc1c4a6de859e6365ebc7124535a84c2aacb3b07..049cbfe25c7f859e762d9cbd69b1969b2ea5a3bf 100644 (file)
--- 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 */");
index 9ff9d74f1cca85027edf97d23abf60c06ac4d548..9eb857ac11e7b17a4a8188b690afac30074d9480 100644 (file)
@@ -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
index 57e5c6c572d2569054a77d992ae7925db8d34de2..30210489b6ce3434337b57a21471640feb66457e 100644 (file)
@@ -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 */
index 6cff42480483918c46ce6c249d33aed4fd70398d..8737291f583efe0236282d21cd142a5c15105b0d 100644 (file)
@@ -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);
 
index ca8c8da74b82efa2c1b1086d37b79e0d5f3f93cb..4159d7b78235758d5ffd6e413d0f7bc0f466c4bb 100644 (file)
@@ -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
 
index bfdd12a429b70de8501de890136389dc403d7b63..497bd9ff81290a129548c9ebdfa28dfb8590923e 100644 (file)
@@ -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: */