public override void EndNode(AstNode node)
 {
     // ignore whitespace: these don't need to be processed.
     // StartNode/EndNode is only called for them to support folding of comments.
     if (node.NodeType != NodeType.Whitespace)
     {
         System.Diagnostics.Debug.Assert(currentList != null);
         foreach (var removable in node.Children.Where(n => n is CSharpTokenNode))
         {
             removable.Remove();
         }
         foreach (var child in currentList)
         {
             System.Diagnostics.Debug.Assert(child.Parent == null || node == child.Parent);
             child.Remove();
             node.AddChildWithExistingRole(child);
         }
         currentList = nodes.Pop();
     }
     else if (node is Comment comment)
     {
         comment.SetEndLocation(locationProvider.Location);
     }
     base.EndNode(node);
 }
		public override void EndNode(AstNode node)
		{
			System.Diagnostics.Debug.Assert(currentList != null);
			foreach (var removable in node.Children.Where(n => n is CSharpTokenNode)) {
				removable.Remove();
			}
			foreach (var child in currentList) {
				System.Diagnostics.Debug.Assert(child.Parent == null || node == child.Parent);
				child.Remove();
				node.AddChildWithExistingRole(child);
			}
			currentList = nodes.Pop();
			base.EndNode(node);
		}
 public override void EndNode(AstNode node)
 {
     System.Diagnostics.Debug.Assert(currentList != null);
     foreach (var removable in node.Children.Where(n => n is CSharpTokenNode))
     {
         removable.Remove();
     }
     foreach (var child in currentList)
     {
         System.Diagnostics.Debug.Assert(child.Parent == null || node == child.Parent);
         child.Remove();
         node.AddChildWithExistingRole(child);
     }
     currentList = nodes.Pop();
     base.EndNode(node);
 }