From 478ed3463c1563c6eecce1ed629fa8fc547dd1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 14 Oct 2016 09:24:06 -0300 Subject: [PATCH] Simplify lambda pursing even further - Remove a redundant case - Restrict grammar according to spec with a simpler scenario --- pmd-java/etc/grammar/Java.jjt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 7588c36ce9..65f9f91c4f 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1812,8 +1812,7 @@ void PrimaryPrefix() : Literal() | LOOKAHEAD(2) "this" {jjtThis.setUsesThisModifier();} | "super" {jjtThis.setUsesSuperModifier();} -| LOOKAHEAD( "(" ")" "->" ) LambdaExpression() -| LOOKAHEAD( VariableDeclaratorId() "->" ) LambdaExpression() +| LOOKAHEAD( "->" ) LambdaExpression() | LOOKAHEAD( "(" VariableDeclaratorId() ( "," VariableDeclaratorId() )* ")" "->" ) LambdaExpression() | LOOKAHEAD( FormalParameters() "->" ) LambdaExpression() | LOOKAHEAD(3) "(" Expression() ")"