Page MenuHomePhabricator

Let PhutilTypeLexer support qualified names
ClosedPublic

Authored by wjiang on Dec 1 2016, 1:05 AM.
Tags
None
Referenced Files
F14142669: D16967.id.diff
Tue, Dec 3, 1:39 PM
Unknown Object (File)
Wed, Nov 27, 4:00 AM
Unknown Object (File)
Tue, Nov 26, 11:57 AM
Unknown Object (File)
Mon, Nov 25, 5:15 AM
Unknown Object (File)
Sat, Nov 23, 1:47 PM
Unknown Object (File)
Thu, Nov 21, 9:54 PM
Unknown Object (File)
Tue, Nov 19, 3:05 PM
Unknown Object (File)
Fri, Nov 15, 5:05 AM
Subscribers

Details

Summary

Ref T11933. This lets PhutilTypeLexer support qualified names.

Test Plan

Unit test

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wjiang retitled this revision from to Let PhutilTypeLexer support qualified names.
wjiang updated this object.
wjiang edited the test plan for this revision. (Show Details)
wjiang added a reviewer: joshuaspence.
epriestley added a reviewer: epriestley.

This change is fine, but I think the new expression is too permissive. Let's add these "good" test cases:

\SomeClass
\Namespace\SomeClass
A\B\C
\A\B\C

And these "bad" test cases:

\
\\
\SomeClass\
SomeClass\

I think some of those won't pass; adjust the regular expression until they do.

(I think all those bad cases are actually illegal, but I haven't used namespaces in PHP very much so my understanding of the syntax may be incorrect.)

This revision now requires changes to proceed.Dec 1 2016, 1:15 AM
wjiang edited edge metadata.
  • Add more tests and fix regex
wjiang edited edge metadata.
  • fix tests
This revision is now accepted and ready to land.Dec 1 2016, 1:50 AM
This revision was automatically updated to reflect the committed changes.