Added basic math.* library, fixed number lexer edgecase

- also added vm.collect() to the vm library
This commit is contained in:
2021-01-29 15:45:24 -06:00
parent cff26574bb
commit 300ffb89e9
3 changed files with 123 additions and 9 deletions

View File

@@ -308,7 +308,7 @@ CToken parseNumber(CLexState *state) {
return makeToken(state, TOKEN_BINNUMBER);
default: // it's a one digit number!!!!!
if (!isNumerical(peek(state)))
if (!isNumerical(peek(state)) && !(peek(state) == '.'))
return makeToken(state, TOKEN_NUMBER);
// if it is a number, fall through and parse normally
}
@@ -318,7 +318,7 @@ CToken parseNumber(CLexState *state) {
while (isNumerical(peek(state))) {
next(state);
}
if (peek(state) == '.' && isNumerical(peekNext(state))) {
next(state); // consume '.'