Changeset 721 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
- Timestamp:
- Aug 15, 2008, 1:51:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r699 r721 292 292 } 293 293 294 295 BOOL GetVarFormatString( char *buffer,char *array,char *array2,char *NestMember,ReferenceKind &refType, PareOrBracket *pPareOrBracket ){ 294 //対応する閉じ括弧cPare_Closeが現れるまでbufからarrayへコピーする。 295 int CopyInsideBracket(char *array, const char *buf, char cPare_Open, char cPare_Close) 296 { 297 bool inStr=false; 298 for(int i2=0;;i2++){ 299 if(buf[i2]=='"'){ 300 inStr=!inStr; 301 } 302 if(!inStr){ 303 if(buf[i2]==cPare_Open){ 304 int i3; 305 if(cPare_Open=='[') i3=GetStringInBracket(array+i2,buf+i2); 306 else i3=GetStringInPare(array+i2,buf+i2); 307 i2+=i3-1; 308 continue; 309 } 310 if(buf[i2]==cPare_Close){ 311 array[i2]=0; 312 return i2; 313 } 314 } 315 array[i2]=buf[i2]; 316 } 317 } 318 319 bool GetVarFormatString( char *buffer,char *array,char *array2,char *NestMember,ReferenceKind &refType, PareOrBracket *pPareOrBracket ){ 296 320 extern int cp; 297 int i ,i2,i3;321 int i; 298 322 char cPare_Open,cPare_Close; 299 323 … … 335 359 336 360 buffer[i]=0; 337 for(i++,i2=0;;i++,i2++){ 338 if(buffer[i]==cPare_Open){ 339 if(cPare_Open=='[') i3=GetStringInBracket(array+i2,buffer+i); 340 else i3=GetStringInPare(array+i2,buffer+i); 341 i+=i3-1; 342 i2+=i3-1; 343 continue; 344 } 345 if(buffer[i]==cPare_Close){ 346 array[i2]=0; 347 break; 348 } 349 array[i2]=buffer[i]; 350 } 361 i++; 362 i+=CopyInsideBracket(array,buffer+i,cPare_Open,cPare_Close); 351 363 if(buffer[i+1]==cPare_Open){ 352 for(i+=2,i2=0;;i++,i2++){ 364 i+=2; 365 for(int i2=0;;i++,i2++){ 353 366 if(buffer[i]==cPare_Open){ 367 int i3; 354 368 if(cPare_Open=='[') i3=GetStringInBracket(array2+i2,buffer+i); 355 369 else i3=GetStringInPare(array2+i2,buffer+i); … … 366 380 if(buffer[i+1]==cPare_Open){ 367 381 compiler.errorMessenger.Output(14,buffer,cp); 368 return 0;382 return false; 369 383 } 370 384 } … … 385 399 if(buffer[i]=='\0') break; 386 400 } 387 return 1;401 return true; 388 402 } 389 403
Note:
See TracChangeset
for help on using the changeset viewer.