regen/regcharclass.pl: add 'bool' support#24356
Open
chansen wants to merge 1 commit intoPerl:bleadfrom
Open
Conversation
Add a new 'bool' return type for generated macros. Unlike the default 'len' return type which returns the byte length of the match, 'bool' macros return a simple true/false result, which can produce simpler generated code when the match length is not needed. The 'bool' type can be requested by appending '-bool' to a type specifier in the __DATA__ section (e.g. 'UTF8-bool'), or by passing ret_type => 'bool' to make_macro() directly. The 'is_' prefix is retained for bool macros, making it more accurate than for 'len' macros which also use it.
ec3bc26 to
aa51f67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new
'bool'return type for generated macros. Unlike the default'len'return type which returns the byte length of the match,'bool'macros return a simple true/false result, which can produce simpler generated code when the match length is not needed.The 'bool' type can be requested by appending
'-bool'to a type specifier in the DATA section (e.g.'UTF8-bool').The
'is_'prefix is retained for bool macros, making it more accurate than for'len'macros which also use it.