summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-03-02 19:19:02 -0700
committerKarl Williamson <public@khwilliamson.com>2013-03-08 10:19:16 -0700
commite9cddfae7ec5891690e4f3255cb1e68612ed33a9 (patch)
tree096e2a1db4c673917e7da1d50b994c574bf4efce /regen
parent4a408539bf705f19d7b7e4702dbada468fb9655f (diff)
downloadperl-e9cddfae7ec5891690e4f3255cb1e68612ed33a9.tar.gz
regen/unicode_constants.pl: Convert '-' in names to '_'
Unicode character names can have dashes in them. These aren't accepted in C macro names. Change so both blanks and the hyphen-minus are converted to underscores.
Diffstat (limited to 'regen')
-rw-r--r--regen/unicode_constants.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/regen/unicode_constants.pl b/regen/unicode_constants.pl
index 48b43f440e..6fb12e1659 100644
--- a/regen/unicode_constants.pl
+++ b/regen/unicode_constants.pl
@@ -29,11 +29,11 @@ END
# The data are at the end of this file. A blank line is output as-is.
# Otherwise, each line represents one #define, and begins with either a
-# Unicode character name with the blanks in it squeezed out or replaced by
+# Unicode character name with the blanks and dashes in it squeezed out or replaced by
# underscores; or it may be a hexadecimal Unicode code point. In the latter
# case, the name will be looked-up to use as the name of the macro. In either
-# case, the macro name will have suffixes as listed above, and all blanks will
-# be replaced by underscores.
+# case, the macro name will have suffixes as listed above, and all blanks and
+# dashes will be replaced by underscores.
#
# Each line may optionally have one of the following flags on it, separated by
# white space from the initial token.
@@ -96,7 +96,7 @@ while ( <DATA> ) {
}
$name = $desired_name if $name eq "" && $desired_name;
- $name =~ s/ /_/g; # The macro name can have no blanks in it
+ $name =~ s/[- ]/_/g; # The macro name can have no blanks nor dashes
my $str = join "", map { sprintf "\\x%02X", $_ }
unpack("U0C*", pack("U", hex $cp));