195 references to ParserOptions
Microsoft.Build (48)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (4)
69
ParserOptions
.AllowAll,
175
ParserOptions
.AllowAll,
211
ParserOptions
.AllowAll,
329
ParserOptions
.AllowAll,
BackEnd\Components\RequestBuilder\IntrinsicTasks\PropertyGroupIntrinsicTask.cs (1)
63
ParserOptions
.AllowAll,
BackEnd\Components\RequestBuilder\TargetEntry.cs (3)
359
ParserOptions
.AllowPropertiesAndItemLists,
616
ParserOptions
.AllowPropertiesAndItemLists,
708
ParserOptions
.AllowPropertiesAndItemLists,
BackEnd\Components\RequestBuilder\TaskBuilder.cs (4)
372
ParserOptions
parserOptions = (_taskNode == null) ?
ParserOptions
.AllowPropertiesAndItemLists :
ParserOptions
.AllowAll;
1076
ParserOptions
.AllowAll,
Evaluation\Conditionals\Parser.cs (3)
46
private
ParserOptions
_options;
98
internal GenericExpressionNode Parse(string expression,
ParserOptions
optionSettings, ElementLocation elementLocation)
102
ErrorUtilities.VerifyThrow(0 != (optionSettings &
ParserOptions
.AllowProperties),
Evaluation\Conditionals\Scanner.cs (9)
34
private
ParserOptions
_options;
58
internal Scanner(string expressionToParse,
ParserOptions
options)
62
ErrorUtilities.VerifyThrow(0 != (options &
ParserOptions
.AllowProperties),
187
if ((_options &
ParserOptions
.AllowItemLists) == 0)
459
if ((_options &
ParserOptions
.AllowItemMetadata) ==
ParserOptions
.AllowItemMetadata)
479
if (((_options &
ParserOptions
.AllowBuiltInMetadata) == 0) &&
489
if (((_options &
ParserOptions
.AllowCustomMetadata) == 0) &&
615
if ((_options &
ParserOptions
.AllowItemLists) == 0)
Evaluation\ConditionEvaluator.cs (3)
184
ParserOptions
options,
217
ParserOptions
options,
303
ParserOptions
options,
Evaluation\Evaluator.cs (15)
979
if (EvaluateConditionCollectingConditionedProperties(propertyGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
994
if (EvaluateCondition(itemDefinitionGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1011
bool itemGroupConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemGroupElement, ExpanderOptions.ExpandPropertiesAndItems,
ParserOptions
.AllowPropertiesAndItemLists);
1291
if (!EvaluateConditionCollectingConditionedProperties(propertyElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1312
bool itemConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemElement, ExpanderOptions.ExpandPropertiesAndItems,
ParserOptions
.AllowPropertiesAndItemLists);
1348
if (EvaluateCondition(itemDefinitionElement, ExpanderOptions.ExpandPropertiesAndMetadata,
ParserOptions
.AllowPropertiesAndCustomMetadata))
1358
if (EvaluateCondition(metadataElement, ExpanderOptions.ExpandPropertiesAndMetadata,
ParserOptions
.AllowPropertiesAndCustomMetadata))
1414
if (EvaluateConditionCollectingConditionedProperties(importGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties, _projectRootElementCache))
1438
if (EvaluateConditionCollectingConditionedProperties(whenElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1588
if (!EvaluateConditionCollectingConditionedProperties(importElement, newExpandedCondition, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties,
1686
ParserOptions
.AllowProperties, _projectRootElementCache))
2376
private bool EvaluateCondition(ProjectElement element, ExpanderOptions expanderOptions,
ParserOptions
parserOptions)
2381
private bool EvaluateCondition(ProjectElement element, string condition, ExpanderOptions expanderOptions,
ParserOptions
parserOptions)
2404
private bool EvaluateConditionCollectingConditionedProperties(ProjectElement element, ExpanderOptions expanderOptions,
ParserOptions
parserOptions, ProjectRootElementCacheBase projectRootElementCache = null)
2412
private bool EvaluateConditionCollectingConditionedProperties(ProjectElement element, string condition, ExpanderOptions expanderOptions,
ParserOptions
parserOptions, ProjectRootElementCacheBase projectRootElementCache = null)
Evaluation\LazyItemEvaluator.cs (2)
65
public bool EvaluateConditionWithCurrentState(ProjectElement element, ExpanderOptions expanderOptions,
ParserOptions
parserOptions)
74
ParserOptions
parserOptions,
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (2)
208
if (!EvaluateCondition(metadataElement.Condition, metadataElement, metadataExpansionOptions,
ParserOptions
.AllowAll, _expander, _lazyEvaluator))
244
ParserOptions
.AllowAll,
Instance\ProjectInstance.cs (1)
2260
ParserOptions
.AllowPropertiesAndItemLists,
Instance\TaskRegistry.cs (1)
303
ParserOptions
.AllowPropertiesAndItemLists,
Microsoft.Build.Engine.UnitTests (147)
BackEnd\BatchingEngine_Tests.cs (1)
72
ParserOptions
.AllowAll,
Evaluation\Evaluator_Tests.cs (2)
4471
ParserOptions
.AllowAll,
4489
ParserOptions
.AllowAll,
Evaluation\Expander_Tests.cs (2)
2324
ParserOptions
.AllowAll,
2334
ParserOptions
.AllowAll,
ExpressionTree_Tests.cs (3)
109
tree = p.Parse(command,
ParserOptions
.AllowAll, ElementLocation.EmptyLocation);
439
GenericExpressionNode tree = p.Parse(expression,
ParserOptions
.AllowAll, MockElementLocation.Instance);
476
GenericExpressionNode tree = p.Parse(expression,
ParserOptions
.AllowAll, MockElementLocation.Instance);
ExpressionTreeExpression_Tests.cs (3)
436
GenericExpressionNode tree = p.Parse(expression,
ParserOptions
.AllowAll, ElementLocation.EmptyLocation);
460
GenericExpressionNode tree = p.Parse(expression,
ParserOptions
.AllowAll, ElementLocation.EmptyLocation);
491
var tree = p.Parse(expression,
ParserOptions
.AllowAll, ElementLocation.EmptyLocation);
Parser_Tests.cs (64)
30
GenericExpressionNode tree = p.Parse("$(foo)",
ParserOptions
.AllowAll, _elementLocation);
33
tree = p.Parse("$(foo)=='hello'",
ParserOptions
.AllowAll, _elementLocation);
36
tree = p.Parse("$(foo)==''",
ParserOptions
.AllowAll, _elementLocation);
39
tree = p.Parse("$(debug) and $(buildlab) and $(full)",
ParserOptions
.AllowAll, _elementLocation);
42
tree = p.Parse("$(debug) or $(buildlab) or $(full)",
ParserOptions
.AllowAll, _elementLocation);
45
tree = p.Parse("$(debug) and $(buildlab) or $(full)",
ParserOptions
.AllowAll, _elementLocation);
48
tree = p.Parse("$(full) or $(debug) and $(buildlab)",
ParserOptions
.AllowAll, _elementLocation);
51
tree = p.Parse("%(culture)",
ParserOptions
.AllowAll, _elementLocation);
54
tree = p.Parse("%(culture)=='french'",
ParserOptions
.AllowAll, _elementLocation);
57
tree = p.Parse("'foo_%(culture)'=='foo_french'",
ParserOptions
.AllowAll, _elementLocation);
60
tree = p.Parse("true",
ParserOptions
.AllowAll, _elementLocation);
63
tree = p.Parse("false",
ParserOptions
.AllowAll, _elementLocation);
66
tree = p.Parse("0",
ParserOptions
.AllowAll, _elementLocation);
69
tree = p.Parse("0.0 == 0",
ParserOptions
.AllowAll, _elementLocation);
79
GenericExpressionNode tree = p.Parse("$(foo)",
ParserOptions
.AllowAll, _elementLocation);
82
tree = p.Parse("($(foo) or $(bar)) and $(baz)",
ParserOptions
.AllowAll, _elementLocation);
85
tree = p.Parse("$(foo) <= 5 and $(bar) >= 15",
ParserOptions
.AllowAll, _elementLocation);
88
tree = p.Parse("(($(foo) <= 5 and $(bar) >= 15) and $(baz) == simplestring) and 'a more complex string' != $(quux)",
ParserOptions
.AllowAll, _elementLocation);
91
tree = p.Parse("(($(foo) or $(bar) == false) and !($(baz) == simplestring))",
ParserOptions
.AllowAll, _elementLocation);
94
tree = p.Parse("(($(foo) or Exists('c:\\foo.txt')) and !(($(baz) == simplestring)))",
ParserOptions
.AllowAll, _elementLocation);
97
tree = p.Parse("'CONTAINS%27QUOTE%27' == '$(TestQuote)'",
ParserOptions
.AllowAll, _elementLocation);
107
GenericExpressionNode tree = p.Parse("!true",
ParserOptions
.AllowAll, _elementLocation);
109
tree = p.Parse("!(true)",
ParserOptions
.AllowAll, _elementLocation);
111
tree = p.Parse("!($(foo) <= 5)",
ParserOptions
.AllowAll, _elementLocation);
113
tree = p.Parse("!(%(foo) <= 5)",
ParserOptions
.AllowAll, _elementLocation);
115
tree = p.Parse("!($(foo) <= 5 and $(bar) >= 15)",
ParserOptions
.AllowAll, _elementLocation);
124
GenericExpressionNode tree = p.Parse("SimpleFunctionCall()",
ParserOptions
.AllowAll, _elementLocation);
126
tree = p.Parse("SimpleFunctionCall( 1234 )",
ParserOptions
.AllowAll, _elementLocation);
127
tree = p.Parse("SimpleFunctionCall( true )",
ParserOptions
.AllowAll, _elementLocation);
128
tree = p.Parse("SimpleFunctionCall( $(property) )",
ParserOptions
.AllowAll, _elementLocation);
130
tree = p.Parse("SimpleFunctionCall( $(property), 1234, abcd, 'abcd efgh' )",
ParserOptions
.AllowAll, _elementLocation);
142
tree = p.Parse("@(foo) == 'a.cs;b.cs'",
ParserOptions
.AllowProperties, _elementLocation);
154
tree = p.Parse("'a.cs;b.cs' == @(foo)",
ParserOptions
.AllowProperties, _elementLocation);
166
tree = p.Parse("'@(foo)' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties, _elementLocation);
178
tree = p.Parse("'otherstuff@(foo)' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties, _elementLocation);
190
tree = p.Parse("'@(foo)otherstuff' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties, _elementLocation);
202
tree = p.Parse("somefunction(@(foo), 'otherstuff')",
ParserOptions
.AllowProperties, _elementLocation);
219
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
224
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
228
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
241
tree = p.Parse("%(foo) == 'a.cs;b.cs'",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
253
tree = p.Parse("'a.cs;b.cs' == %(foo)",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
265
tree = p.Parse("'%(foo)' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
277
tree = p.Parse("'otherstuff%(foo)' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
289
tree = p.Parse("'%(foo)otherstuff' == 'a.cs;b.cs'",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
301
tree = p.Parse("somefunction(%(foo), 'otherstuff')",
ParserOptions
.AllowProperties |
ParserOptions
.AllowItemLists, _elementLocation);
325
tree = p.Parse("'a more complex' == 'asdf",
ParserOptions
.AllowAll, _elementLocation);
338
tree = p.Parse("(($(foo) <= 5 and $(bar) >= 15) and $(baz) == 'simple string) and 'a more complex string' != $(quux)",
ParserOptions
.AllowAll, _elementLocation);
350
tree = p.Parse("($(foo) == 'simple string') $(bar)",
ParserOptions
.AllowAll, _elementLocation);
363
tree = p.Parse("=='x'",
ParserOptions
.AllowAll, _elementLocation);
376
tree = p.Parse("==",
ParserOptions
.AllowAll, _elementLocation);
389
tree = p.Parse(">",
ParserOptions
.AllowAll, _elementLocation);
401
tree = p.Parse("true!=false==",
ParserOptions
.AllowAll, _elementLocation);
414
tree = p.Parse("true!=false==true",
ParserOptions
.AllowAll, _elementLocation);
426
tree = p.Parse("1==(2",
ParserOptions
.AllowAll, _elementLocation);
Scanner_Tests.cs (72)
57
ParserOptions
options = (
ParserOptions
)Enum.Parse(typeof(
ParserOptions
), tests[i, 2], true /* case-insensitive */);
86
Scanner lexer = new Scanner("a=b",
ParserOptions
.AllowProperties);
98
Scanner lexer = new Scanner("$(",
ParserOptions
.AllowProperties);
102
lexer = new Scanner("$x",
ParserOptions
.AllowProperties);
117
Scanner lexer = new Scanner(pattern,
ParserOptions
.AllowProperties);
133
Scanner lexer = new Scanner(pattern,
ParserOptions
.AllowProperties);
144
Scanner lexer = new Scanner("@(",
ParserOptions
.AllowAll);
149
lexer = new Scanner("@x",
ParserOptions
.AllowAll);
154
lexer = new Scanner("@(x",
ParserOptions
.AllowAll);
159
lexer = new Scanner("@(x->'%(y)",
ParserOptions
.AllowAll);
164
lexer = new Scanner("@(x->'%(y)', 'x",
ParserOptions
.AllowAll);
169
lexer = new Scanner("@(x->'%(y)', 'x'",
ParserOptions
.AllowAll);
182
Scanner lexer = new Scanner("false or 'abc",
ParserOptions
.AllowAll);
187
lexer = new Scanner("\'",
ParserOptions
.AllowAll);
198
Scanner lexer = new Scanner("1234",
ParserOptions
.AllowAll);
203
lexer = new Scanner("-1234",
ParserOptions
.AllowAll);
208
lexer = new Scanner("+1234",
ParserOptions
.AllowAll);
213
lexer = new Scanner("1234.1234",
ParserOptions
.AllowAll);
218
lexer = new Scanner(".1234",
ParserOptions
.AllowAll);
223
lexer = new Scanner("1234.",
ParserOptions
.AllowAll);
227
lexer = new Scanner("0x1234",
ParserOptions
.AllowAll);
231
lexer = new Scanner("0X1234abcd",
ParserOptions
.AllowAll);
235
lexer = new Scanner("0x1234ABCD",
ParserOptions
.AllowAll);
246
Scanner lexer = new Scanner("$(foo)",
ParserOptions
.AllowAll);
249
lexer = new Scanner("@(foo)",
ParserOptions
.AllowAll);
252
lexer = new Scanner("abcde",
ParserOptions
.AllowAll);
257
lexer = new Scanner("'abc-efg'",
ParserOptions
.AllowAll);
262
lexer = new Scanner("and",
ParserOptions
.AllowAll);
266
lexer = new Scanner("or",
ParserOptions
.AllowAll);
270
lexer = new Scanner("AnD",
ParserOptions
.AllowAll);
274
lexer = new Scanner("Or",
ParserOptions
.AllowAll);
285
Scanner lexer = new Scanner("(",
ParserOptions
.AllowAll);
288
lexer = new Scanner(")",
ParserOptions
.AllowAll);
291
lexer = new Scanner(",",
ParserOptions
.AllowAll);
294
lexer = new Scanner("==",
ParserOptions
.AllowAll);
297
lexer = new Scanner("!=",
ParserOptions
.AllowAll);
300
lexer = new Scanner("<",
ParserOptions
.AllowAll);
303
lexer = new Scanner(">",
ParserOptions
.AllowAll);
306
lexer = new Scanner("<=",
ParserOptions
.AllowAll);
309
lexer = new Scanner(">=",
ParserOptions
.AllowAll);
312
lexer = new Scanner("!",
ParserOptions
.AllowAll);
323
Scanner lexer = new Scanner("@(Foo, ' ')",
ParserOptions
.AllowAll);
327
lexer = new Scanner("'@(Foo, ' ')'",
ParserOptions
.AllowAll);
331
lexer = new Scanner("'%40(( '",
ParserOptions
.AllowAll);
335
lexer = new Scanner("'@(Complex_ItemType-123, ';')' == ''",
ParserOptions
.AllowAll);
347
Scanner lexer = new Scanner("Foo()",
ParserOptions
.AllowAll);
353
lexer = new Scanner("Foo( 1 )",
ParserOptions
.AllowAll);
360
lexer = new Scanner("Foo( $(Property) )",
ParserOptions
.AllowAll);
367
lexer = new Scanner("Foo( @(ItemList) )",
ParserOptions
.AllowAll);
374
lexer = new Scanner("Foo( simplestring )",
ParserOptions
.AllowAll);
381
lexer = new Scanner("Foo( 'Not a Simple String' )",
ParserOptions
.AllowAll);
388
lexer = new Scanner("Foo( 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
397
lexer = new Scanner("Foo( $(Property), 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
408
lexer = new Scanner("Foo( @(ItemList), $(Property), simplestring, 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
429
Scanner lexer = new Scanner("'String with a $(Property) inside'",
ParserOptions
.AllowAll);
433
lexer = new Scanner("'String with an embedded \\' in it'",
ParserOptions
.AllowAll);
437
lexer = new Scanner("'String with a $(Property) inside'",
ParserOptions
.AllowAll);
441
lexer = new Scanner("@(list, ' ')",
ParserOptions
.AllowAll);
445
lexer = new Scanner("@(files->'%(Filename)')",
ParserOptions
.AllowAll);
455
Scanner lexer = new Scanner("1234",
ParserOptions
.AllowAll);
458
lexer = new Scanner("'abc-efg'==$(foo)",
ParserOptions
.AllowAll);
468
lexer = new Scanner("$(debug)!=true",
ParserOptions
.AllowAll);
478
lexer = new Scanner("$(VERSION)<5",
ParserOptions
.AllowAll);
497
lexer = new Scanner("$(DEBUG) and $(FOO)",
ParserOptions
.AllowAll);
502
lexer = new Scanner("1234$(DEBUG)0xabcd@(foo)asdf<>'foo'<=false>=true==1234!=",
ParserOptions
.AllowAll);
520
lexer = new Scanner(" 1234 $(DEBUG) 0xabcd \n@(foo) \nasdf \n< \n> \n'foo' \n<= \nfalse \n>= \ntrue \n== \n 1234 \n!= ",
ParserOptions
.AllowAll);
545
Scanner lexer = new Scanner("@(foo)",
ParserOptions
.AllowProperties);
549
lexer = new Scanner("1234 '@(foo)'",
ParserOptions
.AllowProperties);
554
lexer = new Scanner("'1234 @(foo)'",
ParserOptions
.AllowProperties);
565
Scanner lexer = new Scanner("'$(DEBUG) == true",
ParserOptions
.AllowAll);