Merge pull request #133 from VVWVV/fix_emit

Allow float negative numbers in #emit
This commit is contained in:
Zeex 2017-01-22 02:11:14 +07:00 committed by GitHub
commit ecfb7cf69e

View File

@ -1346,10 +1346,16 @@ static int command(void)
extern char *sc_tokens[];/* forward declaration */
char s2[33]="-";
if ((char)tok=='-') {
if (lex(&val,&str)==tNUMBER) {
int current_token=lex(&val,&str);
if (current_token==tNUMBER) {
outval(-val,FALSE);
code_idx+=opargs(1);
break;
} else if (current_token==tRATIONAL) {
/* change the first bit to make float negative value */
outval(val | 0x80000000,FALSE);
code_idx+=opargs(1);
break;
} else {
strcpy(s2+1, str);
error(1,sc_tokens[tSYMBOL-tFIRST],s2);