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

Inconsistent handling of in memory buffers compared to file buffers #611

Open
ogdenpm opened this issue Nov 22, 2023 · 0 comments
Open

Inconsistent handling of in memory buffers compared to file buffers #611

ogdenpm opened this issue Nov 22, 2023 · 0 comments

Comments

@ogdenpm
Copy link

ogdenpm commented Nov 22, 2023

Although flex supports yypush_buffer_state for managing nested include files, this cannot be used consistently for in memory files.

Specifically yy_scan_buffer(), uses yy_switch_to_buffer(), which overwrites the top buffer state, this forces managing of in memory files in separate stack, with specific handling also in <>.

As a suggestion replacing the call to yy_switch_to_buffer() with yypush_buffer_state(), would allow consistent usage of a common stack for all buffers.
An alternative, which would be more consistent with the file buffers, would be to remove the yy_switch_to_buffer() and get the user to use yypush_buffer_state() explicitly.

I haven't submitted a pull request as the changes could break existing code, although this could be managed by a suitable conditional control.

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

1 participant