DP_DELIMITED, &has_type);
else
{
- lex_error_expecting (lexer, "FIXED", "DELIMITED", NULL_SENTINEL);
+ lex_error_expecting (lexer, "FIXED", "DELIMITED");
goto error;
}
if (!ok)
}
else
{
- lex_error_expecting (lexer, "LINE", "VARIABLES", NULL_SENTINEL);
+ lex_error_expecting (lexer, "LINE", "VARIABLES");
goto error;
}
}
break;
else
{
- lex_error_expecting (lexer, "VARIABLES", NULL_SENTINEL);
+ lex_error_expecting (lexer, "VARIABLES");
goto error;
}
}
if (!lex_match_id (lexer, "COMM")
&& !lex_match_id (lexer, "TAPE"))
{
- lex_error_expecting (lexer, "COMM", "TAPE", NULL_SENTINEL);
+ lex_error_expecting (lexer, "COMM", "TAPE");
goto error;
}
}
type = TAB_FILE;
else
{
- lex_error_expecting (lexer, "CSV", "TAB", NULL_SENTINEL);
+ lex_error_expecting (lexer, "CSV", "TAB");
goto error;
}
}
recode_user_missing = true;
else
{
- lex_error_expecting (lexer, "IGNORE", "RECODE", NULL_SENTINEL);
+ lex_error_expecting (lexer, "IGNORE", "RECODE");
goto error;
}
}
use_value_labels = true;
else
{
- lex_error_expecting (lexer, "VALUES", "LABELS", NULL_SENTINEL);
+ lex_error_expecting (lexer, "VALUES", "LABELS");
goto error;
}
}
decimal = ',';
else
{
- lex_error_expecting (lexer, "DOT", "COMMA",
- NULL_SENTINEL);
+ lex_error_expecting (lexer, "DOT", "COMMA");
goto error;
}
}
use_print_formats = true;
else
{
- lex_error_expecting (lexer, "PLAIN", "VARIABLE",
- NULL_SENTINEL);
+ lex_error_expecting (lexer, "PLAIN", "VARIABLE");
goto error;
}
}
retain_unselected = false;
else
{
- lex_error_expecting (lexer, "RETAIN", "DELETE", NULL_SENTINEL);
+ lex_error_expecting (lexer, "RETAIN", "DELETE");
goto error;
}
}
cw = true;
else
{
- lex_error_expecting (lexer, "READONLY", "WRITEABLE",
- NULL_SENTINEL);
+ lex_error_expecting (lexer, "READONLY", "WRITEABLE");
goto error;
}
sysfile_opts.create_writeable = porfile_opts.create_writeable = cw;
*retain_unselected = false;
else
{
- lex_error_expecting (lexer, "RETAIN", "DELETE", NULL_SENTINEL);
+ lex_error_expecting (lexer, "RETAIN", "DELETE");
goto error;
}
}
porfile_opts.type = PFM_TAPE;
else
{
- lex_error_expecting (lexer, "COMM", "TAPE", NULL_SENTINEL);
+ lex_error_expecting (lexer, "COMM", "TAPE");
goto error;
}
}
goto done;
if (!lex_match (lexer, T_EQUALS))
{
- lex_error_expecting (lexer, "`='", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`='");
goto done;
}
if (!parse_DATA_LIST_vars (lexer, dict, &new_names, &nn,
command = DELETE;
else if (command == UNKNOWN)
{
- lex_error_expecting (lexer, "ATTRIBUTE=", "DELETE=", NULL_SENTINEL);
+ lex_error_expecting (lexer, "ATTRIBUTE=", "DELETE=");
return CMD_FAILURE;
}
if (!lex_match (lexer, T_LPAREN))
{
- lex_error_expecting (lexer, "`('", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`('");
goto fail;
}
if (!parse_format_specifier (lexer, &f)
if (!lex_match (lexer, T_RPAREN))
{
- lex_error_expecting (lexer, "`)'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`)'");
goto fail;
}
{
if (!lex_match (lexer, T_LPAREN))
{
- lex_error_expecting (lexer, "`('", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`('");
free (v);
goto done;
}
}
if (!lex_match (lexer, T_RPAREN))
{
- lex_error_expecting (lexer, "`)'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`)'");
free (v);
goto done;
}
if (!lex_match (lexer, T_LPAREN))
{
- lex_error_expecting (lexer, "`('", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`('");
goto done;
}
if (!parse_variables (lexer, dataset_dict (ds),
goto done;
if (!lex_match (lexer, T_EQUALS))
{
- lex_error_expecting (lexer, "`='", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`='");
goto done;
}
}
if (!lex_match (lexer, T_RPAREN))
{
- lex_error_expecting (lexer, "`)'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`)'");
goto done;
}
}
break;
if (lex_token (lexer) != T_SLASH)
{
- lex_error_expecting (lexer, "`/'", "`.'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`/'", "`.'");
goto done;
}
lex_get (lexer);
if (!lex_match (lexer, T_RPAREN))
{
- lex_error_expecting (lexer, "`)'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`)'");
goto fail;
}
}
break;
else if (!lex_match (lexer, T_COMMA))
{
- lex_error_expecting (lexer, "`,'", "`)'", NULL_SENTINEL);
+ lex_error_expecting (lexer, "`,'", "`)'");
goto fail;
}
}
/* Prints a syntax error message saying that OPTION0 or one of the other
strings following it, up to the first NULL, is expected. */
void
-lex_error_expecting (struct lexer *lexer, const char *option0, ...)
+(lex_error_expecting) (struct lexer *lexer, const char *option0, ...)
{
enum { MAX_OPTIONS = 8 };
const char *options[MAX_OPTIONS + 1];
return true;
else
{
- lex_error_expecting (lexer, identifier, NULL_SENTINEL);
+ lex_error_expecting (lexer, identifier);
return false;
}
}
if (type_string)
{
char *s = xasprintf ("`%s'", type_string);
- lex_error_expecting (lexer, s, NULL_SENTINEL);
+ lex_error_expecting (lexer, s);
free (s);
}
else
- lex_error_expecting (lexer, token_type_to_name (type), NULL_SENTINEL);
+ lex_error_expecting (lexer, token_type_to_name (type));
return false;
}
#include "data/identifier.h"
#include "data/variable.h"
+#include "libpspp/cast.h"
#include "libpspp/compiler.h"
#include "libpspp/prompt.h"
int lex_end_of_command (struct lexer *);
void lex_error_expecting (struct lexer *, const char *, ...) SENTINEL(0);
+#define lex_error_expecting(...) \
+ lex_error_expecting(__VA_ARGS__, NULL_SENTINEL)
void lex_sbc_only_once (const char *);
void lex_sbc_missing (const char *);
{
dump (1, "if (!lex_match (lexer, T_LPAREN))");
dump (1, "{");
- dump (0, "lex_error_expecting (lexer, \"`('\", "
- "NULL_SENTINEL);");
+ dump (0, "lex_error_expecting (lexer, \"`('\");");
dump (0, "goto lossage;");
dump (-1, "}");
outdent ();
lex_match (lexer, T_EQUALS);
if (!lex_match_id (lexer, "COLUMNWISE"))
{
- lex_error_expecting (lexer, "COLUMNWISE", NULL);
+ lex_error_expecting (lexer, "COLUMNWISE");
goto error;
}
agr.missing = COLUMNWISE;
}
else
{
- lex_error_expecting (lexer, "BIVARIATE", NULL);
+ lex_error_expecting (lexer, "BIVARIATE");
goto error;
}
if (!lex_force_match (lexer, T_RPAREN))
case CT_BAR:
break;
case CT_NONE:
- lex_error_expecting (lexer, "HISTOGRAM", "SCATTERPLOT", "BAR", NULL);
+ lex_error_expecting (lexer, "HISTOGRAM", "SCATTERPLOT", "BAR");
goto error;
default:
NOT_REACHED ();
direction = SC_ASCEND;
else
{
- lex_error_expecting (lexer, "A", "D", NULL_SENTINEL);
+ lex_error_expecting (lexer, "A", "D");
goto error;
}
if (!lex_force_match (lexer, T_RPAREN))
syntax_mode = LEX_SYNTAX_AUTO;
else
{
- lex_error_expecting (lexer, "BATCH", "INTERACTIVE", "AUTO",
- NULL_SENTINEL);
+ lex_error_expecting (lexer, "BATCH", "INTERACTIVE", "AUTO");
goto exit;
}
}
}
else
{
- lex_error_expecting (lexer, "YES", "NO", NULL_SENTINEL);
+ lex_error_expecting (lexer, "YES", "NO");
goto exit;
}
}
}
else
{
- lex_error_expecting (lexer, "CONTINUE", "STOP", NULL_SENTINEL);
+ lex_error_expecting (lexer, "CONTINUE", "STOP");
goto exit;
}
}
}
else
{
- lex_error_expecting (lexer, "WRITEABLE", "READONLY", NULL_SENTINEL);
+ lex_error_expecting (lexer, "WRITEABLE", "READONLY");
goto error;
}
settings_set_show_values (SETTINGS_VALUE_SHOW_BOTH);
else
{
- lex_error_expecting (lexer, "VALUES", "LABELS", "BOTH", NULL_SENTINEL);
+ lex_error_expecting (lexer, "VALUES", "LABELS", "BOTH");
return 0;
}
settings_set_show_variables (SETTINGS_VALUE_SHOW_BOTH);
else
{
- lex_error_expecting (lexer, "NAMES", "LABELS", "BOTH", NULL_SENTINEL);
+ lex_error_expecting (lexer, "NAMES", "LABELS", "BOTH");
return 0;
}