|
Boost-Build : |
Subject: Re: [Boost-build] Upgrading the lexer
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-02-09 16:05:52
AMDG
On 02/09/2018 06:25 AM, Rene Rivera via Boost-build wrote:
> On Fri, Feb 9, 2018 at 7:07 AM, Fabien Chêne via Boost-build <
> boost-build_at_[hidden]> wrote:
>
>>
>> I was wondering if it were possible to extend the bjam grammar so that:
>>
>> rule lib ( name : sources * : requirements * )
>>
>> can be called either (possibly using named arguments coming from the
>> rule definition):
>> lib foo : a.C b.C : requirements <define>XXX ;
>> lib foo : sources a.C b.C : requirements <define>XXX ;
>> lib foo : requirements <define>XXX : sources a.C b.C ;
>> lib sources a.C b.C : name foo : requirements <define>XXX ;
>>
>> What do you think ?
>>
>
I already implemented this in develop. It is implemented
as a library extension rather than a language extension,
so rules must explicitly make use of it:
param.handle-named-params sources requirements
default-build usage-requirements ;
I applied it to all main-target rules.
> IIRC we discussed this some long time ago.. You example usage is not "easy"
> to accomplish in a backward compatible way.
It's true that it isn't perfectly backwards compatible,
but I didn't find any conflicts in Boost. Also, applying
it on a per-rule basis is much safer than baking it into
the language.
> The best alternative that I
> remember was having the argument names be a special format. For example:
>
> lib foo : a.C b.C :requirements <define>XXX ;
> lib foo :sources a.C b.C :requirements <define>XXX ;
> lib foo :requirements <define>XXX :sources a.C b.C ;
> lib :sources a.C b.C :name foo :requirements <define>XXX ;
>
> That is having named arguments be ":<arg-name> arg .." (colon prefixed).
> Which would allow to distinguish them and the list value from all the other
> arguments. How does that sound to you?
>
That syntax conflicts with changing the lexer.
In Christ,
Steven Watanabe
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk