Allow trailing commas in short-lamba expressions
commitcace336e6b7498874c4611cf8a31e1dbff4bd39d
authorSara Golemon <sgolemon@fb.com>
Fri, 19 Dec 2014 06:15:03 +0000 (18 22:15 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Fri, 19 Dec 2014 06:30:28 +0000 (18 22:30 -0800)
tree41b1bbf82bb69717b8f16dd645ac8d87c1a80c4c
parent87361185dcbd2e9865641f0234218fa84c4e4118
Allow trailing commas in short-lamba expressions

Summary: As it says on the tin.

The parser allows it already, but only if the scanner has been
type for '(' and ')' have been correctly overridden to be
T_LAMBDA_OP and T_LAMBDA_CP.

tryParseNonEmptyLambdaParams() was incorrectly disallowing
trailing commas.

{sync, type="child", parent="internal", parentrevid="1748938", parentrevfbid="735574109854167", parentdiffid="5993857"}

Reviewed By: @paulbiss

Differential Revision: D1748938

Signature: t1:1748938:1418936065:e0c4d563bbbeddc1ff8d20f934685089242235d3
hphp/parser/scanner.cpp
hphp/test/slow/closure/trailing-comma.php [new file with mode: 0644]
hphp/test/slow/closure/trailing-comma.php.expect [new file with mode: 0644]