HomePhabricator

Align PHPAST lexer to PHP 5.5.8

Description

Align PHPAST lexer to PHP 5.5.8

Summary:
Ref T4334. This aligns the lexer (but not the parser) with PHP 5.5.8. It also applies the patch on T3512. This has these positive effects:

  • Fixes binary literals.
  • Fixes empty heredoc.
  • Corrects T_BINARY_CAST into T_STRING_CAST (consistent with 5.5.8).
  • Removes T_UNICODE_CAST (not in 5.5.8).
  • Recognizes keywords trait, __trait__, yield, insteadof, callable.

...these sideways effects:

  • Slightly improves terminal heredocs (previously: parse error; now: bad parse).

...and these negative effects:

  • Breaks the callable test, since callable is now recognized as a keyword but the parser doesn't yet support it.

Test Plan: Rebuilt xhpast, ran unit tests.

Reviewers: btrahan, Firehed

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4334

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

Details

Provenance
epriestleyAuthored on
epriestleyPushed on Jan 21 2014, 10:32 PM
Reviewer
btrahan
Differential Revision
D8032: Align PHPAST lexer to PHP 5.5.8
Parents
rPHU2a1a4b020a76: Add PHPAST test for remaining language features
Branches
Unknown
Tags
Unknown
Tasks
T4334: Support PHP5.4+ syntax in XHPAST

Event Timeline