Branch: Tag:

1997-05-13

1997-05-13 15:49:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now handles exponent in float constants.

Rev: src/lex.c:1.22

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: lex.c,v 1.21 1997/04/16 03:09:12 hubbe Exp $"); + RCSID("$Id: lex.c,v 1.22 1997/05/13 15:49:54 grubba Exp $");   #include "language.h"   #include "array.h"   #include "lex.h"
1477:    case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    { -  char *p; +  char *p, *p2;    UNGETC(c); -  READBUF(isdigit(C) || C=='.'); +  READBUF(isdigit(C) || C=='.' || C=='e' || C=='E');       p=STRCHR(buf,'.');   
1501:    return F_FLOAT;    }    } +  p = STRCHR(buf, 'e'); +  p2 = STRCHR(buf, 'E'); +  if (p || p2) { +  if (p) { +  if (p2 && (p > p2)) { +  p = p2; +  } +  } else { +  p = p2; +  } +  UNGETSTR(p, strlen(p)); +  *p = 0; +  }    if(buf[0]=='0')    yylval->number=STRTOL(buf,NULL,8);    else