Skip to content

Commit

Permalink
Rename two variables for ease in debugging and for auto-documentation.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@39581 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
jkeenan committed Jun 16, 2009
1 parent 0587bdf commit e5910dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions t/codingstd/c_indent.t
Expand Up @@ -45,13 +45,13 @@ sub check_indent {

foreach my $path (@_) {
my @source;
open my $fh, '<', $path
open my $IN, '<', $path
or die "Can not open '$path' for reading!\n";
@source = <$fh>;
@source = <$IN>;

my @stack; # for tracking indention level
my $line_cnt = 0;
my $f = undef;
my $block_indent = undef;
my $prev_last_char = '';
my $last_char = '';
my $in_comment = 0;
Expand Down Expand Up @@ -158,21 +158,21 @@ sub check_indent {
if (/^(\s*).*\{\s*$/) {

# note the beginning of a block, and its indent depth.
$f = length($1);
$block_indent = length($1);
next;
}

if (/^\s*([\#\}])/) {

# skip the last line of the func or cpp directives.
$f = undef if ( $1 eq "}" );
$block_indent = undef if ( $1 eq "}" );
next;
}

if ( defined($f) ) {
if ( defined($block_indent) ) {

# first line of a block
if ( $f == 0 ) {
if ( $block_indent == 0 ) {

# first line of a top-level block (first line of a function,
# in other words)
Expand All @@ -185,7 +185,7 @@ sub check_indent {
$c_failed{"$path\n"} = 1;
}
}
$f = undef;
$block_indent = undef;
}

my ($indent) = /^(\s+)/ or next;
Expand Down

0 comments on commit e5910dc

Please sign in to comment.