mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-13 10:00:51 +01:00
Fixed custom groups not multiplying implicitly
This commit is contained in:
parent
8959691a72
commit
c5761bc3b1
@ -409,13 +409,19 @@ fn parse_factor(context: &mut Context) -> Result<Expr, CalcError> {
|
|||||||
|| match_token(context, TokenKind::Identifier)
|
|| match_token(context, TokenKind::Identifier)
|
||||||
|| match_token(context, TokenKind::Literal)
|
|| match_token(context, TokenKind::Literal)
|
||||||
|| match_token(context, TokenKind::OpenParenthesis)
|
|| match_token(context, TokenKind::OpenParenthesis)
|
||||||
|
|| match_token(context, TokenKind::OpenCeil)
|
||||||
|
|| match_token(context, TokenKind::OpenFloor)
|
||||||
|
|| match_token(context, TokenKind::OpenBracket)
|
||||||
{
|
{
|
||||||
// If the token is an identifier, literal, or open parenthesis,
|
// If the token is an identifier, literal, or open parenthesis,
|
||||||
// assume it's multiplication. Eg. 3y or (3x + 2)(2 + 3)
|
// assume it's multiplication. Eg. 3y or (3x + 2)(2 + 3)
|
||||||
let op = match peek(context).kind {
|
let op = match peek(context).kind {
|
||||||
TokenKind::Identifier | TokenKind::Literal | TokenKind::OpenParenthesis => {
|
TokenKind::Identifier
|
||||||
TokenKind::Star
|
| TokenKind::Literal
|
||||||
}
|
| TokenKind::OpenParenthesis
|
||||||
|
| TokenKind::OpenCeil
|
||||||
|
| TokenKind::OpenFloor
|
||||||
|
| TokenKind::OpenBracket => TokenKind::Star,
|
||||||
_ => advance(context).kind,
|
_ => advance(context).kind,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user