Ignore:
Timestamp:
Feb 12, 2007, 2:09:55 PM (17 years ago)
Author:
dai_9181
Message:

DeclareのLib、AliasにConst定義された文字列定数を指定できるようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Subroutine.cpp

    r50 r54  
    455455
    456456    //ライブラリ
    457     if(buffer[i]!='\"'){
     457    i = GetOneParameter( buffer, i, temporary );
     458    int type;
     459    LONG_PTR lpIndex;
     460    _int64 i64data;
     461    type = StaticCalculation( true, temporary, 0, &i64data, &lpIndex );
     462    if( type != DEF_PTR_BYTE ){
    458463        SetError(1,NULL,NowLine);
    459464        return;
    460465    }
    461     for(i++,i2=0;;i++,i2++){
    462         if(buffer[i]=='\"'){
    463             temporary[i2]=0;
    464             break;
    465         }
    466         if(buffer[i]=='\0'){
    467             SetError(1,NULL,NowLine);
    468             return;
    469         }
    470         temporary[i2]=buffer[i];
    471     }
     466    lstrcpy( temporary, (char *)i64data );
    472467    CharUpper(temporary);
    473468    if(!strstr(temporary,".")){
     
    483478    pdi->file=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
    484479    lstrcpy(pdi->file,temporary);
    485     i++;
    486 
    487     if(buffer[i]==','){
    488         i++;
    489         if(buffer[i]!='\"'){
     480
     481    //エイリアス
     482    i = GetOneParameter( buffer, i, temporary );
     483    if( temporary[0] ){
     484        type = StaticCalculation( true, temporary, 0, &i64data, &lpIndex );
     485        if( type != DEF_PTR_BYTE ){
    490486            SetError(1,NULL,NowLine);
    491487            return;
    492488        }
    493         for(i++,i2=0;;i++,i2++){
    494             if(buffer[i]=='\"'){
    495                 temporary[i2]=0;
    496                 break;
    497             }
    498             if(buffer[i]=='\0'){
    499                 SetError(1,NULL,NowLine);
    500                 return;
    501             }
    502             temporary[i2]=buffer[i];
    503         }
     489        lstrcpy( temporary, (char *)i64data );
     490
    504491        pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
    505492        lstrcpy(pdi->alias,temporary);
    506         i++;
    507493    }
    508494    else{
     495        //省略されたときは関数名
    509496        pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(pdi->name)+1);
    510497        lstrcpy(pdi->alias,pdi->name);
Note: See TracChangeset for help on using the changeset viewer.