OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |