From 59f94f34ea25ce8613849bad43faf022b9ed5f5d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 30 Dec 2011 11:00:04 -0700 Subject: Looks like commands work, mostly. --- src/gamebuilder.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/gamebuilder.cpp') diff --git a/src/gamebuilder.cpp b/src/gamebuilder.cpp index 87389ff..e84d8f7 100644 --- a/src/gamebuilder.cpp +++ b/src/gamebuilder.cpp @@ -62,8 +62,7 @@ void GameBuilder::endFunctionParams() for( Bu::StringList::iterator i = lRev.begin(); i; i++ ) { addVarRef( *i, sidLocal ); - addNode( AstNode::tSwap ); - addNode( AstNode::tStore ); + addNode( AstNode::tStoreRev ); } } @@ -171,6 +170,17 @@ void GameBuilder::addCommandParam( const Bu::String &sValue ) pCurCmd->addParam( sValue ); } +void GameBuilder::endCommandParams() +{ + Bu::StringList lParams = pCurCmd->getParamList(); + + for( Bu::StringList::iterator i = lParams.begin(); i; i++ ) + { + addVarRef( *i, sidLocal ); + addNode( AstNode::tStoreRev ); + } +} + void GameBuilder::closeCommand() { pCurCmd->setAst( pCurRoot ); @@ -182,7 +192,7 @@ void GameBuilder::closeCommand() } else { - delete pCurCmd; + pCurSit->csLocal.addCommand( pCurCmd ); } pCurCmd = NULL; } -- cgit v1.2.3