Skip to content

Conversation

@wbangna
Copy link
Contributor

@wbangna wbangna commented Nov 3, 2022

This PR extends the usage of the function ser_context::position() to be usable for other elements reported to the visitor (e.g. start_array, end_array etc.).
It also introduces the function ser_context::end() which reports the end position of the currently parsed element.

To test the new functionality use the following test program: https://gist.github.com/wbangna/03bc656af36c50d6479f166f34981682

I did not change the documentation yet as I am not sure if the functionality changes of ser_context::position() will be accepted.

@danielaparker
Copy link
Owner

Thanks for contributing. Could you rename end() to end_position()? Otherwise I'm fine with this request.

- position() also reports start of elements that are not values (e.g. "{" or "[")
- end_position() reports the end of the element
@wbangna wbangna force-pushed the ser_context_with_end branch from 07c4df2 to 41ad21d Compare November 4, 2022 07:09
@wbangna
Copy link
Contributor Author

wbangna commented Nov 4, 2022

Great!
I just renamed the end() function and added the documentation for ser_context.
Thank you!

@danielaparker danielaparker merged commit 20d3af8 into danielaparker:master Nov 4, 2022
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