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

On parse error, use parser->problem* struct information in exception #34

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

marcinkoziej
Copy link
Contributor

If there is problem with parsing, the libyaml C function returns 0, as well as sets struct parser_s fields: problem, problem_offset, problem_value to problem description, byte offset in source data, and problematic byte value respectively. This PR passes these three information to the message returned in Result.Error(msg).

Copy link
Owner

@avsm avsm left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@avsm avsm merged commit 2febefa into avsm:master Feb 7, 2020
avsm added a commit to avsm/opam-repository that referenced this pull request Feb 7, 2020
CHANGES:

* Fix a memory unsoundness issue with larger files in the
  bindings to libyaml, which fixes spurious errors when parsing
  larger YAML files (avsm/ocaml-yaml#35 marcinkoziej)
* Expose more information about error locations while parsing
  a Yaml file (avsm/ocaml-yaml#34 @marcinkoziej)
* Add test for a large Yaml file (avsm/ocaml-yaml#30 @pmonson711)
* Bump size of internal serialisation buffer in `to_string`
  to 64KB from 16KB (@avsm).
* Switch CI to GitHub Actions (@avsm)
* Depend on dune-configurator in the build to be compatible
  with dune 2.0 and higher (@avsm)
mgree pushed a commit to mgree/opam-repository that referenced this pull request Feb 19, 2020
CHANGES:

* Fix a memory unsoundness issue with larger files in the
  bindings to libyaml, which fixes spurious errors when parsing
  larger YAML files (avsm/ocaml-yaml#35 marcinkoziej)
* Expose more information about error locations while parsing
  a Yaml file (avsm/ocaml-yaml#34 @marcinkoziej)
* Add test for a large Yaml file (avsm/ocaml-yaml#30 @pmonson711)
* Bump size of internal serialisation buffer in `to_string`
  to 64KB from 16KB (@avsm).
* Switch CI to GitHub Actions (@avsm)
* Depend on dune-configurator in the build to be compatible
  with dune 2.0 and higher (@avsm)
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.

2 participants