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)
Sat, Apr 27, 11:08 AM
Unknown Object (File)
Mon, Apr 22, 10:31 PM
Unknown Object (File)
Sat, Apr 20, 6:19 PM
Unknown Object (File)
Thu, Apr 18, 11:39 PM
Unknown Object (File)
Thu, Apr 18, 11:39 PM
Unknown Object (File)
Thu, Apr 18, 11:39 PM
Unknown Object (File)
Thu, Apr 18, 11:10 PM
Unknown Object (File)
Tue, Apr 16, 12:11 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
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.