Page MenuHomePhabricator

Add PHPAST test cases for most lexer patterns
ClosedPublic

Authored by epriestley on Jan 21 2014, 5:37 PM.
Tags
None
Referenced Files
F15509175: D8026.id18170.diff
Wed, Apr 16, 10:26 AM
F15484081: D8026.id18147.diff
Wed, Apr 9, 4:04 PM
F15481456: D8026.id18170.diff
Tue, Apr 8, 8:50 PM
F15474916: D8026.id.diff
Sun, Apr 6, 1:50 PM
F15473386: D8026.diff
Sat, Apr 5, 9:34 PM
F15465524: D8026.diff
Wed, Apr 2, 7:58 PM
F15421000: D8026.id.diff
Mar 21 2025, 8:02 PM
F15405133: D8026.id18170.diff
Mar 18 2025, 10:24 AM
Subscribers

Details

Summary

Ref T4334. Adds test cases for most of the lexer rules: tags, literals, and comments. Remaining lexer rules are mostly difficult to test in isolation, or have a known issue in the case of HEREDOC.

Test Plan

The JSON dumps aren't very human readable, so I'm verifying that the parser output is sane using the web UI PHPAST tool before committing it to tests.

Diff Detail

Branch
ast2
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

src/parser/xhpast/__tests__/data/php-literals.php.test
12

This syntax is unusual ("binary string"), but part of the mainline PHP parser. It's a feature which was added circa 5.2 for forward-compatibility with 6.0, but will probably never actually do anything.

epriestley updated this revision to Unknown Object (????).Jan 21 2014, 5:44 PM
  • Add b"double quotes".
  • Add 0xFF (hex literal).
  • No 0b10 yet because there's no support.