* tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.

* tests/output.at (AT_CHECK_OUTPUT): Likewise.
* tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
* tests/semantic.at (Parsing Guards): Similarly.
* src/reader.at (readgram): Complain if the last rule is not ended
with a semi-colon.
This commit is contained in:
Akim Demaille
2002-03-04 16:23:35 +00:00
parent 65ccf9fc1d
commit bfcf1f3af0
7 changed files with 20 additions and 7 deletions

View File

@@ -1,3 +1,12 @@
2002-03-04 Akim Demaille <akim@epita.fr>
* tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
* tests/output.at (AT_CHECK_OUTPUT): Likewise.
* tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
* tests/semantic.at (Parsing Guards): Similarly.
* src/reader.at (readgram): Complain if the last rule is not ended
with a semi-colon.
2002-03-04 Akim Demaille <akim@epita.fr> 2002-03-04 Akim Demaille <akim@epita.fr>
* src/warshall.h, src/warshall.c (bitmatrix_print): Move to... * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
@@ -5750,3 +5759,5 @@
1987-12-16 Richard Stallman <rms@gnu.org> 1987-12-16 Richard Stallman <rms@gnu.org>
* REFERENCES: entered into RCS * REFERENCES: entered into RCS
$Revision$ $Date$

View File

@@ -1445,6 +1445,8 @@ readgram (void)
/* Warn if there is no default for $$ but we need one. */ /* Warn if there is no default for $$ but we need one. */
else if (!xactions && !first_rhs && lhs->type_name != 0) else if (!xactions && !first_rhs && lhs->type_name != 0)
complain (_("empty rule for typed nonterminal, and no action")); complain (_("empty rule for typed nonterminal, and no action"));
if (t == tok_two_percents || t == tok_eof)
complain (_("previous rule lacks an ending `;'"));
if (t == tok_semicolon) if (t == tok_semicolon)
t = lex (); t = lex ();
} }

View File

@@ -57,7 +57,7 @@ AS_MKDIR_P([$dirname])
AT_DATA([$1.y], AT_DATA([$1.y],
[%% [%%
dummy: dummy:;
]) ])
AT_CHECK([bison --defines=$1.h $1.y]) AT_CHECK([bison --defines=$1.h $1.y])

View File

@@ -29,7 +29,7 @@ AT_SETUP([Invalid $n])
AT_DATA([input.y], AT_DATA([input.y],
[[%% [[%%
exp: { $$ = $1 ; } exp: { $$ = $1 ; };
]]) ]])
AT_CHECK([bison input.y], [1], [], AT_CHECK([bison input.y], [1], [],
@@ -48,7 +48,7 @@ AT_SETUP([Invalid @n])
AT_DATA([input.y], AT_DATA([input.y],
[[%% [[%%
exp: { @$ = @1 ; } exp: { @$ = @1 ; };
]]) ]])
AT_CHECK([bison input.y], [1], [], AT_CHECK([bison input.y], [1], [],

View File

@@ -26,7 +26,7 @@ m4_define([AT_CHECK_OUTPUT],
AT_DATA([$1], AT_DATA([$1],
[[$2 [[$2
%% %%
foo: {} foo: {};
]]) ]])
AT_CHECK([bison $3 $1], 0) AT_CHECK([bison $3 $1], 0)

View File

@@ -103,7 +103,7 @@ AT_DATA([input.y],
[[/* Bison used to swallow the character after `}'. */ [[/* Bison used to swallow the character after `}'. */
%% %%
exp: { tests = {{{{{{{{{{}}}}}}}}}}; } exp: { tests = {{{{{{{{{{}}}}}}}}}}; };
%% %%
]]) ]])
@@ -382,7 +382,7 @@ expr:
{ {
} };
]]) ]])
AT_CHECK([bison input.y -o input.c -v], 0, [], []) AT_CHECK([bison input.y -o input.c -v], 0, [], [])

View File

@@ -38,7 +38,7 @@ AT_DATA([input.y],
%% %%
exp: exp '+' exp { $$ = $1 + $3 } exp: exp '+' exp { $$ = $1 + $3 }
| exp '/' exp %guard { if ($3 == 0) yyerror = 1 } { $$ = $1 / $3 } | exp '/' exp %guard { if ($3 == 0) yyerror = 1 } { $$ = $1 / $3 }
| INT | INT;
%% %%
]]) ]])