Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

function Parser::lexInlineStructure

2 calls to Parser::lexInlineStructure()
Parser::lexInlineMapping in vendor/symfony/yaml/Parser.php
Parser::lexInlineSequence in vendor/symfony/yaml/Parser.php

File

vendor/symfony/yaml/Parser.php, line 1187

Class

Parser
Parser parses YAML strings to convert them to PHP arrays.

Namespace

Symfony\Component\Yaml

Code

private function lexInlineStructure(int &$cursor, string $closingTag) : string {
    $value = $this->currentLine[$cursor];
    ++$cursor;
    do {
        $this->consumeWhitespaces($cursor);
        while (isset($this->currentLine[$cursor])) {
            switch ($this->currentLine[$cursor]) {
                case '"':
                case "'":
                    $value .= $this->lexInlineQuotedString($cursor);
                    break;
                case ':':
                case ',':
                    $value .= $this->currentLine[$cursor];
                    ++$cursor;
                    break;
                case '{':
                    $value .= $this->lexInlineMapping($cursor);
                    break;
                case '[':
                    $value .= $this->lexInlineSequence($cursor);
                    break;
                case $closingTag:
                    $value .= $this->currentLine[$cursor];
                    ++$cursor;
                    return $value;
                case '#':
                    break 2;
                default:
                    $value .= $this->lexUnquotedString($cursor);
            }
            if ($this->consumeWhitespaces($cursor)) {
                $value .= ' ';
            }
        }
        if ($this->hasMoreLines()) {
            $cursor = 0;
        }
    } while ($this->moveToNextLine());
    throw new ParseException('Malformed inline YAML string.');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal