From 5d29fdaa42c638e9420bd3111fb15f3594342354 Mon Sep 17 00:00:00 2001 From: "John Hodge (bugs)" Date: Sun, 14 Dec 2014 10:03:30 +0800 Subject: Parse working, starting on conversion --- parse/lex.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'parse/lex.cpp') 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); } } -- cgit v1.2.3