Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding DeclStmt.Decls #88

Merged
merged 3 commits into from Nov 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions sources/ClangSharp/Cursors/Stmts/DeclStmt.cs
@@ -1,11 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using ClangSharp.Interop;

namespace ClangSharp
{
public sealed class DeclStmt : Stmt
{
private readonly Lazy<IReadOnlyList<Decl>> _children;
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
internal DeclStmt(CXCursor handle) : base(handle, CXCursorKind.CXCursor_DeclStmt)
{
_children = new Lazy<IReadOnlyList<Decl>>(() => CursorChildren.OfType<Decl>().ToList());
}

public IReadOnlyList<Decl> Decls => _children.Value;
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
}
}