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

Get YamlMark instances for all events in Text.Libyaml #157

Closed
afranchuk opened this issue Sep 27, 2018 · 2 comments

Comments

@afranchuk
Copy link

commented Sep 27, 2018

Having the source location of events within Text.Libyaml is useful for printing error/warning messages related to documents. If the marks are available, the Data.Yaml ParseException constructors could (possibly) include the mark related to the monad failure. I haven't looked in depth into the way the Aeson bindings have been done, so maybe that's not possible. But adding location information to errors in Data.Yaml.Parser should be possible. Having the marks in Text.Libyaml would be the minimum necessary to meet what I need (according to the libyaml documentation, start_mark and end_mark attributes are available for all events).

@snoyberg

This comment has been minimized.

Copy link
Owner

commented Sep 30, 2018

To start: I'd be open to a PR to Text.Libyaml to add new decoding functions which return the YamlMark together with the Event.

@afranchuk

This comment has been minimized.

Copy link
Author

commented Oct 2, 2018

Yeah, I may have a PR in the not-too-distant (1-2 months) future. I don't immediately need the functionality, but I will.

afranchuk pushed a commit to afranchuk/yaml that referenced this issue Oct 8, 2018
Alex Franchuk
Close snoyberg#157. Return start and end marks for all events.
Adds decodeMarked and decodeFileMarked functions.

@snoyberg snoyberg closed this in 91c6658 Oct 10, 2018

snoyberg added a commit that referenced this issue Oct 10, 2018
Merge pull request #159 from afranchuk/master
Close #157. Return start and end marks for all events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.