Skip to content

Commit

Permalink
Merge pull request #19 from JuliaPluto/anon-more-cryptic-name
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Mar 29, 2024
2 parents f5b8ff3 + 8b24abf commit b95a003
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/explore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b95a003

Please sign in to comment.