rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  minor but annoying rc-1.4 bug
@ 1993-04-08  4:21 Paul Haahr
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Haahr @ 1993-04-08  4:21 UTC (permalink / raw)
  To: john; +Cc: rc

most interpreters suffer from this problem.  that's not saying it's
not a problem, but it's a hard one to fix.  where does the error
for
	fn runtimeerror {
		$1 = fred
	}
	rc -c 'runtimeerror'
get reported.  it really should be tagged to be in at least the
function that caused the problem, as well as the source line that
the was used to create the particular tree node in question.

none of this is impossible, but a solution isn't pretty.  es suffers
from at least as much of the problem, as do other shells in which you
you can write something equivalent.

how would you fix it?  which line would be associated with the error
message?  4, inside the definition of runtimeerror?  9, at the call
to runtimeerror?

paul


^ permalink raw reply	[flat|nested] 2+ messages in thread

* minor but annoying rc-1.4 bug
@ 1993-04-08  3:12 John Mackin
  0 siblings, 0 replies; 2+ messages in thread
From: John Mackin @ 1993-04-08  3:12 UTC (permalink / raw)
  To: The rc Mailing List

In certain circumstances, rc 1.4 reports an error with the incorrect
line number, and I don't mean off by one.  The simplest case I have
at the moment is this one:

--- begin try
#!/usr/local/bin/rc

fn runtimeerror {
        $1 = fred
}

echo before

while (true) {

        runtimeerror


        echo loop end
}

echo after
--- end try

A run gives me:

: mod;; try
before
line 15: null variable name

Line 15 is the close curly on the while loop.  If you don't have the
while loop, it correctly reports the error as being on the line where
the call to the "runtimeerror" function was.

This can be (and was) a real hassle if the loop was bigger (mine was)
and if you don't know what's going on (I didn't at first :).

OK,
John.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-04-08  4:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-08  4:21 minor but annoying rc-1.4 bug Paul Haahr
  -- strict thread matches above, loose matches on Subject: below --
1993-04-08  3:12 John Mackin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).