protected function reduceRule379()
 {
     foreach ($this->semStack[$this->stackPos - (3 - 2)] as &$s) {
         if (is_string($s)) {
             $s = Node\Scalar\String_::parseEscapeSequences($s, null);
         }
     }
     $s = preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $s);
     if ('' === $s) {
         array_pop($this->semStack[$this->stackPos - (3 - 2)]);
     }
     $this->semValue = new Scalar\Encapsed($this->semStack[$this->stackPos - (3 - 2)], $this->startAttributeStack[$this->stackPos - (3 - 1)] + $this->endAttributes);
 }
Exemple #2
0
 protected function reduceRule463()
 {
     foreach ($this->semStack[$this->stackPos - (3 - 2)] as $s) {
         if ($s instanceof Node\Scalar\EncapsedStringPart) {
             $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, null, false);
         }
     }
     $s->value = preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $s->value);
     if ('' === $s->value) {
         array_pop($this->semStack[$this->stackPos - (3 - 2)]);
     }
     $this->semValue = new Scalar\Encapsed($this->semStack[$this->stackPos - (3 - 2)], $this->startAttributeStack[$this->stackPos - (3 - 1)] + $this->endAttributes);
 }
 protected function reduceRule318()
 {
     $this->semValue = array(Scalar\String_::parseEscapeSequences($this->semStack[$this->stackPos - (1 - 1)], '`'));
 }
Exemple #4
0
 protected function reduceRule477() {
      $attrs = $this->startAttributeStack[$this->stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = strpos($this->semStack[$this->stackPos-(3-1)], "'") === false ? Scalar\String_::KIND_HEREDOC : Scalar\String_::KIND_NOWDOC; preg_match('/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/', $this->semStack[$this->stackPos-(3-1)], $matches); $attrs['docLabel'] = $matches[1];;
         foreach ($this->semStack[$this->stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, null, true); } } $s->value = preg_replace('~(\r\n|\n|\r)\z~', '', $s->value); if ('' === $s->value) array_pop($this->semStack[$this->stackPos-(3-2)]);; $this->semValue = new Scalar\Encapsed($this->semStack[$this->stackPos-(3-2)], $attrs);
 }