Changeset 79 in dev for BasicCompiler64/NumOpe.cpp
- Timestamp:
- Mar 25, 2007, 5:58:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/NumOpe.cpp
r76 r79 177 177 int type_stack[255]; 178 178 LONG_PTR index_stack[255]; 179 bool isNothing_stack[255]; 179 180 BOOL bUseHeap[255]; 180 181 _int64 i64data; … … 187 188 if(idCalc){ 188 189 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演算子を呼び出さない 197 195 } 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 } 201 210 } 202 211 … … 208 217 case 0: 209 218 index_stack[sp]=-1; 219 isNothing_stack[sp] = false; 210 220 bUseHeap[sp]=0; 211 221 … … 424 434 // Nothing 425 435 if( lstrcmp( term, "Nothing" ) == 0 ){ 436 isNothing_stack[sp] = true; 437 426 438 type_stack[sp] = DEF_OBJECT; 427 439 if( baseType.IsObject() ){ … … 554 566 // 型名の場合 555 567 ////////////// 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(); 562 572 sp++; 563 573 break; 564 574 } 565 566 575 567 576
Note:
See TracChangeset
for help on using the changeset viewer.