[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
[WebKit-https.git] / Source / WebCore / extract-localizable-strings.pl
index b2c6939..625f202 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (C) 2006, 2007, 2009, 2010, 2013 Apple Inc. All rights reserved.
 #
@@ -43,6 +43,7 @@
 # The exceptions file has a list of strings in quotes, filenames, and filename/string pairs separated by :.
 
 use strict;
+use warnings;
 use File::Compare;
 use File::Copy;
 use FindBin;
@@ -132,6 +133,7 @@ for my $file (sort @files) {
     my $UIString;
     my $key;
     my $comment;
+    my $mnemonic;
     
     my $string;
     my $stringLine;
@@ -188,6 +190,9 @@ handleString:
                         # FIXME: Validate UTF-8 here?
                         $key = $string;
                         $expected = ",";
+                    } elsif (($macro =~ /WEB_UI_STRING_WITH_MNEMONIC$/) and !defined $mnemonic) {
+                        $mnemonic = $string;
+                        $expected = ",";
                     } elsif (!defined $comment) {
                         # FIXME: Validate UTF-8 here?
                         $comment = $string;
@@ -240,12 +245,13 @@ handleString:
                     emitError($file, $., "found $token but expected $expected");
                     $expected = "";
                 }
-                if (($token =~ /(WEB_)?UI_STRING(_KEY)?(_INTERNAL)?$/) || ($token =~ /WEB_UI_NSSTRING$/)) {
+                if (($token =~ /(WEB_)?UI_STRING(_KEY)?(_INTERNAL)?$/) || ($token =~ /WEB_UI_NSSTRING$/) || ($token =~ /WEB_UI_STRING_WITH_MNEMONIC$/) || ($token =~ /WEB_UI_CFSTRING$/)) {
                     $expected = "(";
                     $macro = $token;
                     $UIString = undef;
                     $key = undef;
                     $comment = undef;
+                    $mnemonic = undef;
                     $macroLine = $.;
                 } elsif ($token eq "(" or $token eq "[") {
                     ++$nestingLevel if defined $nestingLevel;