Mercurial > octave
changeset 28947:b73a54c31152
maint: Use Octave-specific end keywords rather than just 'end'.
* __makeinfo__.m, mustBeInteger.m, publish.m, tar.m, version.m, what.m,
camlookat.m, camorbit.m, hist.m, streamribbon.m, trimesh.m, trisurf.m,
__gnuplot_draw_axes__.m, residue.m, union.m, cosint.m, sinint.m, ranks.m,
super_bug47680.m, foo.m, colon.m, legacy_colon_op.m, colon_op.m:
Use Octave-specific end keywords rather than just 'end'.
line wrap: on
line diff
--- a/scripts/help/__makeinfo__.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/help/__makeinfo__.m Fri Oct 16 10:42:51 2020 -0700 @@ -161,8 +161,8 @@ ## original return value usually more useful if (status_force) status = status_force; - end - end + endif + endif ## Clean up extra newlines generated by makeinfo if (strcmpi (output_type, "plain text"))
--- a/scripts/miscellaneous/mustBeInteger.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/miscellaneous/mustBeInteger.m Fri Oct 16 10:42:51 2020 -0700 @@ -54,7 +54,7 @@ but = "there were non-finite values"; elseif (any (x != fix (x))) but = "it had fractional values in some elements"; - end + endif if (! isempty (but)) label = inputname (1);
--- a/scripts/miscellaneous/publish.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/miscellaneous/publish.m Fri Oct 16 10:42:51 2020 -0700 @@ -1093,7 +1093,7 @@ for i = 1:length (var_names) if (! any (strcmp (var_names{i}, forbidden_var_names))) ctext(var_names{i}) = evalin ("caller", var_names{i}); - end + endif endfor case "load"
--- a/scripts/miscellaneous/tar.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/miscellaneous/tar.m Fri Oct 16 10:42:51 2020 -0700 @@ -72,7 +72,7 @@ else cmd = sprintf ("tar cvf %s -C %s %s", tarfile, rootdir, sprintf (" %s", files{:})); - end + endif ## Save and restore the TAR_OPTIONS environment variable used by GNU tar. tar_options_env = getenv ("TAR_OPTIONS");
--- a/scripts/miscellaneous/version.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/miscellaneous/version.m Fri Oct 16 10:42:51 2020 -0700 @@ -81,7 +81,7 @@ if (nargout > 1) d = __octave_config_info__ ("release_date"); - end + endif else switch (lower (feature)) case "-date"
--- a/scripts/miscellaneous/what.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/miscellaneous/what.m Fri Oct 16 10:42:51 2020 -0700 @@ -105,7 +105,7 @@ if (numel (dir) == 0) w = __what__ (""); w = resize (w, [0, 1]); # Matlab compatibility, return 0x1 empty array - end + endif if (nargout == 0) for i = 1 : numel (w)
--- a/scripts/plot/appearance/camlookat.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/appearance/camlookat.m Fri Oct 16 10:42:51 2020 -0700 @@ -73,7 +73,7 @@ if (isempty (hh)) return; - end + endif x0 = x1 = y0 = y1 = z0 = z1 = []; for i = 1:numel (hh) @@ -81,7 +81,7 @@ if (! ishghandle (h)) error ("camlookat: Inputs must be handles"); - end + endif x0_ = min (get (h, "xdata")(:)); x1_ = max (get (h, "xdata")(:));
--- a/scripts/plot/appearance/camorbit.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/appearance/camorbit.m Fri Oct 16 10:42:51 2020 -0700 @@ -172,7 +172,7 @@ yaw_ax = up; else yaw_ax = dir; - end + endif ## First pitch up then yaw right (order matters) pos = num2cell (campos (hax));
--- a/scripts/plot/draw/hist.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/draw/hist.m Fri Oct 16 10:42:51 2020 -0700 @@ -200,7 +200,7 @@ ## Lookup is more efficient if y is sorted, but sorting costs. if (! equal_bin_spacing && n > sqrt (rows (y) * 1e4)) y = sort (y); - end + endif nanidx = isnan (y); y(nanidx) = 0; @@ -210,21 +210,21 @@ d = 1; else d = (x(end) - x(1)) / (length (x) - 1); - end + endif cutlen = length (cutoff); for j = 1:y_nc freq(:,j) = accumarray (1 + max (0, min (cutlen, ceil ((double (y(:,j)) - cutoff(1)) / d))), double (! nanidx(:,j)), [n, 1]); - end + endfor else for j = 1:y_nc i = lookup (cutoff, y(:,j)); i = 1 + i - (cutoff(max (i, 1)) == y(:,j)); freq(:,j) = accumarray (i, double (! nanidx(:,j)), [n, 1]); - end - end + endfor + endif endif if (norm)
--- a/scripts/plot/draw/streamribbon.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/draw/streamribbon.m Fri Oct 16 10:42:51 2020 -0700 @@ -190,7 +190,7 @@ mxy(j) = max (sly); mny(j) = min (sly); mxz(j) = max (slz); mnz(j) = min (slz); j += 1; - end + endif endfor dx = max (mxx) - min (mnx); dy = max (mxy) - min (mny);
--- a/scripts/plot/draw/trimesh.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/draw/trimesh.m Fri Oct 16 10:42:51 2020 -0700 @@ -76,7 +76,7 @@ varargin(1) = []; if (isvector (c)) c = c(:); - end + endif if (rows (c) != numel (z) && rows (c) != rows (tri)) error ("trimesh: the numbers of colors specified in C must equal the number of vertices in Z or the number of triangles in TRI"); elseif (columns (c) != 1 && columns (c) != 3)
--- a/scripts/plot/draw/trisurf.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/draw/trisurf.m Fri Oct 16 10:42:51 2020 -0700 @@ -71,7 +71,7 @@ varargin(1) = []; if (isvector (c)) c = c(:); - end + endif if (rows (c) != numel (z) && rows (c) != rows (tri)) error ("trisurf: the numbers of colors specified in C must equal the number of vertices in Z or the number of triangles in TRI"); elseif (columns (c) != 1 && columns (c) != 3)
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Fri Oct 16 10:42:51 2020 -0700 @@ -2011,7 +2011,7 @@ edgecolor = obj.markeredgecolor; else edgecolor = obj.color; - end + endif fprintf (plot_stream, ' linecolor rgb "#%02x%02x%02x"', round (255*edgecolor)); else
--- a/scripts/polynomial/residue.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/polynomial/residue.m Fri Oct 16 10:42:51 2020 -0700 @@ -297,13 +297,13 @@ pn = 1; for j = 1:n - 1 pn = conv (pn, [1, -p(j)]); - end + endfor for j = n + 1:numel (p) pn = conv (pn, [1, -p(j)]); - end + endfor for j = 1:e(n) - 1 pn = deconv (pn, p1); - end + endfor pn = r(n) * pn; pnum += prepad (pn, N+1, 0, 2); endfor
--- a/scripts/set/union.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/set/union.m Fri Oct 16 10:42:51 2020 -0700 @@ -91,7 +91,7 @@ na = rows (a); else na = numel (a); - end + endif ia = idx(idx <= na); ib = idx(idx > na) - na; endif
--- a/scripts/specfun/cosint.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/specfun/cosint.m Fri Oct 16 10:42:51 2020 -0700 @@ -96,7 +96,7 @@ x = complex (real (x)(:), imag (x)(:)); else x = x(:); - end + endif ## Initialize the result y = zeros (size (x), class (x)); @@ -136,7 +136,7 @@ xx = complex (real (x)(todo), imag (x)(todo)); else xx = x(todo); - end + endif ssum = - xx .^ 2 / 4; # First term of the series expansion ## FIXME: This is way more precision than a double value can hold. gma = 0.57721566490153286060651209008; # Euler gamma constant
--- a/scripts/specfun/sinint.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/specfun/sinint.m Fri Oct 16 10:42:51 2020 -0700 @@ -75,7 +75,7 @@ x = complex (real (x)(:), imag (x)(:)); else x = x(:); - end + endif ## Initialize the result y = zeros (size (x), class (x));
--- a/scripts/statistics/ranks.m Fri Oct 16 09:48:16 2020 -0700 +++ b/scripts/statistics/ranks.m Fri Oct 16 10:42:51 2020 -0700 @@ -105,7 +105,7 @@ otherwise if (! ischar (rtype)) rtype = num2str (rtype); - end + endif error ("ranks: unknown RTYPE '%s'", rtype); endswitch
--- a/test/bug-47680/super_bug47680.m Fri Oct 16 09:48:16 2020 -0700 +++ b/test/bug-47680/super_bug47680.m Fri Oct 16 10:42:51 2020 -0700 @@ -1,7 +1,7 @@ classdef super_bug47680 properties tag; - end + endproperties methods function obj = super_bug47680 (x) obj.tag = x;
--- a/test/bug-51532/+package_bug51532/foo.m Fri Oct 16 09:48:16 2020 -0700 +++ b/test/bug-51532/+package_bug51532/foo.m Fri Oct 16 10:42:51 2020 -0700 @@ -1,3 +1,3 @@ function retval = foo (val) retval = val; -end +endfunction
--- a/test/colon-op/@legacy_colon_op/colon.m Fri Oct 16 09:48:16 2020 -0700 +++ b/test/colon-op/@legacy_colon_op/colon.m Fri Oct 16 10:42:51 2020 -0700 @@ -3,5 +3,5 @@ r = sprintf ("%s:%s", class (a), class (b)); else r = sprintf ("%s:%s:%s", class (a), class (b), class (c)); - end -end + endif +endfunction
--- a/test/colon-op/@legacy_colon_op/legacy_colon_op.m Fri Oct 16 09:48:16 2020 -0700 +++ b/test/colon-op/@legacy_colon_op/legacy_colon_op.m Fri Oct 16 10:42:51 2020 -0700 @@ -1,3 +1,3 @@ function obj = legacy_colon_op () obj = class (struct (), "legacy_colon_op"); -end +endfunction
--- a/test/colon-op/colon_op.m Fri Oct 16 09:48:16 2020 -0700 +++ b/test/colon-op/colon_op.m Fri Oct 16 10:42:51 2020 -0700 @@ -5,7 +5,7 @@ r = sprintf ("%s:%s", class (a), class (b)); else r = sprintf ("%s:%s:%s", class (a), class (b), class (c)); - end - end - end -end + endif + endfunction + endmethods +endclassdef