Changeset 96 in dev for BasicCompiler_Common/Intermediate_Step1.cpp
- Timestamp:
- Apr 15, 2007, 2:48:08 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Intermediate_Step1.cpp
r88 r96 78 78 GlobalFree(temporary); 79 79 } 80 /*81 TODO: 消す82 int KillReturnCode_InParameter(char *buffer,int *pRnum,char cBeginPare,char cEndPare){83 int i,i2,i3,IsStr;84 85 //カッコ'('直下の改行86 while(buffer[0]=='\n'){87 SlideString(buffer+1,-1);88 (*pRnum)++;89 }90 91 for(i=0,IsStr=0;;i++){92 if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){93 i++;94 continue;95 }96 97 if(buffer[i]=='\"') IsStr^=1;98 99 if(buffer[i]=='\0') break; //エラー100 if(buffer[i]=='\n'){101 i2=0;102 i3=0;103 while(buffer[i+i2]=='\n'){104 i2++;105 i3++;106 while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;107 }108 while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;109 110 if(buffer[i+i2]==cEndPare){111 SlideString(buffer+i+i2,-i2);112 (*pRnum)+=i3;113 break;114 }115 116 //エラー117 break;118 }119 120 if(buffer[i]==cBeginPare&&IsStr==0){121 i++;122 i2=KillReturnCode_InParameter(buffer+i,pRnum,cBeginPare,cEndPare);123 i+=i2;124 if(buffer[i]!=cEndPare) break;125 continue;126 }127 if(buffer[i]==cEndPare&&IsStr==0) break;128 129 if(buffer[i]==','&&buffer[i+1]=='\n'&&IsStr==0){130 i++;131 while(buffer[i]=='\n'){132 SlideString(buffer+i+1,-1);133 (*pRnum)++;134 }135 i--;136 }137 }138 return i;139 }140 void KillReturnCode(char *buffer){141 int i,i2;142 143 //アンダーバーによる改行144 for(i=0;;i++){145 i2=0;146 while(buffer[i]=='_'&&buffer[i+1]=='\n'){147 i2++;148 SlideString(buffer+i+2,-2);149 while(buffer[i]=='\n'){150 SlideString(buffer+i+1,-1);151 i2++;152 }153 for(;;i++){154 if(buffer[i]=='_'&&buffer[i+1]=='\n') break;155 if(buffer[i]=='\n'||buffer[i]=='\0'){156 SlideString(buffer+i,i2);157 memset(buffer+i,'\n',i2);158 break;159 }160 }161 }162 if(buffer[i]=='\0') break;163 }164 165 //カッコ内パラメータの改行166 int IsStr,rnum;167 for(i=0,IsStr=0,rnum=0;;i++){168 if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){169 i++;170 continue;171 }172 if(buffer[i]=='\0') break;173 if(buffer[i]=='\n'){174 if(rnum){175 SlideString(buffer+i+1,rnum);176 memset(buffer+i+1,'\n',rnum);177 rnum=0;178 }179 }180 if(buffer[i]=='\"') IsStr^=1;181 if(buffer[i]=='('&&IsStr==0){182 i++;183 i2=KillReturnCode_InParameter(buffer+i,&rnum,'(',')');184 i+=i2;185 if(buffer[i]!=')') break;186 }187 if(buffer[i]=='['&&IsStr==0){188 i++;189 i2=KillReturnCode_InParameter(buffer+i,&rnum,'[',']');190 i+=i2;191 if(buffer[i]!=']') break;192 }193 }194 }*/195 80 void CheckParenthesis(char *buffer){ 196 81 int i,IsStr,PareNum,sw;
Note:
See TracChangeset
for help on using the changeset viewer.