if (mrset->name == NULL)
{
- msg (SE, _("Required %s specification missing from %s subcommand."),
- "NAME", subcommand_name);
+ lex_spec_missing (lexer, subcommand_name, "NAME");
goto error;
}
else if (mrset->n_vars == 0)
{
- msg (SE, _("Required %s specification missing from %s subcommand."),
- "VARIABLES", subcommand_name);
+ lex_spec_missing (lexer, subcommand_name, "VARIABLES");
goto error;
}
/* Check that VALUE is specified and is valid for the VARIABLES. */
if (!has_value)
{
- msg (SE, _("Required %s specification missing from %s subcommand."),
- "VALUE", subcommand_name);
+ lex_spec_missing (lexer, subcommand_name, "VALUE");
goto error;
}
else if (var_is_alpha (mrset->vars[0]))
msg (SE, _("Required subcommand %s was not specified."), sbc);
}
+/* Reports an error to the effect that specification SPEC may only be specified
+ once within subcommand SBC. */
+void
+lex_spec_only_once (struct lexer *lexer, const char *sbc, const char *spec)
+{
+ lex_error (lexer, _("%s may only be specified once within subcommand %s"),
+ spec, sbc);
+}
+
+/* Reports an error to the effect that specification SPEC is missing within
+ subcommand SBC. */
+void
+lex_spec_missing (struct lexer *lexer, const char *sbc, const char *spec)
+{
+ lex_error (lexer, _("Required %s specification missing from %s subcommand"),
+ sbc, spec);
+}
+
/* Prints a syntax error message containing the current token and
given message MESSAGE (if non-null). */
void
void lex_sbc_only_once (const char *);
void lex_sbc_missing (const char *);
+void lex_spec_only_once (struct lexer *, const char *subcommand,
+ const char *specification);
+void lex_spec_missing (struct lexer *, const char *subcommand,
+ const char *specification);
+
void lex_error_valist (struct lexer *, const char *, va_list)
PRINTF_FORMAT (2, 0);
void lex_next_error_valist (struct lexer *lexer, int n0, int n1,
MRSETS /MCGROUP VARIABLES=a b c.
])
AT_CHECK([pspp -O format=csv mrsets.sps], [1],
- [mrsets.sps:6: error: MRSETS: Required NAME specification missing from MCGROUP subcommand.
+ [mrsets.sps:6.32: error: MRSETS: Syntax error at end of command: Required MCGROUP specification missing from NAME subcommand.
])
AT_CLEANUP
MRSETS /MCGROUP NAME=$Mcgroup.
])
AT_CHECK([pspp -O format=csv mrsets.sps], [1],
- [mrsets.sps:6: error: MRSETS: Required VARIABLES specification missing from MCGROUP subcommand.
+ [mrsets.sps:6.30: error: MRSETS: Syntax error at end of command: Required MCGROUP specification missing from VARIABLES subcommand.
])
AT_CLEANUP