mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
syntax-check: ignore all quoted strings in bracket-spacing
Ignore strings with an escaped double quote too. This removes the need for special handling of quotes in the semicolon check.
This commit is contained in:
parent
b9c4bd0c07
commit
711ca22a20
@ -31,8 +31,8 @@ foreach my $file (@ARGV) {
|
|||||||
while (defined (my $line = <FILE>)) {
|
while (defined (my $line = <FILE>)) {
|
||||||
my $data = $line;
|
my $data = $line;
|
||||||
|
|
||||||
# Kill any quoted strongs
|
# Kill any quoted strings
|
||||||
$data =~ s,".*?","XXX",g;
|
$data =~ s,"([^\\\"]|\\.)*","XXX",g;
|
||||||
|
|
||||||
# Kill any C++ style comments
|
# Kill any C++ style comments
|
||||||
$data =~ s,//.*$,//,;
|
$data =~ s,//.*$,//,;
|
||||||
@ -120,14 +120,9 @@ foreach my $file (@ARGV) {
|
|||||||
# errno == EINTR)
|
# errno == EINTR)
|
||||||
# ;
|
# ;
|
||||||
#
|
#
|
||||||
# 3) ";" is inside double-quote, I.e, as part of const string. E.g.
|
|
||||||
# printf("%s", "a ; b\n");
|
|
||||||
while ($data =~ /[^;\s]\s+;/) {
|
while ($data =~ /[^;\s]\s+;/) {
|
||||||
# Inside the double-quote
|
print "$file:$.: $line";
|
||||||
if ($data !~ /"[^"]*\s;/) {
|
$ret = 1;
|
||||||
print "$file:$.: $line";
|
|
||||||
$ret = 1;
|
|
||||||
}
|
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user