better parser error messages; add -p option to source builtin

This commit is contained in:
Chet Ramey
2024-06-21 10:38:39 -04:00
parent dbb48b9786
commit 886e4e68be
17 changed files with 2057 additions and 1912 deletions
+3 -1
View File
@@ -5041,6 +5041,8 @@ cond_term (void)
}
else
parser_error (lineno, _("expected `)'"));
if (cond_token == WORD)
dispose_word (yylval.word);
COND_RETURN_ERROR ();
}
term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL);
@@ -6642,7 +6644,7 @@ error_token_from_token (int tok)
t = (char *)NULL;
/* This stuff is dicy and needs closer inspection */
switch (current_token)
switch (tok)
{
case WORD:
case ASSIGNMENT_WORD: