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
Unknown Object (File)
Tue, Apr 16, 12:11 AM
Unknown Object (File)
Thu, Apr 11, 7:03 AM
Unknown Object (File)
Sun, Apr 7, 12:16 PM
Unknown Object (File)
Fri, Mar 29, 8:23 AM
Unknown Object (File)
Mar 15 2024, 6:46 PM
Unknown Object (File)
Mar 12 2024, 12:41 AM
Unknown Object (File)
Jan 23 2024, 3:20 PM
Unknown Object (File)
Jan 7 2024, 4:25 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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

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

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.