Chromium Code Reviews
DescriptionMojom parser: Compute and validate struct field ordinals.
In mojom_types.mojom struct fields are supposed to be listed in ordinal order, and the
original lexical order is preserved in a field of DeclarationData called |declaration_order|.
Additionally there is a field of DeclarationData called |declared_ordinal| that records if an
explicit ordinal has been specified.
Previously only the |declared_ordinal| bit was implemented. This has worked so far because the
actual field ordinals are currently computed in the Python back-end using the |declared_ordinal| field.
This CL implements the missing bits which will allow us in a follow-up CL to eliminate the logic from the Python backend. Implementing the missing bits is also important because we are starting to re-write the backends in Go
and also because the runtime type information requires it.
This CL only deals with struct fields. There will be follow-up CLs for union fields and other things. Note that some
ordinals are already being fully handled by the parser, namely method ordinals.
BUG=#696
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/399333c72c83f6df0bab99d1634777142b512db8
Patch Set 1 #Patch Set 2 : More tests and new sha1s. #Patch Set 3 : Maintain the property that the fields of a module.Struct are sorted in declaration order. #Messages
Total messages: 11 (6 generated)
|