Index: t/codingstd/c_indent.t =================================================================== --- t/codingstd/c_indent.t (revision 42801) +++ t/codingstd/c_indent.t (working copy) @@ -123,10 +123,10 @@ pop @{ $state{stack} }; next; } - next unless @{ $state{stack} }; if ( $line =~ m/^\s*\#(\s*)(.*)/) { + next unless @{ $state{stack} }; my ($prespace, $condition) = ($1,$2); next if ($line =~ m/ASSERT_ARGS_/); # autogenerated by headerizer my $indent = q{ } x (@{ $state{stack} }); @@ -145,12 +145,14 @@ # probably overkill for this task. For now we just check the # first line of a function, and assume that more likely than not # indenting is consistent within a func body. - if ($line =~ /^(\s*).*\{\s*$/) { + if ($line =~ /^(\s*)(.*)\{\s*$/) { - my $prespace = $1; - # note the beginning of a block, and its indent depth. - $state{bif} = length($prespace); - next; + if ($2 ne '%') { # ignore yacc/lex blocks + my $prespace = $1; + # note the beginning of a block, and its indent depth. + $state{bif} = length($prespace); + next; + } } if ($line =~ /^\s*([\#\}])/) { @@ -161,7 +163,7 @@ next; } - if ( defined($state{bif}) ) { + if ( defined($state{bif}) and $line !~ m{^\s*/\*} ) { # first line of a block if ( $state{bif} == 0 ) {