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

Make public parse similar to export #502

Open
GunnarFarneback opened this issue Sep 5, 2024 · 2 comments
Open

Make public parse similar to export #502

GunnarFarneback opened this issue Sep 5, 2024 · 2 comments

Comments

@GunnarFarneback
Copy link

I expect public to parse similarly to export, but that doesn't seem to be the case.

On Julia 1.11.0-rc3 (and all other versions I have tested):

julia> begin
           export foo
       end

julia> begin
           public foo
       end
ERROR: ParseError:
# Error @ REPL[2]:2:12
begin
    public foo
#          └─┘ ── Expected `end`
Stacktrace:
 [1] top-level scope
   @ none:1

julia> :(export foo)
:(export foo)

julia> :(public foo)
ERROR: ParseError:
# Error @ REPL[4]:1:10
:(public foo)
#        └─┘ ── Expected `)`
Stacktrace:
 [1] top-level scope
   @ none:1

Is this a bug or mistaken expectations?

@pfitzseb
Copy link
Member

pfitzseb commented Sep 5, 2024

public very intentionally is only a valid keyword in toplevel (module) scopes to limit breakage of existing code. export always was a keyword (importantly, for Julia 1.x), so there's no need to be extra careful with existing code.

@LilithHafner
Copy link
Member

We may be able to improve the situation in Julia 1.13 or some-such following a deprecation. Depending on how important backwards compatibility vs consistent parsing of public/export is. Leaving this issue open to track that possibility.

@c42f c42f changed the title Parsing of public Make public parse similar to export Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants