summaryrefslogtreecommitdiff
path: root/src/gamebuilder.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-29 22:27:59 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-29 22:27:59 -0700
commitf66458278ce3663397fc985a1253c85b74f011e6 (patch)
tree785e2fb51a91fe277c698ea84009e0052ef6555e /src/gamebuilder.cpp
parentf404d991aa53ed81855e51b597bfe1d5c2288b42 (diff)
downloadstage-f66458278ce3663397fc985a1253c85b74f011e6.tar.gz
stage-f66458278ce3663397fc985a1253c85b74f011e6.tar.bz2
stage-f66458278ce3663397fc985a1253c85b74f011e6.tar.xz
stage-f66458278ce3663397fc985a1253c85b74f011e6.zip
Most AstNodes work now.
Next up: loops, proper variable references with scopes, and gotos.
Diffstat (limited to 'src/gamebuilder.cpp')
-rw-r--r--src/gamebuilder.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gamebuilder.cpp b/src/gamebuilder.cpp
index 6c42fb0..d1b4430 100644
--- a/src/gamebuilder.cpp
+++ b/src/gamebuilder.cpp
@@ -50,6 +50,23 @@ void GameBuilder::addFunctionParam( const Bu::String &sName )
50 sio << " - Param added '" << sName << "'" << sio.nl; 50 sio << " - Param added '" << sName << "'" << sio.nl;
51} 51}
52 52
53void GameBuilder::endFunctionParams()
54{
55 Bu::StringList lRev;
56 for( Bu::StringList::const_iterator i = pCurFnc->getParamList().begin();
57 i; i++ )
58 {
59 lRev.prepend( *i );
60 }
61
62 for( Bu::StringList::iterator i = lRev.begin(); i; i++ )
63 {
64 addVarRef( *i );
65 addNode( AstNode::tSwap );
66 addNode( AstNode::tStore );
67 }
68}
69
53void GameBuilder::endFunction() 70void GameBuilder::endFunction()
54{ 71{
55 sio << "Function ended: " << *pCurRoot << sio.nl; 72 sio << "Function ended: " << *pCurRoot << sio.nl;