You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.
In JuliaCI/Coverage.jl#36, I'm trying to leverage this to improve our accounting for code coverage. The biggest challenge is keeping track of line numbers appropriately. Here's a good example of the challenge (save this to a file /tmp/testparser.jl):
f1(x) =2x
ifisdefined(:f1)
f2(x) =3x
endf3(x) =4x
Here's what comes from parsing this file:
julia> io =open("/tmp/testparser.jl")
IOStream(<file /tmp/testparser.jl>)
julia> ast = Parser.parse(io)
:(f1(x) =begin# none, line 1: # we're at line 12x
end)
julia> ast = Parser.parse(io)
:(ifisdefined(:f1) # line 2:f2(x) =begin# none, line 2: # we're at line 2+1 = 33x
endend)
julia> ast = Parser.parse(io)
:(f3(x) =begin# none, line 1: # we're at line 1+3 = 4?4x
end)
Because the end doesn't get its own line number, it doesn't seem possible to keep track of the line number just by looking for :line exprs or LineNumberNodes.
The text was updated successfully, but these errors were encountered:
I want to preserve compatibility with the scheme parser. We could have the parse function take a line parameter to initialize the parse state, the reported line number would be offset from this based on the input stream. I think this is more of a limitation of how we do line numbers in general for Julia.
In JuliaCI/Coverage.jl#36, I'm trying to leverage this to improve our accounting for code coverage. The biggest challenge is keeping track of line numbers appropriately. Here's a good example of the challenge (save this to a file
/tmp/testparser.jl
):Here's what comes from parsing this file:
Because the
end
doesn't get its own line number, it doesn't seem possible to keep track of the line number just by looking for:line
exprs orLineNumberNode
s.The text was updated successfully, but these errors were encountered: