]> granicus.if.org Git - php/commit
Don't include trailing newline in comment token
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 15 Feb 2020 16:54:02 +0000 (17:54 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 25 Jun 2020 09:25:22 +0000 (11:25 +0200)
commit47cf18ba4ef9fb9df6c3affff8f2a3f5a3f930a8
tree8f3750cf4d7003508bbeb411025d673cb391f415
parente12b9df05d238ec0f3cf47b28a49a4df1b1e3442
Don't include trailing newline in comment token

Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong
to the comment logically, and this makes for an ugly special case,
as other tokens do not include trailing newlines.

Whitespace-sensitive tooling will want to either forward or backward
emulate this change.

Closes GH-5182.
UPGRADING
Zend/zend_language_scanner.l
ext/tokenizer/tests/PhpToken_methods.phpt
ext/tokenizer/tests/token_get_all_variation9.phpt