aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorStefan Monnier2023-09-29 17:39:10 -0400
committerStefan Monnier2023-09-29 17:39:10 -0400
commite61a03984335b4ffb164280b2df80668b2a92c23 (patch)
tree561cddddaf41c7ea3f44466f7881b5f927f69173 /java
parent6e44d6e18438ea2665ae6252a6ec090963dd7e42 (diff)
downloademacs-e61a03984335b4ffb164280b2df80668b2a92c23.tar.gz
emacs-e61a03984335b4ffb164280b2df80668b2a92c23.zip
regex.c: Consolidate the two analysis functions
We currently have two functions that analyze the bytecode to try and apply optimizations: `analyze_first` and `mutually_exclusive_p`. Extract the common code between them into a new function `forall_firstchar`, and then rewrite the old ones on top of that one. Along the way, we get slightly better analyses that reverts the recent de-optimizations but without re-introducing the corresponding bugs. * src/regex-emacs.c (forall_firstchar_1, forall_firstchar): New functions. (analyze_first_old): Rename from `analyze_first`. (struct anafirst_data): New struct. (analyze_first_fastmap, analyze_first_null): New functions. (analyze_first): Rewrite to use `forall_firstchar` with those two functions. Take a `bufp` rather than a `multibyte` arg. (regex_compile, re_compile_fastmap): Adjust calls accordingly. (struct mutexcl_data): New struct. (mutually_exclusive_one): New function. (mutually_exclusive_p): Rewrite to use `forall_firstchar` with that function.
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions