summaryrefslogtreecommitdiff
path: root/src/gamebuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gamebuilder.cpp')
-rw-r--r--src/gamebuilder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gamebuilder.cpp b/src/gamebuilder.cpp
index 353e254..bfeffec 100644
--- a/src/gamebuilder.cpp
+++ b/src/gamebuilder.cpp
@@ -177,6 +177,8 @@ void GameBuilder::closeGlobal()
177 177
178void GameBuilder::beginCommand( const Bu::String &sValue ) 178void GameBuilder::beginCommand( const Bu::String &sValue )
179{ 179{
180 if( !bGlobal && pCurSit->getInputType() != Situation::inputCommand )
181 throw Bu::ExceptionBase("Command in non-command situation.");
180 pCurNode = pCurRoot = new AstBranch( AstNode::tScope ); 182 pCurNode = pCurRoot = new AstBranch( AstNode::tScope );
181 pCurCmd = new Command(); 183 pCurCmd = new Command();
182 pCurCmd->addLiteral( sValue ); 184 pCurCmd->addLiteral( sValue );
@@ -221,6 +223,8 @@ void GameBuilder::closeCommand()
221 223
222void GameBuilder::beginOption( const Bu::String &sValue ) 224void GameBuilder::beginOption( const Bu::String &sValue )
223{ 225{
226 if( pCurSit->getInputType() != Situation::inputOption )
227 throw Bu::ExceptionBase("Option in non-option situation.");
224 pCurNode = pCurRoot = new AstBranch( AstNode::tScope ); 228 pCurNode = pCurRoot = new AstBranch( AstNode::tScope );
225 pCurCmd = new Command(); 229 pCurCmd = new Command();
226 pCurCmd->addLiteral( sValue ); 230 pCurCmd->addLiteral( sValue );