handle comments while parsing, instead of returning them to the user

svn path=/branches/xmlbuildsystem/; revision=12816
This commit is contained in:
Royce Mitchell III 2005-01-05 03:47:55 +00:00
parent 0b755662dd
commit 4ee64fd1b7
2 changed files with 3 additions and 5 deletions

View file

@ -445,9 +445,10 @@ XMLParse(XMLFile& f,
return NULL;
bool end_tag;
while ( token[0] != '<' )
while ( token[0] != '<' || !strncmp ( token.c_str(), "<!--", 4 ) )
{
printf ( "syntax error: expecting xml tag, not '%s'\n", token.c_str() );
if ( token[0] != '<' )
printf ( "syntax error: expecting xml tag, not '%s'\n", token.c_str() );
if ( !f.get_token(token) )
return NULL;
}

View file

@ -34,9 +34,6 @@ void Project::ReadXml()
if ( !head )
throw InvalidBuildFileException ( "Document contains no 'project' tag." );
if ( head->name == "!--" )
continue; // ignore comments
if ( head->name != "project" )
{
throw InvalidBuildFileException ( "Expected 'project', got '%s'.",