Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: recent make(1) and pkgsrc



I've found why the change matters ...

Consider:

.for foo in bar baz
    ... ${foo_list:M${foo}} ...
.endfor

Previously ${foo_list:M${foo}} was changed prior to parsing into
first ${foo_list:Mbar} then ${foo_list:Mbaz}

I wanted to leave the expansion as a variable expansion - in order to
stop it being full make syntax (it was possible to use .for like 'eval'
if you tried hard enough) and to make it be detected in places where
a variable name is needed to trigger syntax parsing.

Without extending the current syntax I decided to use ${:U...} ie the loop
text is substituted because the variable with no name us undefined.
(I've also removed all the places where the said variable could get set!)

This makes the above become ${foo_list:M${:Ubar}} then ${foo_list:M${:Ubaz}}
Unfortunately this gets parsed as "${foo_list}" ":M${" ":Ubar" "}"
which really wasn't intended!
Worse still errors from the variable expansion code are largely unreported
and neither fatal nor generate an error return from make itself.

I think it might be best to count {} and () when looking for the end
of a modifier argument - make does this in a few places, even though
nothing disallows unmatched { and (.  They are, however, unlikely once
inside a variable expansion.

(Note that ${foo{bar} is a request to expand the variable "foo{bar"
maybe such variables shouldn't be allowed either!)

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index