Rev | Line | |
---|
[322] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
| 3 | #include <Delegate.h>
|
---|
| 4 |
|
---|
[422] | 5 | void Delegate::RefleshParameterAndReturnType()
|
---|
[322] | 6 | {
|
---|
[449] | 7 | compiler.GetNamespaceSupporter().SetImportedNamespaces( this->importedNamespaces );
|
---|
| 8 | compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( this->GetNamespaceScopes() );
|
---|
| 9 |
|
---|
[422] | 10 | // パラメータを解析
|
---|
[571] | 11 | Jenga::Common::Strings parameterStrings;
|
---|
| 12 | SplitParameter( paramStr, parameterStrings );
|
---|
[572] | 13 | ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( this->GetParameters(), parameterStrings, sourceIndex );
|
---|
[339] | 14 |
|
---|
[422] | 15 | // 動的パラメータを作る
|
---|
[572] | 16 | dynamicParams = this->GetParameters();
|
---|
[339] | 17 | dynamicParams.insert( dynamicParams.begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) );
|
---|
[422] | 18 |
|
---|
| 19 | if( IsFunction() )
|
---|
| 20 | {
|
---|
| 21 | // 戻り値を取得
|
---|
| 22 | if( !compiler.StringToType( returnTypeName, returnType ) )
|
---|
| 23 | {
|
---|
[465] | 24 | compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);
|
---|
[422] | 25 | }
|
---|
| 26 | }
|
---|
[322] | 27 | }
|
---|
| 28 |
|
---|
[448] | 29 | bool Delegate::IsSimilar( const Delegate &dgt ) const
|
---|
| 30 | {
|
---|
| 31 | if( this->Params().Equals( dgt.Params(), true ) ) // パラメータが等しい、もしくは反変
|
---|
| 32 | {
|
---|
| 33 | if( this->returnType.Equals( dgt.returnType ) )
|
---|
| 34 | {
|
---|
| 35 | // 戻り値が等しい
|
---|
| 36 | return true;
|
---|
| 37 | }
|
---|
| 38 | else if( this->returnType.IsCovariant( dgt.returnType ) )
|
---|
| 39 | {
|
---|
| 40 | // 戻り値が共変
|
---|
| 41 | return true;
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
| 44 | return false;
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.