Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
536 B

  1. # Process parentheses.
  2. # An unmatched open paren provides an alternate indent position;
  3. # we first remove all matched pairs, then look at what's left
  4. my $saveLine = $_;
  5. while (s/\(([^()]*)\)/ $1 /g) {};
  6. /^(.*)\(/ && ($altIndentPos = length($1)+1);
  7. my $parenDelta = s/(\()/$1/g - s/(\))/$1/g;
  8. $_ = $saveLine;
  9. ....
  10. # Switch off alternate indent position
  11. if ($parenDelta < 0) {
  12. $altIndentPos = -1;
  13. }