Ignore:
Timestamp:
Dec 19, 2007, 3:31:03 AM (16 years ago)
Author:
dai_9181
Message:

Foreach文のパラメータをInで区切るようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/Compile.cpp

    r372 r381  
    4949        }
    5050        token[i] = source[pos];
     51    }
     52}
     53void GetCustomToken( char *token, const char *source, int &pos, char delimitation, bool isEscapeSequence )
     54{
     55    for( int i=0; ; i++, pos++ ){
     56        if( isEscapeSequence )
     57        {
     58            if( source[pos] == 1 && source[pos+1] == delimitation )
     59            {
     60                token[i] = 0;
     61                pos++;
     62                break;
     63            }
     64        }
     65        else
     66        {
     67            if( source[pos] == delimitation )
     68            {
     69                token[i] = 0;
     70                break;
     71            }
     72        }
     73
     74        token[i] = source[pos];
     75
     76        if( source[pos] == '\0' )
     77        {
     78            break;
     79        }
    5180    }
    5281}
Note: See TracChangeset for help on using the changeset viewer.