diff --git a/src/Parser/Lexer.cpp b/src/Parser/Lexer.cpp index 307426d..c6c47fb 100644 --- a/src/Parser/Lexer.cpp +++ b/src/Parser/Lexer.cpp @@ -70,12 +70,15 @@ IToken* Lexer::LexNumber(char c){ bool has_point = false; bool is_searching = true; while (is_searching){ - char next = Lexer::Next(); + char next = Lexer::Peek(); int next_val = CharToInt(next); if (next_val == -1){ switch (next){ - case '_': continue; + case '_': + Lexer::Next(); + continue; case '.': + Lexer::Next(); has_point = true; decimal_index = 0; float_value = int_value; @@ -86,6 +89,7 @@ IToken* Lexer::LexNumber(char c){ } } else{ + Lexer::Next(); if (has_point){ decimal_index++; float_value += next_val / pow(10, decimal_index);