HomePhabricator

Improve parsing of `use` statements

Tags
None
Referenced Files
F976619: xhpast-before.png
Nov 19 2015, 7:49 PM
F976621: xhpast-after.png
Nov 19 2015, 7:49 PM
Subscribers
None

Description

Improve parsing of use statements

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.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14518

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Nov 19 2015, 7:49 PM
Reviewer
Blessed Reviewers
Differential Revision
D14518: Improve parsing of `use` statements
Parents
rPHU44113cfd0db1: Add an `XHPAST::getNamespace()` method
Branches
Unknown
Tags
Unknown
Build Status
Buildable 8938
Build 10486: Run Core Tests