diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2003-11-29 18:02:40 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2003-11-29 18:02:40 +0000 |
commit | 9177ef8953732721b03af161b1c814e6451255d4 (patch) | |
tree | 00a87439f49a4bb16afb170f2f3c71e4069dfafb /lib/Automake/Variable.pm | |
parent | 2e3bd8433ea520d381c687775919753ddd020cd7 (diff) | |
download | automake-9177ef8953732721b03af161b1c814e6451255d4.tar.gz |
* lib/Automake/VarDef.pm (value): Rename as ...
(raw_value): ... this.
(value): New method, strip # and \n.
(dump): Use raw_value.
* lib/Automake/Variable.pm (output): Use raw_value.
(value_as_list): Simplify, now that backslash and comments
are already removed.
* tests/txinfo22.test: Make sure Automake isn't confused
by comments in variables.
Diffstat (limited to 'lib/Automake/Variable.pm')
-rw-r--r-- | lib/Automake/Variable.pm | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 5bdf8e871..d9d097703 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -500,7 +500,7 @@ sub output ($@) $res .= $def->comment; - my $val = $def->value; + my $val = $def->raw_value; my $equals = $def->type eq ':' ? ':=' : '='; my $str = $cond->subst_string; @@ -569,8 +569,6 @@ sub value_as_list ($$;$$) my $onceflag; foreach my $vcond ($self->conditions->conds) { - my $val = $self->rdef ($vcond)->value; - if ($vcond->true_when ($cond)) { # If there is more than one definitions of $var matching @@ -581,16 +579,8 @@ sub value_as_list ($$;$$) if $onceflag; $onceflag = 1; - # Strip backslashes - $val =~ s/\\(\n|$)/ /g; - - foreach (split (' ', $val)) - { - # If a comment seen, just leave. - last if /^#/; - - push (@result, $_); - } + my $val = $self->rdef ($vcond)->value; + push @result, split (' ', $val); } } return @result; @@ -1259,7 +1249,7 @@ arguments: Typically you should do C<$cond->merge ($parent_cond)> to recompute the C<$full_cond> associated to C<@result>. C<&fun_collect> may return a list of items, that will be used as the result of -C<Automake::Variable::traverse_recursively> (the top-level, or it's +C<Automake::Variable::traverse_recursively> (the top-level, or its recursive calls). =cut @@ -1314,8 +1304,8 @@ sub _do_recursive_traversal ($$&&$$) { # If $val is a variable (i.e. ${foo} or $(bar), not a filename), # handle the sub variable recursively. - # (Backslashes between bracklets, before `}' and `)' are required - # only of Emacs's indentation.) + # (Backslashes before `}' and `)' within brackets are here to + # please Emacs's indentation.) if ($val =~ /^\$\{([^\}]*)\}$/ || $val =~ /^\$\(([^\)]*)\)$/) { my $subvarname = $1; |