Changeset 18 in dev for BasicCompiler32/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
  • BasicCompiler32/Compile_Var.cpp

    r17 r18  
    445445            }
    446446            if(i==pobj_CompilingClass->iMemberNum) goto NonClassMember;
     447        }
     448
     449        //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
     450        //(コンストラクタ、デストラクタ内を除く)
     451        CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();
     452        if( isWriteAccess &&
     453            pMethod->isConst &&
     454            pobj_CompilingClass->IsCompilingConstructor() == false &&
     455            pobj_CompilingClass->IsCompilingDestructor() == false
     456            ){
     457                SetError(131, NULL, cp );
    447458        }
    448459
     
    567578ok:
    568579
    569     if(bConst && isWriteAccess){
     580    if( bConst && isWriteAccess ){
    570581        //Const定義の変数に書き込みアクセスをしようとした場合
    571         SetError(61,VarName,cp);
     582        if( *pType == DEF_OBJECT ){
     583            //オブジェクト定数
     584            SetError(130, VarName, cp );
     585        }
     586        else{
     587            //一般のConst変数
     588            SetError(61,VarName,cp);
     589        }
    572590    }
    573591
Note: See TracChangeset for help on using the changeset viewer.