@alexanderzobnin/monaco-kusto
Version:
CSL, KQL plugin for the Monaco Editor
1 lines • 1.31 MB
JavaScript
!function(a,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.monaco=e():a.monaco=e()}(self,function(){return function(a){var e={};function n(t){if(e[t])return e[t].exports;var s=e[t]={i:t,l:!1,exports:{}};return a[t].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=a,n.c=e,n.d=function(a,e,t){n.o(a,e)||Object.defineProperty(a,e,{enumerable:!0,get:t})},n.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,e){if(1&e&&(a=n(a)),8&e)return a;if(4&e&&"object"==typeof a&&a&&a.__esModule)return a;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:a}),2&e&&"string"!=typeof a)for(var s in a)n.d(t,s,function(e){return a[e]}.bind(null,s));return t},n.n=function(a){var e=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(e,"a",e),e},n.o=function(a,e){return Object.prototype.hasOwnProperty.call(a,e)},n.p="",n(n.s=16)}({0:function(a,e){a.exports={import:function(){throw new Error("System.import cannot be used indirectly")}}},16:function(a,e,n){(function(a){Bridge.assembly("Kusto.Language.Bridge",function(e,n){"use strict";a=n.System,Bridge.define("Kusto.Language.Binding.Binder",{statics:{fields:{s_symbolListPool:null,s_diagnosticListPool:null,s_columnListPool:null,s_tableListPool:null,s_functionListPool:null,s_signatureListPool:null,s_patternListPool:null,s_expressionListPool:null,s_typeListPool:null,s_stringSetPool:null,s_uniqueNameTablePool:null,s_projectionBuilderPool:null,LiteralBoolInfo:null,LiteralIntInfo:null,LiteralLongInfo:null,LiteralRealInfo:null,LiteralDecimalInfo:null,LiteralStringInfo:null,LiteralDateTimeInfo:null,LiteralTimeSpanInfo:null,LiteralGuidInfo:null,LiteralTypeInfo:null,LiteralDynamicInfo:null,ErrorInfo:null,VoidInfo:null},ctors:{init:function(){this.s_symbolListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.Symbol)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.Symbol).ctor)},function(a){a.clear()}),this.s_diagnosticListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Diagnostic)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Diagnostic).ctor)},function(a){a.clear()}),this.s_columnListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.ColumnSymbol)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.ColumnSymbol).ctor)},function(a){a.clear()}),this.s_tableListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.TableSymbol)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.TableSymbol).ctor)},function(a){a.clear()}),this.s_functionListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.FunctionSymbol)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.FunctionSymbol).ctor)},function(a){a.clear()}),this.s_signatureListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.Signature)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.Signature).ctor)},function(a){a.clear()}),this.s_patternListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.PatternSignature)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.PatternSignature).ctor)},function(a){a.clear()}),this.s_expressionListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Syntax.Expression)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Syntax.Expression).ctor)},function(a){a.clear()}),this.s_typeListPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.List$1(Kusto.Language.Symbols.TypeSymbol)))(function(){return new(a.Collections.Generic.List$1(Kusto.Language.Symbols.TypeSymbol).ctor)},function(a){a.clear()}),this.s_stringSetPool=new(Kusto.Language.Utils.ObjectPool$1(a.Collections.Generic.HashSet$1(a.String)))(function(){return new(a.Collections.Generic.HashSet$1(a.String).ctor)},function(a){a.clear()}),this.s_uniqueNameTablePool=new(Kusto.Language.Utils.ObjectPool$1(Kusto.Language.Utils.UniqueNameTable))(function(){return new Kusto.Language.Utils.UniqueNameTable},function(a){a.Clear()}),this.s_projectionBuilderPool=new(Kusto.Language.Utils.ObjectPool$1(Kusto.Language.Binding.ProjectionBuilder))(function(){return new Kusto.Language.Binding.ProjectionBuilder},function(a){a.Clear()}),this.LiteralBoolInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Bool,void 0,!0),this.LiteralIntInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Int,void 0,!0),this.LiteralLongInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Long,void 0,!0),this.LiteralRealInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Real,void 0,!0),this.LiteralDecimalInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Decimal,void 0,!0),this.LiteralStringInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.String,void 0,!0),this.LiteralDateTimeInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.DateTime,void 0,!0),this.LiteralTimeSpanInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.TimeSpan,void 0,!0),this.LiteralGuidInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Guid,void 0,!0),this.LiteralTypeInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Type,void 0,!0),this.LiteralDynamicInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ScalarTypes.Dynamic,void 0,!0),this.ErrorInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.ErrorSymbol.Instance),this.VoidInfo=new Kusto.Language.Syntax.SemanticInfo.$ctor3(Kusto.Language.Symbols.VoidSymbol.Instance)}},methods:{GetSymbolsInScope:function(a,e,n,t,s,o){var r=t.GetOrCreateCache(Kusto.Language.Binding.BindingCache),u=new Kusto.Language.Binding.Binder(n,t,r),i=Kusto.Language.Binding.Binder.GetStartNode(a,e);u.SetContext(i,e),u.GetSymbolsInContext(s,o)},GetStartNode:function(a,e){var n=a.GetTokenAt(e);if(null!=n&&e<=n.TextStart){var t=n.GetPreviousToken();return null!=t&&t.Depth>=n.Depth?t.Parent:n.Parent}return null},GetDeclaredFunctionsInScope:function(e,n,t){var s,o=Kusto.Language.Binding.Binder.s_symbolListPool.AllocateFromPool();try{e.LocalScope.GetSymbols$1(n,Kusto.Language.Symbols.SymbolMatch.Local,o),s=Bridge.getEnumerator(o);try{for(;s.moveNext();){var r,u=s.Current;null!=(r=Bridge.as(Kusto.Language.Binding.Binder.GetResultSymbol(u),Kusto.Language.Symbols.FunctionSymbol))&&t.add(r)}}finally{Bridge.is(s,a.IDisposable)&&s.System$IDisposable$Dispose()}}finally{Kusto.Language.Binding.Binder.s_symbolListPool.ReturnToPool(o)}},IsFunctionCallName:function(a){var e;return null!=(e=Bridge.as(a.Parent,Kusto.Language.Syntax.FunctionCallExpression))&&Bridge.referenceEquals(e.Name,a)},GetWildcardSymbols:function(e,n,t){var s;s=Bridge.getEnumerator(n,Kusto.Language.Symbols.Symbol);try{for(;s.moveNext();){var o=s.Current;Kusto.Language.Binding.Binder.Matches(e,o.Name)&&t.add(o)}}finally{Bridge.is(s,a.IDisposable)&&s.System$IDisposable$Dispose()}},Matches:function(e,n){var t,s,o=0,r=!1;t=Bridge.getEnumerator(e.Tokens,"GetEnumerator$1");try{for(;t.moveNext();){var u=t.Current;if(Bridge.referenceEquals(u.Text,"*"))r=!0;else if(r){var i=a.String.indexOf(n,u.Text,o);if(i<o)return!1;o=i+u.Text.length|0}else{if((o+u.Text.length|0)>n.length)return!1;if(0!==(s=u.Text.length,a.String.compare(u.Text.substr(0,s),n.substr(o,s))))return!1}}}finally{Bridge.is(t,a.IDisposable)&&t.System$IDisposable$Dispose()}return!0},GetOperatorKind:function(a){switch(a){case Kusto.Language.Syntax.SyntaxKind.AddExpression:return Kusto.Language.Symbols.OperatorKind.Add;case Kusto.Language.Syntax.SyntaxKind.SubtractExpression:return Kusto.Language.Symbols.OperatorKind.Subtract;case Kusto.Language.Syntax.SyntaxKind.MultiplyExpression:return Kusto.Language.Symbols.OperatorKind.Multiply;case Kusto.Language.Syntax.SyntaxKind.DivideExpression:return Kusto.Language.Symbols.OperatorKind.Divide;case Kusto.Language.Syntax.SyntaxKind.ModuloExpression:return Kusto.Language.Symbols.OperatorKind.Modulo;case Kusto.Language.Syntax.SyntaxKind.UnaryMinusExpression:return Kusto.Language.Symbols.OperatorKind.UnaryMinus;case Kusto.Language.Syntax.SyntaxKind.UnaryPlusExpression:return Kusto.Language.Symbols.OperatorKind.UnaryPlus;case Kusto.Language.Syntax.SyntaxKind.EqualExpression:return Kusto.Language.Symbols.OperatorKind.Equal;case Kusto.Language.Syntax.SyntaxKind.NotEqualExpression:return Kusto.Language.Symbols.OperatorKind.NotEqual;case Kusto.Language.Syntax.SyntaxKind.LessThanExpression:return Kusto.Language.Symbols.OperatorKind.LessThan;case Kusto.Language.Syntax.SyntaxKind.LessThanOrEqualExpression:return Kusto.Language.Symbols.OperatorKind.LessThanOrEqual;case Kusto.Language.Syntax.SyntaxKind.GreaterThanExpression:return Kusto.Language.Symbols.OperatorKind.GreaterThan;case Kusto.Language.Syntax.SyntaxKind.GreaterThanOrEqualExpression:return Kusto.Language.Symbols.OperatorKind.GreaterThanOrEqual;case Kusto.Language.Syntax.SyntaxKind.EqualTildeExpression:return Kusto.Language.Symbols.OperatorKind.EqualTilde;case Kusto.Language.Syntax.SyntaxKind.BangTildeExpression:return Kusto.Language.Symbols.OperatorKind.BangTilde;case Kusto.Language.Syntax.SyntaxKind.HasExpression:return Kusto.Language.Symbols.OperatorKind.Has;case Kusto.Language.Syntax.SyntaxKind.HasCsExpression:return Kusto.Language.Symbols.OperatorKind.HasCs;case Kusto.Language.Syntax.SyntaxKind.NotHasExpression:return Kusto.Language.Symbols.OperatorKind.NotHas;case Kusto.Language.Syntax.SyntaxKind.NotHasCsExpression:return Kusto.Language.Symbols.OperatorKind.NotHasCs;case Kusto.Language.Syntax.SyntaxKind.HasPrefixExpression:return Kusto.Language.Symbols.OperatorKind.HasPrefix;case Kusto.Language.Syntax.SyntaxKind.HasPrefixCsExpression:return Kusto.Language.Symbols.OperatorKind.HasPrefixCs;case Kusto.Language.Syntax.SyntaxKind.NotHasPrefixExpression:return Kusto.Language.Symbols.OperatorKind.NotHasPrefix;case Kusto.Language.Syntax.SyntaxKind.NotHasPrefixCsExpression:return Kusto.Language.Symbols.OperatorKind.NotHasPrefixCs;case Kusto.Language.Syntax.SyntaxKind.HasSuffixExpression:return Kusto.Language.Symbols.OperatorKind.HasSuffix;case Kusto.Language.Syntax.SyntaxKind.HasSuffixCsExpression:return Kusto.Language.Symbols.OperatorKind.HasSuffixCs;case Kusto.Language.Syntax.SyntaxKind.NotHasSuffixExpression:return Kusto.Language.Symbols.OperatorKind.NotHasSuffix;case Kusto.Language.Syntax.SyntaxKind.NotHasSuffixCsExpression:return Kusto.Language.Symbols.OperatorKind.NotHasSuffixCs;case Kusto.Language.Syntax.SyntaxKind.LikeExpression:return Kusto.Language.Symbols.OperatorKind.Like;case Kusto.Language.Syntax.SyntaxKind.LikeCsExpression:return Kusto.Language.Symbols.OperatorKind.LikeCs;case Kusto.Language.Syntax.SyntaxKind.NotLikeExpression:return Kusto.Language.Symbols.OperatorKind.NotLike;case Kusto.Language.Syntax.SyntaxKind.NotLikeCsExpression:return Kusto.Language.Symbols.OperatorKind.NotLikeCs;case Kusto.Language.Syntax.SyntaxKind.ContainsExpression:return Kusto.Language.Symbols.OperatorKind.Contains;case Kusto.Language.Syntax.SyntaxKind.ContainsCsExpression:return Kusto.Language.Symbols.OperatorKind.ContainsCs;case Kusto.Language.Syntax.SyntaxKind.NotContainsExpression:return Kusto.Language.Symbols.OperatorKind.NotContains;case Kusto.Language.Syntax.SyntaxKind.NotContainsCsExpression:return Kusto.Language.Symbols.OperatorKind.NotContainsCs;case Kusto.Language.Syntax.SyntaxKind.StartsWithExpression:return Kusto.Language.Symbols.OperatorKind.StartsWith;case Kusto.Language.Syntax.SyntaxKind.StartsWithCsExpression:return Kusto.Language.Symbols.OperatorKind.StartsWithCs;case Kusto.Language.Syntax.SyntaxKind.NotStartsWithExpression:return Kusto.Language.Symbols.OperatorKind.NotStartsWith;case Kusto.Language.Syntax.SyntaxKind.NotStartsWithCsExpression:return Kusto.Language.Symbols.OperatorKind.NotStartsWithCs;case Kusto.Language.Syntax.SyntaxKind.EndsWithExpression:return Kusto.Language.Symbols.OperatorKind.EndsWith;case Kusto.Language.Syntax.SyntaxKind.EndsWithCsExpression:return Kusto.Language.Symbols.OperatorKind.EndsWithCs;case Kusto.Language.Syntax.SyntaxKind.NotEndsWithExpression:case Kusto.Language.Syntax.SyntaxKind.NotEndsWithCsExpression:return Kusto.Language.Symbols.OperatorKind.NotEndsWith;case Kusto.Language.Syntax.SyntaxKind.MatchesRegexExpression:return Kusto.Language.Symbols.OperatorKind.MatchRegex;case Kusto.Language.Syntax.SyntaxKind.InExpression:return Kusto.Language.Symbols.OperatorKind.In;case Kusto.Language.Syntax.SyntaxKind.InCsExpression:return Kusto.Language.Symbols.OperatorKind.InCs;case Kusto.Language.Syntax.SyntaxKind.NotInExpression:return Kusto.Language.Symbols.OperatorKind.NotIn;case Kusto.Language.Syntax.SyntaxKind.NotInCsExpression:return Kusto.Language.Symbols.OperatorKind.NotInCs;case Kusto.Language.Syntax.SyntaxKind.BetweenExpression:return Kusto.Language.Symbols.OperatorKind.Between;case Kusto.Language.Syntax.SyntaxKind.NotBetweenExpression:return Kusto.Language.Symbols.OperatorKind.NotBetween;case Kusto.Language.Syntax.SyntaxKind.AndExpression:return Kusto.Language.Symbols.OperatorKind.And;case Kusto.Language.Syntax.SyntaxKind.OrExpression:return Kusto.Language.Symbols.OperatorKind.Or;case Kusto.Language.Syntax.SyntaxKind.SearchExpression:return Kusto.Language.Symbols.OperatorKind.Search;default:return Kusto.Language.Symbols.OperatorKind.None}},IsPromotable:function(a,e){return Kusto.Language.Binding.Binder.SymbolsAssignable(e,Kusto.Language.Symbols.ScalarTypes.Long)&&Kusto.Language.Binding.Binder.SymbolsAssignable(a,Kusto.Language.Symbols.ScalarTypes.Int)},Promote:function(a){return Bridge.referenceEquals(a,Kusto.Language.Symbols.ScalarTypes.Int)?Kusto.Language.Symbols.ScalarTypes.Long:Bridge.referenceEquals(a,Kusto.Language.Symbols.ScalarTypes.Decimal)?Kusto.Language.Symbols.ScalarTypes.Real:a},GetWidestArgumentType:function(e,n){for(var t=null,s=0;s<a.Array.getCount(n,Kusto.Language.Symbols.TypeSymbol);s=s+1|0){var o,r=a.Array.getItem(n,s,Kusto.Language.Symbols.TypeSymbol);null!=(o=Bridge.as(r,Kusto.Language.Symbols.ScalarSymbol))&&o.IsNumeric&&!Bridge.referenceEquals(o,t)&&(null==t||o.IsWiderThan(t))&&(t=o)}return t},GetCommonArgumentType:function(e,n,t){for(var s=null,o=0;o<a.Array.getCount(t,Kusto.Language.Symbols.TypeSymbol);o=o+1|0){var r=e.GetParameter(a.Array.getItem(n,o,Kusto.Language.Syntax.Expression),o,a.Array.getCount(t,Kusto.Language.Symbols.TypeSymbol));if(null!=r){var u=a.Array.getItem(t,o,Kusto.Language.Symbols.TypeSymbol);(r.TypeKind===Kusto.Language.Symbols.ParameterTypeKind.CommonScalar&&u.IsScalar||r.TypeKind===Kusto.Language.Symbols.ParameterTypeKind.CommonScalarOrDynamic&&u.IsScalar||r.TypeKind===Kusto.Language.Symbols.ParameterTypeKind.CommonNumber&&Kusto.Language.Binding.Binder.IsNumber(u)||r.TypeKind===Kusto.Language.Symbols.ParameterTypeKind.CommonSummable&&Kusto.Language.Binding.Binder.IsSummable(u))&&(null==s?s=u:Kusto.Language.Binding.Binder.IsPromotable(s,u)?s=u:Kusto.Language.Binding.Binder.SymbolsAssignable(s,Kusto.Language.Symbols.ScalarTypes.Dynamic)&&(s=u))}}return s},GetCommonScalarType:function(e){void 0===e&&(e=[]);for(var n=null,t=0;t<e.length;t=t+1|0){var s=e[a.Array.index(t,e)];s.IsScalar&&(null==n?n=s:Kusto.Language.Binding.Binder.IsPromotable(n,s)?n=s:Kusto.Language.Binding.Binder.SymbolsAssignable(n,Kusto.Language.Symbols.ScalarTypes.Dynamic)&&(n=s))}return n},GetBestMatchingSignatures:function(e,n,t,s){var o,r,u,i=a.Array.getCount(t,Kusto.Language.Symbols.TypeSymbol);if(0!==a.Array.getCount(e,Kusto.Language.Symbols.Signature))if(1!==a.Array.getCount(e,Kusto.Language.Symbols.Signature)){if(1<a.Array.getCount(e,Kusto.Language.Symbols.Signature)){var g=0,l=0;o=Bridge.getEnumerator(e,Kusto.Language.Symbols.Signature);try{for(;o.moveNext();){var y=o.Current;i>=y.MinArgumentCount&&i<=y.MaxArgumentCount?s.add(y):i<y.MinArgumentCount&&g>y.MinArgumentCount&&(g=y.MinArgumentCount),y.MaxArgumentCount>l&&(l=y.MaxArgumentCount)}}finally{Bridge.is(o,a.IDisposable)&&o.System$IDisposable$Dispose()}if(0===s.Count){0===g&&(g=l),r=Bridge.getEnumerator(e,Kusto.Language.Symbols.Signature);try{for(;r.moveNext();){var S=r.Current;g>=S.MinArgumentCount&&g<=S.MaxArgumentCount&&s.add(S)}}finally{Bridge.is(r,a.IDisposable)&&r.System$IDisposable$Dispose()}}}if(1<s.Count){var c=0;u=Bridge.getEnumerator(s);try{for(;u.moveNext();){var K=u.Current,d=Kusto.Language.Binding.Binder.GetParameterMatchCount(K,n,t);c<d&&(c=d)}}finally{Bridge.is(u,a.IDisposable)&&u.System$IDisposable$Dispose()}for(var L=s.Count-1|0;0<=L;L=L-1|0){var m=s.getItem(L);Kusto.Language.Binding.Binder.GetParameterMatchCount(m,n,t)!==c&&s.removeAt(L)}if(1<s.Count){for(var x=s.getItem(0),p=1;p<s.Count;p=p+1|0)Kusto.Language.Binding.Binder.IsBetterSignatureMatch(s.getItem(p),x,n,t)&&(x=s.getItem(p));for(var h=0;h<s.Count;h=h+1|0)if(!Bridge.referenceEquals(s.getItem(h),x)&&!Kusto.Language.Binding.Binder.IsBetterSignatureMatch(x,s.getItem(h),n,t))return;s.clear(),s.add(x)}}}else s.add(a.Array.getItem(e,0,Kusto.Language.Symbols.Signature))},IsBetterSignatureMatch:function(e,n,t,s){var o=a.Array.getCount(s,Kusto.Language.Symbols.TypeSymbol),r=Kusto.Language.Binding.Binder.GetParameterMatchCount(e,t,s),u=Kusto.Language.Binding.Binder.GetParameterMatchCount(n,t,s);if(r===o&&u<o)return!0;for(var i=null,g=0;g<a.Array.getCount(s,Kusto.Language.Symbols.TypeSymbol);g=g+1|0)if(Kusto.Language.Binding.Binder.IsBetterParameterMatch(e,n,t,s,g)){if(Bridge.referenceEquals(i,n))break;i=e}else if(Kusto.Language.Binding.Binder.IsBetterParameterMatch(n,e,t,s,g)){if(Bridge.referenceEquals(i,e)){i=null;break}i=n}return!!Bridge.referenceEquals(i,e)||u<r},IsBetterParameterMatch:function(a,e,n,t,s){var o=Kusto.Language.Binding.Binder.GetParameterMatchKind$1(a,n,t,s);return Kusto.Language.Binding.Binder.GetParameterMatchKind$1(e,n,t,s)<o},GetParameterMatchCount:function(e,n,t){for(var s=a.Array.getCount(t,Kusto.Language.Symbols.TypeSymbol),o=0,r=0;r<s;r=r+1|0)Kusto.Language.Binding.Binder.GetParameterMatchKind$1(e,n,t,r)!==Kusto.Language.Binding.Binder.MatchKind.None&&(o=o+1|0);return o},ParameterMatches:function(a,e,n,t){return Kusto.Language.Binding.Binder.GetParameterMatchKind$1(a,e,n,t)!==Kusto.Language.Binding.Binder.MatchKind.None},GetParameterMatchKind$1:function(e,n,t,s){var o=Kusto.Language.Binding.Binder.GetParameter(e,n,s);return Kusto.Language.Binding.Binder.GetParameterMatchKind(e,n,t,o,a.Array.getItem(n,s,Kusto.Language.Syntax.Expression),a.Array.getItem(t,s,Kusto.Language.Symbols.TypeSymbol))},GetParameterMatchKind:function(e,n,t,s,o,r){if(null==s)return Kusto.Language.Binding.Binder.MatchKind.None;var u,i;if(null!=s.DefaultValueIndicator&&Bridge.referenceEquals(r,Kusto.Language.Symbols.ScalarTypes.String)&&null!=(u=Bridge.as(o,Kusto.Language.Syntax.LiteralExpression))&&null!=(i=Bridge.as(u.LiteralValue,a.String))&&Bridge.referenceEquals(i,s.DefaultValueIndicator))return Kusto.Language.Binding.Binder.MatchKind.Exact;if(Bridge.is(o,Kusto.Language.Syntax.StarExpression))return s.ArgumentKind===Kusto.Language.Symbols.ArgumentKind.Star?Kusto.Language.Binding.Binder.MatchKind.Exact:Kusto.Language.Binding.Binder.MatchKind.None;if(s.ArgumentKind===Kusto.Language.Symbols.ArgumentKind.Star)return Kusto.Language.Binding.Binder.MatchKind.None;switch(s.TypeKind){case Kusto.Language.Symbols.ParameterTypeKind.Declared:if(Kusto.Language.Binding.Binder.SymbolsAssignable$1(s.DeclaredTypes,r))return 1===a.Array.getCount(s.DeclaredTypes,Kusto.Language.Symbols.TypeSymbol)?Kusto.Language.Binding.Binder.MatchKind.Exact:Kusto.Language.Binding.Binder.MatchKind.OneOfTwo;if(Kusto.Language.Binding.Binder.IsPromotable(r,a.Array.getItem(s.DeclaredTypes,0,Kusto.Language.Symbols.TypeSymbol)))return Kusto.Language.Binding.Binder.MatchKind.Promoted;break;case Kusto.Language.Symbols.ParameterTypeKind.Scalar:if(r.IsScalar)return Kusto.Language.Binding.Binder.MatchKind.Scalar;break;case Kusto.Language.Symbols.ParameterTypeKind.Integer:if(Kusto.Language.Binding.Binder.IsInteger(r))return Kusto.Language.Binding.Binder.MatchKind.OneOfTwo;break;case Kusto.Language.Symbols.ParameterTypeKind.RealOrDecimal:if(Kusto.Language.Binding.Binder.IsRealOrDecimal(r))return Kusto.Language.Binding.Binder.MatchKind.OneOfTwo;break;case Kusto.Language.Symbols.ParameterTypeKind.StringOrDynamic:if(Kusto.Language.Binding.Binder.IsStringOrDynamic(r))return Kusto.Language.Binding.Binder.MatchKind.OneOfTwo;break;case Kusto.Language.Symbols.ParameterTypeKind.IntegerOrDynamic:if(Kusto.Language.Binding.Binder.IsIntegerOrDynamic(r))return Kusto.Language.Binding.Binder.MatchKind.OneOfTwo;break;case Kusto.Language.Symbols.ParameterTypeKind.Number:if(Kusto.Language.Binding.Binder.IsNumber(r))return Kusto.Language.Binding.Binder.MatchKind.Number;break;case Kusto.Language.Symbols.ParameterTypeKind.Summable:if(Kusto.Language.Binding.Binder.IsSummable(r))return Kusto.Language.Binding.Binder.MatchKind.Summable;break;case Kusto.Language.Symbols.ParameterTypeKind.Tabular:case Kusto.Language.Symbols.ParameterTypeKind.SingleColumnTable:if(Kusto.Language.Binding.Binder.IsTabular(r))return Kusto.Language.Binding.Binder.MatchKind.Tabular;break;case Kusto.Language.Symbols.ParameterTypeKind.Database:if(Kusto.Language.Binding.Binder.IsDatabase(r))return Kusto.Language.Binding.Binder.MatchKind.Database;break;case Kusto.Language.Symbols.ParameterTypeKind.Cluster:if(Kusto.Language.Binding.Binder.IsCluster(r))return Kusto.Language.Binding.Binder.MatchKind.Cluster;break;case Kusto.Language.Symbols.ParameterTypeKind.NotBool:if(!Kusto.Language.Binding.Binder.SymbolsAssignable(r,Kusto.Language.Symbols.ScalarTypes.Bool))return Kusto.Language.Binding.Binder.MatchKind.NotType;break;case Kusto.Language.Symbols.ParameterTypeKind.NotRealOrBool:if(!Kusto.Language.Binding.Binder.SymbolsAssignable(r,Kusto.Language.Symbols.ScalarTypes.Real)&&!Kusto.Language.Binding.Binder.SymbolsAssignable(r,Kusto.Language.Symbols.ScalarTypes.Bool))return Kusto.Language.Binding.Binder.MatchKind.NotType;break;case Kusto.Language.Symbols.ParameterTypeKind.NotDynamic:if(!Kusto.Language.Binding.Binder.SymbolsAssignable(r,Kusto.Language.Symbols.ScalarTypes.Dynamic))return Kusto.Language.Binding.Binder.MatchKind.NotType;break;case Kusto.Language.Symbols.ParameterTypeKind.Parameter0:var g=e.GetParameter$1(0,a.Array.getCount(n,Kusto.Language.Syntax.Expression));return Kusto.Language.Binding.Binder.GetParameterMatchKind(e,n,t,g,o,r);case Kusto.Language.Symbols.ParameterTypeKind.Parameter1:var l=e.GetParameter$1(1,a.Array.getCount(n,Kusto.Language.Syntax.Expression));return Kusto.Language.Binding.Binder.GetParameterMatchKind(e,n,t,l,o,r);case Kusto.Language.Symbols.ParameterTypeKind.Parameter2:var y=e.GetParameter$1(2,a.Array.getCount(n,Kusto.Language.Syntax.Expression));return Kusto.Language.Binding.Binder.GetParameterMatchKind(e,n,t,y,o,r);case Kusto.Language.Symbols.ParameterTypeKind.CommonScalar:case Kusto.Language.Symbols.ParameterTypeKind.CommonNumber:case Kusto.Language.Symbols.ParameterTypeKind.CommonSummable:case Kusto.Language.Symbols.ParameterTypeKind.CommonScalarOrDynamic:var S=Kusto.Language.Binding.Binder.GetCommonArgumentType(e,n,t);if(null!=S){if(Kusto.Language.Binding.Binder.SymbolsAssignable(r,S))return Kusto.Language.Binding.Binder.MatchKind.Exact;if(Kusto.Language.Binding.Binder.IsPromotable(r,S))return Kusto.Language.Binding.Binder.MatchKind.Promoted;if(s.TypeKind===Kusto.Language.Symbols.ParameterTypeKind.CommonScalarOrDynamic&&Kusto.Language.Binding.Binder.SymbolsAssignable(r,Kusto.Language.Symbols.ScalarTypes.Dynamic))return Kusto.Language.Binding.Binder.MatchKind.Exact}}return Kusto.Language.Binding.Binder.MatchKind.None},GetParameter:function(e,n,t){return e.GetParameter(a.Array.getItem(n,t,Kusto.Language.Syntax.Expression),t,a.Array.getCount(n,Kusto.Language.Syntax.Expression))},IsInvokeOperatorFunctionCall:function(a){var e;return Bridge.is(a.Parent,Kusto.Language.Syntax.InvokeOperator)||null!=(e=Bridge.as(a.Parent,Kusto.Language.Syntax.PathExpression))&&Bridge.is(e.Parent,Kusto.Language.Syntax.InvokeOperator)},UnifyColumnsWithSameNameAndType:function(e){var n,t=Kusto.Language.Binding.Binder.s_uniqueNameTablePool.AllocateFromPool(),s=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool();try{for(var o=Kusto.Language.Binding.Binder.BuildColumnNameMap(e),r=0;r<e.Count;r=r+1|0){var u=e.getItem(r),i={};if(o.tryGetValue(u.Name,i)){if(1===i.v.Count)s.add(Kusto.Language.Binding.Binder.GetUniqueColumn(u,t));else if(1<i.v.Count){n=Bridge.getEnumerator(i.v);try{for(;n.moveNext();){var g=n.Current,l=t.GetOrAddName((u.Name||"")+"_"+(g.Name||""));s.add(new Kusto.Language.Symbols.ColumnSymbol(l,g))}}finally{Bridge.is(n,a.IDisposable)&&n.System$IDisposable$Dispose()}}o.remove(u.Name)}}e.clear(),e.AddRange(s)}finally{Kusto.Language.Binding.Binder.s_uniqueNameTablePool.ReturnToPool(t),Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(s)}},UnifyColumnsWithSameName:function(a){var e=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool();try{for(var n=Kusto.Language.Binding.Binder.BuildColumnNameMap(a),t=0;t<a.Count;t=t+1|0){var s=a.getItem(t),o={};if(n.tryGetValue(s.Name,o)){if(1===o.v.Count)e.add(s);else if(1<o.v.Count){var r=o.v.ToArray(),u=Kusto.Language.Binding.Binder.GetCommonScalarType(r);null==u&&(u=Kusto.Language.Symbols.ScalarTypes.Dynamic),Bridge.referenceEquals(s.Type,u)?e.add(s):e.add(new Kusto.Language.Symbols.ColumnSymbol(s.Name,u))}n.remove(s.Name)}}a.clear(),a.AddRange(e)}finally{Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(e)}},MakeColumnNamesUnique:function(a){var e=Kusto.Language.Binding.Binder.s_uniqueNameTablePool.AllocateFromPool(),n=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool();try{for(var t=0;t<a.Count;t=t+1|0){var s=a.getItem(t);n.add(Kusto.Language.Binding.Binder.GetUniqueColumn(s,e))}a.clear(),a.AddRange(n)}finally{Kusto.Language.Binding.Binder.s_uniqueNameTablePool.ReturnToPool(e),Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(n)}},BuildColumnNameMap:function(e){for(var n=new(a.Collections.Generic.Dictionary$2(a.String,a.Collections.Generic.List$1(Kusto.Language.Symbols.TypeSymbol))),t=0;t<e.Count;t=t+1|0){var s=e.getItem(t),o={};n.tryGetValue(s.Name,o)||(o.v=new(a.Collections.Generic.List$1(Kusto.Language.Symbols.TypeSymbol).ctor),n.add(s.Name,o.v)),o.v.contains(s.Type)||o.v.add(s.Type)}return n},GetCommonColumns$2:function(e,n,t){var s,o=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool();try{Kusto.Language.Binding.Binder.GetCommonColumns$1(e,n,o),s=Bridge.getEnumerator(o);try{for(;s.moveNext();){var r=s.Current;t.add(r)}}finally{Bridge.is(s,a.IDisposable)&&s.System$IDisposable$Dispose()}}finally{Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(o)}},GetCommonColumns$1:function(e,n,t){var s,o,r=Kusto.Language.Binding.Binder.s_stringSetPool.AllocateFromPool();try{s=Bridge.getEnumerator(n,Kusto.Language.Symbols.ColumnSymbol);try{for(;s.moveNext();){var u=s.Current;r.add(u.Name)}}finally{Bridge.is(s,a.IDisposable)&&s.System$IDisposable$Dispose()}o=Bridge.getEnumerator(e,Kusto.Language.Symbols.ColumnSymbol);try{for(;o.moveNext();){var i=o.Current;r.contains(i.Name)&&t.add(i)}}finally{Bridge.is(o,a.IDisposable)&&o.System$IDisposable$Dispose()}}finally{Kusto.Language.Binding.Binder.s_stringSetPool.ReturnToPool(r)}},GetCommonColumns:function(e,n){if(n.clear(),1===a.Array.getCount(e,Kusto.Language.Symbols.TableSymbol))n.AddRange(a.Array.getItem(e,0,Kusto.Language.Symbols.TableSymbol).Columns);else if(2===a.Array.getCount(e,Kusto.Language.Symbols.TableSymbol))Kusto.Language.Binding.Binder.GetCommonColumns$1(a.Array.getItem(e,0,Kusto.Language.Symbols.TableSymbol).Columns,a.Array.getItem(e,1,Kusto.Language.Symbols.TableSymbol).Columns,n);else if(2<a.Array.getCount(e,Kusto.Language.Symbols.TableSymbol)){var t=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool(),s=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool();try{Kusto.Language.Binding.Binder.GetCommonColumns$1(a.Array.getItem(e,0,Kusto.Language.Symbols.TableSymbol).Columns,a.Array.getItem(e,1,Kusto.Language.Symbols.TableSymbol).Columns,t);for(var o=2;o<a.Array.getCount(e,Kusto.Language.Symbols.TableSymbol);o=o+1|0)Kusto.Language.Binding.Binder.GetCommonColumns$1(t,a.Array.getItem(e,o,Kusto.Language.Symbols.TableSymbol).Columns,s),o<(a.Array.getCount(e,Kusto.Language.Symbols.TableSymbol)-1|0)&&(t.clear(),t.AddRange(s),s.clear());n.AddRange(s)}finally{Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(t),Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(s)}}},GetUniqueColumn:function(a,e){var n=e.GetOrAddName(a.Name);return Bridge.referenceEquals(n,a.Name)?a:new Kusto.Language.Symbols.ColumnSymbol(n,a.Type)},CreateColumnsFromSchema$1:function(a,e,n,t){for(var s=0,o=a.Columns.Count;s<o;s=s+1|0){var r=a.Columns.getItem$1(s).Element$1;do{if(Bridge.is(r,Kusto.Language.Syntax.NameAndTypeDeclaration)){var u=Bridge.cast(r,Kusto.Language.Syntax.NameAndTypeDeclaration);Kusto.Language.Binding.Binder.CreateColumnsFromSchema(u,e,n,t);break}if(Bridge.is(r,Kusto.Language.Syntax.StarExpression)){Bridge.cast(r,Kusto.Language.Syntax.StarExpression);break}}while(0)}},CreateColumnsFromSchema:function(a,e,n,t){var s,o=a.Name.SimpleName;do{if(s=a.Type,Bridge.is(s,Kusto.Language.Syntax.PrimitiveTypeExpression)){var r=Bridge.cast(s,Kusto.Language.Syntax.PrimitiveTypeExpression),u=Kusto.Language.Binding.Binder.GetType(r);Kusto.Language.Binding.Binder.DeclareColumnName(n,o,t,a.Name)&&e.add(new Kusto.Language.Symbols.ColumnSymbol(o,u));break}if(Bridge.is(s,Kusto.Language.Syntax.SchemaTypeExpression)){var i=Bridge.cast(s,Kusto.Language.Syntax.SchemaTypeExpression),g=Kusto.Language.Binding.Binder.s_columnListPool.AllocateFromPool(),l=Kusto.Language.Binding.Binder.s_stringSetPool.AllocateFromPool();try{Kusto.Language.Binding.Binder.CreateColumnsFromSchema$1(i,g,l,t),Kusto.Language.Binding.Binder.DeclareColumnName(n,o,t,a.Name)&&e.add(new Kusto.Language.Symbols.ColumnSymbol(o,new Kusto.Language.Symbols.TableSymbol.$ctor2(g)))}finally{Kusto.Language.Binding.Binder.s_columnListPool.ReturnToPool(g),Kusto.Language.Binding.Binder.s_stringSetPool.ReturnToPool(l)}break}t.add(Kusto.Language.DiagnosticFacts.GetInvalidColumnDeclaration().WithLocation(a));break}while(0)},DeclareColumnName:function(a,e,n,t){return a.contains(e)?(n.add(Kusto.Language.DiagnosticFacts.GetDuplicateColumnDeclaration(e).WithLocation(t)),!1):(a.add(e),!0)},AddOrReplaceColumn:function(a,e){for(var n=0;n<a.Count;n=n+1|0)if(Bridge.referenceEquals(a.getItem(n).Name,e.Name))return void a.setItem(n,e);a.add(e)},AddUniqueColumn:function(a,e,n,t){var s=a.indexOf(n);if(!(0<=s&&s<e)){var o=t.GetOrAddName(n.Name);Bridge.referenceEquals(o,n.Name)||(n=new Kusto.Language.Symbols.ColumnSymbol(o,n.Type)),a.add(n)}},RenameColumn:function(a,e,n){for(var t=0;t<a.Count;t=t+1|0)Bridge.referenceEquals(a.getItem(t).Name,e)&&a.setItem(t,n)},GetExpressionResultName:function(a,e){if(void 0===e&&(e=""),Bridge.is(a,Kusto.Language.Syntax.IdentifierNameReference))return Bridge.cast(a,Kusto.Language.Syntax.IdentifierNameReference).SimpleName;if(Bridge.is(a,Kusto.Language.Syntax.BrackettedNameReference))return Bridge.cast(a,Kusto.Language.Syntax.BrackettedNameReference).SimpleName;if(Bridge.is(a,Kusto.Language.Syntax.PathExpression)){var n=Bridge.cast(a,Kusto.Language.Syntax.PathExpression);return Kusto.Language.Binding.Binder.GetExpressionResultName(n.Selector,e)}if(Bridge.is(a,Kusto.Language.Syntax.ElementExpression)){var t=Bridge.cast(a,Kusto.Language.Syntax.ElementExpression);return Kusto.Language.Binding.Binder.GetExpressionResultName(t.Selector,e)}if(Bridge.is(a,Kusto.Language.Syntax.OrderedExpression)){var s=Bridge.cast(a,Kusto.Language.Syntax.OrderedExpression);return Kusto.Language.Binding.Binder.GetExpressionResultName(s.Expression,e)}return Bridge.is(a,Kusto.Language.Syntax.SimpleNamedExpression)?Bridge.cast(a,Kusto.Language.Syntax.SimpleNamedExpression).Name.SimpleName:e},GetType:function(a,e){void 0===e&&(e=null);var n=a.Type.Text,t=Kusto.Language.Symbols.ScalarTypes.GetSymbol(n);return null!=t?t:(null!=e&&e.add(Kusto.Language.DiagnosticFacts.GetInvalidTypeName(n).WithLocation(a.Type)),Kusto.Language.Symbols.ErrorSymbol.Instance)},IsInteger:function(a){var e;return null!=(e=Bridge.as(a,Kusto.Language.Symbols.ScalarSymbol))&&e.IsInteger},IsRealOrDecimal:function(a){return Kusto.Language.Binding.Binder.SymbolsAssignable(a,Kusto.Language.Symbols.ScalarTypes.Real)||Kusto.Language.Binding.Binder.SymbolsAssignable(a,Kusto.Language.Symbols.ScalarTypes.Decimal)},IsStringOrDynamic:function(a){return Bridge.referenceEquals(a,Kusto.Language.Symbols.ScalarTypes.String)||Bridge.referenceEquals(a,Kusto.Language.Symbols.ScalarTypes.Dynamic)},IsNumber:function(a){var e;return null!=(e=Bridge.as(a,Kusto.Language.Symbols.ScalarSymbol))&&e.IsNumeric},IsIntegerOrDynamic:function(a){return Kusto.Language.Binding.Binder.IsInteger(a)||Bridge.referenceEquals(a,Kusto.Language.Symbols.ScalarTypes.Dynamic)},IsSummable:function(a){var e;return null!=(e=Bridge.as(a,Kusto.Language.Symbols.ScalarSymbol))&&e.IsSummable},IsTabular:function(a){return null!=a&&a.IsTabular},IsDatabase:function(a){return Bridge.is(a,Kusto.Language.Symbols.DatabaseSymbol)},IsCluster:function(a){return Bridge.is(a,Kusto.Language.Symbols.ClusterSymbol)},GetSemanticInfo:function(e,n){return void 0===n&&(n=[]),Kusto.Language.Binding.Binder.CreateSemanticInfo(e,Bridge.cast(n,a.Collections.Generic.IEnumerable$1(Kusto.Language.Diagnostic)))},CreateSemanticInfo:function(a,e){switch(void 0===e&&(e=null),a.Kind){case Kusto.Language.Symbols.SymbolKind.Operator:case Kusto.Language.Symbols.SymbolKind.Column:case Kusto.Language.Symbols.SymbolKind.Table:case Kusto.Language.Symbols.SymbolKind.Parameter:case Kusto.Language.Symbols.SymbolKind.Function:case Kusto.Language.Symbols.SymbolKind.Pattern:case Kusto.Language.Symbols.SymbolKind.Group:return new Kusto.Language.Syntax.SemanticInfo.$ctor1(a,Kusto.Language.Binding.Binder.GetResultSymbol(a),e);case Kusto.Language.Symbols.SymbolKind.Variable:var n=Bridge.cast(a,Kusto.Language.Symbols.VariableSymbol);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(a,Kusto.Language.Binding.Binder.GetResultSymbol(a),e,n.IsConstant);case Kusto.Language.Symbols.SymbolKind.Scalar:case Kusto.Language.Symbols.SymbolKind.Tuple:return new Kusto.Language.Syntax.SemanticInfo.$ctor3(Bridge.cast(a,Kusto.Language.Symbols.TypeSymbol),e);default:return new Kusto.Language.Syntax.SemanticInfo.$ctor1(null,Kusto.Language.Symbols.ErrorSymbol.Instance,e)}},GetResultSymbol:function(e){var n;if(Bridge.is(e,Kusto.Language.Symbols.ColumnSymbol))return Bridge.cast(e,Kusto.Language.Symbols.ColumnSymbol).Type;if(Bridge.is(e,Kusto.Language.Symbols.VariableSymbol))return Bridge.cast(e,Kusto.Language.Symbols.VariableSymbol).Type;if(Bridge.is(e,Kusto.Language.Symbols.ParameterSymbol))return Bridge.cast(e,Kusto.Language.Symbols.ParameterSymbol).Type;if(Bridge.is(e,Kusto.Language.Symbols.GroupSymbol)){var t=Bridge.cast(e,Kusto.Language.Symbols.GroupSymbol),s=new(a.Collections.Generic.List$1(Kusto.Language.Symbols.Symbol).ctor);n=Bridge.getEnumerator(t.Members,Kusto.Language.Symbols.Symbol);try{for(;n.moveNext();){var o=n.Current,r=Kusto.Language.Binding.Binder.GetResultSymbol(o);null!=r&&s.add(r)}}finally{Bridge.is(n,a.IDisposable)&&n.System$IDisposable$Dispose()}return 1===s.Count?Bridge.as(s.getItem(0),Kusto.Language.Symbols.TypeSymbol):1<s.Count?new Kusto.Language.Symbols.GroupSymbol.$ctor1(s):null}return Bridge.is(e,Kusto.Language.Symbols.TypeSymbol)?Bridge.cast(e,Kusto.Language.Symbols.TypeSymbol):null},SymbolsAssignable$1:function(e,n){for(var t=0;t<a.Array.getCount(e,Kusto.Language.Symbols.TypeSymbol);t=t+1|0)if(Kusto.Language.Binding.Binder.SymbolsAssignable(a.Array.getItem(e,t,Kusto.Language.Symbols.TypeSymbol),n))return!0;return!1},SymbolsAssignable:function(a,e){if(Bridge.referenceEquals(a,e))return!0;if(null==a||null==e)return!1;if(a.Kind!==e.Kind)return!1;switch(a.Kind){case Kusto.Language.Symbols.SymbolKind.Column:var n=Bridge.cast(a,Kusto.Language.Symbols.ColumnSymbol),t=Bridge.cast(e,Kusto.Language.Symbols.ColumnSymbol);return Bridge.referenceEquals(n.Name,t.Name)&&Kusto.Language.Binding.Binder.SymbolsAssignable(n.Type,t.Type);case Kusto.Language.Symbols.SymbolKind.Tuple:case Kusto.Language.Symbols.SymbolKind.Group:return Kusto.Language.Binding.Binder.MembersEqual(a,e);case Kusto.Language.Symbols.SymbolKind.Table:return Kusto.Language.Binding.Binder.TablesAssignable(Bridge.cast(a,Kusto.Language.Symbols.TableSymbol),Bridge.cast(e,Kusto.Language.Symbols.TableSymbol))}return!1},MembersEqual:function(e,n){if(a.Array.getCount(e.Members,Kusto.Language.Symbols.Symbol)!==a.Array.getCount(n.Members,Kusto.Language.Symbols.Symbol))return!1;for(var t=0,s=a.Array.getCount(e.Members,Kusto.Language.Symbols.Symbol);t<s;t=t+1|0)if(!Kusto.Language.Binding.Binder.SymbolsAssignable(a.Array.getItem(e.Members,t,Kusto.Language.Symbols.Symbol),a.Array.getItem(n.Members,t,Kusto.Language.Symbols.Symbol)))return!1;return!0},TablesAssignable:function(e,n){var t;t=Bridge.getEnumerator(e.Columns,Kusto.Language.Symbols.ColumnSymbol);try{for(;t.moveNext();){var s=t.Current,o={};if(!n.TryGetColumn(s.Name,o)||!Kusto.Language.Binding.Binder.SymbolsAssignable(s.Type,o.v.Type))return!1}}finally{Bridge.is(t,a.IDisposable)&&t.System$IDisposable$Dispose()}return!0},GetQueryParameterInfo:function(e,n){for(var t=0,s=a.Array.getCount(n,Kusto.Language.Binding.Binder.QueryParameterInfo);t<s;t=t+1|0)if(a.Linq.Enumerable.from(a.Array.getItem(n,t,Kusto.Language.Binding.Binder.QueryParameterInfo).Names).contains(e))return a.Array.getItem(n,t,Kusto.Language.Binding.Binder.QueryParameterInfo);return null},Contains:function(e,n,t){var s=Bridge.as(n,a.String);if(null!=s)for(var o=0,r=a.Array.getCount(e,a.Object);o<r;o=o+1|0){var u=Bridge.as(a.Array.getItem(e,o,a.Object),a.String);if(0===a.String.compare(s,u,!t))return!0}else for(var i=0,g=a.Array.getCount(e,a.Object);i<g;i=i+1|0)if(Bridge.referenceEquals(a.Array.getItem(e,i,a.Object),n))return!0;return!1},ArgumentsHaveErrors:function(e){for(var n=0;n<a.Array.getCount(e,Kusto.Language.Symbols.TypeSymbol);n=n+1|0)if(a.Array.getItem(e,n,Kusto.Language.Symbols.TypeSymbol).IsError)return!0;return!1},IsNamedArgument:function(a){return Bridge.is(a,Kusto.Language.Syntax.NamedExpression)},GetNamedArgumentName:function(a){return Bridge.is(a,Kusto.Language.Syntax.SimpleNamedExpression)?Bridge.cast(a,Kusto.Language.Syntax.SimpleNamedExpression).Name:Bridge.is(a,Kusto.Language.Syntax.CompoundNamedExpression)?Bridge.cast(a,Kusto.Language.Syntax.CompoundNamedExpression).Names:null},CheckArgumentCount:function(a,e,n){return a.Count===e||(n.add(Kusto.Language.DiagnosticFacts.GetArgumentCountExpected(e).WithLocation(a)),!1)}}},fields:{context:null,cache:null},props:{RowScope:{get:function(){return this.context.RowScope||Kusto.Language.Symbols.TableSymbol.Empty}},RightRowScope:{get:function(){return this.context.RightRowScope||Kusto.Language.Symbols.TableSymbol.Empty}}},ctors:{ctor:function(a,e,n){this.$initialize(),this.context=new Kusto.Language.Binding.Binder.BindingContext(a,n),this.cache=e}},methods:{SetContext:function(a,e){if(void 0===e&&(e=-1),null!=a){var n=new Kusto.Language.Binding.Binder.ContextBuilder(this,0<=e?e:a.TextStart);a.Visit$2(n)}},GetSemanticInfo:function(a){return a.GetSemanticInfo()},SetSemanticInfo:function(a,e){},Bind:function(a){var e=new Kusto.Language.Binding.Binder.TreeBinder(this);a.Visit$2(e)},GetResultTypeOrError:function(a){var e;return(null!=(e=this.GetSemanticInfo(a))?e.ResultType:null)||Kusto.Language.Symbols.ErrorSymbol.Instance},GetResultType:function(a){var e;return null!=(e=this.GetSemanticInfo(a))?e.ResultType:null},GetReferencedSymbol:function(a){var e;return null!=(e=this.GetSemanticInfo(a))?e.ReferencedSymbol:null},GetIsConstant:function(a){var e,n;return null!=(e=null!=(n=this.GetSemanticInfo(a))?n.IsConstant:null)&&e},GetSymbolsInContext:function(a,e){if(null!=this.context.PathScope){var n=3&a;0!==n&&this.context.PathScope.GetMembers(n,e),0!=(a&Kusto.Language.Symbols.SymbolMatch.Function)&&this.GetSpecialFunctions(null,e)}else switch(this.context.ScopeKind){case Kusto.Language.Binding.Binder.ScopeKind.Normal:null!=this.context.RowScope&&0!=(a&Kusto.Language.Symbols.SymbolMatch.Column)&&(null!=this.context.RightRowScope?(e.add(new Kusto.Language.Symbols.VariableSymbol("$left",this.context.GetTuple(this.context.RowScope))),e.add(new Kusto.Language.Symbols.VariableSymbol("$right",this.context.GetTuple(this.context.RightRowScope))),Kusto.Language.Binding.Binder.GetCommonColumns$2(this.context.GetDeclaredAndInferredColumns(this.context.RowScope),this.context.GetDeclaredAndInferredColumns(this.context.RightRowScope),e)):this.context.RowScope.GetMembers(a,e)),this.context.LocalScope.GetSymbols(a,e),0!=(a&Kusto.Language.Symbols.SymbolMatch.Function)&&this.GetFunctionsInScope$1(a,null,e,!0,!1,!1,void 0,void 0),null!=this.context.Globals&&this.context.Globals.Database.GetMembers(a,e);break;case Kusto.Language.Binding.Binder.ScopeKind.Aggregate:0!=(a&Kusto.Language.Symbols.SymbolMatch.Function)&&this.GetFunctionsInScope$1(a,null,e,!0,!0,!0,void 0,void 0);break;case Kusto.Language.Binding.Binder.ScopeKind.PlugIn:0!=(a&Kusto.Language.Symbols.SymbolMatch.Function)&&this.GetFunctionsInScope$1(a,null,e)}},GetSpecialFunctions:function(a,e){if(null!=this.context.PathScope)switch(this.context.PathScope.Kind){case Kusto.Language.Symbols.SymbolKind.Cluster:(null==a||Bridge.referenceEquals(Kusto.Language.Symbols.Functions.Database.Name,a))&&e.add(Kusto.Language.Symbols.Functions.Database);break;case Kusto.Language.Symbols.SymbolKind.Database:(null==a||Bridge.referenceEquals(Kusto.Language.Symbols.Functions.Database.Name,a))&&e.add(Kusto.Language.Symbols.Functions.Table)}},GetFunctionsInScope$1:function(e,n,t,s,o,r,u,i){var g;void 0===s&&(s=!1),void 0===o&&(o=!1),void 0===r&&(r=!1),void 0===u&&(u=null),void 0===i&&(i=null);var l=Kusto.Language.Binding.Binder.s_symbolListPool.AllocateFromPool();try{this.GetFunctionsInScope(this.context.ScopeKind,n,l,s,o,r,u,i),g=Bridge.getEnumerator(l);try{for(;g.moveNext();){var y=g.Current;Kusto.Language.Symbols.SymbolMatchExtensions.Matches(y,e)&&t.add(y)}}finally{Bridge.is(g,a.IDisposable)&&g.System$IDisposable$Dispose()}}finally{Kusto.Language.Binding.Binder.s_symbolListPool.ReturnToPool(l)}},GetFunctionsInScope:function(a,e,n,t,s,o,r,u){if(void 0===t&&(t=!1),void 0===s&&(s=!1),void 0===o&&(o=!1),void 0===r&&(r=null),void 0===u&&(u=null),null!=this.context.PathScope)this.GetSpecialFunctions(e,n);else switch(a){case Kusto.Language.Binding.Binder.ScopeKind.Aggregate:if(null==e)n.AddRange(this.context.Globals.Aggregates),this.GetFunctionsInScope(Kusto.Language.Binding.Binder.ScopeKind.Normal,e,n,t,s,o);else{var i=this.context.Globals.GetAggregate(e);null!=i?n.add(i):this.GetFunctionsInScope(Kusto.Language.Binding.Binder.ScopeKind.Normal,e,n,t,s,o),0===n.Count&&null!=r&&r.add(Kusto.Language.DiagnosticFacts.GetAggregateFunctionNotDefined(e).WithLocation(u))}break;case Kusto.Language.Binding.Binder.ScopeKind.PlugIn:if(null==e)n.AddRange(this.context.Globals.PlugIns);else{var g=this.context.Globals.GetPlugIn(e);null!=g?n.add(g):null!=r&&r.add(Kusto.Language.DiagnosticFacts.GetPlugInFunctionNotDefined(e).WithLocation(u))}break;default:if(t)if(null==e)n.AddRange(this.context.Globals.Functions);else if(0===n.Count){var l=this.context.Globals.GetFunction(e);null!=l&&n.add(l)}if(null!=e&&0!==n.Count||!o||Kusto.Language.Binding.Binder.GetDeclaredFunctionsInScope(this.context,e,n),(null==e||0===n.Count)&&s){var y=n.Count;this.context.Globals.Database.GetMembers$1(e,Kusto.Language.Symbols.SymbolMatch.Function,n),n.Count===y&&null!=r&&r.add(Kusto.Language.DiagnosticFacts.GetScalarFunctionNotDefined(e).WithLocation(u))}}},BindName:function(e,n){if(Bridge.referenceEquals(e,""))return Kusto.Language.Binding.Binder.ErrorInfo;if(null!=this.context.PathScope){if(Bridge.referenceEquals(this.context.PathScope,Kusto.Language.Symbols.ScalarTypes.Dynamic))return Kusto.Language.Binding.Binder.LiteralDynamicInfo;if(Bridge.referenceEquals(this.context.PathScope,Kusto.Language.Symbols.ErrorSymbol.Instance))return Kusto.Language.Binding.Binder.ErrorInfo}else if(null!=this.context.RightRowScope){if(Bridge.referenceEquals(e,"$left")){var t=this.context.GetTuple(this.RowScope);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(t,t)}if(Bridge.referenceEquals(e,"$right")){var s=this.context.GetTuple(this.RightRowScope);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(s,s)}}var o=Kusto.Language.Binding.Binder.s_symbolListPool.AllocateFromPool();try{var r=!1;if(null!=this.context.PathScope)this.context.PathScope.GetMembers$1(e,Kusto.Language.Symbols.SymbolMatch.Any,o);else{if(this.RowScope.GetMembers$1(e,Kusto.Language.Symbols.SymbolMatch.Any,o),0===o.Count&&null!=this.context.RightRowScope&&this.context.RightRowScope.GetMembers$1(e,Kusto.Language.Symbols.SymbolMatch.Any,o),0===o.Count&&(this.context.LocalScope.GetSymbols$1(e,Kusto.Language.Symbols.SymbolMatch.Any,o),r=0<o.Count),0===o.Count&&!Kusto.Language.Binding.Binder.IsFunctionCallName(n)){this.GetFunctionsInScope(this.context.ScopeKind,e,o,!1,!0,!1,void 0,void 0);for(var u=o.Count-1|0;0<=u;u=u-1|0){var i=Bridge.as(o.getItem(u),Kusto.Language.Symbols.FunctionSymbol);(null==i||0<i.MinArgumentCount)&&o.removeAt(u)}r=0<o.Count}0===o.Count&&this.context.Globals.Database.GetMembers$1(e,Kusto.Language.Symbols.SymbolMatch.Any,o),0===o.Count&&this.GetFunctionsInScope(this.context.ScopeKind,e,o,!0,!1,!1,void 0,void 0),0===o.Count&&null!=this.context.RowScope&&this.context.RowScope.IsOpen&&o.add(this.context.GetOpenColumn(e,Kusto.Language.Symbols.ScalarTypes.Dynamic,this.context.RowScope))}if(1!==o.Count)return 0===o.Count?new Kusto.Language.Syntax.SemanticInfo.$ctor2(Kusto.Language.Symbols.ErrorSymbol.Instance,Kusto.Language.DiagnosticFacts.GetNameDoesNotReferToAnyDefinedItem(e).WithLocation(n)):new Kusto.Language.Syntax.SemanticInfo.ctor(new Kusto.Language.Symbols.GroupSymbol.$ctor1(a.Linq.Enumerable.from(o).toList(Bridge.global.Kusto.Language.Symbols.Symbol)),Kusto.Language.Symbols.ErrorSymbol.Instance,Kusto.Language.DiagnosticFacts.GetNameRefersToMoreThanOneItem(e).WithLocation(n));var g,l=o.getItem(0),y=Kusto.Language.Binding.Binder.GetResultSymbol(l);if(null==(g=Bridge.as(y,Kusto.Language.Symbols.FunctionSymbol))||Kusto.Language.Binding.Binder.IsFunctionCallName(n))return Kusto.Language.Binding.Binder.CreateSemanticInfo(l);var S=a.Linq.Enumerable.from(g.Signatures).firstOrDefault(function(a){return 0===a.MinArgumentCount},null);if(null!=S&&r){var c=this.GetReturnType$1(S,Kusto.Language.Utils.EmptyReadOnlyList$1(Kusto.Language.Syntax.Expression).Instance,Kusto.Language.Utils.EmptyReadOnlyList$1(Kusto.Language.Symbols.TypeSymbol).Instance);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(l,c)}var K=this.GetCommonReturnType(g.Signatures,Kusto.Language.Utils.EmptyReadOnlyList$1(Kusto.Language.Syntax.Expression).Instance,Kusto.Language.Utils.EmptyReadOnlyList$1(Kusto.Language.Symbols.TypeSymbol).Instance);return new Kusto.Language.Syntax.SemanticInfo.ctor(l,K,Kusto.Language.DiagnosticFacts.GetFunctionRequiresArgumentList(e))}finally{Kusto.Language.Binding.Binder.s_symbolListPool.ReturnToPool(o)}},GetBinaryOperatorInfo$1:function(a,e,n,t){return this.GetBinaryOperatorInfo(a,e,this.GetResultTypeOrError(e),n,this.GetResultTypeOrError(n),t)},GetBinaryOperatorInfo:function(a,e,n,t,s,o){var r=Kusto.Language.Binding.Binder.s_expressionListPool.AllocateFromPool(),u=Kusto.Language.Binding.Binder.s_typeListPool.AllocateFromPool();try{return r.add(e),r.add(t),u.add(n),u.add(s),this.GetOperatorInfo$1(a,r,u,o)}finally{Kusto.Language.Binding.Binder.s_expressionListPool.ReturnToPool(r),Kusto.Language.Binding.Binder.s_typeListPool.ReturnToPool(u)}},GetUnaryOperatorInfo:function(a,e,n){var t=Kusto.Language.Binding.Binder.s_expressionListPool.AllocateFromPool();try{return t.add(e),this.GetOperatorInfo(a,t,n)}finally{Kusto.Language.Binding.Binder.s_expressionListPool.ReturnToPool(t)}},GetOperatorInfo:function(e,n,t){var s=Kusto.Language.Binding.Binder.s_typeListPool.AllocateFromPool();try{for(var o=0;o<a.Array.getCount(n,Kusto.Language.Syntax.Expression);o=o+1|0)s.add(this.GetResultTypeOrError(a.Array.getItem(n,o,Kusto.Language.Syntax.Expression)));return this.GetOperatorInfo$1(e,n,s,t)}finally{Kusto.Language.Binding.Binder.s_typeListPool.ReturnToPool(s)}},GetOperatorInfo$1:function(a,e,n,t){var s=Kusto.Language.Binding.Binder.s_signatureListPool.AllocateFromPool(),o=Kusto.Language.Binding.Binder.s_diagnosticListPool.AllocateFromPool();try{var r=this.context.Globals.GetOperator(a);if(Kusto.Language.Binding.Binder.GetBestMatchingSignatures(r.Signatures,e,n,s),1===s.Count){this.CheckSignature(s.getItem(0),e,n,t,o);var u=this.GetReturnType$1(s.getItem(0),e,n);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(s.getItem(0).Symbol,u,o,this.AllAreConstant(e))}Kusto.Language.Binding.Binder.ArgumentsHaveErrors(n)||o.add(Kusto.Language.DiagnosticFacts.GetOperatorNotDefined$1(t.ToString(!1),n).WithLocation(t));var i=this.GetCommonReturnType(s,e,n);return new Kusto.Language.Syntax.SemanticInfo.$ctor1(s.getItem(0).Symbol,i,o)}finally{Kusto.Language.Binding.Binder.s_signatureListPool.ReturnToPool(s),Kusto.Language.Binding.Binder.s_di