From 33be82a7789abdb8b9f6842a69c4c8f3b4ae830b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 13 Feb 2008 04:43:06 +0000 Subject: There may be some slightly better error reporting in TafReader now... --- src/tafreader.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/tafreader.cpp') diff --git a/src/tafreader.cpp b/src/tafreader.cpp index 4f0e1ec..29796f1 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp @@ -13,7 +13,8 @@ using namespace Bu; Bu::TafReader::TafReader( Bu::Stream &sIn ) : c( 0 ), - sIn( sIn ) + sIn( sIn ), + iLine( 1 ), iCol( 1 ) { next(); next(); } @@ -62,7 +63,7 @@ void Bu::TafReader::groupContent( Bu::TafGroup *pGroup ) else if( c == '/' && la == '/' ) pGroup->addChild( readComment( true ) ); else if( c == ':' ) - throw TafException("Encountered stray ':' in taf stream."); + throw TafException("Encountered stray ':' in taf stream at %d:%d.", iLine, iCol ); else pGroup->addChild( readProperty() ); } @@ -187,6 +188,13 @@ bool Bu::TafReader::isws() void Bu::TafReader::next() { + if( c == '\n' ) + { + iLine++; + iCol = 1; + } + else + iCol++; if( c == '}' ) { sIn.read( &c, 1 ); -- cgit v1.2.3