Ancestry.Daisy.Tests.Daisy.Unit.Utils.DaisyProgramTests.AddLink C# (CSharp) Method

AddLink() public method

public AddLink ( DaisyAst ast, string rawStatement, bool>.Func predicate ) : void
ast Ancestry.Daisy.Language.DaisyAst
rawStatement string
predicate bool>.Func
return void
        public void AddLink(DaisyAst ast, string rawStatement, Func<int,bool> predicate)
        {
            var statement = new FakeStatement(rawStatement, predicate).Link(rawStatement);
            new AstCollector(ast)
                .OfType<StatementNode>()
                .Where(x => x.Text == rawStatement)
                .Select(x => { x.LinkedStatement = statement; return x; }) //Sigh, I wish I had a for each
                .ToList();
        }