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

Define default RE2C_FLAGS #14615

Merged
merged 6 commits into from
Jun 24, 2024
Merged

Define default RE2C_FLAGS #14615

merged 6 commits into from
Jun 24, 2024

Conversation

petk
Copy link
Member

@petk petk commented Jun 20, 2024

The --no-generation-date flag is a common re2c flag used in all re2c invocations. This adds the 2nd optional argument to PHP_PROG_RE2C M4 macro in BC manner to set the default re2c command-line options and sets the default RE2C_FLAGS similarly on Windows.

  • I'll recheck if everything works correctly and matches the php-src workflow, otherwise looks ok already.

The --no-generation-date flag is a common re2c flag used in all re2c
invocations. This adds the 2nd optional argument to PHP_PROG_RE2C M4
macro in BC manner to set the default re2c command-line options and sets
the default RE2C_FLAGS similarly on Windows.
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, even though I m not a lexer expert :)

@petk
Copy link
Member Author

petk commented Jun 20, 2024

Makes sense, even though I m not a lexer expert :)

This flag (--no-genearation-date) only adds the generated date in the top of the file's header comment. Nothing specific to functionality of the generated code here. Other flags are a bit more specific to each file individually otherwise.

@petk
Copy link
Member Author

petk commented Jun 22, 2024

Rechecked and all seems to be working as expected, also that sed command seems to be working from my tests correctly across some exotic shells. Then I think this is ready for merge in the following days.

@petk
Copy link
Member Author

petk commented Jun 24, 2024

I've only appended some CS and help text fixes here. Merge coming up then. This works ok for now. The -g flag is being fixed separately in #11928 because the entire check needs to be refactored a bit further. And it can be also improved on the way in the future as needed. For example, adding -W option when developing can still be done with manual override of the RE2C_FLAGS at the make step: make RE2C_FLAGS=-W and similar.

@petk petk merged commit f3feef8 into php:master Jun 24, 2024
9 of 11 checks passed
@petk petk deleted the patch-re2c-flags branch June 24, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants