Why is it a property of the parameter collection?
I think should be a property of ParameterDeclaration, even if only the
last parameter can be a params parameter.
Daniel
Doug H wrote:
Daniel Grunwald wrote:
How are params methods represented in the AST?
def Method(*args as (int)):
print args.Length
translates to
<Parameters Name="args">
<Type xsi:type="ArrayTypeReference">
<ElementType xsi:type="SimpleTypeReference" Name="int" />
</Type>
</Parameters>
Looking at BooPrinterVisitor, it seems there isn't any code to output
the *.
Daniel
It's printing for me, see the WriteParameterList method in
BooPrinterVisitor. It uses ParameterDeclarationCollection.VariableNumber
But you are right, the information is not there when you do xml
serialization.
I think we either have to add attributes to the right places
(serializable/xmlattribute/xmlinclude/defaultvalue/etc.), or maybe
move VariableNumber to ParameterDeclarationCollectionImpl by editing
ast.model.boo (scripts/astgen.boo would need altering to handle fields
in collection classes).
|