Ignore:
Timestamp:
Mar 19, 2011, 1:29:12 AM (13 years ago)
Author:
イグトランス (egtra)
Message:

LexicalAnalyzer周りの修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp

    r803 r814  
    1515void LexicalAnalyzer::CollectClassesForNameOnly( const char *source, Classes &classes )
    1616{
    17     int i, i2;
     17    int i2;
    1818    char temporary[VN_SIZE];
    1919
     
    2525    compiler.GetNamespaceSupporter().ClearImportedNamespaces();
    2626
    27     for(i=0;;i++){
     27    for(int i=0;;i++){
    2828        if(source[i]=='\0') break;
    2929
    3030        if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
    31             for(i+=2,i2=0;;i2++,i++){
    32                 if( IsCommandDelimitation( source[i] ) ){
    33                     temporary[i2]=0;
    34                     break;
    35                 }
    36                 temporary[i2]=source[i];
    37             }
    38             namespaceScopes.push_back( temporary );
     31            i+=2;
     32            char const* p = &source[i];
     33            while (!IsCommandDelimitation(source[i]))
     34            {
     35                ++i;
     36            }
     37            namespaceScopes.push_back(std::string(p, &source[i]));
    3938
    4039            continue;
     
    5251        }
    5352        else if( source[i] == 1 && source[i+1] == ESC_IMPORTS ){
    54             for(i+=2,i2=0;;i2++,i++){
    55                 if( IsCommandDelimitation( source[i] ) ){
    56                     temporary[i2]=0;
    57                     break;
    58                 }
    59                 temporary[i2]=source[i];
    60             }
    61             if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    62             {
    63                 compiler.errorMessenger.Output(64,temporary,i );
     53            i+=2;
     54            char const* p = &source[i];
     55            while (!IsCommandDelimitation(source[i]))
     56            {
     57                ++i;
     58            }
     59            std::string s(p, &source[i]);
     60            if (!compiler.GetNamespaceSupporter().ImportsNamespace(s))
     61            {
     62                compiler.errorMessenger.Output(64, s.c_str(), i);
    6463            }
    6564
     
    15181517        else
    15191518        {
    1520             for( int i=0; i<pInterface->GetDynamicMethods().size(); i++ )
     1519            for( std::size_t i=0; i<pInterface->GetDynamicMethods().size(); i++ )
    15211520            {
    15221521                if( pInterface->GetDynamicMethods()[i]->IsAbstract() != pExpandedInterface->GetDynamicMethods()[i]->IsAbstract() )
Note: See TracChangeset for help on using the changeset viewer.