? q2c-consistency.patch
Index: doc/q2c.texi
===================================================================
RCS file: /cvsroot/pspp/pspp/doc/q2c.texi,v
retrieving revision 1.4
diff -u -p -u -r1.4 q2c.texi
--- doc/q2c.texi	6 May 2005 02:08:37 -0000	1.4
+++ doc/q2c.texi	2 Jul 2006 00:42:11 -0000
@@ -123,13 +123,12 @@ separated by semicolons (@samp{;}) and t
 (@samp{.}).
 
 @example
-subcommand ::= sbc-options ID sbc-defn
-sbc-options ::= 
-            ::= sbc-option
-            ::= sbc-options sbc-options
-sbc-option ::= *
-           ::= +
-           ::= ^
+subcommand ::= default-opt arity-opt ID sbc-defn
+default-opt ::=
+            ::= *
+arity-opt ::=
+          ::= +
+          ::= ^
 sbc-defn ::= opt-prefix = specifiers
          ::= [ ID ] = array-sbc
          ::= opt-prefix = sbc-special-form
@@ -137,16 +136,16 @@ opt-prefix ::=
            ::= ( ID )
 @end example
 
-Each subcommand can be prefixed with one or more option characters.  An
-asterisk (@samp{*}) is used to indicate the default subcommand; the
-keyword used for the default subcommand can be omitted in the PSPP
-syntax file.  A plus sign (@samp{+}) is used to indicate that a
-subcommand can appear more than once; if it is not present then that
-subcommand can appear no more than once.
-A carat sign (@samp{^}) is used to indicate that a subcommand must appear
-at least once.
+A subcommand that begins with an asterisk (@samp{*}) is the default
+subcommand.  The keyword used for the default subcommand can be omitted
+in the PSPP syntax file.
+
+A plus sign (@samp{+}) indicates that a subcommand can appear more than
+once.  A caret (@samp{^}) indicate that a subcommand must appear exactly
+once.  A subcommand marked with neither character may appear once or not
+at all, but not more than once.
 
-The subcommand name appears after the option characters.
+The subcommand name appears after the leading option characters.
 
 There are three forms of subcommands.  The first and most common form
 simply gives an equals sign (@samp{=}) and a list of specifiers, which
Index: src/language/data-io/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/ChangeLog,v
retrieving revision 1.22
diff -u -p -u -r1.22 ChangeLog
--- src/language/data-io/ChangeLog	28 Jun 2006 05:49:03 -0000	1.22
+++ src/language/data-io/ChangeLog	2 Jul 2006 00:42:12 -0000
@@ -1,3 +1,10 @@
+Sat Jul  1 17:39:40 2006  Ben Pfaff  <blp@gnu.org>
+
+	Fix bug #11612, "q2c documentation does not agree with code".
+	
+	* list.q: Audit use of q2c "+" prefixes that indicate that a
+	command may appear multiple times.
+
 Tue Jun 27 22:44:28 2006  Ben Pfaff  <blp@gnu.org>
 
 	Fix regression in command name completion reported by John
Index: src/language/data-io/list.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/list.q,v
retrieving revision 1.13
diff -u -p -u -r1.13 list.q
--- src/language/data-io/list.q	28 Jun 2006 02:21:28 -0000	1.13
+++ src/language/data-io/list.q	2 Jul 2006 00:42:12 -0000
@@ -52,9 +52,9 @@
    list (lst_):
      *variables=varlist("PV_NO_SCRATCH");
      cases=:from n:first,"%s>0"/by n:step,"%s>0"/ *to n:last,"%s>0";
-     format=numbering:numbered/!unnumbered,
-            wrap:!wrap/single,
-            weight:weight/!noweight.
+     +format=numbering:numbered/!unnumbered,
+             wrap:!wrap/single,
+             weight:weight/!noweight.
 */
 /* (declarations) */
 /* (functions) */
Index: src/language/lexer/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/ChangeLog,v
retrieving revision 1.10
diff -u -p -u -r1.10 ChangeLog
--- src/language/lexer/ChangeLog	28 Jun 2006 05:54:58 -0000	1.10
+++ src/language/lexer/ChangeLog	2 Jul 2006 00:42:13 -0000
@@ -1,3 +1,10 @@
+Sat Jul  1 17:40:38 2006  Ben Pfaff  <blp@gnu.org>
+
+	Fix bug #11612, "q2c documentation does not agree with code".
+	
+	* q2c.c (parse_subcommand): Make "+" mean ARITY_MANY, absence
+	mean ARITY_ONCE_ONLY.
+
 Tue Jun 27 22:54:30 2006  Ben Pfaff  <blp@gnu.org>
 
 	* automake.mk (src_language_lexer_liblexer_a_SOURCES): Add
Index: src/language/lexer/q2c.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/q2c.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 q2c.c
--- src/language/lexer/q2c.c	28 Jun 2006 02:21:28 -0000	1.12
+++ src/language/lexer/q2c.c	2 Jul 2006 00:42:13 -0000
@@ -739,8 +739,6 @@ parse_specifiers (subcommand *sbc)
 static void
 parse_subcommand (subcommand *sbc)
 {
-  sbc->arity = ARITY_MANY;
-
   if (match_token ('*'))
     {
       if (def)
@@ -748,8 +746,9 @@ parse_subcommand (subcommand *sbc)
       def = sbc;
     }
 
+  sbc->arity = ARITY_ONCE_ONLY;
   if ( match_token('+'))
-    sbc->arity = ARITY_ONCE_ONLY ;
+    sbc->arity = ARITY_MANY;
   else if (match_token('^'))
     sbc->arity = ARITY_ONCE_EXACTLY ;
 
Index: src/language/stats/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/ChangeLog,v
retrieving revision 1.25
diff -u -p -u -r1.25 ChangeLog
--- src/language/stats/ChangeLog	23 Jun 2006 21:30:11 -0000	1.25
+++ src/language/stats/ChangeLog	2 Jul 2006 00:42:14 -0000
@@ -1,3 +1,18 @@
+Sat Jul  1 17:41:46 2006  Ben Pfaff  <blp@gnu.org>
+
+	Fix bug #11612, "q2c documentation does not agree with code".
+	
+	* examine.q: Audit use of q2c "+" prefixes that indicate that a
+	command may appear multiple times.
+
+	* frequencies.q: Ditto.
+
+	* oneway.q: Ditto.
+
+	* regression.q: Ditto.
+
+	* t-test.q: Ditto.
+
 Fri Jun 23 14:18:22 2006  Ben Pfaff  <blp@gnu.org>
 
 	Support long string variables on FREQUENCIES, as
Index: src/language/stats/examine.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/examine.q,v
retrieving revision 1.8
diff -u -p -u -r1.8 examine.q
--- src/language/stats/examine.q	28 Jun 2006 02:21:28 -0000	1.8
+++ src/language/stats/examine.q	2 Jul 2006 00:42:15 -0000
@@ -65,8 +65,8 @@ Foundation, Inc., 51 Franklin Street, Fi
    +total=custom;
    +nototal=custom;
    +missing=miss:pairwise/!listwise,
-   rep:report/!noreport,
-   incl:include/!exclude;
+            rep:report/!noreport,
+            incl:include/!exclude;
    +compare=cmp:variables/!groups;
    +percentiles=custom;
    +id=var;
Index: src/language/stats/frequencies.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/frequencies.q,v
retrieving revision 1.11
diff -u -p -u -r1.11 frequencies.q
--- src/language/stats/frequencies.q	28 Jun 2006 02:21:28 -0000	1.11
+++ src/language/stats/frequencies.q	2 Jul 2006 00:42:16 -0000
@@ -68,14 +68,14 @@
 
 /* (specification)
    FREQUENCIES (frq_):
-     *variables=custom;
-     format=cond:condense/onepage(*n:onepage_limit,"%s>=0")/!standard,
-	    table:limit(n:limit,"%s>0")/notable/!table, 
-	    labels:!labels/nolabels,
-	    sort:!avalue/dvalue/afreq/dfreq,
-	    spaces:!single/double,
-	    paging:newpage/!oldpage;
-     missing=miss:include/!exclude;
+     *+variables=custom;
+     +format=cond:condense/onepage(*n:onepage_limit,"%s>=0")/!standard,
+	     table:limit(n:limit,"%s>0")/notable/!table, 
+	     labels:!labels/nolabels,
+	     sort:!avalue/dvalue/afreq/dfreq,
+	     spaces:!single/double,
+	     paging:newpage/!oldpage;
+     +missing=miss:include/!exclude;
      barchart(ba_)=:minimum(d:min),
 	    :maximum(d:max),
 	    scale:freq(*n:freq,"%s>0")/percent(*n:pcnt,"%s>0");
@@ -92,12 +92,12 @@
 	    scale:freq(*n:freq,"%s>0")/percent(*n:pcnt,"%s>0"),
 	    norm:!nonormal/normal,
 	    incr:increment(d:inc,"%s>0");
-     grouped=custom;
-     ntiles=integer;
+     +grouped=custom;
+     +ntiles=integer;
      +percentiles = double list;
-     statistics[st_]=1|mean,2|semean,3|median,4|mode,5|stddev,6|variance,
-	    7|kurtosis,8|skewness,9|range,10|minimum,11|maximum,12|sum,
-	    13|default,14|seskewness,15|sekurtosis,all,none.
+     +statistics[st_]=1|mean,2|semean,3|median,4|mode,5|stddev,6|variance,
+ 	    7|kurtosis,8|skewness,9|range,10|minimum,11|maximum,12|sum,
+ 	    13|default,14|seskewness,15|sekurtosis,all,none.
 */
 /* (declarations) */
 /* (functions) */
Index: src/language/stats/oneway.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/oneway.q,v
retrieving revision 1.8
diff -u -p -u -r1.8 oneway.q
--- src/language/stats/oneway.q	28 Jun 2006 02:21:28 -0000	1.8
+++ src/language/stats/oneway.q	2 Jul 2006 00:42:16 -0000
@@ -58,9 +58,9 @@ Foundation, Inc., 51 Franklin Street, Fi
    "ONEWAY" (oneway_):
    *^variables=custom;
    +missing=miss:!analysis/listwise,
-   incl:include/!exclude;
-   contrast= double list;
-   statistics[st_]=descriptives,homogeneity.
+            incl:include/!exclude;
+   +contrast= double list;
+   +statistics[st_]=descriptives,homogeneity.
 */
 /* (declarations) */
 /* (functions) */
Index: src/language/stats/regression.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/regression.q,v
retrieving revision 1.27
diff -u -p -u -r1.27 regression.q
--- src/language/stats/regression.q	28 Jun 2006 02:21:28 -0000	1.27
+++ src/language/stats/regression.q	2 Jul 2006 00:42:17 -0000
@@ -57,27 +57,27 @@
 /* (specification)
    "REGRESSION" (regression_):
    *variables=custom;
-   statistics[st_]=r,
-   coeff,
-   anova,
-   outs,
-   zpp,
-   label,
-   sha,
-   ci,
-   bcov,
-   ses,
-   xtx,
-   collin,
-   tol,
-   selection,
-   f,
-   defaults,
-   all;
+   +statistics[st_]=r,
+                    coeff,
+                    anova,
+                    outs,
+                    zpp,
+                    label,
+                    sha,
+                    ci,
+                    bcov,
+                    ses,
+                    xtx,
+                    collin,
+                    tol,
+                    selection,
+                    f,
+                    defaults,
+                    all;
    export=custom;
    ^dependent=varlist;
-   save[sv_]=resid,pred;
-   method=enter.
+   +save[sv_]=resid,pred;
+   +method=enter.
 */
 /* (declarations) */
 /* (functions) */
Index: src/language/stats/t-test.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/t-test.q,v
retrieving revision 1.8
diff -u -p -u -r1.8 t-test.q
--- src/language/stats/t-test.q	28 Jun 2006 02:21:28 -0000	1.8
+++ src/language/stats/t-test.q	2 Jul 2006 00:42:18 -0000
@@ -59,11 +59,11 @@
    "T-TEST" (tts_):
      +groups=custom;
      testval=double;
-     variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
-     pairs=custom;
+     +variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
+     +pairs=custom;
      +missing=miss:!analysis/listwise,
              incl:include/!exclude;
-     format=fmt:!labels/nolabels;
+     +format=fmt:!labels/nolabels;
      criteria=:cin(d:criteria,"%s > 0. && %s < 1.").
 */
 /* (declarations) */
