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

Allow pattern-matching on bytearrays #991

Merged
merged 1 commit into from
Aug 3, 2024
Merged

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Aug 2, 2024

Preview

Source code Compiler output
image image
image image
image image
image Screenshot 2024-08-02 at 13 40 14

Remarks

  • Doesn't allow pattern-matching on G1/G2 elements and strings, because the use cases for those is unclear and it adds complexity to the feature.
  • We still parse patterns on G1/G2 elements and strings, but emit an error in those cases.
  • The syntax is the same as for bytearray literals (i.e. supports hex, utf-8 strings or plain arrays of bytes).

@KtorZ KtorZ requested a review from a team as a code owner August 2, 2024 11:41
Comment on lines +6676 to +6669
// Not sure what this extra lambda is or do?
.lambda("???")
.apply(Term::Error.delay());
Copy link
Member Author

Choose a reason for hiding this comment

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

@MicroProofs any idea what this extra lambda is? The generatd name don't even seem to be valid UTF-8 sequence or just some plain newline 🤨. It gets eventually eliminated by the optimizer, but I couldn't make sense of what it is.

@KtorZ KtorZ force-pushed the pattern-match-bytearrays branch 4 times, most recently from 66e42c3 to 85094f7 Compare August 3, 2024 11:33
  - Doesn't allow pattern-matching on G1/G2 elements and strings,
    because the use cases for those is unclear and it adds complexity to
    the feature.

  - We still _parse_ patterns on G1/G2 elements and strings, but emit an
    error in those cases.

  - The syntax is the same as for bytearray literals (i.e. supports hex,
    utf-8 strings or plain arrays of bytes).
@KtorZ KtorZ merged commit 09c065d into main Aug 3, 2024
12 checks passed
@KtorZ KtorZ deleted the pattern-match-bytearrays branch August 3, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ In Next Release
Development

Successfully merging this pull request may close these issues.

1 participant