changeset 12689:53c0ed961de8

maint: Periodic merge of stable to default.
author Rik <octave@nomad.inbox5.com>
date Wed, 25 May 2011 15:52:00 -0700
parents 6d4c18565de1 (current diff) 5dedac50fef9 (diff)
children c0d102ad9bba d30d5adafdb1
files test/test_parser.m
diffstat 13 files changed, 28 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/basics.txi
+++ b/doc/interpreter/basics.txi
@@ -1058,6 +1058,9 @@
 will produce a very quick countdown from '3' to 'Blast Off' as the
 lines "@code{disp(2);}" and "@code{disp(1);}" won't be executed.
 
+The block comment markers must appear alone as the only characters on a line
+(excepting whitepsace) in order to to be parsed correctly.
+
 @node Comments and the Help System
 @subsection Comments and the Help System
 @cindex documenting functions
--- a/scripts/general/cumtrapz.m
+++ b/scripts/general/cumtrapz.m
@@ -83,7 +83,7 @@
   endif
 
   n = sz(dim);
-  idx1 = idx2 = repmat ({:}, [nd, 1]);
+  idx1 = idx2 = repmat ({':'}, [nd, 1]);
   idx1{dim} = 2 : n;
   idx2{dim} = 1 : (n - 1);
 
--- a/scripts/general/trapz.m
+++ b/scripts/general/trapz.m
@@ -97,7 +97,7 @@
   endif
 
   n = sz(dim);
-  idx1 = idx2 = repmat ({:}, [nd, 1]);
+  idx1 = idx2 = repmat ({':'}, [nd, 1]);
   idx1{dim} = 2 : n;
   idx2{dim} = 1 : (n - 1);
 
--- a/scripts/io/textread.m
+++ b/scripts/io/textread.m
@@ -54,7 +54,11 @@
   ## Maybe skip header lines
   headerlines = find (strcmpi (varargin, "headerlines"), 1);
   if (! isempty (headerlines))
-    fskipl (fid, headerlines);
+    hdr_lines = floor (varargin{headerlines + 1});
+    ## Beware of zero valued headerline, fskipl will count lines to EOF then
+    if (hdr_lines > 0)
+      fskipl (fid, hdr_lines);
+    endif
     varargin(headerlines:headerlines+1) = [];
   endif
 
--- a/scripts/io/textscan.m
+++ b/scripts/io/textscan.m
@@ -81,8 +81,11 @@
         ## Maybe skip header lines
         headerlines = find (strcmpi (args, "headerlines"), 1);
         if (! isempty (headerlines))
-          fskipl (fid, headerlines);
-          args(headerlines:headerlines+1) = [];
+          hdr_lines = floor (varargin{headerlines + 1});
+          ## Beware of zero valued headerline, fskipl will count lines to EOF
+          if (hdr_lines > 0)
+            fskipl (fid, hdr_lines);
+          endif
         endif
         if (isfinite (nlines))
           str = "";
--- a/scripts/miscellaneous/ls_command.m
+++ b/scripts/miscellaneous/ls_command.m
@@ -17,10 +17,9 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{old_cmd} =} ls_command (@var{cmd})
-## Set or return the shell command used by Octave's @code{ls} command.
-## The value of @var{cmd} must be a character string.
-## With no arguments, simply return the previous value.
+## @deftypefn  {Function File} {@var{val} =} ls_command ()
+## @deftypefnx {Function File} {@var{old_val} =} ls_command (@var{new_val})
+## Query or set the shell command used by Octave's @code{ls} command.
 ## @seealso{ls}
 ## @end deftypefn
 
--- a/scripts/miscellaneous/ver.m
+++ b/scripts/miscellaneous/ver.m
@@ -40,7 +40,7 @@
 ## Date respecting the version/revision.
 ## @end table
 ##
-## @deftypefnx {Function File} {v =} ver (@code{"Octave"})
+## @deftypefnx {Function File} {v =} ver ("Octave")
 ## Return version information for Octave only.
 ##
 ## @deftypefnx {Function File} {v =} ver (@var{package})
--- a/scripts/plot/__go_draw_axes__.m
+++ b/scripts/plot/__go_draw_axes__.m
@@ -1271,13 +1271,13 @@
           if (nd == 3)
             ## This produces the desired vertical alignment in 3D.
             fprintf (plot_stream,
-                     "set label \"%s\" at %s %.15g,%.15g,%.15g %s rotate by %f offset character %f,%f %s %s front %s;\n",
+                     "set label \"%s\" at %s %.15e,%.15e,%.15e %s rotate by %f offset character %f,%f %s %s front %s;\n",
                      undo_string_escapes (label), units, lpos(1),
                      lpos(2), lpos(3), halign, angle, dx_and_dy, fontspec,
                      __do_enhanced_option__ (enhanced, obj), colorspec);
           else
             fprintf (plot_stream,
-                     "set label \"%s\" at %s %.15g,%.15g %s rotate by %f offset character %f,%f %s %s front %s;\n",
+                     "set label \"%s\" at %s %.15e,%.15e %s rotate by %f offset character %f,%f %s %s front %s;\n",
                      undo_string_escapes (label), units,
                      lpos(1), lpos(2), halign, angle, dx_and_dy, fontspec,
                      __do_enhanced_option__ (enhanced, obj), colorspec);
--- a/scripts/statistics/distributions/frnd.m
+++ b/scripts/statistics/distributions/frnd.m
@@ -71,7 +71,7 @@
       error ("frnd: M and N must be scalar or of size SZ");
     endif
   elseif (nargin == 2)
-    sz = size(a);
+    sz = size(m);
   else
     print_usage ();
   endif
--- a/scripts/time/datenum.m
+++ b/scripts/time/datenum.m
@@ -21,8 +21,8 @@
 ## @deftypefnx {Function File} {} datenum (@var{year}, @var{month}, @var{day}, @var{hour})
 ## @deftypefnx {Function File} {} datenum (@var{year}, @var{month}, @var{day}, @var{hour}, @var{minute})
 ## @deftypefnx {Function File} {} datenum (@var{year}, @var{month}, @var{day}, @var{hour}, @var{minute}, @var{second})
-## @deftypefnx {Function File} {} datenum (@code{"date"})
-## @deftypefnx {Function File} {} datenum (@code{"date"}, @var{p})
+## @deftypefnx {Function File} {} datenum ("date")
+## @deftypefnx {Function File} {} datenum ("date", @var{p})
 ## Return the specified local time as a day number, with Jan 1, 0000
 ## being day 1.  By this reckoning, Jan 1, 1970 is day number 719529.
 ## The fractional portion, @var{p}, corresponds to the portion of the
--- a/src/data.cc
+++ b/src/data.cc
@@ -5873,7 +5873,7 @@
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {} issorted (@var{a})\n\
 @deftypefnx {Built-in Function} {} issorted (@var{a}, @var{mode})\n\
-@deftypefnx {Built-in Function} {} issorted (@var{a}, @code{\"rows\"}, @var{mode})\n\
+@deftypefnx {Built-in Function} {} issorted (@var{a}, \"rows\", @var{mode})\n\
 Return true if the array is sorted according to @var{mode}, which\n\
 may be either \"ascending\", \"descending\", or \"either\".  By default,\n\
  @var{mode} is \"ascending\".  NaNs are treated in the same manner as\n\
--- a/src/dirfns.cc
+++ b/src/dirfns.cc
@@ -283,7 +283,7 @@
 DEFUNX ("rmdir", Frmdir, args, ,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@var{dir})\n\
-@deftypefnx {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@var{dir}, @code{\"s\"})\n\
+@deftypefnx {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@var{dir}, \"s\")\n\
 Remove the directory named @var{dir}.\n\
 \n\
 If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty\n\
--- a/src/mappers.cc
+++ b/src/mappers.cc
@@ -1833,8 +1833,8 @@
 
 DEFUNX ("toupper", Ftoupper, args, ,
     "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {} toupper (@var{s})\n\
-@deftypefnx {Built-in Function} {} upper (@var{s})\n\
+@deftypefn  {Mapping Function} {} toupper (@var{s})\n\
+@deftypefnx {Mapping Function} {} upper (@var{s})\n\
 Return a copy of the string or cell string @var{s}, with each lowercase\n\
 character replaced by the corresponding uppercase one; non-alphabetic\n\
 characters are left unchanged.  For example:\n\