If you have this:
( first second ) [[ foo = [ bar ] ]]
Then the foo annotation applies to the ( ) block, *not* the elements
inside the block. This is obviously the only way that makes sense,
since we need to have annotations that apply to a block rather than to
elements (think MYOPTIONS and number-selected).
In some cases, though, we've added in some icky special casing. For
example, in MYOPTIONS, if you do:
( foo bar ) [[ requires = [ baz ] ]]
it treats it like:
( foo [[ requires = [ baz ] ]] bar [[ requires = [ baz ] ]] )
It seems people want even more of these special cases to be introduced.
I don't like the idea, since if it becomes common people will stop
realising that annotations on compound expressions makes sense at all.
How about instead we introduce new syntax?
We could do this, sort of like labels:
(
[[ requires = [ baz ] ]]
foo
bar
)
where the annotation would apply to every non-compound spec following it
inside the same or deeper nesting level. But to avoid ambiguity, you'd
only be able to do that straight after a (, since otherwise it would
apply to the previous spec. Or we could make it different syntactically:
(
[[ requires = [ baz ] ]]:
foo
bar
)
but that looks a bit weird. Or something like:
(
(*) [[ requires = [ baz ] ]]
foo
bar
)
Or... We could do it by annotating the block in a special way:
(
foo
bar
) [[ annotate-children = [ requires = [ baz ] ] ]]
which would require either a slightly smarter parser to handle nested
[ ]s in annotations, which iirc we don't support, or using a different
quote instead:
(
foo
bar
) [[ annotate-children = [ requires = { baz } ] ]]
Discuss!
--
Ciaran McCreesh
signature.asc
Description: PGP signature
_______________________________________________ Exherbo-dev mailing list [email protected] http://lists.exherbo.org/mailman/listinfo/exherbo-dev
