bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

parser: fix incorrect condition to raise a syntax error


From: Akim Demaille
Subject: parser: fix incorrect condition to raise a syntax error
Date: Fri, 7 Dec 2018 06:22:16 +0100

commit 401afe5cc25563174cb568c0546ce9e6707f2a03
Author: Akim Demaille <address@hidden>
Date:   Thu Dec 6 17:50:54 2018 +0100

    parser: fix incorrect condition to raise a syntax error
    
    * src/parse-gram.y (symbol_def): Fix test.

diff --git a/src/parse-gram.c b/src/parse-gram.c
index 6599619f..a120cf53 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -2571,7 +2571,7 @@ yyreduce:
           else
             symbol_make_alias ((yyvsp[-2].id), (yyvsp[0].yytype_94), 
(yylsp[0]));
         }
-      if (current_class != token_sym && (0 <= (yyvsp[-1].yytype_79) || 
!(yyvsp[0].yytype_94)))
+      if (current_class != token_sym && (0 <= (yyvsp[-1].yytype_79) || 
(yyvsp[0].yytype_94)))
         YYERROR;
     }
 #line 2578 "src/parse-gram.c" /* yacc.c:1649  */
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 246ced74..bfb0f351 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
@@ -522,7 +522,7 @@ symbol_def:
           else
             symbol_make_alias ($id, $alias, @alias);
         }
-      if (current_class != token_sym && (0 <= $num || !$alias))
+      if (current_class != token_sym && (0 <= $num || $alias))
         YYERROR;
     }
 ;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]