Index: trunk/abdev/BasicCompiler32/NumOpe.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 326)
+++ trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 327)
@@ -333,7 +333,9 @@
 		int idProc=GetProc(procName,(void **)&pInfo);
 
-		if(idProc){
-			//閉じカッコ")"に続く文字がNULLでないとき
-			if(termFull[i2+1+i4+1]!='\0'){
+		if(idProc)
+		{
+			if(termFull[i2+1+i4+1]!='\0')
+			{
+				//閉じカッコ")"に続く文字がNULLでないとき
 				SetError(42,NULL,cp);
 			}
Index: trunk/abdev/BasicCompiler32/Opcode.h
===================================================================
--- trunk/abdev/BasicCompiler32/Opcode.h	(revision 326)
+++ trunk/abdev/BasicCompiler32/Opcode.h	(revision 327)
@@ -19,10 +19,4 @@
 #define breakpoint compiler.codeGenerator.PutOld( (char)0xCC );
 
-
-//プロシージャの種類
-#define PROC_DEFAULT	1	//ユーザー定義関数
-#define PROC_DLL		2	//DLL関数
-#define PROC_BUILTIN	3	//コンパイラ埋め込み型
-#define PROC_PTR		4	//関数ポインタ
 
 //プロシージャ
Index: trunk/abdev/BasicCompiler64/Opcode.h
===================================================================
--- trunk/abdev/BasicCompiler64/Opcode.h	(revision 326)
+++ trunk/abdev/BasicCompiler64/Opcode.h	(revision 327)
@@ -19,10 +19,4 @@
 #define breakpoint compiler.codeGenerator.PutOld( (char)0xCC );
 
-
-//プロシージャの種類
-#define PROC_DEFAULT	1	//ユーザー定義関数
-#define PROC_DLL		2	//DLL関数
-#define PROC_BUILTIN	3	//コンパイラ埋め込み型
-#define PROC_PTR		4	//関数ポインタ
 
 //プロシージャ
Index: trunk/abdev/BasicCompiler_Common/Enum.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Enum.cpp	(revision 326)
+++ trunk/abdev/BasicCompiler_Common/Enum.cpp	(revision 327)
@@ -225,4 +225,18 @@
 		}
 
+		sprintf(buffer+length,"\tFunction Operator or (enumBase As %s) As %s\n",parent->GetName().c_str(),parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		sprintf(buffer+length,"\t\tReturn New %s(This.value or enumBase.value, \"custom\")\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Function\n");
+		length+=lstrlen(buffer+length);
+
+		sprintf(buffer+length,"\tFunction Operator and (enumBase As %s) As %s\n",parent->GetName().c_str(),parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		sprintf(buffer+length,"\t\tReturn New %s(This.value and enumBase.value, \"custom\")\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Function\n");
+		length+=lstrlen(buffer+length);
+
 		/*
 		sprintf(buffer+length,"\tOverride Function ToString() As String\n",parent->TypeName);
Index: trunk/abdev/BasicCompiler_Common/Intermediate_Step1.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 326)
+++ trunk/abdev/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 327)
@@ -371,5 +371,5 @@
 	char *temporary,temp2[VN_SIZE];
 
-	bool isBeforeCharDelimitation = false;
+	bool isBeforeCharDelimitation = true;
 	temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,(lstrlen(buffer)+255)*2);
 	for(i=0,i2=0,IsStr=0;;i++,i2++){
Index: trunk/abdev/BasicCompiler_Common/Subroutine.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 326)
+++ trunk/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 327)
@@ -61,11 +61,24 @@
 	if(*ppInfo) return PROC_BUILTIN;
 
-	//関数ポインタ
+
+	/////////////////////////////////////////////////////////////////
+	//関数ポインタ、またはデリゲート
+	/////////////////////////////////////////////////////////////////
+
 	Type type;
 	if( !GetVarType( name, type, false ) ){
 		return 0;
 	}
-	if( type.IsProcPtr() ){
+
+	if( type.IsProcPtr() )
+	{
+		// 関数ポインタ
 		return PROC_PTR;
+	}
+
+	if( type.IsObject() && type.GetClass().IsDelegate() )
+	{
+		// デリゲート
+		return PROC_DELEGATE;
 	}
 
@@ -185,4 +198,19 @@
 			}
 		}
+	}
+	else if( kind == PROC_DELEGATE )
+	{
+		// デリゲート
+		char tempName[VN_SIZE];
+		lstrcpy( tempName, fullCallName );
+		lstrcat( tempName, ".Call" );
+
+		void *pInfo=(void *)GetSubHash( tempName );
+		if( !pInfo )
+		{
+			Jenga::Throw( "デリゲートの内部Callメソッドの取得に失敗" );
+		}
+
+		return CallProc( PROC_DEFAULT, pInfo, tempName, lpszParms, resultType, isCallOn );
 	}
 	else{
Index: trunk/abdev/BasicCompiler_Common/src/Delegate.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 326)
+++ trunk/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 327)
@@ -188,5 +188,3 @@
 		destSource += sourceTemplate.GetResult( values );
 	}
-
-	ts( destSource.c_str() );
 }
