CreateParser(TextReader, Int32, String?) Method

Definition

Namespace SharpYaml
Assembly SharpYaml.dll

Creates a YAML parser with a configurable maximum nesting depth and optional source name.

public static IParser CreateParser(TextReader reader, int maxDepth, string? sourceName)

Parameters

reader
TextReader

The YAML reader.

maxDepth
Int32

The maximum allowed nesting depth for mappings and sequences. A value of 0 uses the default limit of 64.

sourceName
String

An optional source name associated with the YAML payload, such as a file path, used when reporting depth-limit failures.

Returns

IParser
The parser.