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_Delegate.cpp

    r750 r828  
    55void LexicalAnalyzer::CollectDelegates( const char *source, Delegates &delegates )
    66{
    7     int i2;
    8     char temporary[VN_SIZE];
    9 
    107    // 名前空間管理
    118    NamespaceScopes &namespaceScopes = compiler.GetNamespaceSupporter().GetLivingNamespaceScopes();
     
    1512    compiler.GetNamespaceSupporter().ClearImportedNamespaces();
    1613
    17     int length = lstrlen( source );
    18     for( int i=0; i<length; i++ )
     14    for (int i=0; source[i] != '\0'; i++)
    1915    {
    2016        if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
    21             for(i+=2,i2=0;;i2++,i++){
    22                 if( IsCommandDelimitation( source[i] ) ){
    23                     temporary[i2]=0;
    24                     break;
    25                 }
    26                 temporary[i2]=source[i];
    27             }
    28             namespaceScopes.push_back( temporary );
     17            i+=2;
     18            char const* p = &source[i];
     19            while (!IsCommandDelimitation(source[i]))
     20            {
     21                ++i;
     22            }
     23            namespaceScopes.push_back(std::string(p, &source[i]));
    2924
    3025            continue;
     
    4237        }
    4338        else if( source[i] == 1 && source[i+1] == ESC_IMPORTS ){
    44             for(i+=2,i2=0;;i2++,i++){
    45                 if( IsCommandDelimitation( source[i] ) ){
    46                     temporary[i2]=0;
    47                     break;
    48                 }
    49                 temporary[i2]=source[i];
    50             }
    51             if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    52             {
    53                 compiler.errorMessenger.Output(64,temporary,i );
     39            i+=2;
     40            char const* p = &source[i];
     41            while (!IsCommandDelimitation(source[i]))
     42            {
     43                ++i;
     44            }
     45            std::string s(p, &source[i]);
     46            if (!compiler.GetNamespaceSupporter().ImportsNamespace(s))
     47            {
     48                compiler.errorMessenger.Output(64, s.c_str(), i);
    5449            }
    5550
     
    112107                {
    113108                    compiler.errorMessenger.Output(-104,name,nowLine);
    114                     lstrcpy( returnTypeName, "Double" );
     109                    strcpy( returnTypeName, "Double" );
    115110                }
    116111            }
     
    127122    Jenga::Common::SourceTemplate sourceTemplate( ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\templates\\delegate_class.tab" );
    128123
    129     delegates.Iterator_Reset();
    130     while( delegates.Iterator_HasNext() )
    131     {
    132         const Delegate &dg = *delegates.Iterator_GetNext();
     124    foreach (auto pDelegate, delegates)
     125    {
     126        const Delegate &dg = *pDelegate;
    133127
    134128        if( dg.IsExternal() )
     
    263257void LexicalAnalyzer::RefleshDelegatesParameterAndReturnType( Delegates &delegates )
    264258{
    265     delegates.Iterator_Reset();
    266     while( delegates.Iterator_HasNext() )
    267     {
    268         Delegate &dg = *delegates.Iterator_GetNext();
    269         RefleshDelegateParameterAndReturnType( dg );
    270     }
    271 }
     259    foreach (auto *pDelegate, delegates)
     260    {
     261        RefleshDelegateParameterAndReturnType(*pDelegate);
     262    }
     263}
Note: See TracChangeset for help on using the changeset viewer.