Skip to content
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

ExpressionExplorer: global stronger than let #1856

Open
fonsp opened this issue Jan 26, 2022 · 2 comments
Open

ExpressionExplorer: global stronger than let #1856

fonsp opened this issue Jan 26, 2022 · 2 comments
Labels
backend Concerning the julia server and runtime bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers

Comments

@fonsp
Copy link
Owner

fonsp commented Jan 26, 2022

We have a couple of combinations of let and global that are not analyzed correctly, like:

let
	a = 1
	global a = 2
end

defines a global a, but Pluto prioritizes the let block.

@test_broken means that we still need to fix it:

@test testee(:(let global a, b = 1, 2 end), [], [:a, :b], [], [])
@test_broken testee(:(let global a = b = 1 end), [], [:a], [], []; verbose=false)
@test testee(:(let global k = 3 end), [], [:k], [], [])
@test_broken testee(:(let global k = r end), [], [:k], [], []; verbose=false)
@test testee(:(let global k = 3; k end), [], [:k], [], [])
@test testee(:(let global k += 3 end), [:k], [:k], [:+], [])
@test testee(:(let global k; k = 4 end), [], [:k], [], [])
@test testee(:(let global k; b = 5 end), [], [], [], [])
@test testee(:(let global x, y, z; b = 5; x = 1; (y,z) = 3 end), [], [:x, :y, :z], [], [])
@test testee(:(let global x, z; b = 5; x = 1; end), [], [:x], [], [])
@test testee(:(let a = 1, b = 2; show(a + b) end), [], [], [:show, :+], [])
@test_broken testee(:(let a = 1; global a = 2; end), [], [:a], [], []; verbose=false)

This is a good first issue, because the ExpressionExplorer is a small, isolated part of Pluto's codebase. For more info about working on this issue, see:

#=
`@test_broken` means that the test doesn't pass right now, but we want it to pass. Feel free to try to fix it and open a PR!
Some of these @test_broken lines are commented out to prevent printing to the terminal, but we still want them fixed.
# When working on ExpressionExplorer:
- Go to runtests.jl and move `include("ExpressionExplorer.jl")` to the second line, so that they run instantly (after loading the helper functions). Be careful not to commit this change.
- If you are fixing a `@test_broken`:
- uncomment that line if needed
- change `@test_broken` to `@test`
- remove `verbose=false` at the end of the line
- If you are fixing something else:
- you can add lots of tests! They run super fast, don't worry about duplicates too much
-fons =#

fonsp added a commit that referenced this issue Jan 26, 2022
@fonsp fonsp added bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers labels Jan 26, 2022
@StarTrooper08
Copy link

Is the following issue still open?

@fonsp
Copy link
Owner Author

fonsp commented Mar 20, 2022

Yes!

@fonsp fonsp added the backend Concerning the julia server and runtime label May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants