1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 02:07:59 +01:00
PHP-Parser/test/code/parser/scalar/flexibleDocStringErrors.test
Nikita Popov 5f73c4de80 Flexible doc: Validate end label indentation
Move doc string parsing logic from rebuildParsers.php and
String_::parseDocString() into ParserAbstract. This stuff is
going to get complicated now.

For now only implement the validation of the indentation on the
end label.
2018-09-21 16:31:17 +02:00

25 lines
450 B
Plaintext

Error conditions for flexible doc strings
-----
<?php
<<<A
@@{ "\t" }@@A;
<<<A
FooBar
@@{ "\t" }@@A;
-----
Invalid indentation - tabs and spaces cannot be mixed from 4:1 to 4:3
Invalid indentation - tabs and spaces cannot be mixed from 8:1 to 8:3
array(
0: Stmt_Expression(
expr: Scalar_String(
value:
)
)
1: Stmt_Expression(
expr: Scalar_String(
value: FooBar
)
)
)