@@ -353,9 +353,12 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
353
353
if hasproperty (Base, variable) && ! (typeof (getproperty (Base, variable)) <: Function )
354
354
# Remove the escaping if referring to a constant value like Base.pi and Base.Int64
355
355
return variable
356
- elseif @capture (x, variable_Symbol) && hasproperty (Core, variable) && ! (typeof (getproperty (Core, variable)) <: Function )
356
+ elseif hasproperty (Core, variable) && ! (typeof (getproperty (Core, variable)) <: Function )
357
357
# Remove the escaping if referring to a data type like Core.Int64
358
358
return variable
359
+ elseif hasproperty (Statistics, variable) && ! (typeof (getproperty (Statistics, variable)) <: Function )
360
+ # Because Statistics is re-exported
361
+ return variable
359
362
elseif variable in not_escaped[]
360
363
return variable
361
364
elseif contains (string (variable), r" [^\W 0-9]\w *$" ) # valid variable name
@@ -366,17 +369,17 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
366
369
elseif @capture (x, fn_ (args__))
367
370
if fn in not_escaped[]
368
371
return x
369
- elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
372
+ elseif fn isa Symbol && hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
370
373
return x
371
- elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
374
+ elseif fn isa Symbol && hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
372
375
return x
373
- elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
376
+ elseif fn isa Symbol && hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
374
377
return x
375
- elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
378
+ elseif fn isa Symbol && hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
376
379
return x
377
- elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
380
+ elseif fn isa Symbol && hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
378
381
return x
379
- elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
382
+ elseif fn isa Symbol && hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
380
383
return x
381
384
elseif contains (string (fn), r" [^\W 0-9]\w *$" ) # valid variable name
382
385
return :($ (esc (fn))($ (args... )))
@@ -388,17 +391,17 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
388
391
# return x
389
392
if fn in not_escaped[]
390
393
return x
391
- elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
394
+ elseif fn isa Symbol && hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
392
395
return x
393
- elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
396
+ elseif fn isa Symbol && hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
394
397
return x
395
- elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
398
+ elseif fn isa Symbol && hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
396
399
return x
397
- elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
400
+ elseif fn isa Symbol && hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
398
401
return x
399
- elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
402
+ elseif fn isa Symbol && hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
400
403
return x
401
- elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
404
+ elseif fn isa Symbol && hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
402
405
return x
403
406
elseif contains (string (fn), r" [^\W 0-9]\w *$" ) # valid variable name
404
407
return :($ (esc (fn)). ($ (args... )))
0 commit comments