mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-22 04:58:35 +01:00
Removed redundant if
This commit is contained in:
parent
44488d285f
commit
6697a37faa
@ -582,7 +582,6 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
|||||||
&& (match_token(context, TokenKind::Literal) || match_token(context, TokenKind::Identifier))
|
&& (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 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 == "√" {
|
let parameter = if identifier.full_name == "√" {
|
||||||
parse_exponent(context)?
|
parse_exponent(context)?
|
||||||
} else {
|
} else {
|
||||||
@ -590,7 +589,6 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
|||||||
};
|
};
|
||||||
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let parse_as_var_instead = match_token(context, TokenKind::OpenParenthesis)
|
let parse_as_var_instead = match_token(context, TokenKind::OpenParenthesis)
|
||||||
&& !context.parsing_identifier_stmt
|
&& !context.parsing_identifier_stmt
|
||||||
|
Loading…
Reference in New Issue
Block a user