Mercurial > hg > octave-nkf
comparison src/ls-oct-ascii.cc @ 7744:14b841c47a5f
handle load/save for handles to built-in functions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 30 Apr 2008 14:32:41 -0400 |
parents | 745a8299c2b5 |
children | 0ef13e15319b |
comparison
equal
deleted
inserted
replaced
7743:fbe27e477578 | 7744:14b841c47a5f |
---|---|
79 std::string | 79 std::string |
80 extract_keyword (std::istream& is, const char *keyword, const bool next_only) | 80 extract_keyword (std::istream& is, const char *keyword, const bool next_only) |
81 { | 81 { |
82 std::string retval; | 82 std::string retval; |
83 | 83 |
84 int ch = is.peek (); | |
85 if (next_only && ch != '%' && ch != '#') | |
86 return retval; | |
87 | |
84 char c; | 88 char c; |
85 while (is.get (c)) | 89 while (is.get (c)) |
86 { | 90 { |
87 if (c == '%' || c == '#') | 91 if (c == '%' || c == '#') |
88 { | 92 { |
253 filename.c_str ()); | 257 filename.c_str ()); |
254 | 258 |
255 return std::string (); | 259 return std::string (); |
256 } | 260 } |
257 | 261 |
258 if (name == CELL_ELT_TAG) | 262 if (! (name == ".nargin." || name == ".nargout." |
259 { | 263 || name == CELL_ELT_TAG || valid_identifier (name))) |
260 // This is OK -- name won't be used. | |
261 } | |
262 else if (! valid_identifier (name)) | |
263 { | 264 { |
264 error ("load: bogus identifier `%s' found in file `%s'", | 265 error ("load: bogus identifier `%s' found in file `%s'", |
265 name.c_str (), filename.c_str ()); | 266 name.c_str (), filename.c_str ()); |
266 return std::string (); | 267 return std::string (); |
267 } | 268 } |