mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-03-12 20:38:18 +01:00
Allow multi-character parameters
This commit is contained in:
parent
90b6bed227
commit
416b2c571f
@ -484,6 +484,13 @@ fn analyse_var(
|
||||
with_adjacent(Expr::Var(identifier), adjacent_factor, adjacent_exponent)
|
||||
} else if context.symbol_table.contains_var(&identifier.pure_name)
|
||||
|| (identifier.pure_name.len() == 1 && !context.in_equation)
|
||||
|| context.current_function_parameters.is_some()
|
||||
&& context
|
||||
.current_function_parameters
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.any(|param| param[2..] == identifier.pure_name)
|
||||
{
|
||||
with_adjacent(
|
||||
build_var(context, &identifier.full_name),
|
||||
|
@ -1,5 +1,5 @@
|
||||
x = 3
|
||||
f(x) = 2*x
|
||||
g(x, y) = 2*x*y
|
||||
g(x, long_name) = 2*x*long_name
|
||||
|
||||
f(x) = 6 and fx = 6 and x = 3 and g(x, x + 1) = 24 and sqrt4 = 2
|
Loading…
Reference in New Issue
Block a user