Lines Matching defs:currentLine
36 private $currentLine = '';
105 $this->currentLine = '';
119 $this->currentLine = '';
144 if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLine()) {
154 if ("\t" === $this->currentLine[0]) {
155 throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
161 if ('-' === $this->currentLine[0] && self::preg_match('#^\-((?P<leadspaces>\s+)(?P<value>.+))?$#u', rtrim($this->currentLine), $values)) {
163 throw new ParseException('You cannot define a sequence item when in a mapping.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
174 throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
183 $sequenceYaml = substr($this->currentLine, $sequenceIndentation);
218 self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine), $values)
222 throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
230 $e->setSnippet($this->currentLine);
236 throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string').' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
251 throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$refName])), $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename);
254 throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
264 throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
281 throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
327 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
350 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine);
360 throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
367 } elseif ('"' === $this->currentLine[0] || "'" === $this->currentLine[0]) {
369 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
376 $e->setSnippet($this->currentLine);
380 } elseif ('{' === $this->currentLine[0]) {
382 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
390 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
397 $e->setSnippet($this->currentLine);
401 } elseif ('[' === $this->currentLine[0]) {
403 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
411 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
418 $e->setSnippet($this->currentLine);
424 if ('---' === $this->currentLine) {
425 throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
428 if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1])) {
429 throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
438 $e->setSnippet($this->currentLine);
459 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
463 throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
497 throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
565 if (' ' !== ($this->currentLine[0] ?? '')) {
569 return \strlen($this->currentLine) - \strlen(ltrim($this->currentLine, ' '));
614 throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
623 $data[] = substr($this->currentLine, $newIndent ?? 0);
625 $data[] = $this->currentLine;
657 $data[] = substr($this->currentLine, $newIndent);
662 $data[] = substr($this->currentLine, $newIndent);
664 $data[] = $this->currentLine;
670 throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
691 $this->currentLine = $this->lines[++$this->currentLineNb];
705 $this->currentLine = $this->lines[--$this->currentLineNb];
732 throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
735 throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
759 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
763 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
771 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
774 if (isset($this->currentLine[$cursor]) && preg_replace('/\s*(#.*)?$/A', '', substr($this->currentLine, $cursor))) {
775 throw new ParseException(sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor)));
790 $lines[] = trim($this->currentLine);
818 $e->setSnippet($this->currentLine);
852 $currentLineLength = \strlen($this->currentLine);
854 for ($i = 0; $i < $currentLineLength && ' ' === $this->currentLine[$i]; ++$i) {
865 self::preg_match($pattern, $this->currentLine, $matches)
868 if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) {
869 $blockLines[] = substr($this->currentLine, $indentation);
977 return '' === $this->currentLine || '' === trim($this->currentLine, ' ');
986 $ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine;
1066 return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
1152 $quotation = $this->currentLine[$cursor];
1162 $cursor += strspn($this->currentLine, ' ', $cursor);
1171 for (; \strlen($this->currentLine) > $cursor; ++$cursor) {
1172 switch ($this->currentLine[$cursor]) {
1176 } elseif (isset($this->currentLine[++$cursor])) {
1177 $value .= '\\'.$this->currentLine[$cursor];
1184 if ("'" === $quotation && isset($this->currentLine[$cursor]) && "'" === $this->currentLine[$cursor]) {
1191 $value .= $this->currentLine[$cursor];
1198 } elseif ('\\' === $this->currentLine[-1]) {
1217 $cursor += strcspn($this->currentLine, '[]{},: ', $cursor);
1223 return substr($this->currentLine, $offset, $cursor - $offset);
1238 $value = $this->currentLine[$cursor];
1244 while (isset($this->currentLine[$cursor])) {
1245 switch ($this->currentLine[$cursor]) {
1252 $value .= $this->currentLine[$cursor];
1262 $value .= $this->currentLine[$cursor];
1290 $whitespaceOnlyTokenLength = strspn($this->currentLine, ' ', $cursor);
1294 if (isset($this->currentLine[$cursor])) {