Changeset 79 in dev for BasicCompiler_Common/NumOpe_GetType.cpp
- Timestamp:
- Mar 25, 2007, 5:58:57 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/NumOpe_GetType.cpp
r75 r79 340 340 int type_stack[255]; 341 341 LONG_PTR index_stack[255]; 342 bool isNothing_stack[255]; 342 343 _int64 i64data; 343 344 int idCalc; … … 347 348 if(idCalc){ 348 349 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演算子を呼び出さない 352 355 } 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 } 355 364 } 356 365 … … 362 371 case 0: 363 372 index_stack[sp]=-1; 373 isNothing_stack[sp] = false; 364 374 365 375 char *term; … … 490 500 // Nothing 491 501 if( lstrcmp( term, "Nothing" ) == 0 ){ 502 isNothing_stack[sp] = true; 503 492 504 type_stack[sp] = DEF_OBJECT; 493 505 if( baseType.IsObject() ){ … … 558 570 ////////////// 559 571 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(); 565 576 sp++; 566 577 break; 567 578 } 568 569 579 570 580
Note:
See TracChangeset
for help on using the changeset viewer.