using System.Collections.Generic; using System.Collections.Immutable; using Upsilon.BaseTypes; using Upsilon.Text; namespace Upsilon.Binder { public class BoundFunctionCallExpression : BoundExpression { public BoundExpression Identifier { get; } public ImmutableArray Parameters { get; } public BoundFunctionCallExpression(BoundExpression identifier, ImmutableArray parameters, TextSpan span, Type type) : base(span) { Identifier = identifier; Parameters = parameters; Type = type; } public override BoundKind Kind => BoundKind.BoundFunctionCallExpression; public override IEnumerable GetNodeAtPosition(int line, int character) { if (Identifier.Span.Contains(line, character)) { foreach (var exp in Identifier.GetNodeAtPosition(line, character)) { yield return exp; } } foreach (var parameter in Parameters) { if (parameter.Span.Contains(line, character)) { foreach (var exp in parameter.GetNodeAtPosition(line, character)) { yield return exp; } } } yield return this; } public override Type Type { get; } } }