|
@@ -41,6 +41,7 @@ void Reader::read(const char *text, unsigned int length) |
|
|
Region curGroup; |
|
|
Region curGroup; |
|
|
Region curRegion; |
|
|
Region curRegion; |
|
|
Region *buildingRegion = nullptr; |
|
|
Region *buildingRegion = nullptr; |
|
|
|
|
|
bool inComment = false; |
|
|
bool inControl = false; |
|
|
bool inControl = false; |
|
|
bool inGroup = false; |
|
|
bool inGroup = false; |
|
|
water::String defaultPath; |
|
|
water::String defaultPath; |
|
@@ -65,15 +66,31 @@ void Reader::read(const char *text, unsigned int length) |
|
|
// Check if it's a comment line. |
|
|
// Check if it's a comment line. |
|
|
if (c == '/') |
|
|
if (c == '/') |
|
|
{ |
|
|
{ |
|
|
// Skip to end of line. |
|
|
|
|
|
while (p < end) |
|
|
|
|
|
|
|
|
// Skip to end of line or c-style comment. |
|
|
|
|
|
do |
|
|
{ |
|
|
{ |
|
|
c = *++p; |
|
|
c = *++p; |
|
|
|
|
|
if (c == '*') |
|
|
|
|
|
{ |
|
|
|
|
|
inComment = true; |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (inComment) |
|
|
|
|
|
{ |
|
|
|
|
|
if (c != '*') |
|
|
|
|
|
continue; |
|
|
|
|
|
c = *++p; |
|
|
|
|
|
if (c != '/') |
|
|
|
|
|
continue; |
|
|
|
|
|
inComment = false; |
|
|
|
|
|
} |
|
|
if ((c == '\n') || (c == '\r')) |
|
|
if ((c == '\n') || (c == '\r')) |
|
|
{ |
|
|
{ |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
while (p < end); |
|
|
|
|
|
inComment = false; |
|
|
p = handleLineEnd(p); |
|
|
p = handleLineEnd(p); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
@@ -164,16 +181,32 @@ void Reader::read(const char *text, unsigned int length) |
|
|
// Comment. |
|
|
// Comment. |
|
|
else if (c == '/') |
|
|
else if (c == '/') |
|
|
{ |
|
|
{ |
|
|
// Skip to end of line. |
|
|
|
|
|
while (p < end) |
|
|
|
|
|
|
|
|
// Skip to end of line or c-style comment. |
|
|
|
|
|
do |
|
|
{ |
|
|
{ |
|
|
c = *p; |
|
|
c = *p; |
|
|
|
|
|
if (c == '*') |
|
|
|
|
|
{ |
|
|
|
|
|
inComment = true; |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (inComment) |
|
|
|
|
|
{ |
|
|
|
|
|
if (c != '*') |
|
|
|
|
|
continue; |
|
|
|
|
|
c = *++p; |
|
|
|
|
|
if (c != '/') |
|
|
|
|
|
continue; |
|
|
|
|
|
inComment = false; |
|
|
|
|
|
} |
|
|
if ((c == '\r') || (c == '\n')) |
|
|
if ((c == '\r') || (c == '\n')) |
|
|
{ |
|
|
{ |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
p += 1; |
|
|
p += 1; |
|
|
} |
|
|
} |
|
|
|
|
|
while (p < end); |
|
|
|
|
|
inComment = false; |
|
|
} |
|
|
} |
|
|
// Parameter. |
|
|
// Parameter. |
|
|
else |
|
|
else |
|
|