             
             if(type == ValueType.RECORD){
                 let record = Record(ident: typedIdent.ident)
-                let oldScope = AST.scope
-                AST.scope = record.scope
+                let recordStore = Store(ident: record.ident, type: type, isConst: isConst)
                 
                 var decl:DeclarationStore? = typedIdent.optionalRecordDecl!
                 

            } else {
                store = Store(ident: typedIdent.ident, type: type, isConst: true)
            }
            
            if(AST.scope != nil){
                let check = AST.scope!.storeTable[store.ident]
                if(check != nil) {
                    throw ContextError.IdentifierAlreadyDeclared
                } else {
                    AST.scope!.storeTable[store.ident] = store
                }
            } else {
                let check = AST.globalStoreTable[store.ident]
                if(check != nil) {
                    throw ContextError.IdentifierAlreadyDeclared
                } else {
                    AST.globalStoreTable[store.ident] = store
                }
            }
        
            return store
        }

}

class Record {
    let ident:String
    var recordFields: [String:Store] = [:]
    
    init(ident:String) {
        self.ident = ident
    }
}

