Page MenuHomePhabricator

Let PhutilTypeLexer support qualified names
ClosedPublic

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

Details

Summary

Ref T11933. This lets PhutilTypeLexer support qualified names.

Test Plan

Unit test

Diff Detail

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

Event Timeline

wjiang retitled this revision from to Let PhutilTypeLexer support qualified names.Dec 1 2016, 1:05 AM
wjiang updated this object.
wjiang edited the test plan for this revision. (Show Details)
wjiang added a reviewer: joshuaspence.
wjiang updated this revision to Diff 40832.
epriestley requested changes to this revision.

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

Thanks!

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.