mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-09 17:22:18 +02:00
Merge d4a6aa349b
into b0d41af3ee
This commit is contained in:
commit
1599d9385d
|
@ -312,7 +312,7 @@ class Parser
|
||||||
if (null === $indentation) {
|
if (null === $indentation) {
|
||||||
$newIndent = $this->getCurrentLineIndentation();
|
$newIndent = $this->getCurrentLineIndentation();
|
||||||
|
|
||||||
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine);
|
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem();
|
||||||
|
|
||||||
if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) {
|
if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) {
|
||||||
throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
|
throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
|
||||||
|
@ -323,7 +323,7 @@ class Parser
|
||||||
|
|
||||||
$data = array(substr($this->currentLine, $newIndent));
|
$data = array(substr($this->currentLine, $newIndent));
|
||||||
|
|
||||||
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine);
|
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
|
||||||
|
|
||||||
// Comments must not be removed inside a string block (ie. after a line ending with "|")
|
// Comments must not be removed inside a string block (ie. after a line ending with "|")
|
||||||
$removeCommentsPattern = '~' . self::FOLDED_SCALAR_PATTERN . '$~';
|
$removeCommentsPattern = '~' . self::FOLDED_SCALAR_PATTERN . '$~';
|
||||||
|
@ -336,7 +336,7 @@ class Parser
|
||||||
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
|
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) {
|
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem()) {
|
||||||
$this->moveToPreviousLine();
|
$this->moveToPreviousLine();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -635,7 +635,7 @@ class Parser
|
||||||
if (
|
if (
|
||||||
$this->getCurrentLineIndentation() == $currentIndentation
|
$this->getCurrentLineIndentation() == $currentIndentation
|
||||||
&&
|
&&
|
||||||
$this->isStringUnIndentedCollectionItem($this->currentLine)
|
$this->isStringUnIndentedCollectionItem()
|
||||||
) {
|
) {
|
||||||
$ret = true;
|
$ret = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue