git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1930 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2008-03-13 05:24:42 +00:00
parent f06bac7134
commit 9dc6383a6c
5 changed files with 20 additions and 12 deletions

View File

@@ -17,8 +17,15 @@ namespace OpenRa.FileFormats
while( !reader.EndOfStream )
{
string line = reader.ReadLine();
if( !ProcessEntry( line ) )
ProcessSection( line );
if (line.Length == 0) continue;
switch (line[0])
{
case ';': break;
case '[': ProcessSection(line); break;
default: ProcessEntry(line); break;
}
}
}
@@ -27,9 +34,6 @@ namespace OpenRa.FileFormats
bool ProcessSection( string line )
{
if (string.IsNullOrEmpty(line) || line.StartsWith(";"))
return false;
Match m = sectionPattern.Match( line );
if( m == null || !m.Success )
return false;
@@ -43,9 +47,6 @@ namespace OpenRa.FileFormats
bool ProcessEntry( string line )
{
if (string.IsNullOrEmpty(line) || line.StartsWith(";"))
return false;
Match m = entryPattern.Match( line );
if( m == null || !m.Success )
return false;