parser: fix incorrect condition to raise a syntax error

* src/parse-gram.y (symbol_def): Fix test.
This commit is contained in:
Akim Demaille
2018-12-06 17:50:54 +01:00
parent 10e3ccac05
commit 401afe5cc2
2 changed files with 2 additions and 2 deletions

View File

@@ -2571,7 +2571,7 @@ yyreduce:
else else
symbol_make_alias ((yyvsp[-2].id), (yyvsp[0].yytype_94), (yylsp[0])); 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; YYERROR;
} }
#line 2578 "src/parse-gram.c" /* yacc.c:1649 */ #line 2578 "src/parse-gram.c" /* yacc.c:1649 */

View File

@@ -522,7 +522,7 @@ symbol_def:
else else
symbol_make_alias ($id, $alias, @alias); symbol_make_alias ($id, $alias, @alias);
} }
if (current_class != token_sym && (0 <= $num || !$alias)) if (current_class != token_sym && (0 <= $num || $alias))
YYERROR; YYERROR;
} }
; ;