mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-03-04 16:21:16 +01:00
Fixed '0' being lexed as a base literal
This commit is contained in:
parent
cb36f69260
commit
f1881ac9b6
@ -350,9 +350,6 @@ pub(crate) fn eval_fn_call_expr(
|
|||||||
return Ok(sum);
|
return Ok(sum);
|
||||||
}
|
}
|
||||||
"integrate" => {
|
"integrate" => {
|
||||||
// Make sure either 3 or 4 arguments were supplied.
|
|
||||||
if expressions.len() < 3 || expressions.len() > 4 {}
|
|
||||||
|
|
||||||
return match expressions.len() {
|
return match expressions.len() {
|
||||||
3 => calculus::integrate_with_unknown_variable(
|
3 => calculus::integrate_with_unknown_variable(
|
||||||
context,
|
context,
|
||||||
|
@ -200,12 +200,14 @@ impl<'a> Lexer<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Don't include eg. 0x in the value
|
// Don't include eg. 0x in the value
|
||||||
start += 2;
|
if base != 10 {
|
||||||
end += 1;
|
start += 2;
|
||||||
self.advance();
|
end += 1;
|
||||||
value.clear();
|
self.advance();
|
||||||
leading_zero = false;
|
value.clear();
|
||||||
continue;
|
leading_zero = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.is_digit(base) && c != '.' && c != '_' && !c.is_whitespace()
|
if !c.is_digit(base) && c != '.' && c != '_' && !c.is_whitespace()
|
||||||
|
Loading…
Reference in New Issue
Block a user