Changeset 18 in dev for BasicCompiler64/Compile_Var.cpp


Ignore:
Timestamp:
Dec 24, 2006, 4:46:12 AM (17 years ago)
Author:
dai_9181
Message:

オブジェクト定数に対応。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_Var.cpp

    r17 r18  
    471471            }
    472472            if(i==pobj_CompilingClass->iMemberNum) goto NonClassMember;
     473        }
     474
     475        //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
     476        //(コンストラクタ、デストラクタ内を除く)
     477        CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();
     478        if( isWriteAccess &&
     479            pMethod->isConst &&
     480            pobj_CompilingClass->IsCompilingConstructor() == false &&
     481            pobj_CompilingClass->IsCompilingDestructor() == false
     482            ){
     483                SetError(131, NULL, cp );
    473484        }
    474485
     
    590601ok:
    591602
    592     if(bConst && isWriteAccess){
     603    if( bConst && isWriteAccess ){
    593604        //Const定義の変数に書き込みアクセスをしようとした場合
    594         SetError(61,VarName,cp);
     605        if( *pType == DEF_OBJECT ){
     606            //オブジェクト定数
     607            SetError(130, VarName, cp );
     608        }
     609        else{
     610            //一般のConst変数
     611            SetError(61,VarName,cp);
     612        }
    595613    }
    596614
Note: See TracChangeset for help on using the changeset viewer.