summaryrefslogtreecommitdiff
path: root/parse/lex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parse/lex.cpp')
-rw-r--r--parse/lex.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse/lex.cpp b/parse/lex.cpp
index e80f42ca..79db4603 100644
--- a/parse/lex.cpp
+++ b/parse/lex.cpp
@@ -244,7 +244,11 @@ Token Lexer::getToken()
}
}
else {
- throw ParseError::Todo("Lex decimal numbers");
+ while( isdigit(ch) ) {
+ val *= val * 10;
+ val += ch - '0';
+ ch = this->getc();
+ }
}
if(ch == 'u' || ch == 'i') {
@@ -255,6 +259,7 @@ Token Lexer::getToken()
throw ParseError::Todo("Lex floats");
}
else {
+ this->putback();
return Token(val, CORETYPE_ANY);
}
}