UTF-8 scanLineBreak.

This commit is contained in:
Ferdinand Majerech 2014-07-29 03:07:57 +02:00
parent 6dd53b55a0
commit 2a524bbb5e

View file

@ -2049,6 +2049,23 @@ final class Scanner
} }
return '\0'; return '\0';
} }
dchar scanLineBreak8() @safe pure nothrow @nogc
{
const c = reader_.peek();
if(c == '\n' || c == '\r' || c == '\u0085')
{
if(reader_.prefix8(2) == "\r\n") { reader_.forward(2); }
else { reader_.forward(); }
return '\n';
}
if(c == '\u2028' || c == '\u2029')
{
reader_.forward();
return c;
}
return '\0';
}
} }
private: private: