Skip to content

Commit

Permalink
Ensuring we use Parse.Ref to support replacing/ customizing compone…
Browse files Browse the repository at this point in the history
…nts of the parser
  • Loading branch information
djluck committed Nov 24, 2021
1 parent 4b786c0 commit f9c37ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PromQL.Parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ from head in OneOf(
Parse.Ref(() => ParenExpression).Cast<PromToken, ParenExpression, Expr>(),
Parse.Ref(() => AggregateExpr).Cast<PromToken, AggregateExpr, Expr>(),
Parse.Ref(() => FunctionCall).Cast<PromToken, FunctionCall, Expr>(),
Number.Cast<PromToken, NumberLiteral, Expr>().Try(),
Parse.Ref(() => Number).Cast<PromToken, NumberLiteral, Expr>().Try(),
Parse.Ref(() => UnaryExpr).Cast<PromToken, UnaryExpr, Expr>(),
MatrixSelector.Cast<PromToken, MatrixSelector, Expr>().Try(),
VectorSelector.Cast<PromToken, VectorSelector, Expr>(),
StringLiteral.Cast<PromToken, StringLiteral, Expr>()
Parse.Ref(() => MatrixSelector).Cast<PromToken, MatrixSelector, Expr>().Try(),
Parse.Ref(() => VectorSelector).Cast<PromToken, VectorSelector, Expr>(),
Parse.Ref(() => StringLiteral).Cast<PromToken, StringLiteral, Expr>()
)
#pragma warning disable CS8602
from offsetOrSubquery in Parse.Ref(() => OffsetOrSubquery(head)).AsNullable().OptionalOrDefault()
Expand Down

0 comments on commit f9c37ea

Please sign in to comment.