String name=null;
Invoker invoker=null;
// Loop over nested Variables
while (data.cfml.isValidIndex()) {
ExprString nameProp = null,namePropUC = null;
// .
if (data.cfml.forwardIfCurrent('.')) {
// Extract next Var String
comments(data);
Position line=data.cfml.getPosition();
name = identifier(data,true);
if(name==null)
throw new TemplateException(data.cfml, "Invalid identifier");
comments(data);
nameProp=Identifier.toIdentifier(name,line,data.cfml.getPosition());
namePropUC=Identifier.toIdentifier(name,data.settings.dotNotationUpper?Identifier.CASE_UPPER:Identifier.CASE_ORIGNAL,line,data.cfml.getPosition());
}
// []
else if (data.cfml.forwardIfCurrent('[')) {
// get Next Var
nameProp = structElement(data);
namePropUC=nameProp;
// Valid Syntax ???
if (!data.cfml.forwardIfCurrent(']'))
throw new TemplateException(
data.cfml,
"Invalid Syntax Closing []] not found");
}
/* / :
else if (data.cfml.forwardIfCurrent(':')) {
// Extract next Var String
comments(data);
int line=data.cfml.getLine();
name = identifier(true,true);
if(name==null)
throw new TemplateException(cfml, "Invalid identifier");
comments(data);
nameProp=LitString.toExprString(name,line);
}*/
// finish
else {
break;
}
comments(data);
if(expr instanceof Invoker) {
invoker=(Invoker) expr;
}
else {
invoker=new ExpressionInvoker(expr);
expr=invoker;
}
// Method
if (data.cfml.isCurrent('(')) {
if(nameProp==null && name!=null)nameProp=Identifier.toIdentifier(name, Identifier.CASE_ORIGNAL,null,null);// properly this is never used
invoker.addMember(getFunctionMember(data,nameProp, false));
}
// property
else invoker.addMember(new DataMember(namePropUC));
}
return expr;
}