-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ authors = ["Matt <[email protected]>"] | |
version = "0.11.5-dev" | ||
|
||
[deps] | ||
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" | ||
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" | ||
|
@@ -29,7 +28,6 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | |
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
|
||
[compat] | ||
ArgParse = "0.6, 1" | ||
BSON = "0.2, 0.3" | ||
CodeTracking = "0.5, 1" | ||
DBInterface = "2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" | ||
Reproduce = "560a9c3a-0b8c-11e9-0329-d39dfcb85ed2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ using Pkg | |
Pkg.activate(".") | ||
|
||
using Reproduce | ||
using ArgParse | ||
|
||
function main() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
# SQL conf files are ini files... | ||
|
||
function parse_ini(f) | ||
blockname = "default" | ||
seekstart(f); _data=Dict() | ||
for line in eachline(f) | ||
# skip comments and newlines | ||
occursin(r"^\s*(\n|\#|;)", line) && continue | ||
|
||
occursin(r"\w", line) || continue | ||
|
||
line = chomp(line) | ||
|
||
# parse blockname | ||
m = match(r"^\s*\[\s*([^\]]+)\s*\]$", line) | ||
if m !== nothing | ||
blockname = lowercase(m.captures[1]) | ||
continue | ||
end | ||
|
||
# parse key/value | ||
m = match(r"^\s*([^=]*[^\s])\s*=\s*(.*)\s*$", line) | ||
if m !== nothing | ||
key::String, values::String = m.captures | ||
if !haskey(_data, blockname) | ||
_data[blockname] = Dict(key => parse_line(values)) | ||
else | ||
merge!(_data[blockname], Dict(key => parse_line(values))) | ||
end | ||
continue | ||
end | ||
|
||
error("invalid syntax on line: $(line)") | ||
end | ||
_data | ||
end |