diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index 272502b..ee1c70b 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -5977,6 +5977,66 @@ static void emit_param_local(ucell *p,int size) } while (++curp0); +fetchtok: + tok=lex(&val,&str); + switch (tok) { + case tNUMBER: + if (neg!=0) + val=-val; + break; + case tRATIONAL: + if (neg!=0) + val=val|((cell)1 << (PAWN_CELL_SIZE-1)); + break; + case tSYMBOL: + sym=findloc(str); + if (sym==NULL) + sym=findglb(str,sSTATEVAR); + if (sym==NULL) { + error(17,str); /* undefined symbol */ + return; + } /* if */ + switch (sym->ident) { + case iCONSTEXPR: + break; + case iFUNCTN: + case iREFFUNC: + tok=((sym->usage & uNATIVE)!=0) ? teNATIVE : teFUNCTN; + /* drop through */ + default: + if (tok==tSYMBOL) + tok=teDATA; + emit_invalid_token(teNUMBER,tok); + return; + } /* switch */ + markusage(sym,uREAD); + val=(neg!=0) ? -sym->addr : sym->addr; + break; + default: + if (tok==(int)'-' && neg==0) { + neg=1; + goto fetchtok; + } /* if */ + emit_invalid_token(teNUMBER,tok); + return; + } /* switch */ + + *p=val; + for (i=0; i