Page MenuHomePhabricator

Allow spaces after the `.` operator if followed by a comment.
ClosedPublic

Authored by joshuaspence on Jun 9 2014, 7:20 PM.
Tags
None
Referenced Files
F14729190: D9438.id22535.diff
Sat, Jan 18, 6:22 AM
F14720904: D9438.id22534.diff
Fri, Jan 17, 10:19 PM
Unknown Object (File)
Mon, Jan 13, 10:54 AM
Unknown Object (File)
Fri, Jan 10, 10:02 AM
Unknown Object (File)
Wed, Jan 8, 3:20 AM
Unknown Object (File)
Sun, Jan 5, 2:22 PM
Unknown Object (File)
Sun, Jan 5, 9:34 AM
Unknown Object (File)
Fri, Jan 3, 4:14 PM
Subscribers

Details

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.

Diff Detail

Repository
rARC Arcanist
Branch
dotspace
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 940
Build 940: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Allow spaces after the `.` operator if followed by a comment..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Odd place to put a comment, but sure.

This revision is now accepted and ready to land.Jun 9 2014, 7:24 PM

We probably have some annotating regexps, I suppose.

epriestley updated this revision to Diff 22535.

Closed by commit rARC57f4bbae42c5 (authored by @joshuaspence, committed by @epriestley).

In D9438#9, @epriestley wrote:

We probably have some annotating regexps, I suppose.

Spot on, this is from src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupSimpleTableBlockRule.php (rPHU):

preg_match_all(
  '/\|'.
  '('.
    '(?:'.
      '(?:\\[\\[.*?\\]\\])'. // [[ ... | ... ]], a link
      '|'.
        '(?:[^|[]+)'.          // Anything but "|" or "[".
      '|'.
        '(?:\\[[^\\|[])'.      // "[" followed by anything but "[" or "|"
    ')*'.
  ')/', $line, $matches);