• Michal Nazarewicz's avatar
    Get rid of re_set_syntax · 04d96eca
    Michal Nazarewicz authored
    Instead of using a global variable for storing regex syntax, pass it
    to re_compile_pattern.  This is only enabled when compiling Emacs (i.e.
    ‘#ifdef emacs’).
    
    * src/regex.h (re_set_syntax): Declare only #ifndef emacs.
    (re_compile_pattern): Now takes syntax argument #ifdef emacs.
    
    * src/regex.c (re_syntax_options): Define only #ifndef emacs.
    (re_compile_pattern): Use the new syntax argument #ifdef emacs.
    
    * src/search.c (compile_pattern_1): Don’t use re_set_syntax and
    instead pass syntax to re_compile_pattern directly.
    04d96eca
regex.h 23 KB