Fixed lexer compile issues from issue #135

git-svn-id: http://picoc.googlecode.com/svn/trunk@571 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2011-10-05 09:50:42 +00:00
parent 853b6f6259
commit bd7634d75b

10
lex.c
View file

@ -28,7 +28,7 @@
#define MAX_CHAR_VALUE 255 /* maximum value which can be represented by a "char" data type */ #define MAX_CHAR_VALUE 255 /* maximum value which can be represented by a "char" data type */
static union AnyValue LexAnyValue; static union AnyValue LexAnyValue;
static struct Value LexValue = { TypeVoid, &LexAnyValue, FALSE, FALSE }; static struct Value LexValue = { TypeVoid, &LexAnyValue, NULL, FALSE, FALSE, FALSE };
struct ReservedWord struct ReservedWord
{ {
@ -199,8 +199,12 @@ enum LexToken LexGetNumber(struct LexState *Lexer, struct Value *Value)
LEXER_INC(Lexer); LEXER_INC(Lexer);
} }
for (Result = 0; Lexer->Pos != Lexer->End && IS_BASE_DIGIT(*Lexer->Pos, Base); LEXER_INC(Lexer)) Result = 0;
Result = Result * (double)Base + GET_BASE_DIGIT(*Lexer->Pos); while (Lexer->Pos != Lexer->End && IS_BASE_DIGIT(*Lexer->Pos, Base))
{
Result = Result * Base + GET_BASE_DIGIT(*Lexer->Pos);
LEXER_INC(Lexer);
}
FPResult *= pow((double)Base, (double)Result * ExponentMultiplier); FPResult *= pow((double)Base, (double)Result * ExponentMultiplier);
} }