Default scanToNextBreak now only skips, doesn't scan anything.

This commit is contained in:
Ferdinand Majerech 2014-07-26 03:16:27 +02:00
parent ccdbc21e8f
commit 8b086caa40

View file

@ -857,15 +857,13 @@ final class Scanner
return reader_.get(length); return reader_.get(length);
} }
/// Scan all characters until next line break. /// Scan and throw away all characters until next line break.
dchar[] scanToNextBreak() @safe pure nothrow @nogc void scanToNextBreak() @safe pure nothrow @nogc
{ {
uint length = 0; while(!"\0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek()))
while(!"\0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek(length)))
{ {
++length; reader_.forward();
} }
return reader_.get(length);
} }
/// Scan all characters until next line break. /// Scan all characters until next line break.