Derek Peschel wrote: > Now I'm trying to understand error reporting. > Does gforth separate parsing of an input line from execution, or not?
Each word is first parsed, then (its approproate semantics are) executed, then the next one is parsed, then executed. All standard-compliant Forth systems have to do it this way. > I'd like gforth to show simple errors by putting the cursor after the error > in the input line. My terminal program (OS X Terminal) can treat the > window as a series of arbitrarily long lines of text, perfect for gforth's > idea of output. But I only know how to use escape sequences to move the > cursor in the current line, not how to back up past a return that has been > printed. > > For parse errors, I think the terminal package can always assume the cursor > is still on the input line. Only for the first word. What can be done relatively easily is to reprint the last input line from history and place the cursor at the wrong word. However, one may have to take the effects of the earlier executed words into consideration; it may be better to preserve the data stack on an "undefined word" error, and then only show the rest of the line, starting at the wrong word, and with the cursor pointing there. BTW, if you want to play around with that, better look into the latest CVS version <http://www.complang.tuwien.ac.at/forth/gforth/cvs-public/>, because there have been changes in this area since 0.6.2. - anton --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]