tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r675726 - /tomcat/trunk/java/org/apache/el/parser/ELParser.jjt
Date Thu, 10 Jul 2008 20:53:25 GMT
Author: markt
Date: Thu Jul 10 13:53:24 2008
New Revision: 675726

URL: http://svn.apache.org/viewvc?rev=675726&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42565
el ternary expression without space before colon now works
Patch provided by Lucas Galfaso
This is just the jjt patch. The resulting changes to the generated code 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=675726&r1=675725&r2=675726&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/ELParser.jjt (original)
+++ tomcat/trunk/java/org/apache/el/parser/ELParser.jjt Thu Jul 10 13:53:24 2008
@@ -31,7 +31,7 @@
 	NODE_DEFAULT_VOID=true;
 	JAVA_UNICODE_ESCAPE=false;
   	UNICODE_INPUT=true;
-	BUILD_NODE_FILES=true;
+	BUILD_NODE_FILES=false;
 }
 
 /* == Parser Declaration == */
@@ -274,20 +274,19 @@
  */
 void Function() #Function :
 {
-	Token t0 = null;
-	Token t1 = null;
+	Token tx = null;
 }
 {
-	(t0=<NAMESPACE>)? t1=<IDENTIFIER>
+	(tx=<FUNCTION_CALL>) (Expression() (<COMMA> Expression())*)? <RPAREN>
 	{
-		if (t0 != null) {
-			jjtThis.setPrefix(t0.image.substring(0, t0.image.length() - 1));
-			jjtThis.setLocalName(t1.image);
+		int split = tx.image.indexOf(":");
+		if (split!=-1) {
+			jjtThis.setPrefix(tx.image.substring(0, split));
+			jjtThis.setLocalName(tx.image.substring(split + 1, tx.image.length() - 1));
 		} else {
-			jjtThis.setLocalName(t1.image);
+			jjtThis.setLocalName(tx.image.substring(0, tx.image.length() - 1));
 		}
 	}
-	<LPAREN> (Expression() (<COMMA> Expression())*)? <RPAREN>
 }
 
 /*
@@ -428,7 +427,9 @@
 |	< MOD0 : "%" >
 |	< MOD1 : "mod" >
 |	< IDENTIFIER : (<LETTER>|<IMPL_OBJ_START>) (<LETTER>|<DIGIT>)*
>
-|   < NAMESPACE : (<IDENTIFIER> (<IDENTIFIER>|<MINUS>|<DOT>)*
<COLON>) >
+|	< #NAMESPACE : ( <NAMESPACE_NAME> <COLON>) >
+|	< #NAMESPACE_NAME: (<IDENTIFIER> (<LETTER>|<DIGIT>|<MINUS>|<DOT>)*)
>
+|	< FUNCTION_CALL: (<NAMESPACE>)? <IDENTIFIER> <LPAREN> >
 |	< FUNCTIONSUFFIX : (<IDENTIFIER>) >
 |	< #IMPL_OBJ_START: "#" >
 |	< #LETTER:



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message