Currently a '//****' is matched as an /* comment - disallow a '/' in
front of the '/*' match. An 'extern "C" {' can be split in several lines - allow '\n' as space, and lookout for the rest if partial found.
This commit is contained in:
parent
6beae245ea
commit
08aa87fb57
|
@ -75,7 +75,7 @@ foreach my $file (@files) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# remove C comments
|
# remove C comments
|
||||||
if(s/^(.*?)(\/\*.*?\*\/)(.*)$/$1 $3/s) {
|
if(s/^(|.*?[^\/])(\/\*.*?\*\/)(.*)$/$1 $3/s) {
|
||||||
$again = 1;
|
$again = 1;
|
||||||
next;
|
next;
|
||||||
} elsif(/^(.*?)\/\*/s) {
|
} elsif(/^(.*?)\/\*/s) {
|
||||||
|
@ -101,10 +101,13 @@ foreach my $file (@files) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove extern "C"
|
# Remove extern "C"
|
||||||
if(s/^\s*extern\s+"C"\s+\{//m) {
|
if(s/^\s*extern[\s\n]+"C"[\s\n]+\{//m) {
|
||||||
$extern_c = 1;
|
$extern_c = 1;
|
||||||
$again = 1;
|
$again = 1;
|
||||||
next;
|
next;
|
||||||
|
} elsif(m/^\s*extern[\s\n]+"C"/m) {
|
||||||
|
$lookahead = 1;
|
||||||
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($level > 0)
|
if($level > 0)
|
||||||
|
|
Loading…
Reference in New Issue