From fb08786729b9b539d9f172583198a02b60a303ae Mon Sep 17 00:00:00 2001 From: Marrub Date: Fri, 21 Oct 2016 14:50:19 -0400 Subject: [PATCH] Token: Fix Lth_TOK_Dot eating numbers --- lithos_c/src/token.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lithos_c/src/token.c b/lithos_c/src/token.c index c7c8227..f4379f9 100644 --- a/lithos_c/src/token.c +++ b/lithos_c/src/token.c @@ -42,7 +42,6 @@ void Lth_TokenGet(FILE *fp, Lth_Token *out) switch(ch) { - case '.': Lth_TokenSet(out, Dot ); return; case '=': Lth_TokenSet(out, Equals); return; case ';': Lth_TokenSet(out, Semico); return; @@ -50,6 +49,11 @@ void Lth_TokenGet(FILE *fp, Lth_Token *out) case ']': Lth_TokenSet(out, BrackC); return; case '\n': Lth_TokenSet(out, LnEnd ); return; + + case '.': + if(isdigit(Lth_fpeekc(fp))) break; + Lth_TokenSet(out, Dot); + return; } if(isspace(ch))