From 9df2afdd4fb29138d9a1885cd892ea16528a71f3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 11 Apr 2011 22:49:01 -0700 Subject: [PATCH] FORMATS: Allow an optional slash before each set of variable names. This increases compatibility. --- src/language/dictionary/formats.c | 2 ++ tests/language/dictionary/formats.at | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/language/dictionary/formats.c b/src/language/dictionary/formats.c index 718344ac..2244ef77 100644 --- a/src/language/dictionary/formats.c +++ b/src/language/dictionary/formats.c @@ -73,6 +73,8 @@ internal_cmd_formats (struct lexer *lexer, struct dataset *ds, int which) int width; size_t i; + lex_match (lexer, T_SLASH); + if (lex_token (lexer) == T_ENDCMD) break; diff --git a/tests/language/dictionary/formats.at b/tests/language/dictionary/formats.at index 4bdf089f..d3c2e65e 100644 --- a/tests/language/dictionary/formats.at +++ b/tests/language/dictionary/formats.at @@ -4,9 +4,9 @@ AT_SETUP([FORMATS positive tests]) AT_DATA([formats.sps], [dnl DATA LIST LIST /a b c * x (A1) y (A2) z (A3). DISPLAY VARIABLES. -FORMATS a (COMMA10) b (N4). +FORMATS /a (COMMA10) b (N4). DISPLAY VARIABLES. -FORMATS c (E8.1) x (A1) y (AHEX4) z (A3). +FORMATS c (E8.1) x (A1) /y (AHEX4) z (A3). DISPLAY VARIABLES. ]) AT_CHECK([pspp -o pspp.csv formats.sps]) -- 2.30.2