Page MenuHomePhabricator

Align PHPAST lexer to PHP 5.5.8
ClosedPublic

Authored by epriestley on Jan 21 2014, 8:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 10:04 PM
Unknown Object (File)
Sun, Dec 8, 8:54 PM
Unknown Object (File)
Wed, Dec 4, 7:12 PM
Unknown Object (File)
Fri, Nov 29, 5:53 PM
Unknown Object (File)
Tue, Nov 26, 1:19 PM
Unknown Object (File)
Wed, Nov 13, 7:45 AM
Unknown Object (File)
Oct 25 2024, 8:18 AM
Unknown Object (File)
Oct 3 2024, 5:30 PM
Subscribers

Details

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.

Diff Detail

Branch
ast8
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

src/parser/xhpast/__tests__/data/php-syntax.php.expect
10848

This is (binary) now being parsed as T_STRING_CAST (like PHP 5.5.8).