comments, minor fixes

This commit is contained in:
dickelbeck 2009-12-11 15:51:26 +00:00
parent ceb6ad1a72
commit ba78287bc9
1 changed files with 11 additions and 11 deletions

View File

@ -107,6 +107,9 @@ const char* DSNLEXER::Syntax( int aTok )
case DSN_NONE: case DSN_NONE:
ret = "NONE"; ret = "NONE";
break; break;
case DSN_STRING_QUOTE:
ret = "string_quote"; // a special DSN syntax token, see specctra spec.
break;
case DSN_QUOTE_DEF: case DSN_QUOTE_DEF:
ret = "quoted text delimiter"; ret = "quoted text delimiter";
break; break;
@ -160,6 +163,7 @@ const char* DSNLEXER::GetTokenText( int aTok )
void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError) void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError)
{ {
// append to aText, do not overwrite
aText << wxT(" ") << _("in file") << wxT(" \"") << filename aText << wxT(" ") << _("in file") << wxT(" \"") << filename
<< wxT("\" ") << _("on line") << wxT(" ") << reader.LineNumber() << wxT("\" ") << _("on line") << wxT(" ") << reader.LineNumber()
<< wxT(" ") << _("at offset") << wxT(" ") << charOffset; << wxT(" ") << _("at offset") << wxT(" ") << charOffset;
@ -192,6 +196,8 @@ int DSNLEXER::NextTok() throw (IOError)
if( cur >= limit ) if( cur >= limit )
{ {
L_read: L_read:
// blank lines are returned as "\n" and will have a len of 1.
// EOF will have a len of 0 and so is detectable.
int len = readLine(); int len = readLine();
if( len == 0 ) if( len == 0 )
{ {
@ -235,8 +241,7 @@ L_read:
ThrowIOError( errtxt, CurOffset() ); ThrowIOError( errtxt, CurOffset() );
} }
curText.clear(); curText = cc;
curText += cc;
head = cur+1; head = cur+1;
@ -251,9 +256,7 @@ L_read:
if( *cur == '(' ) if( *cur == '(' )
{ {
curText.clear(); curText = *cur;
curText += *cur;
curTok = DSN_LEFT; curTok = DSN_LEFT;
head = cur+1; head = cur+1;
goto exit; goto exit;
@ -261,9 +264,7 @@ L_read:
if( *cur == ')' ) if( *cur == ')' )
{ {
curText.clear(); curText = *cur;
curText += *cur;
curTok = DSN_RIGHT; curTok = DSN_RIGHT;
head = cur+1; head = cur+1;
goto exit; goto exit;
@ -275,10 +276,9 @@ L_read:
*/ */
if( *cur == '-' && cur>start && !isSpace( cur[-1] ) ) if( *cur == '-' && cur>start && !isSpace( cur[-1] ) )
{ {
head = cur+1; curText = '-';
curText.clear();
curText += '-';
curTok = DSN_DASH; curTok = DSN_DASH;
head = cur+1;
goto exit; goto exit;
} }