mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
glr.c: example: several improvements
* examples/c/glr/c++-types.y (node_print): New. Use YY_LOCATION_PRINT instead of duplicating it. And actually use it in the action instead of badly duplicating it. (main): Add proper option support. * examples/c/glr/c++-types.test: Adjust expectations on locations. * examples/c++/glr/c++-types.yy: Fix bad iteration.
This commit is contained in:
@@ -192,11 +192,11 @@ main (int argc, char **argv)
|
||||
bool ran = false;
|
||||
for (int i = 1; i < argc; ++i)
|
||||
// Enable parse traces on option -p.
|
||||
if (strcmp (argv[1], "-p") == 0)
|
||||
if (strcmp (argv[i], "-p") == 0)
|
||||
parse.set_debug_level (1);
|
||||
else
|
||||
{
|
||||
int status = process (parse, argv[1]);
|
||||
int status = process (parse, argv[i]);
|
||||
ran = true;
|
||||
if (!status)
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user