summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-08-31 22:39:42 (GMT)
committerBrad King <brad.king@kitware.com>2004-08-31 22:39:42 (GMT)
commit486a26d3db24cf2569310b4b2dad32667cbbcaa1 (patch)
tree323e4da91a75b65df7edb6efa495fead998e0f82 /Source/cmListFileCache.cxx
parent491bebefa2f6da9221c5d40ce1c4d3ff2da1c401 (diff)
downloadCMake-486a26d3db24cf2569310b4b2dad32667cbbcaa1.zip
CMake-486a26d3db24cf2569310b4b2dad32667cbbcaa1.tar.gz
CMake-486a26d3db24cf2569310b4b2dad32667cbbcaa1.tar.bz2
BUG#1049: Added error message when file ends in an unterminated string.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r--Source/cmListFileCache.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 092d73b..442cd6d 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -144,8 +144,9 @@ bool cmListFileCache::CacheFile(const char* path, bool requireProjectCommand)
cmOStringStream error;
error << "Error in cmake code at\n"
<< filename << ":" << token->line << ":\n"
- << "Parse error. Expected a newline, got \""
- << token->text << "\".";
+ << "Parse error. Expected a newline, got "
+ << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
parseError = true;
}
@@ -155,7 +156,9 @@ bool cmListFileCache::CacheFile(const char* path, bool requireProjectCommand)
cmOStringStream error;
error << "Error in cmake code at\n"
<< filename << ":" << token->line << ":\n"
- << "Parse error. Expected a command name, got \""
+ << "Parse error. Expected a command name, got "
+ << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << " with text \""
<< token->text << "\".";
cmSystemTools::Error(error.str().c_str());
parseError = true;
@@ -226,8 +229,9 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
cmOStringStream error;
error << "Error in cmake code at\n"
<< filename << ":" << cmListFileLexer_GetCurrentLine(lexer) << ":\n"
- << "Parse error. Expected \"(\", got \""
- << token->text << "\".";
+ << "Parse error. Expected \"(\", got "
+ << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
return false;
}
@@ -259,7 +263,9 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
error << "Error in cmake code at\n"
<< filename << ":" << cmListFileLexer_GetCurrentLine(lexer) << ":\n"
<< "Parse error. Function missing ending \")\". "
- << "Instead found \"" << token->text << "\".";
+ << "Instead found "
+ << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
return false;
}