SpiderScript - Bugs, Documentation and a few language features
[tpg/acess2.git] / Usermode / Libraries / libspiderscript.so_src / parse.c
index c3a6824..e369269 100644 (file)
@@ -196,6 +196,10 @@ tAST_Node *Parse_DoBlockLine(tParser *Parser)
        
        switch(LookAhead(Parser))
        {
+       // New block
+       case TOK_BRACE_OPEN:
+               return Parse_DoCodeBlock(Parser);
+       
        // Empty statement
        case TOK_SEMICOLON:
                GetToken(Parser);
@@ -322,6 +326,13 @@ tAST_Node *Parse_GetVarDef(tParser *Parser, int Type)
                AST_AppendNode(ret, Parse_DoExpr0(Parser));
                SyntaxAssert(Parser, GetToken(Parser), TOK_SQUARE_CLOSE);
        }
+       
+       if( LookAhead(Parser) == TOK_ASSIGN )
+       {
+               GetToken(Parser);
+               ret->DefVar.InitialValue = Parse_DoExpr0(Parser);
+       }
+       
        return ret;
 }
 

UCC git Repository :: git.ucc.asn.au