return false;
/* Factor variable (s) */
- while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
+ while (lex_match (lexer, T_BY))
{
- if (lex_match (lexer, T_BY))
- {
- table->n_layers++;
- table->layers =
- pool_realloc (cmd->pool, table->layers,
- sizeof (*table->layers) * table->n_layers);
-
- if (!parse_variables_const_pool
- (lexer, cmd->pool, cmd->dict,
- &table->layers[table->n_layers - 1].factor_vars,
- &table->layers[table->n_layers - 1].n_factor_vars,
- PV_NO_DUPLICATE))
- return false;
-
- }
+ table->n_layers++;
+ table->layers =
+ pool_realloc (cmd->pool, table->layers,
+ sizeof (*table->layers) * table->n_layers);
+
+ if (!parse_variables_const_pool
+ (lexer, cmd->pool, cmd->dict,
+ &table->layers[table->n_layers - 1].factor_vars,
+ &table->layers[table->n_layers - 1].n_factor_vars,
+ PV_NO_DUPLICATE))
+ return false;
}
/* There is always at least one layer.
AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP
+
+
+
+AT_SETUP([MEANS parser bug])
+
+dnl This bug caused an infinite loop
+AT_DATA([means-bad.sps], [dnl
+DATA LIST notable LIST /a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 fylo *.
+begin data.
+1 2 3 4 5 6 7 8 9 0 11
+end data.
+
+MEANS TABLES = a1 a2 a3 a4 a5 a6 a7 a8 a9 a10a BY fylo.
+])
+
+AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
+