JuliaVariables.jl icon indicating copy to clipboard operation
JuliaVariables.jl copied to clipboard

The implementation of NameResolution.jl for Julia language.

Results 11 JuliaVariables.jl issues
Sort by recently updated
recently updated
newest added

`x` should be global in both of these: ```julia julia> solve_from_local(:(x[] = 1)) :($(Expr(:scoped, (bounds = Var[@local x], freevars = Var[], bound_inits = Symbol[]), :((@local x)[] = 1)))) julia> solve_from_local(:(setindex!(x,...

Closes https://github.com/JuliaStaging/JuliaVariables.jl/issues/28 For demonstration, I temporarily added the `@show` line here: ```julia function local_var_to_var(var::LocalVar)::Var unique_id = Symbol(var.sym, "_", id[var.sym]) @show unique_id # Remove after demo Var(var.sym, unique_id, var.is_mutable[], var.is_shared[], false)...

For code rewriting, it can be really useful to have more to distinguish a variable than just its name. For example, we might want to do things like "rename all...

```julia ex = :(let x = y; x + y end) solve_from_local!(ex; custom_locals = [:y]) ```

To allow users to define their own scoping rules with builtin rules.

https://github.com/thautwarm/JuliaVariables.jl/blob/b66db8e1f1efc84406b073ad2a8c03efe34c6b62/src/JuliaVariables.jl#L233 This is relevant to https://github.com/thautwarm/GeneralizedGenerated.jl/issues/44 . It seems that at least `Expr` and `Symbol` can have scopes, while a literal, or `QuoteNode` cannot. I'll update the code once I...

It seems that macro arguments are treated as globals (see `@global x`) ```julia julia> solve(:(macro f(x) end)) :(macro (@global f)(@global x) #= REPL[12]:1 =# end) ``` Compare this to a...

It seems that "type aliases" are not handled correctly at the moment: ```julia julia> solve(:(X{T} = Y{T, S})) :((@global X){@global T} = (@global Y){@global T, @global S}) ``` I suppose...

Hi, thanks for a super useful package. Unfortunately, I think I find a bug ```julia julia> solve(:(struct S x end)) :(struct @global S #= REPL[11]:2 =# @global x end) ```...

```julia julia> solve_from_local(quote x = :(x + 1) end) quote #= REPL[6]:2 =# @x = $(Expr(:quote, :((@global +)(@x, 1)))) end ``` `:(x+1)` shouldn't be analysed. The things can be analysed...