-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can Var
have an id
field?
#28
Comments
It's possible, as JuliaVariables.jl/src/JuliaVariables.jl Line 479 in 67091c1
the same NOTE that the global variables and keyword arguments cannot be refactored by JuliaVariables. |
Ok, I have at least a start on this. I'll PR soon to see what you think. |
Hmm, maybe |
Sorry, I think your modification to Fortunately, You can use either struct Var
name::Symbol
unique_id:: Union{Ref{Bool}, Nothing} # nothing when it's a global variable
is_mutable::Bool
is_shared::Bool
is_global::Bool
end |
Ok, I think I understand, but just to be sure... For two |
@cscherrer Yes.. Sorry for such redundancy, Maybe I should make |
That would make sense, but it's not such a big deal either way. I think I'd refactor it this way if you think you'll be extending it more, since that could be easier to build on. But if it's basically done I'd maybe not worry about it. Up to you of course :) |
Ok, I've updated the PR. Also, what do you think of allowing another method passing an |
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 occurrences of this
x
toy
" or even "convert this AST to SSA style".This could be very easy if JuliaVariables could be extended so
Var
has an additionalid
field. Do you have how difficult that would be to add? If it would be a major rewrite I could try to find other ways of getting to this.The text was updated successfully, but these errors were encountered: