mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
588e6a4d4c
Scalar\String_ and Scalar\Encapsed now have an additional "kind" attribute, which may be one of: * String_::KIND_SINGLE_QUOTED * String_::KIND_DOUBLE_QUOTED * String_::KIND_NOWDOC * String_::KIND_HEREDOC Additionally, if the string kind is one of the latter two, an attribute "docLabel" is provided, which contains the doc string label (STR in <<<STR) that was originally used. The pretty printer will try to take the original kind of the string, as well as the used doc string label into account.
86 lines
495 B
Plaintext
86 lines
495 B
Plaintext
Literals
|
|
-----
|
|
<?php
|
|
|
|
<<<'STR'
|
|
STR;
|
|
<<<STR
|
|
STR;
|
|
|
|
<<<'STR'
|
|
A
|
|
B
|
|
STR;
|
|
<<<STR
|
|
A
|
|
B
|
|
STR;
|
|
|
|
<<<'STR'
|
|
a\nb$c
|
|
STR;
|
|
<<<STR
|
|
a\\nb\$c
|
|
STR;
|
|
|
|
<<<STR
|
|
a$b
|
|
{$c->d}
|
|
STR;
|
|
|
|
call(
|
|
<<<STR
|
|
A
|
|
STR
|
|
, <<<STR
|
|
B
|
|
STR
|
|
);
|
|
|
|
function test() {
|
|
<<<STR
|
|
Foo
|
|
STR;
|
|
<<<STR
|
|
Bar
|
|
STR;
|
|
}
|
|
-----
|
|
<<<'STR'
|
|
STR;
|
|
<<<STR
|
|
STR;
|
|
<<<'STR'
|
|
A
|
|
B
|
|
STR;
|
|
<<<STR
|
|
A
|
|
B
|
|
STR;
|
|
<<<'STR'
|
|
a\nb$c
|
|
STR;
|
|
<<<STR
|
|
a\\nb\$c
|
|
STR;
|
|
<<<STR
|
|
a{$b}
|
|
{$c->d}
|
|
STR;
|
|
call(<<<STR
|
|
A
|
|
STR
|
|
, <<<STR
|
|
B
|
|
STR
|
|
);
|
|
function test()
|
|
{
|
|
<<<STR
|
|
Foo
|
|
STR;
|
|
<<<STR
|
|
Bar
|
|
STR;
|
|
} |