Lines Matching defs:mapping

371                     // nested mapping
379 // embedded mapping?
409 * Parses a YAML mapping.
415 private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = [])
418 $len = \strlen($mapping);
424 switch ($mapping[$i]) {
440 $isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true);
441 $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false);
444 throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping);
448 $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
452 if (false === $i = strpos($mapping, ':', $i)) {
460 throw new ParseException('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead.', self::$parsedLineNumber + 1, $mapping);
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);
473 if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) {
479 $tag = self::parseTag($mapping, $i, $flags);
480 switch ($mapping[$i]) {
483 $value = self::parseSequence($mapping, $flags, $i, $references);
485 // Parser cannot abort this mapping earlier, since lines
499 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
503 // nested mapping
504 $value = self::parseMapping($mapping, $flags, $i, $references);
506 // Parser cannot abort this mapping earlier, since lines
518 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
522 $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted);
524 // Parser cannot abort this mapping earlier, since lines
541 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
551 throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename);