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

cdata codegen with eager outputs, part 2 #32

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

silentbicycle
Copy link

  • Add an EXPENSIVE_CHECKS wrapper to fsm_exec, this means minutes vs. HOURS for this build.
  • Fix the codegen handling for AMBIG_MULTI vs. AMBIG_NONE, etc. This fixes a warning and bad bracing.

Normally this doesn't matter, because the expected API use is based on
code generation rather than heavily using `fsm_exec`, but we are
calling fsm_exec to check that the combined DFAs still match all of
their original regexes. This is very expensive. (It similarly gets
very cumbersome during fuzzing.)

A better way to address this long-term is tracking on the FSM whether
it's result of fsm_determinise (and optionally fsm_minimise), and
updating that info to indicate that it reverted to an NFA if any
other operations modify the FSM states/edges. That's outside the scope
of this PR though.
Previously `AMBIG_NONE` was missing the closing curly brace but
the other variants added it. All three need it, so it's cleaner
to move it outside the switch case.

Also, make AMBIG_NONE output `(void)endid_base;`, because otherwise it
leads to a warning about the unused variable. (It's probably not worth
complicating the output template further to avoid using it in the
first place here.)
@silentbicycle silentbicycle marked this pull request as ready for review October 14, 2024 15:17
@silentbicycle silentbicycle merged commit adf2f2c into main Oct 14, 2024
522 checks passed
@silentbicycle silentbicycle deleted the sv/add-cdata-codegen-with-eager-outputs-part-2 branch October 14, 2024 15:25
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

Successfully merging this pull request may close these issues.

2 participants