Closed xR3b0rn closed 2 years ago
Hi @xR3b0rn , we are already working on a --loop-switch
option that would generate code without goto (the primary goal is to add a Rust backend, but the option would also work on C/C++ and Go). See https://github.com/skvadrik/re2c/issues/372 for discussion of the --loop-switch
option. Early results are available on the rust
branch.
Closing, as --loop-switch
is fully implemented and will soon be released.
Can you link the commit?
It's a bit difficult because the implementation for different features appeared in parts:
Generally, see https://github.com/skvadrik/re2c/search?q=loop%2Fswitch&type=commits
When you will integrate this feature in production?
It is already released in version 3.0: release notes and https://github.com/skvadrik/re2c/releases/tag/3.0
Removing
goto
from the code template, would make it possible to use the generated code in C++constexpr
-functions. I know thegoto
s are fundamental part of the concept of this library, however, it could be worth the effort in order to catch some C++ programmers which are looking for a compile-time regex library.