From: andy Date: Tue, 30 Sep 2008 19:06:34 +0000 (+0000) Subject: Fix broken lex.c checkin X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f5f1f0da8e8d058de2f580df2254a987aaf7f666;p=simgear.git Fix broken lex.c checkin --- diff --git a/simgear/nasal/lex.c b/simgear/nasal/lex.c index d3d525c3..685393ad 100644 --- a/simgear/nasal/lex.c +++ b/simgear/nasal/lex.c @@ -257,7 +257,7 @@ static int lexHexLiteral(struct Parser* p, int index) } #define ISNUM(c) ((c) >= '0' && (c) <= '9') - +#define NUMSTART(c) (ISNUM(c) || (c)=='+' || (c) == '-') static int lexNumLiteral(struct Parser* p, int index) { int len = p->len, i = index; @@ -267,17 +267,15 @@ static int lexNumLiteral(struct Parser* p, int index) if(buf[0] == '0' && i+1= '0' && buf[i] <= '9') i++; + while(i= '0' && buf[i] <= '9') i++; + while(i= '0' && buf[i+1] <= '9')) i++; - while(i= '0' && buf[i] <= '9') i++; + if(buf[i] == '-' || buf[i] == '+') i++; + while(ibuf + index, i - index, &d); newToken(p, index, TOK_LITERAL, 0, 0, d);