cvs commit: hugs98/src input.c script.c

Ross Paterson ross@soi.city.ac.uk
Thu, 13 Mar 2003 16:31:31 +0000


On Thu, Mar 13, 2003 at 07:38:28AM -0800, Sigbjorn Finne wrote:
> sof         2003/03/13 07:38:28 PST
> 
>   Modified files:
>     src                  input.c script.c 
>   Log:
>   script.c:addScript() + input.c:parseScript():
>     Delay assignment of 'scriptFile' until new file/module has been
>     located. This is so that if it cannot be found, we want the error
>     message to refer to file/module that imported it.

Doesn't this work only if the first import in a module fails?
If the second import fails, the parent module name is gone.

On the subject of scripts (though not new in this change), it's a
bit wierd that findPathname() discovers that something is missing,
but then returns its argument intact so that fileInput() will report
the error.  This produces wierdness like a module M matching a file M
with no extension, or the inaccurate message 'Unable to open file "M"'.
Of course fileInput() has to check even if findPathname() succeeded, in
case the file disappears, but earlier on we could give better messages.