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)
66
ParserOptions
.AllowAll,
BackEnd\Components\RequestBuilder\TargetEntry.cs (3)
354
ParserOptions
.AllowPropertiesAndItemLists,
611
ParserOptions
.AllowPropertiesAndItemLists,
703
ParserOptions
.AllowPropertiesAndItemLists,
BackEnd\Components\RequestBuilder\TaskBuilder.cs (4)
372
ParserOptions
parserOptions = (_taskNode == null) ?
ParserOptions
.AllowPropertiesAndItemLists :
ParserOptions
.AllowAll;
1085
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)
183
ParserOptions
options,
216
ParserOptions
options,
302
ParserOptions
options,
Evaluation\Evaluator.cs (15)
992
if (EvaluateConditionCollectingConditionedProperties(propertyGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1007
if (EvaluateCondition(itemDefinitionGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1024
bool itemGroupConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemGroupElement, ExpanderOptions.ExpandPropertiesAndItems,
ParserOptions
.AllowPropertiesAndItemLists);
1310
if (!EvaluateConditionCollectingConditionedProperties(propertyElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1331
bool itemConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemElement, ExpanderOptions.ExpandPropertiesAndItems,
ParserOptions
.AllowPropertiesAndItemLists);
1367
if (EvaluateCondition(itemDefinitionElement, ExpanderOptions.ExpandPropertiesAndMetadata,
ParserOptions
.AllowPropertiesAndCustomMetadata))
1377
if (EvaluateCondition(metadataElement, ExpanderOptions.ExpandPropertiesAndMetadata,
ParserOptions
.AllowPropertiesAndCustomMetadata))
1433
if (EvaluateConditionCollectingConditionedProperties(importGroupElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties, _projectRootElementCache))
1457
if (EvaluateConditionCollectingConditionedProperties(whenElement, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties))
1607
if (!EvaluateConditionCollectingConditionedProperties(importElement, newExpandedCondition, ExpanderOptions.ExpandProperties,
ParserOptions
.AllowProperties,
1705
ParserOptions
.AllowProperties, _projectRootElementCache))
2398
private bool EvaluateCondition(ProjectElement element, ExpanderOptions expanderOptions,
ParserOptions
parserOptions)
2403
private bool EvaluateCondition(ProjectElement element, string condition, ExpanderOptions expanderOptions,
ParserOptions
parserOptions)
2426
private bool EvaluateConditionCollectingConditionedProperties(ProjectElement element, ExpanderOptions expanderOptions,
ParserOptions
parserOptions, ProjectRootElementCacheBase projectRootElementCache = null)
2434
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)
302
ParserOptions
.AllowPropertiesAndItemLists,
Microsoft.Build.Engine.UnitTests (147)
BackEnd\BatchingEngine_Tests.cs (1)
72
ParserOptions
.AllowAll,
Evaluation\Evaluator_Tests.cs (2)
4506
ParserOptions
.AllowAll,
4524
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)
54
ParserOptions
options = (
ParserOptions
)Enum.Parse(typeof(
ParserOptions
), tests[i, 2], true /* case-insensitive */);
83
Scanner lexer = new Scanner("a=b",
ParserOptions
.AllowProperties);
95
Scanner lexer = new Scanner("$(",
ParserOptions
.AllowProperties);
99
lexer = new Scanner("$x",
ParserOptions
.AllowProperties);
114
Scanner lexer = new Scanner(pattern,
ParserOptions
.AllowProperties);
130
Scanner lexer = new Scanner(pattern,
ParserOptions
.AllowProperties);
141
Scanner lexer = new Scanner("@(",
ParserOptions
.AllowAll);
146
lexer = new Scanner("@x",
ParserOptions
.AllowAll);
151
lexer = new Scanner("@(x",
ParserOptions
.AllowAll);
156
lexer = new Scanner("@(x->'%(y)",
ParserOptions
.AllowAll);
161
lexer = new Scanner("@(x->'%(y)', 'x",
ParserOptions
.AllowAll);
166
lexer = new Scanner("@(x->'%(y)', 'x'",
ParserOptions
.AllowAll);
179
Scanner lexer = new Scanner("false or 'abc",
ParserOptions
.AllowAll);
184
lexer = new Scanner("\'",
ParserOptions
.AllowAll);
195
Scanner lexer = new Scanner("1234",
ParserOptions
.AllowAll);
200
lexer = new Scanner("-1234",
ParserOptions
.AllowAll);
205
lexer = new Scanner("+1234",
ParserOptions
.AllowAll);
210
lexer = new Scanner("1234.1234",
ParserOptions
.AllowAll);
215
lexer = new Scanner(".1234",
ParserOptions
.AllowAll);
220
lexer = new Scanner("1234.",
ParserOptions
.AllowAll);
224
lexer = new Scanner("0x1234",
ParserOptions
.AllowAll);
228
lexer = new Scanner("0X1234abcd",
ParserOptions
.AllowAll);
232
lexer = new Scanner("0x1234ABCD",
ParserOptions
.AllowAll);
243
Scanner lexer = new Scanner("$(foo)",
ParserOptions
.AllowAll);
246
lexer = new Scanner("@(foo)",
ParserOptions
.AllowAll);
249
lexer = new Scanner("abcde",
ParserOptions
.AllowAll);
254
lexer = new Scanner("'abc-efg'",
ParserOptions
.AllowAll);
259
lexer = new Scanner("and",
ParserOptions
.AllowAll);
263
lexer = new Scanner("or",
ParserOptions
.AllowAll);
267
lexer = new Scanner("AnD",
ParserOptions
.AllowAll);
271
lexer = new Scanner("Or",
ParserOptions
.AllowAll);
282
Scanner lexer = new Scanner("(",
ParserOptions
.AllowAll);
285
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);
320
Scanner lexer = new Scanner("@(Foo, ' ')",
ParserOptions
.AllowAll);
324
lexer = new Scanner("'@(Foo, ' ')'",
ParserOptions
.AllowAll);
328
lexer = new Scanner("'%40(( '",
ParserOptions
.AllowAll);
332
lexer = new Scanner("'@(Complex_ItemType-123, ';')' == ''",
ParserOptions
.AllowAll);
344
Scanner lexer = new Scanner("Foo()",
ParserOptions
.AllowAll);
350
lexer = new Scanner("Foo( 1 )",
ParserOptions
.AllowAll);
357
lexer = new Scanner("Foo( $(Property) )",
ParserOptions
.AllowAll);
364
lexer = new Scanner("Foo( @(ItemList) )",
ParserOptions
.AllowAll);
371
lexer = new Scanner("Foo( simplestring )",
ParserOptions
.AllowAll);
378
lexer = new Scanner("Foo( 'Not a Simple String' )",
ParserOptions
.AllowAll);
385
lexer = new Scanner("Foo( 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
394
lexer = new Scanner("Foo( $(Property), 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
405
lexer = new Scanner("Foo( @(ItemList), $(Property), simplestring, 'Not a Simple String', 1234 )",
ParserOptions
.AllowAll);
426
Scanner lexer = new Scanner("'String with a $(Property) inside'",
ParserOptions
.AllowAll);
430
lexer = new Scanner("'String with an embedded \\' in it'",
ParserOptions
.AllowAll);
434
lexer = new Scanner("'String with a $(Property) inside'",
ParserOptions
.AllowAll);
438
lexer = new Scanner("@(list, ' ')",
ParserOptions
.AllowAll);
442
lexer = new Scanner("@(files->'%(Filename)')",
ParserOptions
.AllowAll);
452
Scanner lexer = new Scanner("1234",
ParserOptions
.AllowAll);
455
lexer = new Scanner("'abc-efg'==$(foo)",
ParserOptions
.AllowAll);
465
lexer = new Scanner("$(debug)!=true",
ParserOptions
.AllowAll);
475
lexer = new Scanner("$(VERSION)<5",
ParserOptions
.AllowAll);
494
lexer = new Scanner("$(DEBUG) and $(FOO)",
ParserOptions
.AllowAll);
499
lexer = new Scanner("1234$(DEBUG)0xabcd@(foo)asdf<>'foo'<=false>=true==1234!=",
ParserOptions
.AllowAll);
517
lexer = new Scanner(" 1234 $(DEBUG) 0xabcd \n@(foo) \nasdf \n< \n> \n'foo' \n<= \nfalse \n>= \ntrue \n== \n 1234 \n!= ",
ParserOptions
.AllowAll);
542
Scanner lexer = new Scanner("@(foo)",
ParserOptions
.AllowProperties);
546
lexer = new Scanner("1234 '@(foo)'",
ParserOptions
.AllowProperties);
551
lexer = new Scanner("'1234 @(foo)'",
ParserOptions
.AllowProperties);
562
Scanner lexer = new Scanner("'$(DEBUG) == true",
ParserOptions
.AllowAll);