diff --git a/src/explore.jl b/src/explore.jl index 17ce05e..d66c688 100644 --- a/src/explore.jl +++ b/src/explore.jl @@ -334,7 +334,7 @@ Returns whether or not an assignment Expr(:(=),...) is assigning to a new functi """ is_function_assignment(ex::Expr)::Bool = ex.args[1] isa Expr && (ex.args[1].head === :call || ex.args[1].head === :where || (ex.args[1].head === :(::) && ex.args[1].args[1] isa Expr && ex.args[1].args[1].head === :call)) -anonymous_name() = Symbol("anon", rand(UInt64)) +anonymous_name() = Symbol("__ExprExpl_anon__", rand(UInt64)) function explore_assignment!(ex::Expr, scopestate::ScopeState)::SymbolsState # Does not create scope diff --git a/test/helpers.jl b/test/helpers.jl index 48226f7..95012fc 100644 --- a/test/helpers.jl +++ b/test/helpers.jl @@ -67,7 +67,7 @@ function testee(expr::Any, expected_references, expected_definitions, expected_f # Anonymous function are given a random name, which looks like anon67387237861123 # To make testing easier, we rename all such functions to anon new_name(fn::FunctionName) = FunctionName(map(new_name, fn.parts)...) - new_name(sym::Symbol) = startswith(string(sym), "anon") ? :anon : sym + new_name(sym::Symbol) = startswith(string(sym), "__ExprExpl_anon__") ? :anon : sym result.assignments = Set(new_name.(result.assignments)) result.funcdefs = let