Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14147861
D16967.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16967.diff
View Options
diff --git a/src/lexer/PhutilTypeLexer.php b/src/lexer/PhutilTypeLexer.php
--- a/src/lexer/PhutilTypeLexer.php
+++ b/src/lexer/PhutilTypeLexer.php
@@ -19,7 +19,7 @@
array('map', 'map'),
array('list', 'list'),
array('int|float|bool|string|null|callable|wild|regex', 'k'),
- array('[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*', 'k'),
+ array('\\\\?[a-zA-Z_\x7f-\xff]+(\\\\[a-zA-Z_\x7f-\xff]+)*', 'k'),
array('\\(', '(', 'comment'),
),
'comment' => array(
diff --git a/src/parser/__tests__/PhutilTypeSpecTestCase.php b/src/parser/__tests__/PhutilTypeSpecTestCase.php
--- a/src/parser/__tests__/PhutilTypeSpecTestCase.php
+++ b/src/parser/__tests__/PhutilTypeSpecTestCase.php
@@ -18,6 +18,10 @@
'optional int? (minimum 300)',
'list<wild>',
'list<list<list<map<string, string>>>> (easy)',
+ '\\SomeClass',
+ '\\Namespace\\SomeClass',
+ '\\NamespaceA\\NamespaceB\\NamespaceC',
+ 'NamespaceA\\NamespaceB\\NamespaceC',
);
$bad = array(
@@ -29,6 +33,10 @@
'(derp)',
'list<string (capital letters), string>',
'int?|string',
+ '\\',
+ '\\\\',
+ '\\SomeClass\\',
+ 'SomeClass\\',
);
$good = array_fill_keys($good, true);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 8:20 AM (13 h, 15 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6824997
Default Alt Text
D16967.diff (1 KB)
Attached To
Mode
D16967: Let PhutilTypeLexer support qualified names
Attached
Detach File
Event Timeline
Log In to Comment