private static int ParseStmt_Block(Context ctx, KStatement stmt, Syntax syn, Symbol name, IList<Token> tls, int s, int e)
{
//Console.WriteLine("ParseStmt_Block name:" + name.Name);
Token tk = tls[s];
if(tk.Type == TokenType.CODE) {
stmt.map.Add(name, new CodeExpr(tk));
return s + 1;
}
var parser = new Parser(ctx, stmt.ks);
if (tk.Type == TokenType.AST_BRACE)
{
BlockExpr bk = parser.CreateBlock(stmt, tk.Sub, 0, tk.Sub.Count, ';');
stmt.map.Add(name, bk);
return s + 1;
}
else {
BlockExpr bk = parser.CreateBlock(stmt, tls, s, e, ';');
stmt.map.Add(name, bk);
return e;
}
}