@@ -351,7 +351,7 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
351
351
# If it's already escaped, make sure it needs to remain escaped
352
352
if @capture (x, esc (variable_Symbol))
353
353
if hasproperty (Base, variable) && ! (typeof (getproperty (Base, variable)) <: Function )
354
- # Remove the escaping if referring to a constant value like Base.pi
354
+ # Remove the escaping if referring to a constant value like Base.pi and Base.Int64
355
355
return variable
356
356
elseif @capture (x, variable_Symbol) && hasproperty (Core, variable) && ! (typeof (getproperty (Core, variable)) <: Function )
357
357
# Remove the escaping if referring to a data type like Core.Int64
@@ -364,21 +364,41 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
364
364
return variable
365
365
end
366
366
elseif @capture (x, fn_ (args__))
367
- if hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
367
+ if fn in not_escaped[]
368
+ return x
369
+ elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
368
370
return x
369
371
elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
370
372
return x
371
373
elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
372
374
return x
373
- elseif fn in not_escaped[]
375
+ elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
376
+ return x
377
+ elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
378
+ return x
379
+ elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
374
380
return x
375
381
elseif contains (string (fn), r" [^\W 0-9]\w *$" ) # valid variable name
376
382
return :($ (esc (fn))($ (args... )))
377
383
else
378
384
return x
379
385
end
380
386
elseif @capture (x, fn_ .(args__))
381
- if fn in [:esc :in :∈ :∉ :Ref :Set :Cols :(:) :∘ :across :desc :mean :std :var :median :first :last :minimum :maximum :sum :length :skipmissing :quantile :passmissing :startswith :contains :endswith ]
387
+ # if fn in [:esc :in :∈ :∉ :Ref :Set :Cols :(:) :∘ :across :desc :mean :std :var :median :first :last :minimum :maximum :sum :length :skipmissing :quantile :passmissing :startswith :contains :endswith]
388
+ # return x
389
+ if fn in not_escaped[]
390
+ return x
391
+ elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Function
392
+ return x
393
+ elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Function
394
+ return x
395
+ elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Function
396
+ return x
397
+ elseif hasproperty (Base, fn) && typeof (getproperty (Base, fn)) <: Type
398
+ return x
399
+ elseif hasproperty (Core, fn) && typeof (getproperty (Core, fn)) <: Type
400
+ return x
401
+ elseif hasproperty (Statistics, fn) && typeof (getproperty (Statistics, fn)) <: Type
382
402
return x
383
403
elseif contains (string (fn), r" [^\W 0-9]\w *$" ) # valid variable name
384
404
return :($ (esc (fn)). ($ (args... )))
@@ -439,9 +459,11 @@ function parse_interpolation(var_expr::Union{Expr,Symbol,Number,String};
439
459
elseif @capture (x, variable_Symbol)
440
460
if variable in not_escaped[]
441
461
return variable
442
- elseif hasproperty (Base, variable) && ! (typeof (getproperty (Base, variable)) <: Function )
462
+ elseif hasproperty (Base, variable) && ! (typeof (getproperty (Base, variable)) <: Function ) && ! ( typeof ( getproperty (Base, variable)) <: Type )
443
463
return esc (variable)
444
- elseif @capture (x, variable_Symbol) && hasproperty (Core, variable) && ! (typeof (getproperty (Core, variable)) <: Function )
464
+ elseif hasproperty (Core, variable) && ! (typeof (getproperty (Core, variable)) <: Function ) && ! (typeof (getproperty (Core, variable)) <: Type )
465
+ return esc (variable)
466
+ elseif hasproperty (Statistics, variable) && ! (typeof (getproperty (Statistics, variable)) <: Function ) && ! (typeof (getproperty (Statistics, variable)) <: Type )
445
467
return esc (variable)
446
468
else
447
469
return variable
0 commit comments