Mercurial > hg > octave-nkf
changeset 2790:ecc1a12678de
[project @ 1997-03-05 02:47:54 by jwe]
author | jwe |
---|---|
date | Wed, 05 Mar 1997 02:47:55 +0000 |
parents | e68dcf8ffd33 |
children | ef422e6f6138 |
files | src/ChangeLog src/symtab.cc src/symtab.h src/variables.cc |
diffstat | 4 files changed, 20 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +Tue Mar 4 20:36:53 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * variables.cc (Fexist): Don't let files with `.' in their names + confuse us. + + * symtab.cc (valid_identifier (const string&)): New function. + Sat Mar 1 15:23:14 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * Version 2.0.5 released.
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -1190,6 +1190,12 @@ return 1; } +int +valid_identifier (const string& s) +{ + return valid_identifier (s.c_str ()); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/symtab.h +++ b/src/symtab.h @@ -321,6 +321,8 @@ extern int valid_identifier (const char *s); +extern int valid_identifier (const string& s); + #endif /*
--- a/src/variables.cc +++ b/src/variables.cc @@ -331,18 +331,19 @@ } string struct_elts; + string symbol_name = name; size_t pos = name.find ('.'); - if (pos != NPOS) + if (pos != NPOS && pos > 0) { struct_elts = name.substr (pos+1); - name = name.substr (0, pos); + symbol_name = name.substr (0, pos); } - symbol_record *sr = curr_sym_tab->lookup (name, 0, 0); + symbol_record *sr = curr_sym_tab->lookup (symbol_name, 0, 0); if (! sr) - sr = global_sym_tab->lookup (name, 0, 0); + sr = global_sym_tab->lookup (symbol_name, 0, 0); retval = 0.0;