aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-07-30 19:59:54 +0200
committerJoey Hess <joey@kitenet.net>2011-07-30 20:12:33 +0200
commitd2cf71687665f4237c73954892f7bc6a611afbba (patch)
treeafe0bf14e6f6852eb59dc6205daa350033011939 /IkiWiki.pm
parent739c62613151ce58ced6e94af60a85a613fee931 (diff)
downloadikiwiki-d2cf71687665f4237c73954892f7bc6a611afbba.tar
ikiwiki-d2cf71687665f4237c73954892f7bc6a611afbba.tar.gz
Avoid using named capture groups in heredoc code for oldperl compatability.
Also reordered heredoc part of regexp for consistency.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 8a66dcedb..637d56c73 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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
)