Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42565
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 Aug 2008 16:11:14 +0000 (16:11 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 Aug 2008 16:11:14 +0000 (16:11 +0000)
This patch:
 - limits the regexp for namespace to what is in the spec
 - removes the namespace token since the maximal munch rule means that there is a risk the second and third parts of a ternary expression would, incorrectly, be interpreted as a fucntion call.
 - modifies the lookahead for function to be more explicit about what to look for
My set of weird and wonderful test cases (mixing ternary, fucntion and empty) now all work.
Updated generated files will follow.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@681736 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/parser/ELParser.jjt

index 1a6c41c..0708858 100644 (file)
@@ -255,7 +255,7 @@ void BracketSuffix() #BracketSuffix : {}
 void NonLiteral() : {}
 {
        <LPAREN> Expression() <RPAREN>
-       | LOOKAHEAD(3) Function()
+       | LOOKAHEAD((<IDENTIFIER> <COLON>)? <IDENTIFIER>) Function()
        | Identifier()
 }
 
@@ -278,7 +278,7 @@ void Function() #Function :
        Token t1 = null;
 }
 {
-       (t0=<NAMESPACE>)? t1=<IDENTIFIER>
+       (t0=<IDENTIFIER> <COLON>)? t1=<IDENTIFIER>
        {
                if (t0 != null) {
                        jjtThis.setPrefix(t0.image.substring(0, t0.image.length() - 1));
@@ -428,7 +428,6 @@ void Null() #Null : {}
 |      < MOD0 : "%" >
 |      < MOD1 : "mod" >
 |      < IDENTIFIER : (<LETTER>|<IMPL_OBJ_START>) (<LETTER>|<DIGIT>)* >
-|   < NAMESPACE : (<IDENTIFIER> (<IDENTIFIER>|<MINUS>|<DOT>)* <COLON>) >
 |      < FUNCTIONSUFFIX : (<IDENTIFIER>) >
 |      < #IMPL_OBJ_START: "#" >
 |      < #LETTER: