ASCII art diagram converter: Difference between revisions

Added an assert to the D entry
(Added an assert to the D entry)
Line 162:
 
foreach (line; diagram.splitLines) {
assert(!line.empty);
line = line.strip;
if (line[0] == C.cross) {
Line 167 ⟶ 168:
currentBits, code, currentName);
if (bitCountPerRow == 0)
bitCountPerRow = cast(uint) (line.length - 1) / cWidth;
else
assert(bitCountPerRow == (line.length - 1) / cWidth);
Line 193 ⟶ 194:
// At this point, line does not include the first
// C.pipe, but the length will include the last.
currentBits += cast(uint) line.length / cWidth;
 
line = line[$ .. $];
Line 274 ⟶ 275:
private ubyte[12] _payload;
}</lang>
 
Static support for BigEndian is easy to add.
 
It also supports larger values like this, that is 32 bits long: