Ignore:
Timestamp:
Apr 19, 2007, 3:09:55 AM (17 years ago)
Author:
dai_9181
Message:

Namespaceステートメントのエスケープシーケンス化を行った。
[IDE]バックアップに失敗したときにエラーメッセージを出さないようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Intermediate_Step1.cpp

    r96 r99  
    320320    char *temporary,temp2[VN_SIZE];
    321321
     322    bool isBeforeCharDelimitation = false;
    322323    temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(buffer)*2);
    323324    for(i=0,i2=0,IsStr=0;;i++,i2++){
     
    327328            buffer[i+1]=ESC_PSMEM;
    328329        }
     330
     331        if( buffer[i] && IsCommandDelimitation( buffer[i] ) ){
     332            isBeforeCharDelimitation = true;
     333
     334            temporary[i2]=buffer[i];
     335            continue;
     336        }
     337
    329338        if(IsVariableChar(buffer[i])&&IsStr==0){
     339
    330340            i3=i2;
    331341            for(;;i++,i2++){
     
    336346                temporary[i2]=buffer[i];
    337347            }
     348
     349            bool isAfterCharBlank = false;
     350            if( IsBlank( buffer[i] ) ){
     351                isAfterCharBlank = true;
     352            }
     353
    338354            if(lstrcmpi(temporary+i3,"End")==0) i6=1;
    339355            else if(lstrcmpi(temporary+i3,"Exit")==0) i6=2;
     
    389405                            if(lstrcmpi(temp2,"Macro")==0) sw1=1;
    390406                            break;
     407                        case 'n':
     408                        case 'N':
     409                            if(lstrcmpi(temp2,"Namespace")==0) sw1=1;
     410                            break;
    391411                        case 's':
    392412                        case 'S':
     
    642662                            temporary[i2]=ESC_ENDMACRO;
    643663                        }
     664                        else if(lstrcmpi(temporary+i3,"EndNamespace")==0){
     665                            i2=i3;
     666                            temporary[i2++]=1;
     667                            temporary[i2]=ESC_ENDNAMESPACE;
     668                        }
    644669                        else if(lstrcmpi(temporary+i3,"EndClass")==0){
    645670                            i2=i3;
     
    757782                case 'n':
    758783                case 'N':
    759                     if(lstrcmpi(temporary+i3,"New")==0){
     784                    if(isBeforeCharDelimitation
     785                        && lstrcmpi(temporary+i3,"Namespace")==0
     786                        && isAfterCharBlank ){
     787                        i2=i3;
     788                        temporary[i2++]=1;
     789                        temporary[i2]=ESC_NAMESPACE;
     790                    }
     791                    else if(lstrcmpi(temporary+i3,"New")==0){
    760792                        i2=i3;
    761793                        temporary[i2++]=1;
     
    868900            continue;
    869901        }
     902
     903        if( !IsBlank( buffer[i] ) ){
     904            isBeforeCharDelimitation = false;
     905        }
     906
    870907        temporary[i2]=buffer[i];
    871908        if(buffer[i]=='\0') break;
Note: See TracChangeset for help on using the changeset viewer.