mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-11-08 00:44:40 +01:00
Created synonym 'integral' for 'integrate'
This commit is contained in:
parent
7b635079c8
commit
34e374b346
@ -364,7 +364,7 @@ pub(crate) fn eval_fn_call_expr(
|
||||
|
||||
return Ok(sum);
|
||||
}
|
||||
"integrate" | "∫" => {
|
||||
"integrate" | "integral" | "∫" => {
|
||||
// Make sure exactly 3 arguments were supplied.
|
||||
if expressions.len() != 3 {
|
||||
return Err(CalcError::IncorrectAmountOfArguments(
|
||||
|
@ -504,7 +504,9 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
||||
if !parse_as_var_instead && match_token(context, TokenKind::OpenParenthesis) {
|
||||
advance(context);
|
||||
|
||||
let is_integral = identifier.full_name == "integrate" || identifier.full_name == "∫";
|
||||
let is_integral = identifier.full_name == "integrate"
|
||||
|| identifier.full_name == "integral"
|
||||
|| identifier.full_name == "∫";
|
||||
if is_integral {
|
||||
context.is_in_integral = true;
|
||||
}
|
||||
|
@ -159,6 +159,7 @@ pub fn is_prelude_func(identifier: &str) -> bool {
|
||||
identifier == "sum"
|
||||
|| identifier == "Σ"
|
||||
|| identifier == "integrate"
|
||||
|| identifier == "integral"
|
||||
|| identifier == "∫"
|
||||
|| UNARY_FUNCS.contains_key(identifier)
|
||||
|| BINARY_FUNCS.contains_key(identifier)
|
||||
|
@ -112,6 +112,7 @@ lazy_static! {
|
||||
m.insert("gamma", "Γ");
|
||||
m.insert("sum", "Σ()");
|
||||
m.insert("integrate", "∫()");
|
||||
m.insert("integral", "∫()");
|
||||
m.insert("phi", "ϕ");
|
||||
m.insert("pi", "π");
|
||||
m.insert("sqrt", "√");
|
||||
|
Loading…
Reference in New Issue
Block a user