mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-22 18:51:22 +02:00
Support syntax like sin2x
This commit is contained in:
parent
0001544028
commit
2a7c403c56
@ -504,7 +504,7 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
|||||||
{
|
{
|
||||||
// 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 context.symbol_table.contains_fn(&identifier.pure_name) {
|
if context.symbol_table.contains_fn(&identifier.pure_name) {
|
||||||
let parameter = parse_primary(context)?;
|
let parameter = parse_factor(context)?;
|
||||||
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
return Ok(Expr::FnCall(identifier, vec![parameter]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user