• Stefan Monnier's avatar
    Add support for new '\_<' and '\_>' regexp operators, matching the · 669fa600
    Stefan Monnier authored
    beginning and ends of symbols.
    * regex.c (enum syntaxcode): Add Ssymbol.
    (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword.
    (re_opcode_t): New opcodes `symbeg' and `symend'.
    (print_partial_compiled_pattern): Print the new opcodes properly.
    (regex_compile): Parse the new operators.
    (analyse_first): Skip symbeg and symend (they match only the empty string).
    (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and
    \sw; `symbeg' is mutually exclusive with \S_ and \Sw.
    (re_match_2_internal): Match symbeg and symend.
regex.c 185 KB