@@ -19,6 +19,7 @@ struct walk_until_occurrence{E}
1919end
2020
2121not_enter_indexed_walk = guarded_walk ((x) -> (x isa Expr && x. head == :ref ) || (x isa Expr && x. head == :call && x. args[1 ] == :new ))
22+ not_created_by = guarded_walk ((x) -> (x isa Expr && ! isempty (x. args) && x. args[1 ] == :created_by ))
2223
2324function (w:: walk_until_occurrence{E} )(f, x) where {E <: Tuple }
2425 return walk (x, z -> any (pattern -> @capture (x, $ (pattern)), w. patterns) ? z : w (f, z), f)
@@ -265,7 +266,7 @@ function convert_to_kwargs_expression(e::Expr)
265266end
266267
267268# This is necessary to ensure that we don't change the `created_by` option as well.
268- what_walk (:: typeof (convert_to_kwargs_expression)) = guarded_walk ((x) -> (x isa Expr && x . args[ 1 ] == :created_by ))
269+ what_walk (:: typeof (convert_to_kwargs_expression)) = not_created_by
269270
270271"""
271272 convert_to_anonymous(e::Expr, created_by)
@@ -357,7 +358,7 @@ function add_get_or_create_expression(e::Expr)
357358 return e
358359end
359360
360- what_walk (:: typeof (add_get_or_create_expression)) = guarded_walk ((x) -> (x isa Expr && x . args[ 1 ] == :created_by ))
361+ what_walk (:: typeof (add_get_or_create_expression)) = not_created_by
361362
362363"""
363364 generate_get_or_create(s::Symbol, lhs::Symbol, index::Nothing)
@@ -626,7 +627,7 @@ function convert_tilde_expression(e::Expr)
626627 end
627628end
628629
629- what_walk (:: typeof (convert_tilde_expression)) = guarded_walk ((x) -> (x isa Expr && x . args[ 1 ] == :created_by ))
630+ what_walk (:: typeof (convert_tilde_expression)) = not_created_by
630631
631632"""
632633 options_vector_to_named_tuple(options::AbstractArray)
0 commit comments