summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/makevalues.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/makevalues.pl')
-rwxr-xr-xSource/WebCore/css/makevalues.pl19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/WebCore/css/makevalues.pl b/Source/WebCore/css/makevalues.pl
index 98ca601bc..c0b11e498 100755
--- a/Source/WebCore/css/makevalues.pl
+++ b/Source/WebCore/css/makevalues.pl
@@ -21,6 +21,9 @@
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
+use FindBin;
+use lib "$FindBin::Bin/../bindings/scripts";
+
use Getopt::Long;
use preprocessor;
use strict;
@@ -37,6 +40,8 @@ my %namesHash;
my @duplicates = ();
my @names = ();
+my @lower_names = ();
+
foreach (@NAMES) {
next if (m/(^\s*$)/);
next if (/^#/);
@@ -44,13 +49,13 @@ foreach (@NAMES) {
# Input may use a different EOL sequence than $/, so avoid chomp.
$_ =~ s/[\r\n]+$//g;
# CSS values need to be lower case.
- $_ = lc $_;
if (exists $namesHash{$_}) {
push @duplicates, $_;
} else {
$namesHash{$_} = 1;
}
push @names, $_;
+ push @lower_names, lc $_;
}
if (@duplicates > 0) {
@@ -89,10 +94,10 @@ struct Value;
%%
EOF
-foreach my $name (@names) {
- my $id = $name;
+for my $i (0 .. $#names) {
+ my $id = $names[$i];
$id =~ s/(^[^-])|-(.)/uc($1||$2)/ge;
- print GPERF $name . ", CSSValue" . $id . "\n";
+ print GPERF $lower_names[$i] . ", CSSValue" . $id . "\n";
}
print GPERF << "EOF";
@@ -134,8 +139,7 @@ open HEADER, ">CSSValueKeywords.h" || die "Could not open CSSValueKeywords.h for
print HEADER << "EOF";
/* This file is automatically generated from CSSValueKeywords.in by makevalues, do not edit */
-#ifndef CSSValueKeywords_h
-#define CSSValueKeywords_h
+#pragma once
#include <string.h>
@@ -165,9 +169,6 @@ print HEADER << "EOF";
const char* getValueName(unsigned short id);
} // namespace WebCore
-
-#endif // CSSValueKeywords_h
-
EOF
close HEADER;