summaryrefslogtreecommitdiff
path: root/src/gamebuilder.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-27 00:32:12 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-27 00:32:12 -0700
commit40e08192a08f55b5090d5ef28f48c74613e2e5a0 (patch)
tree352817365ce93d8d022cc1e04f5a411ce0df2b01 /src/gamebuilder.cpp
parentf33fdd93ef93fdbb0e6b3a8e2ecb80b78f1b2816 (diff)
downloadstage-40e08192a08f55b5090d5ef28f48c74613e2e5a0.tar.gz
stage-40e08192a08f55b5090d5ef28f48c74613e2e5a0.tar.bz2
stage-40e08192a08f55b5090d5ef28f48c74613e2e5a0.tar.xz
stage-40e08192a08f55b5090d5ef28f48c74613e2e5a0.zip
Wow, a whole lot of code builds now.
Diffstat (limited to 'src/gamebuilder.cpp')
-rw-r--r--src/gamebuilder.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gamebuilder.cpp b/src/gamebuilder.cpp
index 44fd6c1..47de17d 100644
--- a/src/gamebuilder.cpp
+++ b/src/gamebuilder.cpp
@@ -57,8 +57,6 @@ void GameBuilder::addParam( const Bu::String &sName )
57 57
58void GameBuilder::addNode( AstNode::Type iType ) 58void GameBuilder::addNode( AstNode::Type iType )
59{ 59{
60 sio << " - Added type " << Fmt::hex() << iType << sio.nl;
61
62 switch( iType&AstNode::tTypeMask ) 60 switch( iType&AstNode::tTypeMask )
63 { 61 {
64 case AstNode::tBranch: 62 case AstNode::tBranch:
@@ -71,6 +69,11 @@ void GameBuilder::addNode( AstNode::Type iType )
71 } 69 }
72} 70}
73 71
72void GameBuilder::closeNode()
73{
74 pCurNode = pCurNode->getParent();
75}
76
74void GameBuilder::addLiteral( const Variable &v ) 77void GameBuilder::addLiteral( const Variable &v )
75{ 78{
76 setLiteral( v ); 79 setLiteral( v );
@@ -78,11 +81,13 @@ void GameBuilder::addLiteral( const Variable &v )
78 { 81 {
79 pCurNode->addNode( new AstLeafLiteral( v ) ); 82 pCurNode->addNode( new AstLeafLiteral( v ) );
80 } 83 }
81 sio << " - Added literal " << v << sio.nl;
82} 84}
83 85
84void GameBuilder::addVarRef( const Bu::String &sName ) 86void GameBuilder::addVarRef( const Bu::String &sName )
85{ 87{
86 sio << " - Added varref '" << sName << "'" << sio.nl; 88 if( pCurNode )
89 {
90 pCurNode->addNode( new AstLeafLiteral( AstNode::tVarName, sName ) );
91 }
87} 92}
88 93