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_parser/mojom" | 10 "mojom/mojom_parser/mojom" |
(...skipping 151 matching lines...) Loading... |
162 } | 162 } |
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 enum value integers. | |
173 if err = descriptor.ComputeEnumValueIntegers(); err != nil { | |
174 return | |
175 } | |
176 | |
177 // Compute data for generators. | 172 // Compute data for generators. |
178 » err = descriptor.ComputeDataForGenerators() | 173 » err = descriptor.ComputeFinalData() |
179 return | 174 return |
180 } | 175 } |
181 | 176 |
182 type FileReference struct { | 177 type FileReference struct { |
183 mojomFile *mojom.MojomFile | 178 mojomFile *mojom.MojomFile |
184 importedFrom *FileReference | 179 importedFrom *FileReference |
185 specifiedPath string | 180 specifiedPath string |
186 absolutePath string | 181 absolutePath string |
187 directoryPath string | 182 directoryPath string |
188 } | 183 } |
(...skipping 111 matching lines...) Loading... |
300 return fmt.Errorf("File not found: %s", fileRef) | 295 return fmt.Errorf("File not found: %s", fileRef) |
301 } | 296 } |
302 | 297 |
303 func isFile(path string) bool { | 298 func isFile(path string) bool { |
304 info, err := os.Stat(path) | 299 info, err := os.Stat(path) |
305 if err != nil { | 300 if err != nil { |
306 return false | 301 return false |
307 } | 302 } |
308 return !info.IsDir() | 303 return !info.IsDir() |
309 } | 304 } |
OLD | NEW |