small fix of ReadComment()
This commit is contained in:
parent
ec29c53974
commit
e2eef3c80a
@ -45,9 +45,9 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
|
|
||||||
string ReadName()
|
string ReadName()
|
||||||
{
|
{
|
||||||
while (i < text.Length - 1)
|
while (++i < text.Length)
|
||||||
{
|
{
|
||||||
c = text[++i];
|
c = text[i];
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case ' ':
|
case ' ':
|
||||||
@ -82,7 +82,7 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
|
|
||||||
return b.Length == 0
|
return b.Length == 0
|
||||||
? ""
|
? ""
|
||||||
: throw new Exception("DtsodV23.Deserialize.ReadName() error: end of text\ntext:\n" + text);
|
: throw new Exception("DtsodV23.Deserialize.ReadName() error: end of text\ntext:\n" + _text);
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic ReadValue(out bool endOfList)
|
dynamic ReadValue(out bool endOfList)
|
||||||
@ -98,7 +98,7 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
{
|
{
|
||||||
prevIsBackslash = c == '\\' && !prevIsBackslash;
|
prevIsBackslash = c == '\\' && !prevIsBackslash;
|
||||||
b.Append(c);
|
b.Append(c);
|
||||||
if (++i >= text.Length) throw new Exception("DtsodV23.Deserialize() error: end of text\ntext:\n" + text);
|
if (++i >= text.Length) throw new Exception("DtsodV23.Deserialize() error: end of text\ntext:\n" + _text);
|
||||||
c = text[i];
|
c = text[i];
|
||||||
}
|
}
|
||||||
b.Append('"');
|
b.Append('"');
|
||||||
@ -137,7 +137,7 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++i >= text.Length) throw new Exception("DtsodV23.Deserialize() error: end of text\ntext:\n" + text);
|
if (++i >= text.Length) throw new Exception("DtsodV23.Deserialize() error: end of text\ntext:\n" + _text);
|
||||||
c = text[i];
|
c = text[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,9 +215,9 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i < text.Length - 1)
|
while (++i < text.Length)
|
||||||
{
|
{
|
||||||
c = text[++i];
|
c = text[i];
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case ' ':
|
case ' ':
|
||||||
@ -260,13 +260,13 @@ public class DtsodV23 : DtsodDict<string, dynamic>, IDtsod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("DtsodV23.Deserialize.ReadValue() error: end of text\ntext:\n" + text);
|
throw new Exception("DtsodV23.Deserialize.ReadValue() error: end of text\ntext:\n" + _text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkipComment()
|
void SkipComment()
|
||||||
{
|
{
|
||||||
while (text[i] != '\n')
|
while (i < text.Length && text[i] != '\n')
|
||||||
if (++i >= text.Length) throw new Exception("DtsodV23.Deserialize() error: end of text\ntext:\n" + text);
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user