Parses a """long string""". This method assumes that the first three double quotes have already been parsed.
@ignore
string $quote The type of quote to use (either ' or "):
protected function parseLongString($quote) {
$str = '';
$doubleQuoteCount = 0;
while ($doubleQuoteCount < 3) {
$c = $this
->read();
if ($c == -1) {
throw new EasyRdf_Exception("Turtle Parse Error: unexpected end of file while reading long string");
}
elseif ($c == $quote) {
$doubleQuoteCount++;
}
else {
$doubleQuoteCount = 0;
}
$str .= $c;
if ($c == '\\') {
// This escapes the next character, which might be a ' or "
$c = $this
->read();
if ($c == -1) {
throw new EasyRdf_Exception("Turtle Parse Error: unexpected end of file while reading long string");
}
$str .= $c;
}
}
return substr($str, 0, -3);
}