Skip to content

Commit

Permalink
Parse libs in julia directly, without using awk
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Jun 24, 2019
1 parent 6def4d7 commit 6d057d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
22 changes: 14 additions & 8 deletions deps/parselibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function execute(cmd::Cmd)
code = process.exitcode)
end

parsepath = abspath(joinpath(@__DIR__, "..", "etc", "parse_libs.sh"))
libparsepath = abspath(joinpath(@__DIR__, "..", "local", "bin", "libparse"))

library_dir = ""
Expand All @@ -29,12 +28,19 @@ output_filename = abspath(joinpath(@__DIR__, "..", "src", "libraryfuncdictionary
open(output_filename, "w") do outputfile
println(outputfile, "libraryfunctiondictionary = Dict(")
for i in filenames
full_path = joinpath(library_dir, i)
libs = execute(`$parsepath $libparsepath $full_path`)
println(outputfile, """
:$(i[1:end - 4]) => [
$(libs.stdout)],
""")
end
full_path = joinpath(library_dir, i)
libs = execute(`$libparsepath $full_path`)
if libs.stderr != ""
error("from libparse: $(libs.stderr)")
end
libs_splitted = split(libs.stdout,"\n")[4:end-1]
libs_splitted = [ split(i," ") for i in libs_splitted ]
libs_splitted = [ [ j for j in i if j != ""] for i in libs_splitted ]
println(outputfile, ":$(i[1:end - 4]) => [")
for j in libs_splitted
println(outputfile, """[ "$(j[1])", "$(j[3])" ],""")
end
println(outputfile, "],\n")
end
println(outputfile, ")\n")
end
5 changes: 0 additions & 5 deletions etc/parse_libs.sh

This file was deleted.

0 comments on commit 6d057d3

Please sign in to comment.