diff options
| author | fukachan <fukachan> | 2002-07-22 09:40:07 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-07-22 09:40:07 +0000 |
| commit | 9a70bf27bf43d45355a3af9bf581a0a3760ec19d (patch) | |
| tree | ec78faa6d02d94d6d07a6d252a9d6132b9189eda /fml | |
| parent | 86113829f346f168a93ae9b292f405c6d15ef92b (diff) | |
| download | fml8-9a70bf27bf43d45355a3af9bf581a0a3760ec19d.tar.gz fml8-9a70bf27bf43d45355a3af9bf581a0a3760ec19d.tar.bz2 fml8-9a70bf27bf43d45355a3af9bf581a0a3760ec19d.zip | |
expand READ_ONLY($array) -> an array of READ_ONLY($array[$i])
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Config.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm index aabb8a3b..d0b0a0c8 100644 --- a/fml/lib/FML/Config.pm +++ b/fml/lib/FML/Config.pm @@ -3,7 +3,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Config.pm,v 1.63 2002/07/02 03:50:51 fukachan Exp $ +# $FML: Config.pm,v 1.64 2002/07/14 23:02:22 fukachan Exp $ # package FML::Config; @@ -595,6 +595,8 @@ sub _expand_variables $config->{$x} =~ s/\$([a-z_]+[a-z0-9])/(defined $config->{$1} ? $config->{$1} : '')/ge; + __expand_special_macros( $config, $x ); + last EXPANSION_LOOP if $config->{ $x } !~ /\$/o; last EXPANSION_LOOP if $org eq $config->{ $x }; @@ -610,6 +612,28 @@ sub _expand_variables } +# Descriptions: expand READ_ONLY(a b c) -> READ_ONLY(a) READ_ONLY(b) ... +# Arguments: OBJ($config) STR($x) +# Side Effects: rewrite $config +# Return Value: none +sub __expand_special_macros +{ + my ( $config, $x ) = @_; + + return unless defined $config; + return unless defined $x; + return unless defined $config->{ $x }; + + if ($config->{ $x } =~ /READ_ONLY\((.*)\)/) { + my (@x) = split(/\s+/, $1); + my $v = ''; + for my $key (@x) { $v .= " READ_ONLY($key)";} + + $config->{ $x } =~ s/READ_ONLY\((.*)\)/$v/; + } +} + + =head2 C<expand_variable_in_buffer($rbuf)> expand $varname to $config->{ varname } in C<$rbuf>. |
