You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/01/13 20:19:25 UTC
svn commit: r898900 -
/tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
Author: markt
Date: Wed Jan 13 19:19:25 2010
New Revision: 898900
URL: http://svn.apache.org/viewvc?rev=898900&view=rev
Log:
Jasper Parser change so methods with parameters aren't mistaken for functions
Modified:
tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=898900&r1=898899&r2=898900&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java Wed Jan 13 19:19:25 2010
@@ -30,7 +30,8 @@
public class ELParser {
- private Token curToken; // current token
+ private Token curToken; // current token
+ private Token prevToken; // previous token
private ELNode.Nodes expr;
@@ -119,27 +120,28 @@
* arguments
*/
private boolean parseFunction() {
- if (!(curToken instanceof Id) || isELReserved(curToken.toString())) {
+ if (!(curToken instanceof Id) || isELReserved(curToken.toString()) ||
+ prevToken instanceof Char && prevToken.toChar() == '.') {
return false;
}
String s1 = null; // Function prefix
String s2 = curToken.toString(); // Function name
int mark = getIndex();
if (hasNext()) {
- Token t = nextToken();
- if (t.toChar() == ':') {
+ curToken = nextToken();
+ if (curToken.toChar() == ':') {
if (hasNext()) {
Token t2 = nextToken();
if (t2 instanceof Id) {
s1 = s2;
s2 = t2.toString();
if (hasNext()) {
- t = nextToken();
+ curToken = nextToken();
}
}
}
}
- if (t.toChar() == '(') {
+ if (curToken.toChar() == '(') {
ELexpr.add(new ELNode.Function(s1, s2));
return true;
}
@@ -224,6 +226,7 @@
* @return The next token in the EL expression buffer.
*/
private Token nextToken() {
+ prevToken = curToken;
skipSpaces();
if (hasNextChar()) {
char ch = nextChar();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org