Skip to content

Commit

Permalink
Auto-sync from Azure-Kusto-Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Kusto Build System committed Aug 1, 2024
1 parent 2f98fac commit 13cb2d8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
9 changes: 1 addition & 8 deletions src/Kusto.Language/Parser/QueryGrammar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2002,14 +2002,7 @@ Parser<LexicalToken, DataScopeClause> DataScopeClause(CompletionKind ckind) =>
new MvExpandExpression(expr, toTypeOfClause)));

var MvExpandExpressionList =
First(
// if only one item that is just "to typeof(xxx)" then allow expression to be null w/o error
If(And(Token(SyntaxKind.ToKeyword), TypeofLiteral, Fails(Token(SyntaxKind.CommaToken))),
Rule(ToTypeOfClause,
clause => new SyntaxList<SeparatedElement<MvExpandExpression>>(new[] {
new SeparatedElement<MvExpandExpression>(new MvExpandExpression(null, clause)) })))
.Hide(),
SeparatedList(MvExpandExpression, SyntaxKind.CommaToken, fnMissingElement: CreateMissingMvExpandExpression, oneOrMore: true));
SeparatedList(MvExpandExpression, SyntaxKind.CommaToken, fnMissingElement: CreateMissingMvExpandExpression, oneOrMore: true);

var MvExpandRowLimitClause =
Rule(
Expand Down
19 changes: 0 additions & 19 deletions src/Kusto.Language/Parser/QueryParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4219,25 +4219,6 @@ private MvExpandExpression CreateMissingMvExpandExpression() =>

private SyntaxList<SeparatedElement<MvExpandExpression>> ParseMvExpandExpressionList()
{
if (PeekToken().Kind == SyntaxKind.ToKeyword)
{
var position = GetResetPoint();

// if only one item that is just "to typeof(xxx)" then allow expression to be null w/o error
var clause = ParseToTypeOfClause();
if (PeekToken().Kind != SyntaxKind.CommaToken)
{
return new SyntaxList<SeparatedElement<MvExpandExpression>>(new[]
{
new SeparatedElement<MvExpandExpression>(new MvExpandExpression(null, clause))
});
}
else
{
Reset(position);
}
}

return ParseCommaList(FnParseMvExpandExpression, CreateMissingMvExpandExpression, FnScanMvExpandExpressionListEnd, oneOrMore: true);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Kusto.Language/Syntax/CodeGen/GeneratedSyntaxNodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6140,7 +6140,7 @@ public sealed partial class MvExpandExpression : Expression
/// </summary>
internal MvExpandExpression(Expression expression, ToTypeOfClause toTypeOf, IReadOnlyList<Diagnostic> diagnostics = null) : base(diagnostics)
{
this.Expression = Attach(expression, optional: true);
this.Expression = Attach(expression);
this.ToTypeOf = Attach(toTypeOf, optional: true);
this.Init();
}
Expand Down Expand Up @@ -6171,7 +6171,6 @@ public override bool IsOptional(int index)
{
switch (index)
{
case 0:
case 1:
return true;
default:
Expand Down

0 comments on commit 13cb2d8

Please sign in to comment.