Changeset 79 in dev for BasicCompiler64/NumOpe.cpp


Ignore:
Timestamp:
Mar 25, 2007, 5:58:57 AM (17 years ago)
Author:
dai_9181
Message:

バージョンをβ17にした。
#strictをデフォルトの状態で適用するようにした(#90)。
Dimステートメントにおいて、初期値式とAsが同時に指定されていたとき、As以降も初期値式の一部として捉えるよう、変更(#91)。
GetTypeDef関数を完全廃止。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/NumOpe.cpp

    r76 r79  
    177177    int type_stack[255];
    178178    LONG_PTR index_stack[255];
     179    bool isNothing_stack[255];
    179180    BOOL bUseHeap[255];
    180181    _int64 i64data;
     
    187188        if(idCalc){
    188189            if(type_stack[sp-2]==DEF_OBJECT){
    189                 //オーバーロードされたオペレータを呼び出す
    190                 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp);
    191                 if(i2==0){
    192                     if(idCalc==CALC_EQUAL) lstrcpy(temp2,"==");
    193                     else GetCalcName(idCalc,temp2);
    194                     sprintf(temporary,"Operator %s",temp2);
    195                     SetError(27,temporary,cp);
    196                     goto error;
     190                if( idCalc == CALC_AS
     191                    && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
     192                    && index_stack[sp-1] == index_stack[sp-2]
     193                    || isNothing_stack[sp-2] ){
     194                        // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
    197195                }
    198                 else if(i2==-1) goto error;
    199 
    200                 continue;
     196                else{
     197                    //オーバーロードされたオペレータを呼び出す
     198                    i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp);
     199                    if(i2==0){
     200                        if(idCalc==CALC_EQUAL) lstrcpy(temp2,"==");
     201                        else GetCalcName(idCalc,temp2);
     202                        sprintf(temporary,"Operator %s",temp2);
     203                        SetError(27,temporary,cp);
     204                        goto error;
     205                    }
     206                    else if(i2==-1) goto error;
     207
     208                    continue;
     209                }
    201210            }
    202211
     
    208217            case 0:
    209218                index_stack[sp]=-1;
     219                isNothing_stack[sp] = false;
    210220                bUseHeap[sp]=0;
    211221
     
    424434                    // Nothing
    425435                    if( lstrcmp( term, "Nothing" ) == 0 ){
     436                        isNothing_stack[sp] = true;
     437
    426438                        type_stack[sp] = DEF_OBJECT;
    427439                        if( baseType.IsObject() ){
     
    554566                    // 型名の場合
    555567                    //////////////
    556 
    557                     LONG_PTR lp;
    558                     i3=GetTypeFixed(term,&lp);
    559                     if(i3!=-1){
    560                         type_stack[sp]=i3|FLAG_CAST;
    561                         index_stack[sp]=lp;
     568                    Type tempType;
     569                    if( Type::StringToType( term, tempType ) ){
     570                        type_stack[sp] = tempType.GetBasicType() | FLAG_CAST;
     571                        index_stack[sp] = tempType.GetIndex();
    562572                        sp++;
    563573                        break;
    564574                    }
    565 
    566575
    567576
Note: See TracChangeset for help on using the changeset viewer.