mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
* src/reader.c (parse_expect_decl): Use `skip_white_space' and
`read_signed_integer'.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2000-10-16 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/reader.c (parse_expect_decl): Use `skip_white_space' and
|
||||||
|
`read_signed_integer'.
|
||||||
|
|
||||||
|
|
||||||
2000-10-16 Akim Demaille <akim@epita.fr>
|
2000-10-16 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/reader.c (copy_dollar): New function.
|
* src/reader.c (copy_dollar): New function.
|
||||||
|
|||||||
23
src/reader.c
23
src/reader.c
@@ -773,28 +773,13 @@ parse_union_decl (void)
|
|||||||
static void
|
static void
|
||||||
parse_expect_decl (void)
|
parse_expect_decl (void)
|
||||||
{
|
{
|
||||||
int c;
|
int c = skip_white_space ();
|
||||||
size_t count;
|
|
||||||
char buffer[20];
|
|
||||||
|
|
||||||
c = getc (finput);
|
|
||||||
while (c == ' ' || c == '\t')
|
|
||||||
c = getc (finput);
|
|
||||||
|
|
||||||
count = 0;
|
|
||||||
while (c >= '0' && c <= '9')
|
|
||||||
{
|
|
||||||
if (count < sizeof(buffer) - 1)
|
|
||||||
buffer[count++] = c;
|
|
||||||
c = getc (finput);
|
|
||||||
}
|
|
||||||
buffer[count] = 0;
|
|
||||||
|
|
||||||
ungetc (c, finput);
|
ungetc (c, finput);
|
||||||
|
|
||||||
if (count <= 0 || count > 10)
|
if (!isdigit (c))
|
||||||
complain (_("argument of %%expect is not an integer"));
|
complain (_("argument of %%expect is not an integer"));
|
||||||
expected_conflicts = atoi (buffer);
|
else
|
||||||
|
expected_conflicts = read_signed_integer (finput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user