summaryrefslogtreecommitdiff
path: root/src/gamebuilder.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-30 11:00:04 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-30 11:00:04 -0700
commit59f94f34ea25ce8613849bad43faf022b9ed5f5d (patch)
tree987aaeab8fbe4635018be1d2d31ea5c21e2edb69 /src/gamebuilder.cpp
parent9e6dc529833d17374a73bae1f30c7970f936f7cc (diff)
downloadstage-59f94f34ea25ce8613849bad43faf022b9ed5f5d.tar.gz
stage-59f94f34ea25ce8613849bad43faf022b9ed5f5d.tar.bz2
stage-59f94f34ea25ce8613849bad43faf022b9ed5f5d.tar.xz
stage-59f94f34ea25ce8613849bad43faf022b9ed5f5d.zip
Looks like commands work, mostly.
Diffstat (limited to 'src/gamebuilder.cpp')
-rw-r--r--src/gamebuilder.cpp16
1 files changed, 13 insertions, 3 deletions
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()
62 for( Bu::StringList::iterator i = lRev.begin(); i; i++ ) 62 for( Bu::StringList::iterator i = lRev.begin(); i; i++ )
63 { 63 {
64 addVarRef( *i, sidLocal ); 64 addVarRef( *i, sidLocal );
65 addNode( AstNode::tSwap ); 65 addNode( AstNode::tStoreRev );
66 addNode( AstNode::tStore );
67 } 66 }
68} 67}
69 68
@@ -171,6 +170,17 @@ void GameBuilder::addCommandParam( const Bu::String &sValue )
171 pCurCmd->addParam( sValue ); 170 pCurCmd->addParam( sValue );
172} 171}
173 172
173void GameBuilder::endCommandParams()
174{
175 Bu::StringList lParams = pCurCmd->getParamList();
176
177 for( Bu::StringList::iterator i = lParams.begin(); i; i++ )
178 {
179 addVarRef( *i, sidLocal );
180 addNode( AstNode::tStoreRev );
181 }
182}
183
174void GameBuilder::closeCommand() 184void GameBuilder::closeCommand()
175{ 185{
176 pCurCmd->setAst( pCurRoot ); 186 pCurCmd->setAst( pCurRoot );
@@ -182,7 +192,7 @@ void GameBuilder::closeCommand()
182 } 192 }
183 else 193 else
184 { 194 {
185 delete pCurCmd; 195 pCurSit->csLocal.addCommand( pCurCmd );
186 } 196 }
187 pCurCmd = NULL; 197 pCurCmd = NULL;
188} 198}