SliceBuilder is now a part of Reader.

This commit is contained in:
Ferdinand Majerech 2014-07-24 02:43:28 +02:00
parent d8f1221457
commit a2cbb90d4e

View file

@ -121,6 +121,8 @@ final class Reader
while(!noZeros.empty && noZeros.back == '\0') { noZeros.popBack(); }
enforce(printable(noZeros[]),
new ReaderException("Special unicode characters are not allowed"));
this.sliceBuilder = SliceBuilder(this);
}
/// Get character at specified index relative to current position.
@ -226,6 +228,9 @@ final class Reader
}
}
/// Used to build slices of read data in Reader; to avoid allocations.
SliceBuilder sliceBuilder;
/// Get a string describing current buffer position, used for error messages.
final Mark mark() @safe pure nothrow const @nogc { return Mark(line_, column_); }