Skip to content

Commit

Permalink
Fix an issue where the parser storage was emptied before saving an en…
Browse files Browse the repository at this point in the history
…try id
  • Loading branch information
Azzaare committed Jun 25, 2021
1 parent e1dbc66 commit 52d452e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BibParser"
uuid = "13533e5b-e1c2-4e57-8cef-cac5e52f6474"
authors = ["azzaare <[email protected]>"]
version = "0.1.16"
version = "0.1.17"

[deps]
BibInternal = "2027ae74-3657-4b95-ae00-e2f7d55c3e64"
Expand Down
4 changes: 0 additions & 4 deletions src/bibtex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ Storage() = Storage(nothing, Vector{Field}(), "", "")
Make a `BibInternal.Entry` from a completed entry in a parser storage.
"""
function make_entry(storage)
# @info "making entry" storage
d = Dict("_type" => storage.kind)
foreach(field -> push!(d, field.name => field.value), storage.fields)
return d
Expand Down Expand Up @@ -460,7 +459,6 @@ function dump!(parser, char, ::Val{:field_outquote})
parser.task = :field_next
elseif char == rev(parser.storage.delim)
entry = make_entry(parser.storage)
parser.storage = Storage()
push!(parser.content.entries,
parser.storage.key => BibInternal.make_bibtex_entry(parser.storage.key, entry)
)
Expand Down Expand Up @@ -496,7 +494,6 @@ function dump!(parser, char, ::Val{:field_var})
else
acc = split(get_acc(parser), r"[\t\r\n ]+"; keepempty=false)
if length(acc) == 1
# @info "Printing" parser.content.strings[acc[1]] parser.field.value
parser.field.value *= parser.content.strings[acc[1]]
if char == '#'
parser.task = :field_concat
Expand Down Expand Up @@ -563,7 +560,6 @@ function dump!(parser, char, ::Val{:field_out})
parser.task = :field_next
elseif char == rev(parser.storage.delim)
entry = make_entry(parser.storage)
# @show entry
push!(parser.content.entries,
parser.storage.key => BibInternal.make_bibtex_entry(parser.storage.key, entry)
)
Expand Down

0 comments on commit 52d452e

Please sign in to comment.