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
  • BasicCompiler_Common/NumOpe_GetType.cpp

    r75 r79  
    340340    int type_stack[255];
    341341    LONG_PTR index_stack[255];
     342    bool isNothing_stack[255];
    342343    _int64 i64data;
    343344    int idCalc;
     
    347348        if(idCalc){
    348349            if(type_stack[sp-2]==DEF_OBJECT){
    349                 //オーバーロードされたオペレータを呼び出す
    350                 if(!GetReturnType_OperatorProc(idCalc,baseType,type_stack,index_stack,sp)){
    351                     goto error;
     350                if( idCalc == CALC_AS
     351                    && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
     352                    && index_stack[sp-1] == index_stack[sp-2]
     353                    || isNothing_stack[sp-2] ){
     354                        // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
    352355                }
    353 
    354                 continue;
     356                else{
     357                    //オーバーロードされたオペレータを呼び出す
     358                    if(!GetReturnType_OperatorProc(idCalc,baseType,type_stack,index_stack,sp)){
     359                        goto error;
     360                    }
     361
     362                    continue;
     363                }
    355364            }
    356365
     
    362371            case 0:
    363372                index_stack[sp]=-1;
     373                isNothing_stack[sp] = false;
    364374
    365375                char *term;
     
    490500                    // Nothing
    491501                    if( lstrcmp( term, "Nothing" ) == 0 ){
     502                        isNothing_stack[sp] = true;
     503
    492504                        type_stack[sp] = DEF_OBJECT;
    493505                        if( baseType.IsObject() ){
     
    558570                    //////////////
    559571
    560                     LONG_PTR lp;
    561                     i3=GetTypeFixed(term,&lp);
    562                     if(i3!=-1){
    563                         type_stack[sp]=i3|FLAG_CAST;
    564                         index_stack[sp]=lp;
     572                    Type tempType;
     573                    if( Type::StringToType( term, tempType ) ){
     574                        type_stack[sp] = tempType.GetBasicType() | FLAG_CAST;
     575                        index_stack[sp] = tempType.GetIndex();
    565576                        sp++;
    566577                        break;
    567578                    }
    568 
    569579
    570580
Note: See TracChangeset for help on using the changeset viewer.