insert space before if
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 19 Aug 2009 16:24:43 +0000 (16:24 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 19 Aug 2009 16:24:43 +0000 (16:24 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1277 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Parser.pm
t/conf/normalize/sub.pl

index 5d2e72f..d459a90 100644 (file)
@@ -333,7 +333,7 @@ sub _parse_source {
 
                        $Element->isa('PPI::Token::Word') or return '';
 
-                       if ( $Element->content eq 'sub' ) {
+                       if ( $Element->content =~ m{^(sub|if)$} ) {
                                # repair demage done by prune of whitespace
                                $Element->insert_after( PPI::Token::Whitespace->new(' ') );
                                return '';
index 62dec98..44acfce 100644 (file)
@@ -17,5 +17,5 @@ sub test($) {
 }
 
 foreach my $a ( 1,2,3 ) {
-       test($a);       
+       test($a) if length($a) > 0;
 }