Summary: Currently, `'foo'. // Some comment` is not allowed by the `ArcanistXHPASTLinter::LINT_BINARY_EXPRESSION_SPACING` rule. I believe that in the case of a trailing comment, we //should// allow whitespace after the `.` operator.
Test Plan: Wrote and executed a unit test for this case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9438
continue;
}
+ $next = $wtoken->getNextToken();
+ if ($next && $next->getTypeName() == 'T_COMMENT') {
+ continue;
+ }
+
$this->raiseLintAtToken(
$wtoken,
self::LINT_BINARY_EXPRESSION_SPACING,
$a .$b;
$a.
$b;
+$a. // This should be okay.
+$b;
array($x => $y);
array($x=>$y);
warning:3:5
warning:4:4
warning:5:3
-warning:10:9
-warning:11:10
warning:12:9
-warning:22:5
+warning:13:10
+warning:14:9
+warning:24:5
~~~~~~~~~~
<?php
$a.$b;
$a.$b;
$a.
$b;
+$a. // This should be okay.
+$b;
array($x => $y);
array($x => $y);