Index: BasicCompiler_Common/Subroutine.cpp
===================================================================
--- BasicCompiler_Common/Subroutine.cpp	(revision 99)
+++ BasicCompiler_Common/Subroutine.cpp	(revision 100)
@@ -99,4 +99,5 @@
 	}
 	if( lastIndex == -1 ){
+		lstrcpy( member, desc );
 		return false;
 	}
@@ -298,5 +299,5 @@
 //インデクサ（getter）の戻り値を取得
 bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType ){
-	std::vector<UserProc *> subs;
+	vector<UserProc *> subs;
 	objClass.EnumMethod( CALC_ARRAY_GET, subs );
 	if( subs.size() == 0 ){
@@ -310,5 +311,5 @@
 
 
-void AddDeclareData(char *buffer,int nowLine){
+void AddDeclareData(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine){
 	extern HANDLE hHeap;
 	int i2;
@@ -401,5 +402,5 @@
 
 	// オブジェクトを生成
-	DllProc *pDllProc = new DllProc( procName, kind, isCdecl, dllFileName, alias );
+	DllProc *pDllProc = new DllProc( namespaceScopes, procName, kind, isCdecl, dllFileName, alias );
 
 	// パラメータを解析
@@ -462,5 +463,5 @@
 }
 
-UserProc *AddSubData(char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){
+GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){
 	int i2,i3;
 	char temporary[8192];
@@ -468,5 +469,5 @@
 	int i=1;
 
-	UserProc::Kind kind = Procedure::Sub;
+	Procedure::Kind kind = Procedure::Sub;
 	bool isMacro = false;
 	if(buffer[i]==ESC_FUNCTION) kind = Procedure::Function;
@@ -583,5 +584,5 @@
 	SubNum++;
 
-	UserProc *pUserProc = new UserProc( temporary, kind, isMacro, isCdecl, isExport );
+	GlobalProc *pUserProc = new GlobalProc( namespaceScopes, temporary, kind, isMacro, isCdecl, isExport );
 	pUserProc->SetParentClass( pobj_c );
 
@@ -610,7 +611,7 @@
 	key=hash_default(pUserProc->GetName().c_str());
 
-	extern UserProc **ppSubHash;
+	extern GlobalProc **ppSubHash;
 	if(ppSubHash[key]){
-		UserProc *psi2;
+		GlobalProc *psi2;
 		psi2=ppSubHash[key];
 		while(1){
@@ -648,7 +649,7 @@
 
 	//サブルーチン（ユーザー定義）情報を初期化
-	extern UserProc **ppSubHash;
+	extern GlobalProc **ppSubHash;
 	extern int SubNum;
-	ppSubHash=(UserProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(UserProc *));
+	ppSubHash=(GlobalProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(GlobalProc *));
 	SubNum=0;
 
@@ -660,5 +661,5 @@
 
 	// 名前空間管理
-	vector<string> namespaceScopes;
+	NamespaceScopes namespaceScopes;
 
 	i=-1;
@@ -715,5 +716,5 @@
 				if(basbuf[i]=='\0') break;
 			}
-			AddDeclareData(temporary,i);
+			AddDeclareData(namespaceScopes,temporary,i);
 
 			continue;
@@ -728,5 +729,5 @@
 				if(basbuf[i]=='\0') break;
 			}
-			AddSubData(temporary,i,0,0);
+			AddSubData(namespaceScopes,temporary,i,0,0);
 
 			continue;
@@ -743,37 +744,38 @@
 	// 特殊関数
 	////////////
+	namespaceScopes.clear();
 
 	sprintf(temporary,"%c%c_allrem()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_aullrem()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_allmul()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_alldiv()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_aulldiv()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_allshl()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_allshr()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_aullshr()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
+	AddSubData( namespaceScopes, temporary,0,0,0);
 
 	sprintf(temporary,"%c%c_System_InitStaticLocalVariables()",1,ESC_SUB);
-	AddSubData(temporary,0,0,0);
-}
-void Delete_si(UserProc *pUserProc){
+	AddSubData( namespaceScopes, temporary,0,0,0);
+}
+void Delete_si(GlobalProc *pUserProc){
 	if(pUserProc->pNextData) Delete_si(pUserProc->pNextData);
 	delete pUserProc;
 }
-void DeleteSubInfo(UserProc **ppSubHash,char **ppMacroNames,int MacroNum){	//サブルーチン情報のメモリ解放
+void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum){	//サブルーチン情報のメモリ解放
 	int i;
 	for(i=0;i<MAX_HASH;i++){
@@ -845,6 +847,6 @@
 bool IsNeedProcCompile(){
 	for(int i2=0;i2<MAX_HASH;i2++){
-		extern UserProc **ppSubHash;
-		UserProc *pUserProc=ppSubHash[i2];
+		extern GlobalProc **ppSubHash;
+		GlobalProc *pUserProc=ppSubHash[i2];
 		while(pUserProc){
 			if( pUserProc->IsUsing() && pUserProc->IsCompiled() == false ){
