From 3769021a233260c4ed3f4dd4c850decf1361a4f5 Mon Sep 17 00:00:00 2001 From: Benjamin BOUVIER Date: Mon, 1 Oct 2012 23:25:51 -0400 Subject: [PATCH] Bugfix Serialization parser: spaces can be inserted before or after the arrays. --- eo/src/serial/Parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eo/src/serial/Parser.cpp b/eo/src/serial/Parser.cpp index 258174c8..f46c829e 100644 --- a/eo/src/serial/Parser.cpp +++ b/eo/src/serial/Parser.cpp @@ -124,6 +124,7 @@ Entity* Parser::parseRight(const std::string & str, size_t & pos) DEBUG("We read an object.") Object* obj = new Object; pos += 1; + ignoreChars( str, pos ); while( pos < str.size() && str[ pos ] != '}' ) { parseLeft( str, pos, obj ); @@ -145,11 +146,13 @@ Entity* Parser::parseRight(const std::string & str, size_t & pos) DEBUG("We read an array") Array* array = new Array; pos += 1; + ignoreChars( str, pos ); while( pos < str.size() && str[ pos ] != ']' ) { Entity* child = parseRight( str, pos ); if ( child ) array->push_back( child ); + ignoreChars( str, pos ); } DEBUG("We've finished to read our array.") pos += 1; // we're on the ], go to the next char