Changeset 381 in dev for trunk/abdev/BasicCompiler64


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/BasicCompiler64/Compile_Statement.cpp

    r380 r381  
    473473{
    474474    Type resultType;
    475     int i;
    476475    char temporary[VN_SIZE],variable[VN_SIZE],collectionVar[VN_SIZE];
    477476    bool isError = false;
    478477
     478    //レキシカルスコープをレベルアップ
     479    compiler.codeGenerator.lexicalScopes.Start( compiler.codeGenerator.GetNativeCodeSize(), LexicalScope::SCOPE_TYPE_FOR );
     480
    479481    //第1パラメータを取得
    480     i=GetOneParameter(Parameter,0,temporary);
     482    int i = 0;
     483    GetCustomToken( variable, Parameter, i, ESC_IN, true );
    481484    if(!Parameter[i]){
    482485        SetError(12,"Foreach",cp);
     
    484487        goto ErrorStep;
    485488    }
    486 
    487     lstrcpy( variable, temporary );
     489    i++;
    488490
    489491    //第2パラメータを取得(in~)
    490     i=GetOneParameter(Parameter,i,collectionVar);
    491 
    492     //レキシカルスコープをレベルアップ
    493     compiler.codeGenerator.lexicalScopes.Start( compiler.codeGenerator.GetNativeCodeSize(), LexicalScope::SCOPE_TYPE_FOR );
     492    lstrcpy( collectionVar, Parameter + i );
    494493
    495494    if( !GetVarType( variable, resultType, false ) )
     
    527526    const PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(long), true );
    528527
    529     // Currentプロパティから現在の値を取得
    530     sprintf( temporary, "%s=%s.Current", variable, collectionVar );
    531     Compile( temporary );
     528    if( !isError )
     529    {
     530        // Currentプロパティから現在の値を取得
     531        sprintf( temporary, "%s=%s.Current", variable, collectionVar );
     532        Compile( temporary );
     533    }
    532534
    533535    //For内をコンパイル
     
    542544    }
    543545
    544     //jmp ...
    545     compiler.codeGenerator.op_jmp_continue();
     546    if( !isError )
     547    {
     548        //jmp ...
     549        compiler.codeGenerator.op_jmp_continue();
     550    }
    546551
    547552    //レキシカルスコープをレベルダウン
Note: See TracChangeset for help on using the changeset viewer.