private void funcBody() throws Exception
    {
        while(scan.sym == Token.var || scan.sym == Token.array) {
            varDecl(false);
        }
        if(scan.sym == Token.opencurly) {
            scan.next();
            if(scan.sym != Token.closecurly) {
                statSequence();
            }
            if(scan.sym == Token.closecurly) {
                scan.next();
                if(!currentBB.hasFinalReturn()) {
                    // make sure all functions end in a return
                    currentBB.addInstruction(new Ret());
                }
            } else {
                throw new Exception("Function body: no closing '}'");
            }
        } else {
            throw new Exception("Function body: no opening '{'");
        }
    }