forked from Azure/PSRule.Rules.Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bd4055
commit 5e5a82e
Showing
11 changed files
with
448 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics; | ||
|
||
namespace PSRule.Rules.Azure.Data.Template | ||
{ | ||
/// <summary> | ||
/// An individual expression token. | ||
/// </summary> | ||
[DebuggerDisplay("Type = {Type}, Content = {Content}")] | ||
internal sealed class ExpressionToken | ||
{ | ||
internal readonly ExpressionTokenType Type; | ||
internal readonly long Value; | ||
internal readonly string Content; | ||
|
||
internal ExpressionToken(ExpressionTokenType type, string content) | ||
{ | ||
Type = type; | ||
Content = content; | ||
} | ||
|
||
internal ExpressionToken(long value) | ||
{ | ||
Type = ExpressionTokenType.Numeric; | ||
Value = value; | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/PSRule.Rules.Azure/Data/Template/ExpressionTokenType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Rules.Azure.Data.Template | ||
{ | ||
/// <summary> | ||
/// The available token types used for Azure Resource Manager expressions. | ||
/// </summary> | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1720:Identifier contains type name", Justification = "Represents standard type.")] | ||
public enum ExpressionTokenType : byte | ||
{ | ||
/// <summary> | ||
/// Null token. | ||
/// </summary> | ||
None, | ||
|
||
/// <summary> | ||
/// A function name. | ||
/// </summary> | ||
Element, | ||
|
||
/// <summary> | ||
/// A property <c>.property_name</c>. | ||
/// </summary> | ||
Property, | ||
|
||
/// <summary> | ||
/// A string literal. | ||
/// </summary> | ||
String, | ||
|
||
/// <summary> | ||
/// A numeric literal. | ||
/// </summary> | ||
Numeric, | ||
|
||
/// <summary> | ||
/// Start a grouping <c>'('</c>. | ||
/// </summary> | ||
GroupStart, | ||
|
||
/// <summary> | ||
/// End a grouping <c>')'</c>. | ||
/// </summary> | ||
GroupEnd, | ||
|
||
/// <summary> | ||
/// Start an index <c>'['</c>. | ||
/// </summary> | ||
IndexStart, | ||
|
||
/// <summary> | ||
/// End an index <c>']'</c>. | ||
/// </summary> | ||
IndexEnd | ||
} | ||
} |
Oops, something went wrong.