Page MenuHomePhabricator

Add support for exponentiation
Needs ReviewPublic

Authored by joshuaspence on May 3 2017, 12:00 PM.

Details

Summary

Ref T4334. Adds support for exponentiation via ** to XHPAST.

Test Plan

Added a test case.

Diff Detail

Repository
rPHU libphutil
Branch
master
Lint
Lint OK
Unit
Unit Test Errors
Build Status
Buildable 16771
Build 22375: Run Core Tests
Build 22374: arc lint + arc unit

Unit TestsFailed

Excuse: WIP
TimeTest
44 msPHPASTParserTestCase::Unknown Unit Message ("")
Assertion failed, expected values to be equal (at PHPASTParserTestCase.php:120): Parser output for "base-pass.php.test". Expected vs Actual Output Diff --- Old Value
22 msPHPASTParserTestCase::Unknown Unit Message ("")
Assertion failed, expected values to be equal (at PHPASTParserTestCase.php:120): Parser output for "base-pass.php.test". Expected vs Actual Output Diff --- Old Value
1 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
View Full Test Results (2 Failed · 383 Passed · 2 Skipped)

Event Timeline

joshuaspence created this revision.May 3 2017, 12:00 PM

I definitely did something wrong here, because I updated src/parser/xhpast/parser_tokens.php by hand...

Because the token values have shifted pretty much all test cases have bad data :(

It will probably be a lot easier to handle after something like D17802#214972 is implemented.

epriestley edited edge metadata.May 3 2017, 5:21 PM

wow exactly what the language desperately needed

I bet there are as many as 0 uses for this in our small million-line codebase

wjiang added a subscriber: wjiang.May 4 2017, 2:01 AM