<div dir="ltr">On Tue, Aug 27, 2013 at 3:33 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Aug 27, 2013 at 6:27 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>

> On Tue, Aug 27, 2013 at 3:16 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
> wrote:<br>
>><br>
>> Attributes can have a single parameter, as well as multiple (sometimes<br>
>> optional) arguments.<br>
><br>
><br>
> What is the distinction you're drawing between parameters and arguments<br>
> here?<br>
<br>
</div>Parameters are used by GNU-only attributes, arguments everywhere else.<br>
 The distinction is required so that we can properly handle error<br>
reporting when parameters and arguments are both required for the<br>
attribute.<br>
<div class="im"><br>
> If you mean the weirdness in the GNU attribute syntax that we sometimes use<br>
> different parsing rules for the first argument, I don't think modeling that<br>
> as a fundamentally different kind of argument is the right way to proceed.<br>
> Instead, we should look at the list of Args when parsing an attribute<br>
> argument list, to determine how to parse each element.<br>
<br>
</div>I do mean that weirdness, but this has very little to do with parsing.<br>
 The parsing logic is identical to its previous state, except instead<br>
of looking for things which don't have params and bailing out, we look<br>
for the much smaller list of things which do have params and include<br>
them.<br>
<br>
I dislike the notion of looking at the first argument in the list and<br>
essentially guessing whether it's a parameter.</blockquote><div><br></div><div>It would not be a guess. We would look at the kind of the argument, and parse an entity of that kind.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That makes semantic<br>
checking basically impossible to generalize because we don't know<br>
whether we should be looking for a parameter or not.  FWIW, this<br>
caused (what I think are) bugs that I rectified in the test cases once<br>
the logic was made more explicit.</blockquote><div><br></div><div>The parameter/argument thing is a bogus distinction that we made up. Under the GNU syntax, the first argument sometimes has different parsing rules, that's all. The right thing to do is to change AttributeList to represent the "parameter" as just another argument, not to make the distinction here more ingrained.</div>
</div></div></div>