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

Support new Zig's labeled switch/continue #492

Closed
Ev1lT3rm1nal opened this issue Oct 2, 2024 · 2 comments
Closed

Support new Zig's labeled switch/continue #492

Ev1lT3rm1nal opened this issue Oct 2, 2024 · 2 comments

Comments

@Ev1lT3rm1nal
Copy link

So, issue ziglang/zig#21257 was closed, adding support for new syntax for labeled switch/continue statements, which improves performance (somewhat like computed gotos in C). It would be great if re2c added this feature too, although it is currently in Zig's master branch.

@skvadrik
Copy link
Owner

skvadrik commented Oct 2, 2024

I added labelled loops for Zig in 72a7d1b (it hasn't been merged into master yet, but it will be merged soon). This feature is important for correctness, as it would be quite easy to forget about the hidden loop generated by re2c when enclosing it in an outer user-defined loop. It is possible to suppress label generation by setting re2c:label:yyloop = ""; (e.g. if the Zig toolchain in use doesn't have this feature yet).

@Ev1lT3rm1nal
Copy link
Author

This looks awesome! Thank you for updating the library for the upcoming changes.

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

No branches or pull requests

2 participants