Lines Matching refs:this

60         $this->filename = $filename;
63 return $this->parse(file_get_contents($filename), $flags);
65 $this->filename = null;
82 …new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename);
85 $this->refs = [];
96 $data = $this->doParse($value, $flags);
101 $this->lines = [];
102 $this->currentLine = '';
103 $this->refs = [];
104 $this->skippedLineNumbers = [];
105 $this->locallySkippedLineNumbers = [];
118 return $this->getRealCurrentLineNb();
123 $this->currentLineNb = -1;
124 $this->currentLine = '';
125 $value = $this->cleanup($value);
126 $this->lines = explode("\n", $value);
127 $this->locallySkippedLineNumbers = [];
129 if (null === $this->totalNumberOfLines) {
130 $this->totalNumberOfLines = \count($this->lines);
133 if (!$this->moveToNextLine()) {
141 while ($this->isCurrentLineEmpty()) {
142 if (!$this->moveToNextLine()) {
148 …if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLi…
153 if ($this->isCurrentLineEmpty()) {
158 if ("\t" === $this->currentLine[0]) {
159 …ML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLin…
162 Inline::initialize($flags, $this->getRealCurrentLineNb(), $this->filename);
165 …if ('-' === $this->currentLine[0] && self::preg_match('#^\-((?P<leadspaces>\s+)(?P<value>.+))?$#u'…
167 …ot define a sequence item when in a mapping', $this->getRealCurrentLineNb() + 1, $this->currentLin…
173 $this->refsBeingParsed[] = $isRef;
178 …w ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->…
183 …$data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true…
184 … } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) {
187 … $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags)
191 …e::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['v…
195 if ($this->isNextLineIndented()) {
196 …$block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['lead…
199 $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags);
201 $data[] = $this->parseValue($values['value'], $flags, $context);
205 $this->refs[$isRef] = end($data);
206 array_pop($this->refsBeingParsed);
209 …'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(\s++(?P<value>.+))?$#u', rtrim($this->currentLine), $val…
213 …cannot define a mapping item when in a sequence', $this->currentLineNb + 1, $this->currentLine, $t…
220 $e->setParsedLine($this->getRealCurrentLineNb() + 1);
221 $e->setSnippet($this->currentLine);
227 …nstead.', is_numeric($key) ? 'Numeric' : 'Non-string'), $this->getRealCurrentLineNb() + 1, $this->…
240 if (!\array_key_exists($refName, $this->refs)) {
241 … if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) {
242 …lode(', ', \array_slice($this->refsBeingParsed, $pos)), $refName, $refName), $this->currentLineNb …
245 …('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLin…
248 $refValue = $this->refs[$refName];
255 …ed with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLin…
263 $value = $this->getNextEmbedBlock();
265 … $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags);
272 …ed with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLin…
285 …ew ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem, $
298 $this->refsBeingParsed[] = $isRef;
305 …s['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values…
308 if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) {
318 …xception(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->…
322 $realCurrentLineNbKey = $this->getRealCurrentLineNb();
323 … $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
325 $this->refs[$refMatches['ref']] = $value;
341 …tion(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine);
345 $value = $this->parseValue(rtrim($values['value']), $flags, $context);
351 …xception(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->…
355 $this->refs[$isRef] = $data[$key];
356 array_pop($this->refsBeingParsed);
360 if ('---' === $this->currentLine) {
361 …xception('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $t…
364 …if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $
365 …w ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->…
369 if (\is_string($value) && $this->lines[0] === trim($value)) {
371 $value = Inline::parse($this->lines[0], $flags, $this->refs);
373 $e->setParsedLine($this->getRealCurrentLineNb() + 1);
374 $e->setSnippet($this->currentLine);
383 if (0 === $this->currentLineNb) {
388 foreach ($this->lines as $line) {
390 … if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) {
391 …throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine…
424 …throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine…
426 } while ($this->moveToNextLine());
447 $skippedLineNumbers = $this->skippedLineNumbers;
449 foreach ($this->locallySkippedLineNumbers as $lineNumber) {
459 $parser->totalNumberOfLines = $this->totalNumberOfLines;
461 $parser->refs = &$this->refs;
462 $parser->refsBeingParsed = $this->refsBeingParsed;
476 $realCurrentLineNumber = $this->currentLineNb + $this->offset;
478 foreach ($this->skippedLineNumbers as $skippedLineNumber) {
496 return \strlen($this->currentLine) - \strlen(ltrim($this->currentLine, ' '));
511 $oldLineIndentation = $this->getCurrentLineIndentation();
513 if (!$this->moveToNextLine()) {
525 if ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) {
526 $EOF = !$this->moveToNextLine();
532 $newIndent = $this->getCurrentLineIndentation();
537 $this->moveToPreviousLine();
540 $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem();
542 if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) {
543 …ow new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLin…
550 if ($this->getCurrentLineIndentation() >= $newIndent) {
551 $data[] = substr($this->currentLine, $newIndent);
552 } elseif ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) {
553 $data[] = $this->currentLine;
555 $this->moveToPreviousLine();
563 $this->moveToPreviousLine();
568 $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
570 while ($this->moveToNextLine()) {
571 $indent = $this->getCurrentLineIndentation();
573 …if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollect…
574 $this->moveToPreviousLine();
578 if ($this->isCurrentLineBlank()) {
579 $data[] = substr($this->currentLine, $newIndent);
584 $data[] = substr($this->currentLine, $newIndent);
585 } elseif ($this->isCurrentLineComment()) {
586 $data[] = $this->currentLine;
588 $this->moveToPreviousLine();
592 …ow new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLin…
606 if ($this->currentLineNb >= \count($this->lines) - 1) {
610 $this->currentLine = $this->lines[++$this->currentLineNb];
622 if ($this->currentLineNb < 1) {
626 $this->currentLine = $this->lines[--$this->currentLineNb];
651 if (!\array_key_exists($value, $this->refs)) {
652 if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) {
653 …mplode(', ', \array_slice($this->refsBeingParsed, $pos)), $value, $value), $this->currentLineNb + …
656 …printf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $t…
659 return $this->refs[$value];
665 …$data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int…
683 return Inline::parse($value, $flags, $this->refs);
688 while ($this->moveToNextLine()) {
690 if (null === $quotation && 0 === $this->getCurrentLineIndentation()) {
691 $this->moveToPreviousLine();
696 $lines[] = trim($this->currentLine);
699 if ('' !== $this->currentLine && substr($this->currentLine, -1) === $quotation) {
717 Inline::$parsedLineNumber = $this->getRealCurrentLineNb();
719 $parsedValue = Inline::parse($value, $flags, $this->refs);
722 …olon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $th…
727 $e->setParsedLine($this->getRealCurrentLineNb() + 1);
728 $e->setSnippet($this->currentLine);
745 $notEOF = $this->moveToNextLine();
750 $isCurrentLineBlank = $this->isCurrentLineBlank();
756 if ($notEOF = $this->moveToNextLine()) {
758 $isCurrentLineBlank = $this->isCurrentLineBlank();
764 $currentLineLength = \strlen($this->currentLine);
766 for ($i = 0; $i < $currentLineLength && ' ' === $this->currentLine[$i]; ++$i) {
777 self::preg_match($pattern, $this->currentLine, $matches)
780 if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) {
781 $blockLines[] = substr($this->currentLine, $indentation);
789 if ($notEOF = $this->moveToNextLine()) {
790 $isCurrentLineBlank = $this->isCurrentLineBlank();
799 $this->moveToPreviousLine();
800 } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) {
854 $currentIndentation = $this->getCurrentLineIndentation();
858 $EOF = !$this->moveToNextLine();
863 } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()));
869 $ret = $this->getCurrentLineIndentation() > $currentIndentation;
872 $this->moveToPreviousLine();
885 return $this->isCurrentLineBlank() || $this->isCurrentLineComment();
895 return '' == trim($this->currentLine, ' ');
906 $ltrimmedLine = ltrim($this->currentLine, ' ');
913 return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1);
930 $this->offset += $count;
936 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
944 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
961 $currentIndentation = $this->getCurrentLineIndentation();
965 $EOF = !$this->moveToNextLine();
970 } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()));
976 …$ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedColl…
979 $this->moveToPreviousLine();
992 return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
1058 if ($nextLineCheck && !$this->isNextLineIndented()) {
1066 …The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $th…
1073 …PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $th…