Lines Matching refs:i
77 $i = 0;
78 $tag = self::parseTag($value, $i, $flags);
79 switch ($value[$i]) {
81 $result = self::parseSequence($value, $flags, $i, $references);
82 ++$i;
85 $result = self::parseMapping($value, $flags, $i, $references);
86 ++$i;
89 $result = self::parseScalar($value, $flags, null, $i, true, $references);
93 if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) {
94 throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
268 public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null)
270 if (\in_array($scalar[$i], ['"', "'"], true)) {
273 $output = self::parseQuotedScalar($scalar, $i);
276 $tmp = ltrim(substr($scalar, $i), " \n");
281 throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
289 $output = substr($scalar, $i);
290 $i += \strlen($output);
296 } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
298 $i += \strlen($output);
322 private static function parseQuotedScalar(string $scalar, int &$i = 0): string
324 if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
325 throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
331 if ('"' == $scalar[$i]) {
337 $i += \strlen($match[0]);
347 private static function parseSequence(string $sequence, int $flags, int &$i = 0, array &$references = []): array
351 ++$i;
354 while ($i < $len) {
355 if (']' === $sequence[$i]) {
358 if (',' === $sequence[$i] || ' ' === $sequence[$i]) {
359 ++$i;
364 $tag = self::parseTag($sequence, $i, $flags);
365 switch ($sequence[$i]) {
368 $value = self::parseSequence($sequence, $flags, $i, $references);
372 $value = self::parseMapping($sequence, $flags, $i, $references);
375 $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted);
393 --$i;
402 ++$i;
415 private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = [])
419 ++$i;
423 while ($i < $len) {
424 switch ($mapping[$i]) {
428 ++$i;
439 $offsetBeforeKeyParsing = $i;
440 $isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true);
441 $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false);
443 if ($offsetBeforeKeyParsing === $i) {
448 $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
452 if (false === $i = strpos($mapping, ':', $i)) {
464 if (!$isKeyQuoted && (!isset($mapping[$i + 1]) || !\in_array($mapping[$i + 1], [' ', ',', '[', ']', '{', '}', "\n"], true))) {
465 throw new ParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping);
472 while ($i < $len) {
473 if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) {
474 ++$i;
479 $tag = self::parseTag($mapping, $i, $flags);
480 switch ($mapping[$i]) {
483 $value = self::parseSequence($mapping, $flags, $i, $references);
504 $value = self::parseMapping($mapping, $flags, $i, $references);
522 $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted);
543 --$i;
545 ++$i;
633 $i = 0;
634 if (\defined($const = self::parseScalar(substr($scalar, 11), 0, null, $i, false))) {
721 private static function parseTag(string $value, int &$i, int $flags): ?string
723 if ('!' !== $value[$i]) {
727 $tagLength = strcspn($value, " \t\n[]{},", $i + 1);
728 $tag = substr($value, $i + 1, $tagLength);
730 $nextOffset = $i + $tagLength + 1;
743 $i = $nextOffset;
750 if ('' !== $tag && !isset($value[$i])) {
769 if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) {
809 return '~^0x[0-9a-f_]++$~i';