Mercurial > hg > octave-lyh
changeset 10093:d90736774da2
inputname: use isvarname instead of regexp
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 13 Jan 2010 03:49:12 -0500 |
parents | 02453ee20140 |
children | ab1101011a6d |
files | scripts/ChangeLog scripts/miscellaneous/inputname.m |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-01-13 John W. Eaton <jwe@octave.org> + + * miscellaneous/inputname.m: Use isvarname instead of regexp. + 2010-01-13 John W. Eaton <jwe@octave.org> * miscellaneous/inputname.m: Return "" if argument name is not a
--- a/scripts/miscellaneous/inputname.m +++ b/scripts/miscellaneous/inputname.m @@ -31,7 +31,7 @@ s = evalin ("caller", sprintf ("deblank (argn(%d,:));", n)); ## For compatibility with Matlab, return empty string if argument ## name is not a valid identifier. - if (isempty (regexp (s, "^[_a-zA-Z][_a-zA-Z0-9]*$"))) + if (! isvarname (s)) s = ""; endif else