$value =
trim($value);
if ('' ===
$value) { return '';
} $i = 0;
$tag = self::
parseTag($value,
$i,
$flags);
switch ($value[$i]) { case '[':
$result = self::
parseSequence($value,
$flags,
$i,
$references);
++
$i;
break;
case '{':
$result = self::
parseMapping($value,
$flags,
$i,
$references);
++
$i;
break;
default:
$result = self::
parseScalar($value,
$flags, null,
$i, true,
$references);
} // some comments are allowed at the end