Fixed '0' being lexed as a base literal

This commit is contained in:
PaddiM8 2021-12-30 12:44:48 +01:00
parent cb36f69260
commit f1881ac9b6
2 changed files with 8 additions and 9 deletions

View File

@ -350,9 +350,6 @@ pub(crate) fn eval_fn_call_expr(
return Ok(sum);
}
"integrate" => {
// Make sure either 3 or 4 arguments were supplied.
if expressions.len() < 3 || expressions.len() > 4 {}
return match expressions.len() {
3 => calculus::integrate_with_unknown_variable(
context,

View File

@ -200,6 +200,7 @@ impl<'a> Lexer<'a> {
};
// Don't include eg. 0x in the value
if base != 10 {
start += 2;
end += 1;
self.advance();
@ -207,6 +208,7 @@ impl<'a> Lexer<'a> {
leading_zero = false;
continue;
}
}
if !c.is_digit(base) && c != '.' && c != '_' && !c.is_whitespace()
|| c == '\n'