[Vala] Support for fields like e.g. int a, b;



Jürg,

Vala does not support fields like int a, b.

I think I now figured out how I can add that support, but before
putting time in it I have a few questions

Do you want this support added to vala?

Adding this does not make the vala compiler code nicer to read because
Field is one of the few (others are Const and Signal as far as I can
see) symbols that can have multiple declarations with just one symbol
in the code.

One of  idea is to make a "parse_field_declarations" function like the
"parse_local_variable_declarations" which handles the "int a, b;"
stuff for local variables, but in that the "parse_declaration" has to
be removed and that code needs to be merged into the following 6
functions

parse_namespace_member
parse_class_member
parse_struct_member
parse_interface_member
parse_enum_declaration
parse_errordomain_declaration

That doesn't really make the code easier to read.

Another idea I had is to let parse_declaration and all it
parse_*_declaration friends return a list of Symbols. I think this is
a cleaner solution (though probably a bit slower, don't know if it's
measurable).

What do you think about this? Also Let me know if you have better
ideas on how to implement this.

Jaap



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]