[Exspiminator-commits] CVS: exspiminator/base Parser.java,1.2,1.3
Status: Alpha
Brought to you by:
nphillips
|
From: Nigel P. <nph...@us...> - 2001-11-20 12:19:30
|
Update of /cvsroot/exspiminator/exspiminator/base
In directory usw-pr-cvs1:/tmp/cvs-serv3012/base
Modified Files:
Parser.java
Log Message:
Move exception handling further up the chain - tider.
Index: Parser.java
===================================================================
RCS file: /cvsroot/exspiminator/exspiminator/base/Parser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Parser.java 2001/11/19 16:17:49 1.2
--- Parser.java 2001/11/20 12:19:27 1.3
***************
*** 46,51 ****
/** Parses the next line from the String and returns it as a Line object, or null if the
end of the string has already been reached.*/
! // bug: doesn't handle leading whitespace
! public Line parse()
{
Line result=null;
--- 46,51 ----
/** Parses the next line from the String and returns it as a Line object, or null if the
end of the string has already been reached.*/
! // bug: doesn't handle leading whitespace (???)
! public Line parse() throws IOException
{
Line result=null;
***************
*** 86,112 ****
@return False iff the string has already been read completely (and thus <code>to</code> contains
garbage).*/
! boolean readLine(StringBuffer to)
{
boolean done=false;
to.setLength(0);
! try
{
! String s=reader.readLine();
! if (s==null)
! {
! reader.close();
! return false;
! }
! else
! {
! to.append(s);
! return true;
! }
}
! catch(IOException ex)
{
! // BUG: Could allow this exception propogate back up to NewAssembler.assemble... tidier?
! System.err.println("Internal error: reader produced IOException");
! return false;
}
}
--- 86,103 ----
@return False iff the string has already been read completely (and thus <code>to</code> contains
garbage).*/
! boolean readLine(StringBuffer to) throws IOException
{
boolean done=false;
to.setLength(0);
! String s=reader.readLine();
! if (s==null)
{
! reader.close();
! return false;
}
! else
{
! to.append(s);
! return true;
}
}
|