/// <summary> /// Throws if disposed instance. /// </summary> /// <param name="parsedContextStreamParent">The parsed context stream parent.</param> /// <exception cref="ObjectDisposedException">Thrown if specified object is <see cref="Instance"/>.</exception> public static void ThrowIfDisposedInstance(IParsingContextStreamParent parsedContextStreamParent) { if (ReferenceEquals(Instance, parsedContextStreamParent)) { throw new ObjectDisposedException(DisposedObjectName); } }
/// <summary> /// Initializes the new instance of the <see cref="ISourceCodeFragment" /> type. /// </summary> /// <param name="parent">The source code parent.</param> /// <param name="offset">The absolute source code offset, where the fragment starts.</param> /// <param name="length">The length of the source code fragment.</param> public SourceCodeFragment(IParsingContextStreamParent parent, int offset, int length) { _cachedValue = null; _parent = parent; SourcePosition = offset; Count = length; }
/// <inheritdoc /> public ISourceCodeFragment Create(IParsingContextStreamParent parent, int offset, int length) { if (length <= 0) { return(ParserExtensions.EmptyFragment); } return(new SourceCodeFragment(parent, offset, length)); }
/// <inheritdoc /> public IParsingContextStream Create(IParsingContextStreamParent parent, int offset, int maxDeep, ICacheParsingResults cache) { return(new ParsingContextStream(_productFactory, parent, offset, maxDeep, cache)); }