Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue #22 by restructuring tracking of curly brace nesting. #23

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Fixing issue #22 by restructuring tracking of curly brace nesting. #23

merged 1 commit into from
Jul 21, 2021

Conversation

LazyScholar
Copy link
Contributor

@LazyScholar LazyScholar commented Jul 8, 2021

Fixed the problem of the mutation of strings within the curly braces entries in issue #22.

Note that i did not change the stability of the parser!
Unequal numbers of { and } after the sequence <entry> = will still lead to misbehaviour of the parser (which is not necessarily bad).

using Pkg
Pkg.activate(".")
using BibParser

test = parse_entry(raw"
@Article{2015Nguyen,
  author    = {Vinh Phu Nguyen and Cosmin Anitescu and St{\'{e}}phane P.A. Bordas and Timon Rabczuk},
  journal   = {Mathematics and Computers in Simulation},
  title     = {Isogeometric analysis: An overview and computer implementation aspects},
  year      = {2015},
  month     = {nov},
  pages     = {89--116},
  volume    = {117},
  doi       = {10.1016/j.matcom.2015.05.008},
  publisher = {Elsevier {BV}},
}
")
display(test["2015Nguyen"].authors)
4-element Vector{BibInternal.Name}:
 BibInternal.Name("", "Nguyen", "", "Vinh", " Phu")
 BibInternal.Name("", "Anitescu", "", "Cosmin", "")
 BibInternal.Name("", "Bordas", "", "St{\\'{e}}phane", " P.A.")
 BibInternal.Name("", "Rabczuk", "", "Timon", "")

@Azzaare
Copy link
Member

Azzaare commented Jul 12, 2021

@LazyScholar I have been super busy for a week, so I am currently popping GitHub stuff from the stack. I will go through this either today or tomorrow. Thanks in any case ;)

@LazyScholar
Copy link
Contributor Author

Tiny change to make it more robust in case of error (resetting brace count in case of error).

Copy link
Member

@Azzaare Azzaare left a comment

Choose a reason for hiding this comment

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

The changes seems good to me. All tests pass on Bibliography, StaticWebPages and DocumenterCitations, so it should be fine.

@Azzaare Azzaare merged commit e18bb8d into Humans-of-Julia:master Jul 21, 2021
@LazyScholar LazyScholar deleted the fixBraces branch July 21, 2021 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants