We have several “collection” nodes, and some of them are called ThingList, while others are called Things. In my understanding, the rule of thumb to decide which to use was: If it’s a “complete” element, with surrounding tokens (if appropriate), then it’s a Things – e. g., PositionalArguments and NamedArguments include the surrounding parentheses / braces. On the other hand, if the surrounding elements are missing and/or the list is “auxiliary”, it’s a ThingList – e. g., ArgumentList is a comma-separated list of arguments, without surrounding tokens, used by both PositionalArguments and NamedArguments. Another example is TypeList, which is used for tuple types and callable types.
The third ThingList we currently have is ConditionList – but this does include the surrounding parentheses! Shouldn’t it be called Conditions then?
(This naming comes largely from the spec, which also has the same three ThingLists. @gavinking was this distinction intentional, or is it random?)
We have several “collection” nodes, and some of them are called
ThingList
, while others are calledThings
. In my understanding, the rule of thumb to decide which to use was: If it’s a “complete” element, with surrounding tokens (if appropriate), then it’s aThings
– e. g.,PositionalArguments
andNamedArguments
include the surrounding parentheses / braces. On the other hand, if the surrounding elements are missing and/or the list is “auxiliary”, it’s aThingList
– e. g.,ArgumentList
is a comma-separated list of arguments, without surrounding tokens, used by bothPositionalArguments
andNamedArguments
. Another example isTypeList
, which is used for tuple types and callable types.The third
ThingList
we currently have isConditionList
– but this does include the surrounding parentheses! Shouldn’t it be calledConditions
then?(This naming comes largely from the spec, which also has the same three
ThingList
s. @gavinking was this distinction intentional, or is it random?)