Page MenuHomePhabricator

Improve parsing of `use` statements
ClosedPublic

Authored by joshuaspence on Nov 19 2015, 8:50 AM.
Tags
None
Referenced Files
F19706947: D14518.id.diff
Wed, Feb 11, 10:17 AM
F19684271: D14518.diff
Mon, Feb 9, 3:41 AM
F19684269: D14518.diff
Mon, Feb 9, 3:36 AM
F19627224: D14518.diff
Wed, Feb 4, 9:00 PM
F19627223: D14518.diff
Wed, Feb 4, 9:00 PM
F19521443: D14518.id.diff
Jan 16 2026, 10:18 PM
F19518351: D14518.diff
Jan 15 2026, 7:57 PM
F19513086: D14518.diff
Jan 13 2026, 7:40 AM
Subscribers

Details

Summary

The way that we parse use statements at the moment is a bit odd. For example, consider the following example:

<?php

use A\B\C;
use X\Y\Z;

This is currently parsed as:

xhpast-before.png (336×182 px, 8 KB)

After this change, it is instead parsed as:

xhpast-after.png (279×166 px, 7 KB)

Test Plan

Added a test case.

Diff Detail

Repository
rPHU libphutil
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8930
Build 10474: Run Core Tests
Build 10473: arc lint + arc unit

Event Timeline

joshuaspence retitled this revision from to Improve parsing on `use` statements.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Nov 19 2015, 4:34 PM
joshuaspence retitled this revision from Improve parsing on `use` statements to Improve parsing of `use` statements.Nov 19 2015, 7:47 PM
joshuaspence edited edge metadata.
This revision was automatically updated to reflect the committed changes.