Native only if function call is not a valid identifier.

This commit is contained in:
Stephen Chung
2020-12-18 23:03:56 +08:00
parent 5454ff0cd5
commit db7b9cb0f9
4 changed files with 32 additions and 14 deletions

View File

@@ -357,6 +357,7 @@ fn parse_fn_call(
return Ok(Expr::FnCall(
Box::new(FnCallExpr {
name: id.to_string().into(),
native_only: !is_valid_identifier(id.chars()), // script functions can only be valid identifiers
capture,
namespace,
hash: hash_script,
@@ -404,6 +405,7 @@ fn parse_fn_call(
return Ok(Expr::FnCall(
Box::new(FnCallExpr {
name: id.to_string().into(),
native_only: !is_valid_identifier(id.chars()), // script functions can only be valid identifiers
capture,
namespace,
hash: hash_script,