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 ++++++++++-- src/tafreader.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) 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 ); diff --git a/src/tafreader.h b/src/tafreader.h index 3668296..ce67a5f 100644 --- a/src/tafreader.h +++ b/src/tafreader.h @@ -37,6 +37,7 @@ namespace Bu Bu::FString readStr(); char c, la; Bu::Stream &sIn; + int iLine, iCol; }; } -- cgit v1.2.3