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

Turn off re2c:eof = 0 #254

Closed
terpstra opened this issue Aug 5, 2019 · 3 comments

Comments

@terpstra
Copy link

commented Aug 5, 2019

I have a .re file with several different lexers in it.

Some of them use the new 're2c:eof = 0' feature. However, some of them use the 'sentinel method' with no need to YYFILL. As far as I can tell, once you turn on 're2c:eof = 0', it stays on for the rest of the file. I worked around this by putting all my 'sentinel method' lexers at the top of the file and then all the 'EOF rule' parsers at the bottom.

If there is already a method 'unset' EOF mode, it should be documented somewhere. If there is not, it should be added.

skvadrik added a commit that referenced this issue Aug 5, 2019

Allow to reset 're2c:eof' configuration.
The ability to reset this configuration is necessary in order to be able to
mix re2c blocks that use EOF rule and blocks that don't.

This fixes bug #254: "Turn off re2c:eof".
@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 5, 2019

All true, well spotted!

I added the ability to reset re2c:eof by setting it to a negative value -1 (2715620), and updated the manpage and online docs (search for re2c:eof description among other configurations).

@terpstra

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

Great!

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2019

Released re2c-1.2.1 with the fix. Closing the bug.

@skvadrik skvadrik closed this Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.