Page MenuHomePhabricator

Let PhutilTypeLexer support qualified names

Authored by wjiang on Dec 1 2016, 1:05 AM.



Ref T11933. This lets PhutilTypeLexer support qualified names.

Test Plan

Unit test

Diff Detail

rPHU libphutil
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wjiang updated this revision to Diff 40832.Dec 1 2016, 1:05 AM
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 requested changes to this revision.Dec 1 2016, 1:15 AM
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:


And these "bad" test cases:


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 updated this revision to Diff 40833.Dec 1 2016, 1:46 AM
wjiang edited edge metadata.
  • Add more tests and fix regex
wjiang updated this revision to Diff 40834.Dec 1 2016, 1:48 AM
wjiang edited edge metadata.
  • fix tests
epriestley accepted this revision.Dec 1 2016, 1:50 AM
epriestley edited edge metadata.


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.