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:
parent
a689dee228
commit
e03431def8
4 changed files with 313 additions and 301 deletions
|
@ -131,15 +131,25 @@ pass
|
|||
* n_CALL_PARAMETER_LIST
|
||||
> (
|
||||
* n_UNPACK
|
||||
* "<INVALID TYPE \"0\">"
|
||||
> ...
|
||||
* n_ARRAY_LITERAL
|
||||
* n_ARRAY_VALUE_LIST
|
||||
> [
|
||||
* n_ARRAY_VALUE
|
||||
* n_EMPTY
|
||||
* n_NUMERIC_SCALAR
|
||||
> 1
|
||||
> ,
|
||||
> " "
|
||||
* n_ARRAY_VALUE
|
||||
* n_EMPTY
|
||||
* n_NUMERIC_SCALAR
|
||||
> 2
|
||||
> ,
|
||||
> " "
|
||||
* n_ARRAY_VALUE
|
||||
* n_EMPTY
|
||||
* n_NUMERIC_SCALAR
|
||||
> 3
|
||||
> ]
|
||||
> )
|
||||
|
@ -152,8 +162,8 @@ pass
|
|||
* n_CALL_PARAMETER_LIST
|
||||
> (
|
||||
* n_UNPACK
|
||||
* "<INVALID TYPE \"0\">"
|
||||
> ...
|
||||
* n_VARIABLE
|
||||
> $foo
|
||||
> )
|
||||
> ;
|
||||
|
|
|
@ -8,7 +8,7 @@ final class PhutilXHPASTBinary extends Phobject {
|
|||
* This is the version that would be obtained with an up-to-date XHPAST
|
||||
* build. The //actual// XHPAST build version may vary.
|
||||
*/
|
||||
const EXPECTED_VERSION = '7.1.4';
|
||||
const EXPECTED_VERSION = '7.1.5';
|
||||
|
||||
/**
|
||||
* The XHPAST build version.
|
||||
|
|
|
@ -1051,8 +1051,8 @@ non_empty_parameter_list:
|
|||
|
||||
parameter:
|
||||
T_ELLIPSIS T_VARIABLE {
|
||||
$$ = NTYPE($1, n_UNPACK);
|
||||
$$->appendChild(NTYPE($2, n_VARIABLE));
|
||||
NTYPE($1, n_UNPACK);
|
||||
$$ = $1->appendChild(NTYPE($2, n_VARIABLE));
|
||||
}
|
||||
| T_VARIABLE {
|
||||
$$ = NTYPE($1, n_VARIABLE);
|
||||
|
@ -1111,7 +1111,8 @@ non_empty_function_call_parameter_list:
|
|||
argument:
|
||||
expr
|
||||
| T_ELLIPSIS expr {
|
||||
$$ = NNEW(n_UNPACK)->appendChild($1);
|
||||
NTYPE($1, n_UNPACK);
|
||||
$$ = $1->appendChild($2);
|
||||
}
|
||||
| '&' w_variable {
|
||||
NTYPE($1, n_VARIABLE_REFERENCE);
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue