Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Issue 1767033002: Mojom parser: Compute and validate struct field ordinals. (Closed)

Created:
4 years, 9 months ago by rudominer
Modified:
4 years, 9 months ago
Reviewers:
azani
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Mojom 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -83 lines) Patch
M mojo/public/tools/bindings/mojom_tool/bin/linux64/mojom.sha1 View 1 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 View 1 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py View 1 2 3 chunks +15 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py View 1 2 2 chunks +22 lines, -6 lines 0 comments Download
M mojom/mojom_parser/mojom/user_defined_types.go View 10 chunks +84 lines, -12 lines 0 comments Download
M mojom/mojom_parser/parser/comment_merger_test.go View 1 chunk +1 line, -1 line 0 comments Download
M mojom/mojom_parser/parser/parser_test.go View 5 chunks +141 lines, -6 lines 0 comments Download
M mojom/mojom_parser/parser/parsing.go View 2 chunks +9 lines, -2 lines 0 comments Download
M mojom/mojom_parser/parser/resolution_test.go View 1 chunk +1 line, -1 line 0 comments Download
M mojom/mojom_parser/serialization/serialization.go View 2 chunks +6 lines, -3 lines 0 comments Download
M mojom/mojom_parser/serialization/serialization_test.go View 1 34 chunks +179 lines, -48 lines 0 comments Download

Messages

Total messages: 11 (6 generated)
rudominer
Hi Alex, ptal.
4 years, 9 months ago (2016-03-07 17:02:26 UTC) #5
azani
lgtm
4 years, 9 months ago (2016-03-07 19:29:45 UTC) #6
rudominer
Hi Alex, I made a change to mojom_translator.py to maintain the property that the fields ...
4 years, 9 months ago (2016-03-07 22:13:27 UTC) #7
azani
still lgtm
4 years, 9 months ago (2016-03-07 22:34:31 UTC) #8
rudominer
4 years, 9 months ago (2016-03-07 22:42:06 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
399333c72c83f6df0bab99d1634777142b512db8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698