|
/** |
|
* Construct an emitter. |
|
* |
|
* Params: stream = Output range to write to. |
|
* canonical = Write scalars in canonical form? |
|
* indent = Indentation width. |
|
* lineBreak = Line break character/s. |
|
*/ |
|
this(Range stream, const bool canonical, const int indent, const int width, |
|
const LineBreak lineBreak) @safe |
|
{ |
|
states_.reserve(32); |
|
indents_.reserve(32); |
|
stream_ = stream; |
|
canonical_ = canonical; |
|
nextExpected!"expectStreamStart"(); |
|
|
|
if(indent > 1 && indent < 10){bestIndent_ = indent;} |
|
if(width > bestIndent_ * 2) {bestWidth_ = width;} |
|
bestLineBreak_ = lineBreak; |
|
|
|
analysis_.flags.isNull = true; |
|
} |
@WebFreaK remarked that (on L176):
why are the given in values ignored in other cases? shouldn't this rather be using contracts?
The parameters in question are not documented either.
D-YAML/source/dyaml/emitter.d
Lines 158 to 180 in 57c725a
@WebFreaK remarked that (on L176):
The parameters in question are not documented either.