AUTORECODE now optionally accepts / before INTO
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 13 Aug 2016 05:29:30 +0000 (07:29 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 13 Aug 2016 05:36:31 +0000 (07:36 +0200)
Fixes Bug #48762

NEWS
src/language/stats/autorecode.c
tests/language/stats/autorecode.at

diff --git a/NEWS b/NEWS
index 0b87edb31adaa07305e23c546e3cad692182d690..883590541ee61c5a4af4af84d6865a5b95053409 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,9 @@ Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
 
 Changes from 0.10.2 to 0.10.4:
 
- * Updated to Gtk+3.14.5
+ *  Gtk+3.14.5 or later must now be used when building.
+
+ *  The AUTORECODE command now accepts an optional / before INTO.
 
 Changes from 0.10.1 to 0.10.2:
 
index dc357f7c4482496be6182c8698c53e820da24503..d3c5864c2221a6f79ff5ffada2b88c887de069fe 100644 (file)
@@ -153,6 +153,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds)
   if (!parse_variables_const (lexer, dict, &src_vars, &n_srcs,
                               PV_NO_DUPLICATE | PV_NO_SCRATCH))
     goto error;
+  lex_match (lexer, T_SLASH);
   if (!lex_force_match_id (lexer, "INTO"))
     goto error;
   lex_match (lexer, T_EQUALS);
index 6a8ff8e7316c224b478e8fa6ac5eb9c457be42c5..52c56a8582ae2336bf9618cc14b116bc48d3be7c 100644 (file)
@@ -272,3 +272,36 @@ asdfk,0,2.00,.  @&t@
 asdfk,1,2.00,.  @&t@
 ])
 AT_CLEANUP
+
+
+dnl For compatibility, make sure that /INTO (with leading slash) is accepted
+dnl (bug #48762)
+AT_SETUP([AUTORECODE with /INTO])
+AT_DATA([autorecode.sps],
+  [data list list notable /x .
+begin data.
+1
+8
+-901
+4
+1
+99
+8
+end data.
+
+autorecode x  /into y.
+
+list.
+])
+AT_CHECK([pspp -O format=csv autorecode.sps], [0],
+[Table: Data List
+x,y
+1.00,2.00
+8.00,4.00
+-901.00,1.00
+4.00,3.00
+1.00,2.00
+99.00,5.00
+8.00,4.00
+])
+AT_CLEANUP