Many of the invocations of lex_error() were easy to rephrase to be more
easily translated, or to rewrite as calls to other functions.
- lex_error (lexer, _("expecting VARIABLES"));
+ lex_error (lexer, _("expecting %s"), "VARIABLES");
command = DELETE;
else if (command == UNKNOWN)
{
command = DELETE;
else if (command == UNKNOWN)
{
- lex_error (lexer, _("expecting ATTRIBUTE= or DELETE="));
+ lex_error (lexer, _("expecting %s or %s"), "ATTRIBUTE=", "DELETE=");
if (!parse_variables (lexer, dataset_dict (ds), &v, &nv, PV_NONE))
goto done;
if (!parse_variables (lexer, dataset_dict (ds), &v, &nv, PV_NONE))
goto done;
- if (!lex_match (lexer, '('))
- {
- lex_error (lexer, _("expecting `('"));
- goto done;
- }
+ if (!lex_force_match (lexer, '('))
+ goto done;
for (i = 0; i < nv; i++)
var_clear_missing_values (v[i]);
for (i = 0; i < nv; i++)
var_clear_missing_values (v[i]);
union any_node *node;
lex_get (lexer);
node = parse_or (lexer, e);
union any_node *node;
lex_get (lexer);
node = parse_or (lexer, e);
- if (node != NULL && !lex_match (lexer, ')'))
- {
- lex_error (lexer, _("expecting `)'"));
- return NULL;
- }
+ if (node != NULL && !lex_force_match (lexer, ')'))
+ return NULL;
lex_match (lexer, '=');
if (!lex_match_id (lexer, "COLUMNWISE"))
{
lex_match (lexer, '=');
if (!lex_match_id (lexer, "COLUMNWISE"))
{
- lex_error (lexer, _("while expecting COLUMNWISE"));
+ lex_error (lexer, _("expecting %s"), "COLUMNWISE");
goto error;
}
agr.missing = COLUMNWISE;
goto error;
}
agr.missing = COLUMNWISE;
copy_documents = true;
else if (lex_match_id (lexer, "PRESORTED"))
presorted = true;
copy_documents = true;
else if (lex_match_id (lexer, "PRESORTED"))
presorted = true;
- else if (lex_match_id (lexer, "BREAK"))
+ else if (lex_force_match_id (lexer, "BREAK"))
- {
- lex_error (lexer, _("expecting BREAK"));
- goto error;
- }
}
if (presorted && saw_direction)
msg (SW, _("When PRESORTED is specified, specifying sorting directions "
}
if (presorted && saw_direction)
msg (SW, _("When PRESORTED is specified, specifying sorting directions "
{
if (function->src_vars == AGR_SV_YES)
{
{
if (function->src_vars == AGR_SV_YES)
{
- lex_error (lexer, _("expecting `('"));
+ lex_force_match (lexer, '(');
- if (!lex_match (lexer, ')'))
- {
- lex_error (lexer, _("expecting `)'"));
- goto error;
- }
+ if (!lex_force_match (lexer, ')'))
+ goto error;
/* Now check that the number of source variables match
the number of target variables. If we check earlier
/* Now check that the number of source variables match
the number of target variables. If we check earlier
- lex_error (lexer, _("expecting BY"));
+ lex_force_match (lexer, T_BY);
| PV_NO_DUPLICATE | PV_NO_SCRATCH)))
return 0;
| PV_NO_DUPLICATE | PV_NO_SCRATCH)))
return 0;
- if (lex_token (lexer) != '(')
- {
- lex_error (lexer, "expecting `('");
+ if (!lex_force_match (lexer, '('))
if (!lex_force_int (lexer))
goto lossage;
if (!lex_force_int (lexer))
goto lossage;
- if (lex_token (lexer) != ')')
- {
- lex_error (lexer, "expecting `)'");
- goto lossage;
- }
- lex_get (lexer);
+ if (!lex_force_match (lexer, ')'))
+ goto lossage;
for (i = orig_nv; i < proc->n_variables; i++)
{
for (i = orig_nv; i < proc->n_variables; i++)
{
syntax_mode = GETL_BATCH;
else
{
syntax_mode = GETL_BATCH;
else
{
- lex_error(lexer,
- _("Expecting BATCH or INTERACTIVE after SYNTAX."));
+ lex_error (lexer, _("expecting %s or %s after %s"),
+ "BATCH", "INTERACTIVE", "SYNTAX");
- lex_error (lexer, _("Expecting YES or NO after CD."));
+ lex_error (lexer, _("expecting %s or %s after %s"),
+ "YES", "NO", "CD");
- lex_error (lexer, _("Expecting CONTINUE or STOP after ERROR."));
+ lex_error (lexer, _("expecting %s or %s after %s"),
+ "CONTINUE", "STOP", "ERROR");