Index: BasicCompiler_Common/VariableOpe.cpp
===================================================================
--- BasicCompiler_Common/VariableOpe.cpp	(revision 78)
+++ BasicCompiler_Common/VariableOpe.cpp	(revision 79)
@@ -179,96 +179,4 @@
 	return MAKE_PTR_TYPE(NATURAL_TYPE(type),PTR_LEVEL(type)+1);
 }
-int GetTypeFixed(const char *TypeName,LONG_PTR *lpNum){
-	int type;
-
-	if(lpNum) *lpNum=-1;
-
-	if(TypeName[0]=='*'){
-		if(TypeName[1]==1&&(TypeName[2]==ESC_FUNCTION||TypeName[2]==ESC_SUB)){
-			//関数ポインタ（*Function）
-			return DEF_PTR_PROC;
-		}
-
-		type=GetTypeFixed(TypeName+1,lpNum);
-		if(type==-1) return -1;
-
-		return GetPtrType(type);
-	}
-
-	//整数型
-	if(lstrcmpi(TypeName,"SByte")==0)			return DEF_SBYTE;
-	else if(lstrcmpi(TypeName,"Byte")==0)		return DEF_BYTE;
-	else if(lstrcmpi(TypeName,"Integer")==0)	return DEF_INTEGER;
-	else if(lstrcmpi(TypeName,"WORD")==0)		return DEF_WORD;
-	else if(lstrcmpi(TypeName,"Long")==0)		return DEF_LONG;
-	else if(lstrcmpi(TypeName,"DWORD")==0)		return DEF_DWORD;
-	else if(lstrcmpi(TypeName,"Int64")==0)		return DEF_INT64;
-	else if(lstrcmpi(TypeName,"QWORD")==0)		return DEF_QWORD;
-
-	//実数型
-	else if(lstrcmpi(TypeName,"Single")==0)		return DEF_SINGLE;
-	else if(lstrcmpi(TypeName,"Double")==0)		return DEF_DOUBLE;
-
-	//文字型
-	//else if( lstrcmpi( TypeName, "Char" ) == 0 ) return DEF_CHAR;
-
-	//bool型
-	else if( lstrcmpi( TypeName, "Boolean" ) == 0 ) return DEF_BOOLEAN;
-
-	//ポインタ型
-	//※VoidPtr型以外のポインタ型はTypeDef宣言により定義される
-	else if(lstrcmpi(TypeName,"VoidPtr")==0)	return DEF_PTR_VOID;
-
-	//その他
-	else if(lstrcmpi(TypeName,"Any")==0)		return DEF_ANY;
-
-
-	////////////////////
-	// TypeDefされた型
-	////////////////////
-	int i;
-	i=House::typeDefs.GetIndex(TypeName);
-	if(i!=-1){
-		*lpNum = House::typeDefs[i].GetBaseType().GetIndex();
-		return House::typeDefs[i].GetBaseType().GetBasicType();
-	}
-
-	if(!lpNum) return -1;
-
-	//クラス
-	CClass *pobj_c;
-	pobj_c=pobj_DBClass->check(TypeName);
-	if(pobj_c){
-		*lpNum=(LONG_PTR)pobj_c;
-
-		if( pobj_c->IsStructure() ){
-			return DEF_STRUCT;
-		}
-		else{
-			return DEF_OBJECT;
-		}
-	}
-
-	return -1;
-}
-/*
-TODO: 消す(TypeDef関連の変更)
-void GetOriginalTypeName_Old(char *buffer){
-	// TypeDefされた型に対して、オリジナルの型の名前に変更する
-
-	if(buffer[0]=='*'){
-		if(buffer[1]==1&&(buffer[2]==ESC_FUNCTION||buffer[2]==ESC_SUB)) return;
-
-		GetOriginalTypeName_Old(buffer+1);
-		return;
-	}
-
-	int i;
-	i=House::typeDefs.GetIndex(buffer);
-	if(i!=-1){
-		lstrcpy(buffer,House::typeDefs[i].GetBaseName().c_str());
-		GetOriginalTypeName_Old(buffer);
-	}
-}*/
 BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name){
 	if(PTR_LEVEL(type)){
@@ -948,26 +856,36 @@
 		// 初期化データが指定されいるとき
 		////////////////////////////////////
-
-		for(i++,i2=0,IsStr=0;;i++,i2++){
-			if(buffer[i]=='\"') IsStr^=1;
-			if(buffer[i]=='('&&IsStr==0){
-				i3=GetStringInPare(InitBuf+i2,buffer+i);
-				i+=i3-1;
-				i2+=i3-1;
-				continue;
-			}
-			if(buffer[i]=='['&&IsStr==0){
-				i3=GetStringInBracket(InitBuf+i2,buffer+i);
-				i+=i3-1;
-				i2+=i3-1;
-				continue;
-			}
-			if((buffer[i]==1&&buffer[i+1]==ESC_AS)||
-				(buffer[i]==','&&IsStr==0)||
-				buffer[i]=='\0'){
-				InitBuf[i2]=0;
-				break;
-			}
-			InitBuf[i2]=buffer[i];
+		i++;
+
+		if( buffer[i]=='[' ){
+			// 構造初期データの場合
+
+			i3=GetStringInBracket(InitBuf,buffer+i);
+			i+=i3;
+		}
+		else{
+			// 代入初期データの場合
+
+			for(i2=0,IsStr=0;;i++,i2++){
+				if(buffer[i]=='\"') IsStr^=1;
+				if(buffer[i]=='('&&IsStr==0){
+					i3=GetStringInPare(InitBuf+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if(buffer[i]=='['&&IsStr==0){
+					i3=GetStringInBracket(InitBuf+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if((buffer[i]==','&&IsStr==0)||
+					buffer[i]=='\0'){
+					InitBuf[i2]=0;
+					break;
+				}
+				InitBuf[i2]=buffer[i];
+			}
 		}
 	}
@@ -1052,4 +970,8 @@
 				return false;
 			}
+
+			if( IS_LITERAL( type.GetIndex() ) ){
+				type.SetIndex( -1 );
+			}
 		}
 
@@ -1099,5 +1021,5 @@
 
 
-void AddGlobalVariable(bool isRef, const char *name,int *SubScripts, const Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlag){
+void AddGlobalVariable( const char *name,int *SubScripts, const Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlag){
 	/////////////////////////
 	// グローバル変数を追加
@@ -1114,5 +1036,5 @@
 	bool isConst = ( dwFlag & DIMFLAG_CONST ) ? true:false;
 
-	Variable *pVar = new Variable( name, type, isConst, isRef );
+	Variable *pVar = new Variable( name, type, isConst );
 
 	if( SubScripts[0] != -1 ){
@@ -1217,12 +1139,9 @@
 	char VarName[VN_SIZE];
 
-	//参照型かどうか
-	bool isRef = false;
-
 	i2 = 0;
 
 	if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
 		//参照型
-		isRef = true;
+		SetError();
 		Parameter += 2;
 	}
@@ -1290,5 +1209,5 @@
 		GetNowStaticVarFullName(VarName,temporary);
 
-		dim( isRef,temporary,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
+		dim( temporary,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
 
 		/*
@@ -1298,5 +1217,5 @@
 	}
 	else{
-		dim( isRef,VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
+		dim( VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
 	}
 }
