I have the following Java code
fun(GUIBundle.getString("Key1"), GUIBundle.getString("Key2"));
I use Perl to parse the source code, to see whether "Key1" and "Key2" is found within $gui_bundle.
while (my $line = <FILE>) {
$line_number++;
if ($line =~ /^#/) {
next;
}
chomp $line;
if ($line =~ /GUIBundle\.getString\("([^"]+)"\)/) {
my $key = $1;
if (not $gui_bundle{$key}) {
print "WARNING : key '$key' not found ($name $line_number)\n";
}
}
}
However, for the way I write the code, I can only verify "Key1". How I can verify "Key2" as well?