Author: markt
Date: Fri Aug  1 09:11:14 2008
New Revision: 681736

URL: http://svn.apache.org/viewvc?rev=681736&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42565
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.

Modified:
    tomcat/trunk/java/org/apache/el/parser/ELParser.jjt

Modified: tomcat/trunk/java/org/apache/el/parser/ELParser.jjt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/ELParser.jjt?rev=681736&r1=681735&r2=681736&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/ELParser.jjt (original)
+++ tomcat/trunk/java/org/apache/el/parser/ELParser.jjt Fri Aug  1 09:11:14 2008
@@ -255,7 +255,7 @@
 void NonLiteral() : {}
 {
        <LPAREN> Expression() <RPAREN>
-       | LOOKAHEAD(3) Function()
+       | LOOKAHEAD((<IDENTIFIER> <COLON>)? <IDENTIFIER>) Function()
        | Identifier()
 }
 
@@ -278,7 +278,7 @@
        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 @@
 |      < MOD0 : "%" >
 |      < MOD1 : "mod" >
 |      < IDENTIFIER : (<LETTER>|<IMPL_OBJ_START>) (<LETTER>|<DIGIT>)* >
-|   < NAMESPACE : (<IDENTIFIER> (<IDENTIFIER>|<MINUS>|<DOT>)* <COLON>) >
 |      < FUNCTIONSUFFIX : (<IDENTIFIER>) >
 |      < #IMPL_OBJ_START: "#" >
 |      < #LETTER:



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to