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

Unified Diff: mojom/mojom_parser/parser/parsing.go

Issue 1767033002: Mojom parser: Compute and validate struct field ordinals. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Maintain the property that the fields of a module.Struct are sorted in declaration order. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/parser/parser_test.go ('k') | mojom/mojom_parser/parser/resolution_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/parser/parsing.go
diff --git a/mojom/mojom_parser/parser/parsing.go b/mojom/mojom_parser/parser/parsing.go
index a8b1128ccb9330c66a6d23194938ad7dcf32ad4a..2fa321a45d5f2c541056a37579b3ac7caab2bd71 100644
--- a/mojom/mojom_parser/parser/parsing.go
+++ b/mojom/mojom_parser/parser/parsing.go
@@ -654,7 +654,10 @@ func (p *Parser) parseParamList(methodName string, isRequest bool) (paramStruct
}
if p.OK() {
- paramStruct.ComputeFieldOrdinals()
+ if err := paramStruct.ComputeFieldOrdinals(); err != nil {
+ p.err = err
+ return nil
+ }
}
return
}
@@ -750,8 +753,12 @@ func (p *Parser) parseStructBody(mojomStruct *mojom.MojomStruct) bool {
}
}
if p.OK() {
- mojomStruct.ComputeFieldOrdinals()
+ if err := mojomStruct.ComputeFieldOrdinals(); err != nil {
+ p.err = err
+ return false
+ }
}
+
return p.OK()
}
« no previous file with comments | « mojom/mojom_parser/parser/parser_test.go ('k') | mojom/mojom_parser/parser/resolution_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698