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 "mojom/mojom_parser/mojom" | 9 "mojom/mojom_parser/mojom" |
10 "strings" | 10 "strings" |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 struct Struct2{}; | 1238 struct Struct2{}; |
1239 | 1239 |
1240 interface Interface1 { | 1240 interface Interface1 { |
1241 const Color FAVORITE_COLOR = RED; | 1241 const Color FAVORITE_COLOR = RED; |
1242 | 1242 |
1243 Foo(int32 x) => (string y); | 1243 Foo(int32 x) => (string y); |
1244 }; | 1244 }; |
1245 | 1245 |
1246 interface Interface2 { | 1246 interface Interface2 { |
1247 Foo(int32 x) => (Struct1 y); | 1247 Foo(int32 x) => (Struct1 y); |
| 1248 Bar(string x); |
1248 }; | 1249 }; |
1249 ` | 1250 ` |
1250 | 1251 |
1251 test.addTestCase(contents, | 1252 test.addTestCase(contents, |
1252 "Interface1", | 1253 "Interface1", |
1253 []string{"Interface1", "Color"}, | 1254 []string{"Interface1", "Color"}, |
1254 ) | 1255 ) |
1255 | 1256 |
1256 test.addTestCase(contents, | 1257 test.addTestCase(contents, |
1257 "Interface2", | 1258 "Interface2", |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 typeKey = mojom.ComputeTypeKey(t) | 1386 typeKey = mojom.ComputeTypeKey(t) |
1386 } | 1387 } |
1387 userDefinedType := descriptor.TypesByKey[typeKey] | 1388 userDefinedType := descriptor.TypesByKey[typeKey] |
1388 if userDefinedType == nil { | 1389 if userDefinedType == nil { |
1389 panic(fmt.Sprintf("No type found for: %s", t)) | 1390 panic(fmt.Sprintf("No type found for: %s", t)) |
1390 } | 1391 } |
1391 typeSet.Add(userDefinedType) | 1392 typeSet.Add(userDefinedType) |
1392 } | 1393 } |
1393 return typeSet | 1394 return typeSet |
1394 } | 1395 } |
OLD | NEW |