 #endif
 }
 
-// MARK: implementation details
+// MARK: Implementation Details
 private extension Parser {
     private var streamEndProduced: Bool {
         return parser.stream_end_produced != 0

    private let closure: () throws -> T?
}

public final class Parser {
    // MARK: public
    public let yaml: String
    public let resolver: Resolver
    public let constructor: Constructor

    /// Set up Parser.
    ///
    /// - Parameter string: YAML
    /// - Parameter resolver: Resolver
    /// - Parameter constructor: Constructor
    /// - Throws: YamlError
    public init(yaml string: String,
                resolver: Resolver = .default,
                constructor: Constructor = .default) throws {


    /// Parse next document and return root Node.
    ///
    /// - returns: next Node.
    ///
    /// - throws: `YamlError`.
    public func nextRoot() throws -> Node? {
        guard !streamEndProduced, try parse().type != YAML_STREAM_END_EVENT else { return nil }
        return try loadDocument()
    }

    /// Parses the document expecting a single root Node and returns it.
    ///
    /// - returns: Single root Node.
    ///
    /// - throws: `YamlError`.
    public func singleRoot() throws -> Node? {
        guard !streamEndProduced, try parse().type != YAML_STREAM_END_EVENT else { return nil }
        let node = try loadDocument()
