+ else if (lex_match_id (lexer, "ARRANGEMENT"))
+ {
+ bool ok;
+
+ lex_match (lexer, T_EQUALS);
+ if (lex_match_id (lexer, "FIXED"))
+ ok = set_type (parser, "ARRANGEMENT=FIXED", DP_FIXED, &has_type);
+ else if (lex_match_id (lexer, "DELIMITED"))
+ ok = set_type (parser, "ARRANGEMENT=DELIMITED",
+ DP_DELIMITED, &has_type);
+ else
+ {
+ lex_error_expecting (lexer, "FIXED", "DELIMITED");
+ goto error;
+ }
+ if (!ok)
+ goto error;
+ }
+ else if (lex_match_id (lexer, "FIRSTCASE"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if (!lex_force_int (lexer))
+ goto error;
+ if (lex_integer (lexer) < 1)
+ {
+ msg (SE, _("Value of %s must be 1 or greater."), "FIRSTCASE");
+ goto error;
+ }
+ data_parser_set_skip (parser, lex_integer (lexer) - 1);
+ lex_get (lexer);
+ }
+ else if (lex_match_id_n (lexer, "DELCASE", 4))
+ {
+ if (!set_type (parser, "DELCASE", DP_DELIMITED, &has_type))
+ goto error;
+ lex_match (lexer, T_EQUALS);
+ if (lex_match_id (lexer, "LINE"))
+ data_parser_set_span (parser, false);
+ else if (lex_match_id (lexer, "VARIABLES"))
+ {
+ data_parser_set_span (parser, true);
+
+ /* VARIABLES takes an integer argument, but for no
+ good reason. We just ignore it. */
+ if (!lex_force_int (lexer))
+ goto error;
+ lex_get (lexer);
+ }
+ else
+ {
+ lex_error_expecting (lexer, "LINE", "VARIABLES");
+ goto error;
+ }
+ }
+ else if (lex_match_id (lexer, "FIXCASE"))
+ {
+ if (!set_type (parser, "FIXCASE", DP_FIXED, &has_type))
+ goto error;
+ lex_match (lexer, T_EQUALS);
+ if (!lex_force_int (lexer))
+ goto error;
+ if (lex_integer (lexer) < 1)
+ {
+ msg (SE, _("Value of %s must be 1 or greater."), "FIXCASE");
+ goto error;
+ }
+ data_parser_set_records (parser, lex_integer (lexer));
+ lex_get (lexer);
+ }
+ else if (lex_match_id (lexer, "IMPORTCASES"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if (lex_match (lexer, T_ALL))
+ {
+ /* Nothing to do. */
+ }
+ else if (lex_match_id (lexer, "FIRST"))
+ {
+ if (!lex_force_int (lexer))
+ goto error;
+ lex_get (lexer);
+ }
+ else if (lex_match_id (lexer, "PERCENT"))
+ {
+ if (!lex_force_int (lexer))
+ goto error;
+ lex_get (lexer);
+ }
+ msg (SW, _("Ignoring obsolete IMPORTCASES subcommand. (N OF CASES "
+ "or SAMPLE may be used to substitute.)"));
+ }
+ else if (lex_match_id_n (lexer, "DELIMITERS", 4))
+ {
+ struct string hard_seps = DS_EMPTY_INITIALIZER;
+ const char *soft_seps = "";
+ struct substring s;
+ int c;
+
+ if (!set_type (parser, "DELIMITERS", DP_DELIMITED, &has_type))
+ goto error;
+ lex_match (lexer, T_EQUALS);
+
+ if (!lex_force_string (lexer))
+ goto error;
+
+ /* XXX should support multibyte UTF-8 characters */
+ s = lex_tokss (lexer);
+ if (ss_match_string (&s, ss_cstr ("\\t")))
+ ds_put_cstr (&hard_seps, "\t");
+ if (ss_match_string (&s, ss_cstr ("\\\\")))
+ ds_put_cstr (&hard_seps, "\\");
+ while ((c = ss_get_byte (&s)) != EOF)
+ if (c == ' ')
+ soft_seps = " ";
+ else
+ ds_put_byte (&hard_seps, c);
+ data_parser_set_soft_delimiters (parser, ss_cstr (soft_seps));
+ data_parser_set_hard_delimiters (parser, ds_ss (&hard_seps));
+ ds_destroy (&hard_seps);
+
+ lex_get (lexer);
+ }
+ else if (lex_match_id (lexer, "QUALIFIERS"))
+ {
+ if (!set_type (parser, "QUALIFIERS", DP_DELIMITED, &has_type))
+ goto error;
+ lex_match (lexer, T_EQUALS);
+
+ if (!lex_force_string (lexer))
+ goto error;
+
+ /* XXX should support multibyte UTF-8 characters */
+ if (settings_get_syntax () == COMPATIBLE
+ && ss_length (lex_tokss (lexer)) != 1)
+ {
+ msg (SE, _("In compatible syntax mode, the QUALIFIER string "
+ "must contain exactly one character."));
+ goto error;
+ }
+
+ data_parser_set_quotes (parser, lex_tokss (lexer));
+ lex_get (lexer);
+ }
+ else if (lex_match_id (lexer, "VARIABLES"))
+ break;