public void TestPsrAst3WithPos() { Compile(@" function ast3\withPos(factory,type) [compiler] { var args; var targs = args >> skip(2); if(factory is null) throw ""AST factory cannot be null.""; return call\member(factory,type, targs); }"); var factory = new Mock<IAstFactory>(MockBehavior.Strict); var astPlaceholder = new AstPlaceholder(NoSourcePosition.MissingFileName, NoSourcePosition.Instance.Line, NoSourcePosition.Instance.Column); factory.Setup(f => f.Placeholder(It.IsAny<ISourcePosition>(), 5)) .Returns(astPlaceholder); ExpectNamed("ast3\\withPos", astPlaceholder, sctx.CreateNativePValue(factory.Object), "Placeholder", sctx.CreateNativePValue(NoSourcePosition.Instance), 5); }
public override AstGetSet GetCopy() { var copy = new AstPlaceholder(File, Line, Column, Index); CopyBaseMembers(copy); return copy; }