private int CalcNumOfRootElements(Scope scope) { var rootElementCount = 0; foreach (var entity in scope.Entities) { if (entity is DOM.Element) { rootElementCount++; } if (entity is Scope scopeEntity) { rootElementCount += CalcNumOfRootElements(scopeEntity); } if (entity is DOM.Alias) { rootElementCount += CalcNumOfRootElements((Alias)entity); } if (rootElementCount > 1) { break; } } return(rootElementCount); }
public override void Visit(Scope pair) { PrintNodeName(pair); PrintNodeStart(pair); base.Visit(pair); PrintNodeEnd(pair); }
public override void Visit(Scope pair) { CheckNoPairValue(pair); base.Visit(pair); }
public override void OnScope(Scope pair) { CheckNoPairValue(pair); base.OnScope(pair); }