Skip to content

Commit

Permalink
Tweak anonrex (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Nov 19, 2019
1 parent f30ab38 commit adef272
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ os:
julia:
- 0.7
- 1.0
- 1.2
- nightly
notifications:
email: false
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
JLD = "4138dd39-2aa7-5051-a626-17a0bb65d9c8"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Pkg", "ColorTypes", "Test", "FixedPointNumbers", "JLD"]
test = ["Pkg", "ColorTypes", "Test", "FixedPointNumbers", "JLD", "SparseArrays"]
2 changes: 1 addition & 1 deletion src/SnoopCompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function extract_topmod(e)
return :unknown
end

const anonrex = r"##\d*#{1,2}\d*" # detect anonymous functions
const anonrex = r"#{1,2}\d+#{1,2}\d+" # detect anonymous functions

function parse_call(line; subst=Vector{Pair{String, String}}(), blacklist=String[])
match(anonrex, line) === nothing || return false, line, :unknown, ""
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pc = SnoopCompile.parcel(reverse!(data[2]))

# issue #29
keep, pcstring, topmod, name = SnoopCompile.parse_call("Tuple{getfield(JLD, Symbol(\"##s27#8\")), Any, Any, Any, Any, Any}")
@test keep == true
@test keep
@test pcstring == "Tuple{getfield(JLD, Symbol(\"##s27#8\")), Int, Int, Int, Int, Int}"
@test topmod == :JLD
@test name == "##s27#8"
Expand Down

2 comments on commit adef272

@timholy
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/5590

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.2 -m "<description of version>" adef2720d6436e0ad2d71531f32d134f21b689f8
git push origin v0.4.2

Please sign in to comment.