[opengtl-commits] [410] don't assert when trying to access a member of non structure |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 410
Author: cyrille
Date: 2008-09-21 11:01:21 +0200 (Sun, 21 Sep 2008)
Log Message:
-----------
don't assert when trying to access a member of non structure
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp
Modified: trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp 2008-09-21 07:27:58 UTC (rev 409)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ParserBase_p.cpp 2008-09-21 09:01:21 UTC (rev 410)
@@ -226,7 +226,7 @@
std::list<AST::Expression*> arguments = parseArguments( sfm->name(), sfm->parameters(), 1 );
return new AST::FunctionMemberAccessorExpression(_expression, sfm, arguments);
}
- } else {
+ } else if( _expression->type()->dataType() == Type::STRUCTURE ) {
int index = _expression->type()->d->memberToIndex( name );
if( index == -1 )
{
@@ -236,6 +236,9 @@
} else {
return parseMemberArrayExpression( new AST::StructAccessorExpression( _expression , index ), _constantExpression);
}
+ } else {
+ GTL_DEBUG("unexpected");
+ reportUnexpected( d->currentToken );
}
}
} else if( d->currentToken.type == Token::STARTBOXBRACKET )
@@ -270,6 +273,7 @@
getNextToken();
list_.push_back( expr );
} else {
+ GTL_DEBUG("unexpected");
reportUnexpected( d->currentToken );
list_.push_back( 0 );
}