annotate ck-oct-fcns.m @ 2992:53b38bf1d443

[project @ 1997-05-20 19:48:00 by jwe]
author jwe
date Tue, 20 May 1997 19:48:00 +0000
parents 4a9feb849125
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
1 # Script to check for dependency on whitespace_in_literal_matrix.
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
2 #
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
3 # Use with a command like this:
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
4 #
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
5 # find . -name '*.m' -print | \
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
6 # sed -e 's,^.*/,,' -e 's,\.m$,,' | \
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
7 # octave --norc --silent --path "`pwd`//:" ~/check_octave_functions
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
8 #
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
9 # Originally by R. D. Auchterlounie <rda@eng.cam.ac.uk>
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
10
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
11 1; # Don't interpret this a file that defines a single function.
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
12
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
13 function t = wlm_check (wlm, fname)
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
14 whitespace_in_literal_matrix = wlm;
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
15 bc = "printf (\" %s\", wlm)";
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
16 eval (["t = type ", fname, ";"], ["t = \"failed\";", bc]);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
17 endfunction
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
18
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
19 while (isstr (fname = fgets (stdin, 100)))
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
20
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
21 # Someone should improve Octave's string handling capabilities!
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
22
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
23 tmp = toascii (fname);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
24 tmp (length (tmp)) = 0;
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
25 fname = setstr (tmp);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
26
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
27 printf ("checking %s ...", fname);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
28
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
29 eval (["clear ", fname]); trd = wlm_check ("traditional", fname);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
30 eval (["clear ", fname]); ign = wlm_check ("ignore", fname);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
31 eval (["clear ", fname]); def = wlm_check ("default", fname);
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
32
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
33 if (strcmp (trd, "failed")
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
34 || strcmp (ign, "failed")
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
35 || strcmp (def, "failed"))
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
36 printf (" FAILED\n");
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
37 else
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
38 printf (" ok\n");
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
39 endif
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
40
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
41 endwhile