private StringSegment GetShortName(IntermediateNode node) { var typeName = node.GetType().Name; return (typeName.EndsWith(nameof(IntermediateNode), StringComparison.Ordinal) ? new StringSegment(typeName, 0, typeName.Length - nameof(IntermediateNode).Length) : typeName); }
protected void WriteName(IntermediateNode node) { var typeName = node.GetType().Name; if (typeName.EndsWith("IntermediateNode")) { _writer.Write(typeName.Substring(0, typeName.Length - "IntermediateNode".Length)); } else { _writer.Write(typeName); } }