projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8028d97
)
added support for here-docs and ''' in parameters.
author
Timo Paulssen
<timonator@perpetuum-immobile.de>
Sat, 30 Apr 2011 19:58:43 +0000
(21:58 +0200)
committer
Joey Hess
<joey@kitenet.net>
Fri, 13 May 2011 15:24:15 +0000
(11:24 -0400)
IkiWiki.pm
patch
|
blob
|
history
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index fdf3e5c471441a8af1b5605ea12213177df4b757..8136a7c4b67cff3ead2bae127b8020559111e132 100644
(file)
--- a/
IkiWiki.pm
+++ b/
IkiWiki.pm
@@
-1392,10
+1392,14
@@
sub preprocess ($$$;$$) {
|
"([^"]*?)" # 3: single-quoted value
|
|
"([^"]*?)" # 3: single-quoted value
|
- (\S+) # 4: unquoted value
+ '''(.*?)''' # 4: triple-single-quote
+ |
+ <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # 5, 6: heredoc'd value.
+ |
+ (\S+) # 7: unquoted value
)
(?:\s+|$) # delimiter to next param
)
(?:\s+|$) # delimiter to next param
- }sgx) {
+ }
m
sgx) {
my $key=$1;
my $val;
if (defined $2) {
my $key=$1;
my $val;
if (defined $2) {
@@
-1410,6
+1414,12
@@
sub preprocess ($$$;$$) {
elsif (defined $4) {
$val=$4;
}
elsif (defined $4) {
$val=$4;
}
+ elsif (defined $7) {
+ $val=$7;
+ }
+ elsif (defined $+{heredoc}) {
+ $val=$+{heredoc};
+ }
if (defined $key) {
push @params, $key, $val;
if (defined $key) {
push @params, $key, $val;
@@
-1478,6
+1488,10
@@
sub preprocess ($$$;$$) {
|
"[^"]*?" # single-quoted value
|
|
"[^"]*?" # single-quoted value
|
+ <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # heredoc'd value.
+ |
+ '''.*?''' # triple-single-quoted value
+ |
[^"\s\]]+ # unquoted value
)
\s* # whitespace or end
[^"\s\]]+ # unquoted value
)
\s* # whitespace or end
@@
-1501,6
+1515,10
@@
sub preprocess ($$$;$$) {
|
"[^"]*?" # single-quoted value
|
|
"[^"]*?" # single-quoted value
|
+ '''.*?''' # triple-single-quoted value
+ |
+ <<(?<start>[a-zA-Z]+)\n(?<heredoc>.*?)\n\k<start> # heredoc'd value.
+ |
[^"\s\]]+ # unquoted value
)
\s* # whitespace or end
[^"\s\]]+ # unquoted value
)
\s* # whitespace or end