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

Add source names (via new Stream and SourceSpan classes) and .span() combinator (take 2) #85

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tsani
Copy link

@tsani tsani commented Jan 23, 2025

Following up from #83, here's a new PR:

  • without any CI adjustments
  • using str and bytes subclasses equipped with a source attribute, wrapping the user's input only when a source is provided to .parse() or .parse_partial().

The test suite is virtually unchanged this time around. I took care to keep everything as backwards compatible as possible, including keeping line_info returning a 2-tuple when no source is given.

tsani added 4 commits January 23, 2025 08:15
For backwards compatibility, these are only used to wrap input data
when a source is given to `parse()` or `parse_partial()`.

When a source is given, the following behaviours change:
- the primitive `line_info` parser returns a 3-tuple instead of a
  2-tuple
- ParseError objects will include the source
@tsani tsani force-pushed the feature/source-span-stream-nonbreaking branch from be70346 to 5c5b293 Compare January 23, 2025 13:15
@tsani
Copy link
Author

tsani commented Feb 2, 2025

Hi @spookylukey, I need your help getting this merged -- can you let me know when you'll be able to check out the PR?

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.

1 participant