aboutsummaryrefslogtreecommitdiff
path: root/src/gram.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/gram.y')
-rw-r--r--src/gram.y28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/gram.y b/src/gram.y
index 57d90c5..5372795 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -71,20 +71,20 @@ stmtlist : stmt
| stmtlist stmt
;
-stmt : /* empty */ '\n'
+stmt : /* empty */ eol
{
run_last_command ();
}
- | T_CMD arglist '\n'
+ | T_CMD arglist eol
{
- if (run_command ($1, &$2) && !interactive)
+ if (run_command ($1, &$2) && !interactive ())
exit (EXIT_USAGE);
}
- | set '\n'
- | defn '\n'
- | T_BOGUS '\n'
+ | set eol
+ | defn eol
+ | T_BOGUS eol
{
- if (interactive)
+ if (interactive ())
{
yyclearin;
yyerrok;
@@ -92,9 +92,9 @@ stmt : /* empty */ '\n'
else
YYERROR;
}
- | error { end_def(); } '\n'
+ | error { end_def(); } eol
{
- if (interactive)
+ if (interactive ())
{
yyclearin;
yyerrok;
@@ -104,6 +104,10 @@ stmt : /* empty */ '\n'
}
;
+eol : '\n'
+ | ';'
+ ;
+
arglist : /* empty */
{
gdbmarglist_init (&$$, NULL);
@@ -367,3 +371,9 @@ yyerror (char const *s)
terror ("%s", s);
return 0;
}
+
+void
+gram_trace (int n)
+{
+ yydebug = 1;
+}

Return to:

Send suggestions and report system problems to the System administrator.