From 02a2391690670d09d4a156ed908fd246f1fce6e2 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 15 Oct 2008 22:02:16 -0700 Subject: [PATCH] --- yaml --- r: 114751 b: refs/heads/master c: 14b111c158116f02c1c862397075e28ac12d65d6 h: refs/heads/master i: 114749: 6660c4215a6ac1fe35ddfff48d404c1609a8943d 114747: c4ffa172c1b7b41f2a5cb695d1983c10c4b664ed 114743: 228a72cac7db1a3e57ad99a19d38bc8a1b008ada 114735: 1a4b9c2062d53b04395c85743e68567e6d41e067 114719: 136de6280b984d252e6197b7a09bb3d72c2cc9ab 114687: b5e6a135573c779a59c8ee52a2b1c8f9dfd54520 v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index cd672d3dfc1b..39f18af7c9ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0d413866c7df63794790518e3fd5890969c206ad +refs/heads/master: 14b111c158116f02c1c862397075e28ac12d65d6 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 114821364c00..1e7d2cdd0c20 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -782,9 +782,9 @@ sub annotate_values { } $type = 'N'; - } elsif ($cur =~ /^(if|while|typeof|__typeof__|for)\b/o) { + } elsif ($cur =~ /^(if|while|for)\b/o) { print "COND($1)\n" if ($dbg_values > 1); - $av_pending = 'N'; + $av_pending = 'E'; $type = 'N'; } elsif ($cur =~/^(case)/o) { @@ -792,7 +792,7 @@ sub annotate_values { $av_pend_colon = 'C'; $type = 'N'; - } elsif ($cur =~/^(return|else|goto)/o) { + } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) { print "KEYWORD($1)\n" if ($dbg_values > 1); $type = 'N'; @@ -1846,6 +1846,11 @@ sub process { $check = 0; } + # Ignore the current line if it is label. + if ($s =~ /^\s*$Ident\s*:/) { + $check = 0; + } + my (undef, $sindent) = line_stats("+" . $s); ##print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s>\n";