fixed: in Space serializer: we have to escape more characters

fixed: in SpaceParser::ReadTokenSingle
       the delimiter can be only if the character was not escaped


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@409 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-05-12 15:54:20 +00:00
parent e195145394
commit 11ddf0f6d9
2 changed files with 28 additions and 62 deletions

View File

@@ -410,11 +410,15 @@ void SpaceParser::ReadTokenSingle(bool white_delimit, bool new_line_delimit, int
SkipLine();
if( lastc == -1 ||
lastc == list_end ||
(delimit1 != -1 && lastc == delimit1) ||
(delimit2 != -1 && lastc == delimit2) ||
(white_delimit && IsWhite(lastc)) ||
(new_line_delimit && lastc == '\n') )
(!char_was_escaped &&
(
lastc == list_end ||
(new_line_delimit && lastc == '\n') ||
(delimit1 != -1 && lastc == delimit1) ||
(delimit2 != -1 && lastc == delimit2)
) ) )
{
break;
}
@@ -662,11 +666,10 @@ int SpaceParser::ReadChar()
switch(lastc)
{
case '0': lastc = 0; break;
case 'n': lastc = '\n'; break;
case '\\': lastc = '\\'; break;
case 'r': lastc = '\r'; break;
case 't': lastc = '\t'; break;
case '"': lastc = '"'; break;
case 'r': lastc = '\r'; break;
case 'n': lastc = '\n'; break;
// in other cases we return the last character
}
}