Internal Test: Verifies that any rule not on the root transformer is considered a child, regardless of nesting depth.

ID: 938

				
					using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
var grandParentRule = t.Pattern("grandparent");

// Create a child
var parentTransformer = grandParentRule.LocalTransformer;
var parentRule = parentTransformer.Pattern("parent");

// Create a grandchild
var childTransformer = parentRule.LocalTransformer;
var childRule = childTransformer.Pattern("child");

Console.WriteLine($"Grandparent is child: {grandParentRule.IsChildRule}");
Console.WriteLine($"Parent is child: {parentRule.IsChildRule}");
Console.WriteLine($"Child (grandchild) is child: {childRule.IsChildRule}");
				
			
Grandparent is child: False
Parent is child: True
Child (grandchild) is child: True
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

#define tf(IsTrue) ((IsTrue) ? "True" : "False")

int main() {
   uCalc uc;
   uCalc::Transformer t;
   auto grandParentRule = t.Pattern("grandparent");

   // Create a child
   auto parentTransformer = grandParentRule.LocalTransformer();
   auto parentRule = parentTransformer.Pattern("parent");

   // Create a grandchild
   auto childTransformer = parentRule.LocalTransformer();
   auto childRule = childTransformer.Pattern("child");

   cout << "Grandparent is child: " << tf(grandParentRule.IsChildRule()) << endl;
   cout << "Parent is child: " << tf(parentRule.IsChildRule()) << endl;
   cout << "Child (grandchild) is child: " << tf(childRule.IsChildRule()) << endl;
}
				
			
Grandparent is child: False
Parent is child: True
Child (grandchild) is child: True
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t As New uCalc.Transformer()
      Dim grandParentRule = t.Pattern("grandparent")
      
      '// Create a child
      Dim parentTransformer = grandParentRule.LocalTransformer
      Dim parentRule = parentTransformer.Pattern("parent")
      
      '// Create a grandchild
      Dim childTransformer = parentRule.LocalTransformer
      Dim childRule = childTransformer.Pattern("child")
      
      Console.WriteLine($"Grandparent is child: {grandParentRule.IsChildRule}")
      Console.WriteLine($"Parent is child: {parentRule.IsChildRule}")
      Console.WriteLine($"Child (grandchild) is child: {childRule.IsChildRule}")
   End Sub
End Module
				
			
Grandparent is child: False
Parent is child: True
Child (grandchild) is child: True