Allow space after function name, without parenthesis

This commit is contained in:
bakk 2021-06-01 00:18:14 +02:00
parent 96a81b1359
commit 44488d285f

View File

@ -578,10 +578,8 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|| context.current_function.as_ref() == Some(&identifier.pure_name); || context.current_function.as_ref() == Some(&identifier.pure_name);
// Eg. sqrt64 // Eg. sqrt64
if match_token(context, TokenKind::Literal) if exists_as_fn
|| peek(context).value == "π" && (match_token(context, TokenKind::Literal) || match_token(context, TokenKind::Identifier))
|| peek(context).value == "τ"
|| peek(context).value == "ϕ"
{ {
// 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 { if exists_as_fn {