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

SR-2301 - Fix XMLParser #700

Merged
merged 4 commits into from
Nov 29, 2016
Merged

Conversation

KingOfBrian
Copy link

@KingOfBrian KingOfBrian commented Oct 28, 2016

XMLParser was completely broken, even though the bridging was available and things are 99% complete. This PR adds a number of tests to show the problem, and fixes a number of issues:

  • The contract was different from Foundation. Methods were not optional and NSError was still in use.
  • There was an incorrect nullability annotation on the C Shim between libxml2. This was causing a crash when processing namespaces.
  • The bomChunk parsing was broken. There was no way for the parser to actually be constructed.
  • Some of the logic as to what values get reported to startElement and endElement I believe was wrong. I had trouble fixing the logic for the nullability changes and decided that it was easier to re-write things.

There's a lot of code in this file hasn't been spruced up in a while and doesn't follow many swift best practices. I'm not sure what the policy was on cleaning things up was, so I tried to just focus on my bugs. However I would be surprised if a cleanup didn't find a few more issues.

Brian King

@parkera
Copy link
Contributor

parkera commented Oct 28, 2016

@swift-ci please test

@parkera
Copy link
Contributor

parkera commented Nov 29, 2016

Let's get this in.

@parkera
Copy link
Contributor

parkera commented Nov 29, 2016

@swift-ci please test and merge

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.

3 participants