summaryrefslogtreecommitdiff
path: root/src/gamestate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gamestate.cpp')
-rw-r--r--src/gamestate.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gamestate.cpp b/src/gamestate.cpp
index d45d53c..e8df070 100644
--- a/src/gamestate.cpp
+++ b/src/gamestate.cpp
@@ -408,6 +408,20 @@ void GameState::parse( const AstBranch::NodeList &lCode )
408 break; 408 break;
409 409
410 case AstNode::tIn: 410 case AstNode::tIn:
411 {
412 Variable v = popDeref();
413 Variable x = popDeref();
414 if( v.getType() == Variable::tDictionary )
415 {
416 push( Variable( v.has( x ) ) );
417 }
418 else
419 {
420 throw Bu::ExceptionBase("Invalid type for operator in");
421 }
422 }
423 break;
424
411 case AstNode::tGoto: 425 case AstNode::tGoto:
412 { 426 {
413 Variable x = popDeref(); 427 Variable x = popDeref();
@@ -439,6 +453,14 @@ void GameState::parse( const AstBranch::NodeList &lCode )
439 } 453 }
440 break; 454 break;
441 455
456 case AstNode::tInsert:
457 {
458 Variable v = popDeref();
459 Variable k = popDeref();
460 lStack.peek().insert( k, v );
461 }
462 break;
463
442 // tLeafLiteral 464 // tLeafLiteral
443 case AstNode::tVarName: 465 case AstNode::tVarName:
444 case AstNode::tLiteral: 466 case AstNode::tLiteral: