1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-08 16:02:39 +01:00

Fix XHPAST parsing of variadic calls

Summary:
Depends on D21066. Ref T13492. The switch of unit test data to stable/readable output exposed this bug in parsing of variadic calls: some nodes are not given types properly.

Fix the parser and update the test.

Test Plan: Ran the test, which now works.

Maniphest Tasks: T13492

Differential Revision: https://secure.phabricator.com/D21067
This commit is contained in:
epriestley 2020-04-07 12:11:37 -07:00
parent a689dee228
commit e03431def8
4 changed files with 313 additions and 301 deletions

View file

@ -131,15 +131,25 @@ pass
* n_CALL_PARAMETER_LIST * n_CALL_PARAMETER_LIST
> ( > (
* n_UNPACK * n_UNPACK
* "<INVALID TYPE \"0\">"
> ... > ...
* n_ARRAY_LITERAL
* n_ARRAY_VALUE_LIST
> [ > [
* n_ARRAY_VALUE
* n_EMPTY
* n_NUMERIC_SCALAR
> 1 > 1
> , > ,
> " " > " "
* n_ARRAY_VALUE
* n_EMPTY
* n_NUMERIC_SCALAR
> 2 > 2
> , > ,
> " " > " "
* n_ARRAY_VALUE
* n_EMPTY
* n_NUMERIC_SCALAR
> 3 > 3
> ] > ]
> ) > )
@ -152,8 +162,8 @@ pass
* n_CALL_PARAMETER_LIST * n_CALL_PARAMETER_LIST
> ( > (
* n_UNPACK * n_UNPACK
* "<INVALID TYPE \"0\">"
> ... > ...
* n_VARIABLE
> $foo > $foo
> ) > )
> ; > ;

View file

@ -8,7 +8,7 @@ final class PhutilXHPASTBinary extends Phobject {
* This is the version that would be obtained with an up-to-date XHPAST * This is the version that would be obtained with an up-to-date XHPAST
* build. The //actual// XHPAST build version may vary. * build. The //actual// XHPAST build version may vary.
*/ */
const EXPECTED_VERSION = '7.1.4'; const EXPECTED_VERSION = '7.1.5';
/** /**
* The XHPAST build version. * The XHPAST build version.

View file

@ -1051,8 +1051,8 @@ non_empty_parameter_list:
parameter: parameter:
T_ELLIPSIS T_VARIABLE { T_ELLIPSIS T_VARIABLE {
$$ = NTYPE($1, n_UNPACK); NTYPE($1, n_UNPACK);
$$->appendChild(NTYPE($2, n_VARIABLE)); $$ = $1->appendChild(NTYPE($2, n_VARIABLE));
} }
| T_VARIABLE { | T_VARIABLE {
$$ = NTYPE($1, n_VARIABLE); $$ = NTYPE($1, n_VARIABLE);
@ -1111,7 +1111,8 @@ non_empty_function_call_parameter_list:
argument: argument:
expr expr
| T_ELLIPSIS expr { | T_ELLIPSIS expr {
$$ = NNEW(n_UNPACK)->appendChild($1); NTYPE($1, n_UNPACK);
$$ = $1->appendChild($2);
} }
| '&' w_variable { | '&' w_variable {
NTYPE($1, n_VARIABLE_REFERENCE); NTYPE($1, n_VARIABLE_REFERENCE);

File diff suppressed because it is too large Load diff