Skip to content

Commit

Permalink
Merge pull request #3 from djluck/binary-arithmetic-operators
Browse files Browse the repository at this point in the history
Adding set to describe the binary arithmetic operators
  • Loading branch information
djluck authored Apr 8, 2022
2 parents eba7d4a + 12ab91f commit 5728f62
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/PromQL.Parser/Operators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ public enum Unary
Binary.Eql,
Binary.Neq
}.ToImmutableHashSet();

/// <summary>
/// The set of binary operations that are arithmetic operators.
/// </summary>
/// <remarks>https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators</remarks>
public static ImmutableHashSet<Binary> BinaryArithmeticOperators { get; set; }= new[]
{
Binary.Add,
Binary.Sub,
Binary.Mod,
Binary.Mul,
Binary.Div,
Binary.Pow
}.ToImmutableHashSet();

/// <summary>
/// Operators are ordered by highest -> lowest precedence.
Expand Down

0 comments on commit 5728f62

Please sign in to comment.