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

Handle KLLVM.StringBuffer.contents as bytes and enable unicode tests in String contructors #4567

Closed
wants to merge 1 commit into from

Conversation

Robertorosmaninho
Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho commented Aug 1, 2024

Blocked on #1126.
Related to:

This PR aims to support the new feature introduced in #1126 that makes KLLVM.StringBuffer.contents returns bytes. To ensure the symmetric behavior, we should also construct the KLLVM.StringBuffer object with bytes. To ensure this feature works properly, we're using raw_unicode_escape encoding to pass and retrieve the result.

This can be used as a first step in a new attempt to support Unicode!

@Robertorosmaninho
Copy link
Collaborator Author

These commits will be squashed and committed to #4565 as they block that PR and depend on the changes there. However, as this changes important parts of PyK, I would like your thoughts about it @tothtamas28, @gtrepta, and @Scott-Guest.

I've tested it also on KEVM, and everything looks good there

@Robertorosmaninho
Copy link
Collaborator Author

Robertorosmaninho commented Aug 7, 2024

@tothtamas28 and @Scott-Guest, can you please review the PR again? If you approve it, I'll cherry-pick the commit and put it in #4565 so the tests pass as expected there, and we can merge both changes.
The modification that makes StringPattern.contents return bytes is there and it's blocked by this change.

pyk/src/tests/integration/test_string.py Outdated Show resolved Hide resolved
pyk/src/tests/integration/test_string.py Outdated Show resolved Hide resolved
Modifying string tests to only test non-unicode string for bindings.
Decoding `pattern.contents` in `test_string`
@Robertorosmaninho Robertorosmaninho force-pushed the Fix-Bytes-KLLVM-PArsing branch from 48d7fec to 39a44a9 Compare August 7, 2024 19:45
@Robertorosmaninho
Copy link
Collaborator Author

Closing as this modification was merged with #4565

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.

4 participants