From: Ben Pfaff Date: Wed, 5 Jul 2006 05:14:30 +0000 (+0000) Subject: Fix bug #11612, "q2c documentation does not agree with code". X-Git-Tag: v0.6.0~781 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a9572a7a0ec2f7fc572cc9807bc5205a5e8a8d;p=pspp-builds.git Fix bug #11612, "q2c documentation does not agree with code". Thanks to John Darrington for review. --- diff --git a/doc/q2c.texi b/doc/q2c.texi index 8a4257c0..280c543a 100644 --- a/doc/q2c.texi +++ b/doc/q2c.texi @@ -123,13 +123,12 @@ separated by semicolons (@samp{;}) and terminated with a full stop (@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. -The subcommand name appears after the option characters. +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 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 diff --git a/src/language/data-io/ChangeLog b/src/language/data-io/ChangeLog index 22d8e675..d78105b8 100644 --- a/src/language/data-io/ChangeLog +++ b/src/language/data-io/ChangeLog @@ -1,3 +1,10 @@ +Sat Jul 1 17:39:40 2006 Ben Pfaff + + 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. + Sat Jul 1 20:44:22 2006 Ben Pfaff Fix bug #15786: System File Creation crashes if directoy is diff --git a/src/language/data-io/list.q b/src/language/data-io/list.q index cd5de5c3..19c1bb45 100644 --- a/src/language/data-io/list.q +++ b/src/language/data-io/list.q @@ -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) */ diff --git a/src/language/lexer/ChangeLog b/src/language/lexer/ChangeLog index fbab8e4b..2bc5b87e 100644 --- a/src/language/lexer/ChangeLog +++ b/src/language/lexer/ChangeLog @@ -1,3 +1,10 @@ +Sat Jul 1 17:40:38 2006 Ben Pfaff + + Fix bug #11612, "q2c documentation does not agree with code". + + * q2c.c (parse_subcommand): Make "+" mean ARITY_MANY, absence + mean ARITY_ONCE_ONLY. + Tue Jul 4 09:45:12 2006 Ben Pfaff Fix bug #15766 (/KEEP subcommand on SAVE doesn't fully support diff --git a/src/language/lexer/q2c.c b/src/language/lexer/q2c.c index a62cf917..df6f5d9f 100644 --- a/src/language/lexer/q2c.c +++ b/src/language/lexer/q2c.c @@ -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 ; diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index 3cce67c4..0a0abfb6 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,18 @@ +Sat Jul 1 17:41:46 2006 Ben Pfaff + + 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 Support long string variables on FREQUENCIES, as diff --git a/src/language/stats/correlations.q b/src/language/stats/correlations.q index 5ba91e5c..12d36459 100644 --- a/src/language/stats/correlations.q +++ b/src/language/stats/correlations.q @@ -59,8 +59,8 @@ cmd_correlations (void) /* (specification) "CORRELATIONS" (cor_): *variables=custom; - +missing=miss:!pairwise/listwise, - inc:include/exclude; + missing=miss:!pairwise/listwise, + inc:include/exclude; +print=tail:!twotail/onetail, sig:!sig/nosig; +format=fmt:!matrix/serial; diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 23b12a9d..d13a1432 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -68,7 +68,7 @@ crosstabs (crs_): *^tables=custom; +variables=custom; - +missing=miss:!table/include/report; + missing=miss:!table/include/report; +write[wr_]=none,cells,all; +format=fmt:!labels/nolabels/novallabs, val:!avalue/dvalue, diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index 44e7125d..c930cf01 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -64,9 +64,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *^variables=custom; +total=custom; +nototal=custom; - +missing=miss:pairwise/!listwise, - rep:report/!noreport, - incl:include/!exclude; + missing=miss:pairwise/!listwise, + rep:report/!noreport, + incl:include/!exclude; +compare=cmp:variables/!groups; +percentiles=custom; +id=var; diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index 95041d5d..5c3de42c 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -68,13 +68,13 @@ /* (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; + *+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), @@ -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) */ diff --git a/src/language/stats/means.q b/src/language/stats/means.q index fb03f754..8405ff36 100644 --- a/src/language/stats/means.q +++ b/src/language/stats/means.q @@ -44,7 +44,7 @@ name:!names/nonames, val:!values/novalues, fmt:!table/tree; - +missing=miss:!table/include/dependent; + missing=miss:!table/include/dependent; +cells[cl_]=default,count,sum,mean,stddev,variance,all; +statistics[st_]=anova,linearity,all,none. */ diff --git a/src/language/stats/oneway.q b/src/language/stats/oneway.q index 674cf710..cda3c17b 100644 --- a/src/language/stats/oneway.q +++ b/src/language/stats/oneway.q @@ -57,10 +57,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA /* (specification) "ONEWAY" (oneway_): *^variables=custom; - +missing=miss:!analysis/listwise, - incl:include/!exclude; - contrast= double list; - statistics[st_]=descriptives,homogeneity. + missing=miss:!analysis/listwise, + incl:include/!exclude; + +contrast= double list; + +statistics[st_]=descriptives,homogeneity. */ /* (declarations) */ /* (functions) */ diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index 7024304d..71eaeccb 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -47,7 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +n=custom; +savage=custom; +print=print:!yes/no; - +missing=miss:!exclude/include. + missing=miss:!exclude/include. */ /* (declarations) */ /* (functions) */ diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index 40781568..4e82a923 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -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) */ diff --git a/src/language/stats/t-test.q b/src/language/stats/t-test.q index 5584df7d..3116f625 100644 --- a/src/language/stats/t-test.q +++ b/src/language/stats/t-test.q @@ -59,11 +59,11 @@ "T-TEST" (tts_): +groups=custom; testval=double; - variables=varlist("PV_NO_SCRATCH | PV_NUMERIC"); - pairs=custom; - +missing=miss:!analysis/listwise, - incl:include/!exclude; - format=fmt:!labels/nolabels; + +variables=varlist("PV_NO_SCRATCH | PV_NUMERIC"); + +pairs=custom; + missing=miss:!analysis/listwise, + incl:include/!exclude; + +format=fmt:!labels/nolabels; criteria=:cin(d:criteria,"%s > 0. && %s < 1."). */ /* (declarations) */