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

JuliaSyntax says public as an identifier is deprecated #612

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

ericphanson
Copy link
Contributor

This makes JuliaSyntax happier when parsing the code of JuliaInterpreter. Note this doesn't affect normal usage of the package.

Found when testing out https://github.com/ericphanson/ExplicitImports.jl, which relies on source code parsing via JuliaSyntax.

master

julia> JuliaSyntax.parseall(JuliaSyntax.SyntaxNode, read("src/precompile.jl", String); version=v"1.11")
ERROR: ParseError:
# Warning @ line 2:1
module var"#Internal"
public(x::String) = false
└────┘ ── using public as an identifier is deprecated
Stacktrace:
 [1] _parse(rule::Symbol, need_eof::Bool, ::Type{…}, text::String, index::Int64; version::VersionNumber, ignore_trivia::Bool, filename::Nothing, first_line::Int64, ignore_errors::Bool, ignore_warnings::Bool, kws::@Kwargs{})
   @ JuliaSyntax ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:93
 [2] _parse (repeats 2 times)
   @ ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:77 [inlined]
 [3] #parseall#96
   @ ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:143 [inlined]
 [4] top-level scope
   @ REPL[9]:1
Some type information was truncated. Use `show(err)` to see complete types.

PR

julia> JuliaSyntax.parseall(JuliaSyntax.SyntaxNode, read("src/precompile.jl", String); version=v"1.11")
line:col│ tree                                   │ file_name
   1:1  │[toplevel]
   1:1  │  [module]
   1:8  │    [var]
   1:12#Internal
   1:22 │    [block]
   2:1  │      [=]
   2:1  │        [call]
   2:1  │          public_fn
   2:11 │          [::-i]
   2:11 │            x
   2:14 │            String
   2:24false
   5:1  │  [function]
   5:10 │    [call]
   5:10 │      _precompile_
   5:24 │    [block]
   6:5  │      [||]
   6:5  │        [call-i]
   6:5  │          [call]
   6:5  │            ccall
   6:11 │            [quote-:]
   6:12 │              jl_generating_output
   6:34 │            Cint
   6:40 │            [tuple-p]
   6:44==
   6:471
   6:52 │        [return]
   6:59nothing
   7:5  │      [macrocall]
   7:6@interpret
   7:16 │        [call]
   7:16 │          sum
   7:20 │          [call]
   7:20 │            rand
   7:2510
   8:5  │      [=]
   8:5  │        expr
   8:12 │        [quote]
   8:12 │          [block]
   9:9  │            [=]
   9:9  │              [call]
   9:9  │                public_fn
   9:19 │                [::-i]
   9:19 │                  x
   9:22 │                  Integer
   9:33true
  10:9  │            [module]
  10:16 │              Private
  10:23 │              [block]
  11:13 │                [=]
  11:13 │                  [call]
  11:13 │                    private
  11:21 │                    [::-i]
  11:21 │                      y
  11:24 │                      String
  11:34false
  13:9  │            [const]
  13:14 │              [=]
  13:15 │                threshold
  13:270.1
  15:5  │      [for]
  15:8  │        [=]
  15:9  │          [tuple-p]
  15:10 │            mod
  15:15 │            ex
  15:22 │          [call]
  15:22 │            ExprSplitter
  15:35 │            [var]
  15:39#Internal
  15:51 │            expr
  15:56 │        [block]
  16:9  │          [=]
  16:9  │            frame
  16:17 │            [call]
  16:17 │              Frame
  16:23 │              mod
  16:28 │              ex
  17:9  │          [call]
  17:9  │            debug_command
  17:23 │            frame
  17:30 │            [quote-:]
  17:31 │              c
  17:34true

Copy link

codecov bot commented Feb 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.77%. Comparing base (f7138f9) to head (bed1f7d).

Files Patch % Lines
src/precompile.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
- Coverage   85.05%   82.77%   -2.29%     
==========================================
  Files          12       12              
  Lines        2536     2397     -139     
==========================================
- Hits         2157     1984     -173     
- Misses        379      413      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristofferC KristofferC merged commit 397ea70 into JuliaDebug:master Jun 14, 2024
4 of 13 checks passed
@ericphanson ericphanson deleted the eph/public branch June 14, 2024 08:54
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

Successfully merging this pull request may close these issues.

2 participants