protected override void BeginVisitNode(AphidExpression expression) { if (IsMember(expression)) { _object = Ancestors.Peek().ToObject(); _member = expression.ToBinaryOperator(); _currentPath.Push(_member.LeftOperand); } else if (IsArray(expression)) { _array = expression.ToArray(); } }
private bool IsMember(AphidExpression expression) => expression?.Type == AphidExpressionType.BinaryOperatorExpression && Ancestors.Count >= 1 && Ancestors.Peek().Type == AphidExpressionType.ObjectExpression;