mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-13 18:10:42 +01:00
Removed redundant if
This commit is contained in:
parent
d1177f6c10
commit
a05cb65434
@ -582,14 +582,12 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
||||
&& (match_token(context, TokenKind::Literal) || match_token(context, TokenKind::Identifier))
|
||||
{
|
||||
// If there is a function with this name, parse it as a function, with the next token as the argument.
|
||||
if exists_as_fn {
|
||||
let parameter = if identifier.full_name == "√" {
|
||||
parse_exponent(context)?
|
||||
} else {
|
||||
parse_factor(context)?
|
||||
};
|
||||
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
||||
}
|
||||
let parameter = if identifier.full_name == "√" {
|
||||
parse_exponent(context)?
|
||||
} else {
|
||||
parse_factor(context)?
|
||||
};
|
||||
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
||||
}
|
||||
|
||||
let parse_as_var_instead = match_token(context, TokenKind::OpenParenthesis)
|
||||
|
Loading…
Reference in New Issue
Block a user