diff options
author | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-14 10:03:30 +0800 |
---|---|---|
committer | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-14 10:03:30 +0800 |
commit | 5d29fdaa42c638e9420bd3111fb15f3594342354 (patch) | |
tree | d1c3ce2d13751c6ee23b92b44fc7053c681d4a3d /parse/lex.cpp | |
parent | 605c764a79ed00630967780ee7d434fbaa8aa284 (diff) | |
download | mrust-5d29fdaa42c638e9420bd3111fb15f3594342354.tar.gz |
Parse working, starting on conversion
Diffstat (limited to 'parse/lex.cpp')
-rw-r--r-- | parse/lex.cpp | 7 |
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);
}
}
|