143 references to Captures
Microsoft.Build (12)
Evaluation\Expander.cs (9)
2016if (expressionCapture.Captures?.Any(capture => string.Equals(capture.FunctionName, "Count", StringComparison.OrdinalIgnoreCase)) != true) 2019if (expressionCapture.Captures?.Any(capture => string.Equals(capture.FunctionName, "AnyHaveMetadataValue", StringComparison.OrdinalIgnoreCase)) != true) 2027if (expressionCapture.Captures != null) 2136ProjectErrorUtilities.VerifyThrowInvalidProject(match.Captures.Count > 0, elementLocation, "InvalidFunctionPropertyExpression"); 2138Stack<TransformFunction<S>> transformFunctionStack = new Stack<TransformFunction<S>>(match.Captures.Count); 2144for (int n = match.Captures.Count - 1; n >= 0; n--) 2146string function = match.Captures[n].Value; 2147string functionName = match.Captures[n].FunctionName; 2148string argumentsExpression = match.Captures[n].FunctionArguments;
Evaluation\LazyItemEvaluator.cs (2)
694if (match.Captures != null) 696foreach (var subMatch in match.Captures)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
339if (itemExpressionFragment.Capture.Captures is object)
Microsoft.Build.Engine.UnitTests (131)
Evaluation\ExpressionShredder_Tests.cs (131)
581Assert.Equal("%(Meta0)", capture.Captures[0].Value); 582Assert.Equal("%(Filename)", capture.Captures[1].Value); 583Assert.Equal("Substring($(Val))", capture.Captures[2].Value); 614if (capture.Captures != null) 618Assert.Equal(transformGroup.Captures[i].Value, capture.Captures[i].Value); 657Assert.Null(capture.Captures); 659Assert.Null(capture.Captures); 673Assert.Null(capture.Captures); 676Assert.Null(capture.Captures); 690Assert.Single(capture.Captures); 693Assert.Single(capture.Captures); 694Assert.Equal("%(Fullpath)", capture.Captures[0].Value); 708Assert.Single(capture.Captures); 711Assert.Single(capture.Captures); 712Assert.Equal("%(Fullpath)", capture.Captures[0].Value); 726Assert.Single(capture.Captures); 729Assert.Single(capture.Captures); 730Assert.Equal("Bar(a,b)", capture.Captures[0].Value); 731Assert.Equal("Bar", capture.Captures[0].FunctionName); 732Assert.Equal("a,b", capture.Captures[0].FunctionArguments); 746Assert.Single(capture.Captures); 749Assert.Single(capture.Captures); 750Assert.Equal("Bar(a,b)", capture.Captures[0].Value); 751Assert.Equal("Bar", capture.Captures[0].FunctionName); 752Assert.Equal("a,b", capture.Captures[0].FunctionArguments); 766Assert.Equal(2, capture.Captures.Count); 769Assert.Equal("Metadata('Meta0')", capture.Captures[0].Value); 770Assert.Equal("Metadata", capture.Captures[0].FunctionName); 771Assert.Equal("'Meta0'", capture.Captures[0].FunctionArguments); 772Assert.Equal("Directory()", capture.Captures[1].Value); 773Assert.Equal("Directory", capture.Captures[1].FunctionName); 774Assert.Null(capture.Captures[1].FunctionArguments); 788Assert.Equal(2, capture.Captures.Count); 791Assert.Equal("Metadata('Meta0')", capture.Captures[0].Value); 792Assert.Equal("Metadata", capture.Captures[0].FunctionName); 793Assert.Equal("'Meta0'", capture.Captures[0].FunctionArguments); 794Assert.Equal("Directory()", capture.Captures[1].Value); 795Assert.Equal("Directory", capture.Captures[1].FunctionName); 796Assert.Null(capture.Captures[1].FunctionArguments); 810Assert.Equal(2, capture.Captures.Count); 813Assert.Equal("%(Fullpath)", capture.Captures[0].Value); 814Assert.Null(capture.Captures[0].FunctionName); 815Assert.Null(capture.Captures[0].FunctionArguments); 816Assert.Equal("Directory()", capture.Captures[1].Value); 817Assert.Equal("Directory", capture.Captures[1].FunctionName); 818Assert.Null(capture.Captures[1].FunctionArguments); 832Assert.Equal(2, capture.Captures.Count); 835Assert.Equal("%(Fullpath)", capture.Captures[0].Value); 836Assert.Null(capture.Captures[0].FunctionName); 837Assert.Null(capture.Captures[0].FunctionArguments); 838Assert.Equal("Directory()", capture.Captures[1].Value); 839Assert.Equal("Directory", capture.Captures[1].FunctionName); 840Assert.Null(capture.Captures[1].FunctionArguments); 854Assert.Single(capture.Captures); 857Assert.Equal("$(SOMEPROP)%(Fullpath)", capture.Captures[0].Value); 858Assert.Null(capture.Captures[0].FunctionName); 859Assert.Null(capture.Captures[0].FunctionArguments); 873Assert.Equal(2, capture.Captures.Count); 876Assert.Equal("%(Filename)", capture.Captures[0].Value); 877Assert.Null(capture.Captures[0].FunctionName); 878Assert.Null(capture.Captures[0].FunctionArguments); 879Assert.Equal("Substring($(Val), $(Boo))", capture.Captures[1].Value); 880Assert.Equal("Substring", capture.Captures[1].FunctionName); 881Assert.Equal("$(Val), $(Boo)", capture.Captures[1].FunctionArguments); 895Assert.Equal(2, capture.Captures.Count); 898Assert.Equal("%(Filename)", capture.Captures[0].Value); 899Assert.Null(capture.Captures[0].FunctionName); 900Assert.Null(capture.Captures[0].FunctionArguments); 901Assert.Equal("Substring(\"AA\", 'BB', `cc`)", capture.Captures[1].Value); 902Assert.Equal("Substring", capture.Captures[1].FunctionName); 903Assert.Equal("\"AA\", 'BB', `cc`", capture.Captures[1].FunctionArguments); 917Assert.Equal(2, capture.Captures.Count); 920Assert.Equal("%(Filename)", capture.Captures[0].Value); 921Assert.Null(capture.Captures[0].FunctionName); 922Assert.Null(capture.Captures[0].FunctionArguments); 923Assert.Equal("Substring('()', $(Boo), ')(')", capture.Captures[1].Value); 924Assert.Equal("Substring", capture.Captures[1].FunctionName); 925Assert.Equal("'()', $(Boo), ')('", capture.Captures[1].FunctionArguments); 939Assert.Equal(2, capture.Captures.Count); 942Assert.Equal("%(Filename)", capture.Captures[0].Value); 943Assert.Null(capture.Captures[0].FunctionName); 944Assert.Null(capture.Captures[0].FunctionArguments); 945Assert.Equal("Substring(`()`, $(Boo), \"AA\")", capture.Captures[1].Value); 946Assert.Equal("Substring", capture.Captures[1].FunctionName); 947Assert.Equal("`()`, $(Boo), \"AA\"", capture.Captures[1].FunctionArguments); 961Assert.Equal(2, capture.Captures.Count); 964Assert.Equal("%(Filename)", capture.Captures[0].Value); 965Assert.Null(capture.Captures[0].FunctionName); 966Assert.Null(capture.Captures[0].FunctionArguments); 967Assert.Equal("Substring(`()`, $(Boo), \")(\")", capture.Captures[1].Value); 968Assert.Equal("Substring", capture.Captures[1].FunctionName); 969Assert.Equal("`()`, $(Boo), \")(\"", capture.Captures[1].FunctionArguments); 983Assert.Equal(2, capture.Captures.Count); 986Assert.Equal("%(Filename)", capture.Captures[0].Value); 987Assert.Null(capture.Captures[0].FunctionName); 988Assert.Null(capture.Captures[0].FunctionArguments); 989Assert.Equal("Substring(\"()\", $(Boo), `)(`)", capture.Captures[1].Value); 990Assert.Equal("Substring", capture.Captures[1].FunctionName); 991Assert.Equal("\"()\", $(Boo), `)(`", capture.Captures[1].FunctionArguments); 1006Assert.Null(expressions[0].Captures); 1007Assert.Equal(2, capture.Captures.Count); 1010Assert.Equal("%(Filename)", capture.Captures[0].Value); 1011Assert.Null(capture.Captures[0].FunctionName); 1012Assert.Null(capture.Captures[0].FunctionArguments); 1013Assert.Equal("Substring(\"()\", $(Boo), `)(`)", capture.Captures[1].Value); 1014Assert.Equal("Substring", capture.Captures[1].FunctionName); 1015Assert.Equal("\"()\", $(Boo), `)(`", capture.Captures[1].FunctionArguments); 1030Assert.Null(expressions[1].Captures); 1031Assert.Equal(2, capture.Captures.Count); 1034Assert.Equal("%(Filename)", capture.Captures[0].Value); 1035Assert.Null(capture.Captures[0].FunctionName); 1036Assert.Null(capture.Captures[0].FunctionArguments); 1037Assert.Equal("Substring(\"()\", $(Boo), `)(`)", capture.Captures[1].Value); 1038Assert.Equal("Substring", capture.Captures[1].FunctionName); 1039Assert.Equal("\"()\", $(Boo), `)(`", capture.Captures[1].FunctionArguments); 1054Assert.Null(expressions[1].Captures); 1055Assert.Equal(2, capture.Captures.Count); 1058Assert.Equal("%(Filename)", capture.Captures[0].Value); 1059Assert.Null(capture.Captures[0].FunctionName); 1060Assert.Null(capture.Captures[0].FunctionArguments); 1061Assert.Equal("Substring(\"()\", $(Boo), `)(`)", capture.Captures[1].Value); 1062Assert.Equal("Substring", capture.Captures[1].FunctionName); 1063Assert.Equal("\"()\", $(Boo), `)(`", capture.Captures[1].FunctionArguments); 1078Assert.Null(expressions[1].Captures); 1079Assert.Equal(2, capture.Captures.Count); 1082Assert.Equal("%(Filename)", capture.Captures[0].Value); 1083Assert.Null(capture.Captures[0].FunctionName); 1084Assert.Null(capture.Captures[0].FunctionArguments); 1085Assert.Equal("Substring(\"()\", $(Boo), `)(\"`)", capture.Captures[1].Value); 1086Assert.Equal("Substring", capture.Captures[1].FunctionName); 1087Assert.Equal("\"()\", $(Boo), `)(\"`", capture.Captures[1].FunctionArguments);