aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/src/symlist.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-29 21:48:22 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-29 21:59:59 +0300
commitb21e05a2e32e36ae9cc9826acf98084ca4b52d7d (patch)
tree20d654fb0156f50e150944fc8108a3cada8ca6ec /contrib/tools/bison/src/symlist.c
parent0cf48e974f5542c3e65398c01b9b6baf8aa6c260 (diff)
downloadydb-b21e05a2e32e36ae9cc9826acf98084ca4b52d7d.tar.gz
Update contrib/tools/bison to 3.3.2
6215035f251de2d87363064fb4f07a2b14a3b4c8
Diffstat (limited to 'contrib/tools/bison/src/symlist.c')
-rw-r--r--contrib/tools/bison/src/symlist.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/contrib/tools/bison/src/symlist.c b/contrib/tools/bison/src/symlist.c
index 201ddabdba..c5947cc890 100644
--- a/contrib/tools/bison/src/symlist.c
+++ b/contrib/tools/bison/src/symlist.c
@@ -1,6 +1,6 @@
/* Lists of symbols for Bison
- Copyright (C) 2002, 2005-2007, 2009-2015, 2018 Free Software
+ Copyright (C) 2002, 2005-2007, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -49,6 +49,8 @@ symbol_list_sym_new (symbol *sym, location loc)
res->dprec_location = empty_location;
res->merger = 0;
res->merger_declaration_location = empty_location;
+ res->expected_sr_conflicts = -1;
+ res->expected_rr_conflicts = -1;
res->next = NULL;
@@ -79,6 +81,15 @@ symbol_list_type_new (uniqstr type_name, location loc)
}
+symbol_list *
+symbol_list_type_set (symbol_list *syms, uniqstr type_name, location loc)
+{
+ for (symbol_list *l = syms; l; l = l->next)
+ symbol_type_set (l->content.sym, type_name, loc);
+ return syms;
+}
+
+
/*-----------------------------------------------------------------------.
| Print this list, for which every content_type must be SYMLIST_SYMBOL. |
`-----------------------------------------------------------------------*/
@@ -172,9 +183,8 @@ symbol_list_length (symbol_list const *l)
symbol_list *
symbol_list_n_get (symbol_list *l, int n)
{
- int i;
aver (0 <= n);
- for (i = 0; i < n; ++i)
+ for (int i = 0; i < n; ++i)
{
l = l->next;
aver (l);