Avoid using named capture groups in heredoc code for oldperl compatability.
authorJoey Hess <joey@kitenet.net>
Sat, 30 Jul 2011 17:59:54 +0000 (19:59 +0200)
committerJoey Hess <joey@kitenet.net>
Sat, 30 Jul 2011 18:12:33 +0000 (20:12 +0200)
Also reordered heredoc part of regexp for consistency.

IkiWiki.pm
debian/changelog

index 8a66dcedb4b0cb356aa02d1b9b9687fc1226916b..637d56c7302b95d350651cc3516738a739a43df9 100644 (file)
@@ -1394,7 +1394,8 @@ sub preprocess ($$$;$$) {
                                |
                                        '''(.*?)'''     # 4: triple-single-quote
                                |
-                                       <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # 5, 6: heredoc'd value.
+                                       <<([a-zA-Z]+)\n # 5: heredoc start
+                                       (.*?)\n\5       # 6: heredoc value
                                |
                                        (\S+)           # 7: unquoted value
                                )
@@ -1417,8 +1418,8 @@ sub preprocess ($$$;$$) {
                                elsif (defined $7) {
                                        $val=$7;
                                }
-                               elsif (defined $+{heredoc}) {
-                                       $val=$+{heredoc};
+                               elsif (defined $6) {
+                                       $val=$6;
                                }
 
                                if (defined $key) {
@@ -1488,9 +1489,10 @@ sub preprocess ($$$;$$) {
                                                |
                                                "[^"]*?"        # single-quoted value
                                                |
-                                               <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # heredoc'd value.
+                                               '''.*?'''       # triple-single-quote
                                                |
-                                               '''.*?''' # triple-single-quoted value
+                                               <<([a-zA-Z]+)\n # 5: heredoc start
+                                               (?:.*?)\n\5     # heredoc value
                                                |
                                                [^"\s\]]+       # unquoted value
                                        )
@@ -1515,9 +1517,10 @@ sub preprocess ($$$;$$) {
                                                |
                                                "[^"]*?"        # single-quoted value
                                                |
-                                               '''.*?'''       # triple-single-quoted value
+                                               '''.*?'''       # triple-single-quote
                                                |
-                                               <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # heredoc'd value.
+                                               <<([a-zA-Z]+)\n # 5: heredoc start
+                                               (?:.*?)\n\5     # heredoc value
                                                |
                                                [^"\s\]]+       # unquoted value
                                        )
index 66389f3fb01d62bf35afbeabee262c398b5da0cd..193600f454c6c8d69bf2cf6eff14ae4c60e11ab5 100644 (file)
@@ -13,6 +13,7 @@ ikiwiki (3.20110716) UNRELEASED; urgency=low
     regexp blowup.
   * Fix escaping of html entities in permalinks.
   * Fix escaping of html entities in tag names.
+  * Avoid using named capture groups in heredoc code for oldperl compatability.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 19 Jul 2011 11:22:52 -0400