From 2d9ebae0e102c437dd9471631b9d46ec907d5ce3 Mon Sep 17 00:00:00 2001 From: WhiteBlackGoose Date: Fri, 22 Jul 2022 17:07:29 +0300 Subject: [PATCH] Docs --- .../Core/Entity/Entity.Definition.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Sources/AngouriMath/AngouriMath/Core/Entity/Entity.Definition.cs b/Sources/AngouriMath/AngouriMath/Core/Entity/Entity.Definition.cs index 41b38a7e..36d5f53e 100644 --- a/Sources/AngouriMath/AngouriMath/Core/Entity/Entity.Definition.cs +++ b/Sources/AngouriMath/AngouriMath/Core/Entity/Entity.Definition.cs @@ -134,16 +134,28 @@ public abstract partial record Entity : ILatexiseable /// A depth-first enumeration is required by /// /// - /// The list of all nodes of the given expression + /// The list of all subnodes of the given expression, including its own. Traverses + /// the tree the following order: + ///
    + ///
  1. The node itself
  2. + ///
  3. All nodes from all children
  4. + ///
///
/// /// /// Entity expr = "a + b / 2 ^ 3"; - /// Console.WriteLine(string.Join(", ", expr.Nodes)); + /// for (var node in expr.Nodes) + /// Console.WriteLine(node); /// /// Output: /// - /// a + b / 2 ^ 3, a, b / 2 ^ 3, b, 2 ^ 3, 2, 3 + /// a + b / 2 ^ 3 + /// a + /// b / 2 ^ 3 + /// b + /// 2 ^ 3 + /// 2 + /// 3 /// /// public IEnumerable Nodes => nodes.GetValue(static @this => @this.DirectChildren.SelectMany(c => c.Nodes).Prepend(@this), this); @@ -694,4 +706,4 @@ public IReadOnlyList Vars /// public bool IsConstantLeaf => this is Boolean or Number or Set.SpecialSet; } -} \ No newline at end of file +}