comparison src/input.cc @ 7818:5640a70cbab1

Add Ffilemarker and fix for 'dbstep in'
author David Bateman <dbateman@free.fr>
date Sun, 25 May 2008 15:04:37 +0200
parents 6b521b1e3631
children 8018e10d2b87
comparison
equal deleted inserted replaced
7817:31fb919ba0c0 7818:5640a70cbab1
151 int Vdebugging_current_line = -1; 151 int Vdebugging_current_line = -1;
152 152
153 // TRUE if we are running in the Emacs GUD mode. 153 // TRUE if we are running in the Emacs GUD mode.
154 static bool Vgud_mode = false; 154 static bool Vgud_mode = false;
155 155
156 // The filemarker used to separate filenames from subfunction names
157 char Vfilemarker = '>';
158
156 static void 159 static void
157 do_input_echo (const std::string& input_string) 160 do_input_echo (const std::string& input_string)
158 { 161 {
159 int do_echo = reading_script_file ? 162 int do_echo = reading_script_file ?
160 (Vecho_executing_commands & ECHO_SCRIPTS) 163 (Vecho_executing_commands & ECHO_SCRIPTS)
1331 print_usage (); 1334 print_usage ();
1332 1335
1333 return retval; 1336 return retval;
1334 } 1337 }
1335 1338
1339 DEFUN (filemarker, args, nargout,
1340 "-*- texinfo -*-\n\
1341 @deftypefn {Built-in Function} {} filemarker ()\n\
1342 Returns or sets the character used to separate filename from the\n\
1343 the subfunction names contained within the file. This can be used in\n\
1344 a generic manner to interact with subfunctions. For example\n\
1345 \n\
1346 @example\n\
1347 help ([\"myfunc\", filemarker, \"mysubfunc\"])\n\
1348 @end example\n\
1349 \n\
1350 @noindent\n\
1351 returns the help string associated with the sub-function @code{mysubfunc}\n\
1352 of the function @code{myfunc}. Another use of @code{filemarker} is when\n\
1353 debugging it allows easier placement of breakpoints within sub-functions.\n\
1354 For example\n\
1355 \n\
1356 @example\n\
1357 dbstop ([\"myfunc\", filemarker, \"mysubfunc\"])\n\
1358 @end example\n\
1359 \n\
1360 @noindent\n\
1361 will set a breakpoint at the first line of the subfunction @code{mysubfunc}.\n\
1362 @end deftypefn")
1363 {
1364 char tmp = Vfilemarker;
1365 octave_value retval = SET_INTERNAL_VARIABLE (filemarker);
1366
1367 // The character passed must not be a legal character for a function name
1368 if (! error_state && (::isalnum (Vfilemarker) || Vfilemarker == '_'))
1369 {
1370 Vfilemarker = tmp;
1371 error ("filemarker: character can not be a valid character for a function name");
1372 }
1373
1374 return retval;
1375 }
1376
1336 /* 1377 /*
1337 ;;; Local Variables: *** 1378 ;;; Local Variables: ***
1338 ;;; mode: C++ *** 1379 ;;; mode: C++ ***
1339 ;;; End: *** 1380 ;;; End: ***
1340 */ 1381 */