diff options
author | Karl Williamson <khw@cpan.org> | 2020-01-16 16:14:40 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-01-23 15:46:56 -0700 |
commit | daf6caf1ef25ff48f871fa1e53adcefc11bf1d08 (patch) | |
tree | d82154f20ec7d73e8fae65ff09c56458f4c667a5 /utf8.h | |
parent | 5e6ebb121e85847e480061b087a1c6fe206e6c3a (diff) | |
download | perl-daf6caf1ef25ff48f871fa1e53adcefc11bf1d08.tar.gz |
pv_uni_display: Use common fcn; \b mnemonic
This removes the (almost) duplicate code in this function to display
mnemonics for control characters that have them. The reason the two
pieces of code aren't precisely the same is that the other function also
uses \b as a mnemonic for backspace. Using all possible mnemonics is
desirable, so a flag is added for pv_uni_display to now use \b. This is
now by default enabled in double-quoted strings, but not regex patterns
(as \b there means something quite different except in character classes).
B.pm is changed to expect \b.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1009,7 +1009,13 @@ Evaluates to 0xFFFD, the code point of the Unicode REPLACEMENT CHARACTER #define UNI_DISPLAY_ISPRINT 0x0001 #define UNI_DISPLAY_BACKSLASH 0x0002 -#define UNI_DISPLAY_QQ (UNI_DISPLAY_ISPRINT|UNI_DISPLAY_BACKSLASH) +#define UNI_DISPLAY_BACKSPACE 0x0004 /* Allow \b when also + UNI_DISPLAY_BACKSLASH */ +#define UNI_DISPLAY_QQ (UNI_DISPLAY_ISPRINT \ + |UNI_DISPLAY_BACKSLASH \ + |UNI_DISPLAY_BACKSPACE) + +/* Character classes could also allow \b, but not patterns in general */ #define UNI_DISPLAY_REGEX (UNI_DISPLAY_ISPRINT|UNI_DISPLAY_BACKSLASH) #define ANYOF_FOLD_SHARP_S(node, input, end) \ |