Changeset 79 in dev for BasicCompiler32/NumOpe.cpp
- Timestamp:
- Mar 25, 2007, 5:58:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/NumOpe.cpp
r76 r79 151 151 int sp; 152 152 int type_stack[255]; 153 bool isNothing_stack[255]; 153 154 LONG_PTR index_stack[255]; 154 155 BOOL bUseHeap[255]; … … 160 161 if(idCalc){ 161 162 if(type_stack[sp-2]==DEF_OBJECT){ 162 //オーバーロードされたオペレータを呼び出す 163 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp); 164 if(i2==0){ 165 if(idCalc==CALC_EQUAL) lstrcpy(temp2,"=="); 166 else GetCalcName(idCalc,temp2); 167 sprintf(temporary,"Operator %s",temp2); 168 SetError(27,temporary,cp); 169 goto error; 163 if( idCalc == CALC_AS 164 && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST ) 165 && index_stack[sp-1] == index_stack[sp-2] 166 || isNothing_stack[sp-2] ){ 167 // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない 170 168 } 171 else if(i2==-1) goto error; 172 173 continue; 169 else{ 170 //オーバーロードされたオペレータを呼び出す 171 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp); 172 if(i2==0){ 173 if(idCalc==CALC_EQUAL) lstrcpy(temp2,"=="); 174 else GetCalcName(idCalc,temp2); 175 sprintf(temporary,"Operator %s",temp2); 176 SetError(27,temporary,cp); 177 goto error; 178 } 179 else if(i2==-1) goto error; 180 181 continue; 182 } 174 183 } 175 184 … … 181 190 case 0: 182 191 index_stack[sp]=-1; 192 isNothing_stack[sp] = false; 183 193 bUseHeap[sp]=0; 184 194 … … 363 373 // Nothing 364 374 if( lstrcmp( term, "Nothing" ) == 0 ){ 375 isNothing_stack[sp] = true; 376 365 377 type_stack[sp] = DEF_OBJECT; 366 378 if( baseType.IsObject() ){ … … 489 501 // 型名の場合 490 502 ////////////// 491 492 LONG_PTR lp; 493 i3=GetTypeFixed(term,&lp); 494 if(i3!=-1){ 495 type_stack[sp]=i3|FLAG_CAST; 496 index_stack[sp]=lp; 503 Type tempType; 504 if( Type::StringToType( term, tempType ) ){ 505 type_stack[sp] = tempType.GetBasicType() | FLAG_CAST; 506 index_stack[sp] = tempType.GetIndex(); 497 507 sp++; 498 508 break; 499 509 } 500 501 510 502 511
Note:
See TracChangeset
for help on using the changeset viewer.