Changeset 553 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src
- Timestamp:
- May 5, 2008, 1:03:45 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp
r531 r553 902 902 } 903 903 904 bool BasicSource::Generate( const std::string &genName, const char *genBuffer ){905 const int genBufferLength = lstrlen( genBuffer );906 907 #ifdef _DEBUG908 // 挿入ソースに改行コードが含まれていないかを検査する909 for( int i=0; genBuffer[i] ; i++ ){910 if( genBuffer[i] == '\n' ){911 compiler.errorMessenger.OutputFatalError();912 break;913 }914 }915 #endif916 917 bool isFound = false;918 919 for( int i=0; ; i++ ){920 if( i == 0 || buffer[i] == '\n' ){921 if( buffer[i] == '\n' ){922 i++;923 }924 while( IsBlank( buffer[i] ) ){925 i++;926 }927 928 int startIndex = i;929 930 if( memicmp( buffer + i, generateDirectiveName.c_str(), generateDirectiveName.size() ) == 0 ){931 i += (int)generateDirectiveName.size();932 while( IsBlank( buffer[i] ) ){933 i++;934 }935 936 char temporary[VN_SIZE];937 for( int i2=0; ; i++, i2++ ){938 if( buffer[i] == '\n' ){939 temporary[i2] = 0;940 break;941 }942 temporary[i2] = buffer[i];943 }944 if( genName == temporary ){945 // 一致946 947 int endIndex = i;948 949 int lengthOffset = genBufferLength - ( endIndex - startIndex );950 951 Realloc( length + lengthOffset );952 Text::SlideString( buffer + endIndex, lengthOffset );953 memcpy( buffer + startIndex, genBuffer, genBufferLength );954 955 isFound = true;956 957 break;958 }959 }960 }961 }962 963 return isFound;964 }965 966 904 void BasicSource::Addition( const char *buffer ){ 967 905 Realloc( length + lstrlen(buffer) );
Note:
See TracChangeset
for help on using the changeset viewer.