Ignore:
Timestamp:
Mar 19, 2012, 1:59:48 AM (12 years ago)
Author:
イグトランス (egtra)
Message:

egtraブランチの内容をマージ。

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ab5.0/abdev

    • Property svn:ignore set to
      *.opensdf
      *.sdf
      *.suo
      *.user
      int
      ipch
      out
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer.cpp

    r625 r828  
    33using namespace ActiveBasic::Compiler;
    44
    5 bool LexicalAnalyzer::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )
     5using boost::numeric_cast;
     6
     7bool LexicalAnalyzer::CollectNamespaces(char const* source, NamespaceScopesCollection &namespaceScopesCollection)
    68{
    7     int i, i2;
    8     char temporary[1024];
    9 
    109    bool isSuccessful = true;
    1110
     
    1312    NamespaceScopes namespaceScopes;
    1413
    15     for(i=0;;i++){
     14    for (int i = 0; ; i++)
     15    {
    1616        if(source[i]=='\0') break;
    1717
    1818        if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
    19             for(i+=2,i2=0;;i2++,i++){
    20                 if( IsCommandDelimitation( source[i] ) ){
    21                     temporary[i2]=0;
    22                     break;
    23                 }
    24                 temporary[i2]=source[i];
     19            i+=2;
     20            char const* p = &source[i];
     21            while (!IsCommandDelimitation(source[i]))
     22            {
     23                ++i;
    2524            }
    26             namespaceScopes.push_back( temporary );
     25            namespaceScopes.push_back(std::string(p, &source[i]));
    2726
    2827            if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){
     
    4645    }
    4746
    48     if( namespaceScopes.size() > 0 ){
     47    if( !namespaceScopes.empty() ){
    4948        compiler.errorMessenger.Output( 63, NULL, cp );
    5049        isSuccessful = false;
Note: See TracChangeset for help on using the changeset viewer.