Modify ExprFunctionExternal syntax to avoid conflicts with ExprFunctionProperty
Closed this issue · 0 comments
Is your feature request related to a problem? Please describe.
The fact that the external function expression (ExprFunctionExternal
) and function property expression (ExprFunctionProperty
) are distinguished only by the use of non-identifier symbols in the function source is limiting — for example, function() from cool expression
is parsed as a usage of the external function expression, despite the source, cool expression
, being an expression, and not a valid script or library.
Describe the solution you'd like
I propose that the syntax for the external function expression be changed to include a syntax specifier, something like function(...) from source %Source%
. This way, the function property expression would take precedence when the source is an expression or a valid Object, allowing for more concise function calls, like function() from cool expression
in place of
set {x} to cool expression
function() from {x}
Describe alternatives you've considered
Another possible alternative would be to include a keyword, like external function
, in front of the existing syntax for the external function expression. This is also valid, though the syntax may become quite lengthy. A third alternative would be to add a syntax specifier to the function property expression, instead. This is also valid, though arguably a worse solution because the function property expression is more common.