2019-06-12 21:56:55 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-08-29 12:10:23 -04:00
|
|
|
|
using System.Linq;
|
2019-06-12 21:56:55 +02:00
|
|
|
|
|
|
|
|
|
namespace CapnpC.Model
|
|
|
|
|
{
|
|
|
|
|
interface IHasNestedDefinitions
|
|
|
|
|
{
|
2019-08-29 12:10:23 -04:00
|
|
|
|
IEnumerable<TypeDefinition> NestedTypes { get; }
|
|
|
|
|
ICollection<IDefinition> NestedDefinitions { get; }
|
|
|
|
|
ICollection<Constant> Constants { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static partial class Extensions
|
|
|
|
|
{
|
|
|
|
|
public static IEnumerable<TypeDefinition> GetNestedTypes(this IHasNestedDefinitions def)
|
|
|
|
|
=> def.NestedDefinitions.Select(d => d as TypeDefinition).Where(d => d != null);
|
2019-06-12 21:56:55 +02:00
|
|
|
|
}
|
|
|
|
|
}
|