Merge remote-tracking branch 'eodev/master' into mpi-exp

This commit is contained in:
Benj Bouv 2013-01-30 19:29:36 +01:00
commit 70397c5ac8
7 changed files with 683 additions and 39 deletions

View file

@ -118,12 +118,14 @@ Entity* Parser::parseRight(const std::string & str, size_t & pos)
{
Entity* value = 0;
ignoreChars( str, pos );
if ( str[ pos ] == '{' )
{
// next one is an object
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 +147,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