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

Side by Side Diff: mojom/mojom_tool/parser/parse_driver.go

Issue 1915413002: Mojom frontend: Detect Ill-founded Types (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix comments as per code review. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package parser 5 package parser
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "io/ioutil" 9 "io/ioutil"
10 "mojom/mojom_tool/mojom" 10 "mojom/mojom_tool/mojom"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 } 164 }
165 } 165 }
166 166
167 // Perform type and value resolution 167 // Perform type and value resolution
168 if err = descriptor.Resolve(); err != nil { 168 if err = descriptor.Resolve(); err != nil {
169 return 169 return
170 } 170 }
171 171
172 // Compute data for generators. 172 // Compute data for generators.
173 » err = descriptor.ComputeFinalData() 173 » if err = descriptor.ComputeFinalData(); err != nil {
174 » » return
175 » }
176
177 » // Check for ill-founded types.
178 » err = descriptor.DetectIllFoundedTypes()
174 return 179 return
175 } 180 }
176 181
177 type FileReference struct { 182 type FileReference struct {
178 mojomFile *mojom.MojomFile 183 mojomFile *mojom.MojomFile
179 importedFrom *FileReference 184 importedFrom *FileReference
180 specifiedPath string 185 specifiedPath string
181 absolutePath string 186 absolutePath string
182 directoryPath string 187 directoryPath string
183 } 188 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return fmt.Errorf("File not found: %s", fileRef) 300 return fmt.Errorf("File not found: %s", fileRef)
296 } 301 }
297 302
298 func isFile(path string) bool { 303 func isFile(path string) bool {
299 info, err := os.Stat(path) 304 info, err := os.Stat(path)
300 if err != nil { 305 if err != nil {
301 return false 306 return false
302 } 307 }
303 return !info.IsDir() 308 return !info.IsDir()
304 } 309 }
OLDNEW
« no previous file with comments | « mojom/mojom_tool/mojom/user_defined_types.go ('k') | mojom/mojom_tool/serialization/serialization_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698