Ignore:
Timestamp:
Dec 7, 2006, 3:09:44 AM (17 years ago)
Author:
dai_9181
Message:

Constステートメントで定数変数を宣言できるように改良。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/calculation.cpp

    r5 r7  
    627627                        //定数
    628628                        /////////
    629                         double dbl;
    630629                        StrPtr[pnum]=0;
    631                         type[pnum]=GetConstValue(Parms,&dbl,temporary,&before_index[pnum]);
    632                         if(type[pnum]!=-1){
     630                        type[pnum] = CDBConst::obj.GetType(Parms);
     631                        if(type[pnum]){
    633632                            if(IsRealNumberType(type[pnum])){
    634633                                //実数型
    635                                 nums[pnum]=dbl;
    636                             }
    637                             else if(Is64Type(type[pnum])){
    638                                 //64ビット整数
    639                                 memcpy(&i64nums[pnum],&dbl,sizeof(_int64));
     634                                nums[pnum] = CDBConst::obj.GetDoubleData(Parms);
    640635                            }
    641636                            else if(IsWholeNumberType(type[pnum])){
    642637                                //整数
    643                                 i64nums[pnum]=(_int64)dbl;
     638                                i64nums[pnum] = CDBConst::obj.GetWholeData(Parms);
    644639                            }
    645                             else if(type[pnum]==DEF_STRING){
     640/*                          else if(type[pnum]==DEF_STRING){
    646641                                //リテラル文字列
    647642
     
    652647                                memcpy(Parms,temporary,(int)nums[pnum]);
    653648                                goto StrLiteral;
    654                             }
     649                            }*/
    655650                            else{
    656651                                //エラー
     
    671666                            if(bDebuggingWatchList) return -1;
    672667                            //エラー
    673                             if(enableerror) SetError(33,NULL,cp);
     668                            if(enableerror) SetError(3,Parms,cp);
    674669                            return 0;
    675670                        }
     
    12041199int IsStrCalculation(char *Command){
    12051200    int i,i2,i3,i4,type,PareNum;
    1206     double dbl;
    12071201    char temporary[VN_SIZE],temp2[8192];
    12081202
     
    13001294
    13011295                //定数
    1302                 i3=GetConstValue(Command+i2,&dbl,temporary,0);
     1296                i3 = CDBConst::obj.GetType(Command+i2);
    13031297                if(i3==DEF_STRING) return 1;    //文字列
    1304                 if(i3!=-1) return 0;            //数値
     1298                if(i3) return 0;            //数値
    13051299
    13061300                //変数
Note: See TracChangeset for help on using the changeset viewer.