use of lucee.transformer.expression.ExprString in project Lucee by lucee.
the class AbstrCFMLExprTransformer method structElement.
/**
* Transfomiert ein Collection Element das in eckigen Klammern aufgerufen wird.
* <br />
* EBNF:<br />
* <code>"[" impOp "]"</code>
* @return CFXD Element
* @throws TemplateException
*/
private ExprString structElement(ExprData data) throws TemplateException {
comments(data);
ExprString name = data.factory.toExprString(assignOp(data));
if (name instanceof LitString)
((LitString) name).fromBracket(true);
comments(data);
return name;
}
use of lucee.transformer.expression.ExprString in project Lucee by lucee.
the class AbstrCFMLExprTransformer method getFunctionMemberAttrs.
private int getFunctionMemberAttrs(ExprData data, ExprString name, boolean checkLibrary, Func fm, FunctionLibFunction flf) throws TemplateException {
// Function Attributes
ArrayList<FunctionLibFunctionArg> arrFuncLibAtt = null;
// int libLen = 0;
if (checkLibrary) {
arrFuncLibAtt = flf.getArg();
// libLen = arrFuncLibAtt.size();
}
int count = 0;
do {
data.srcCode.next();
comments(data);
// finish
if (count == 0 && data.srcCode.isCurrent(')'))
break;
// Argument arg;
if (checkLibrary && flf.getArgType() != FunctionLibFunction.ARG_DYNAMIC) {
// current attribues from library
String _type;
try {
_type = arrFuncLibAtt.get(count).getTypeAsString();
} catch (IndexOutOfBoundsException e) {
_type = null;
}
fm.addArgument(functionArgument(data, _type, false));
} else {
fm.addArgument(functionArgument(data, false));
}
comments(data);
count++;
if (data.srcCode.isCurrent(')'))
break;
} while (data.srcCode.isCurrent(','));
if (!data.srcCode.forwardIfCurrent(')')) {
if (name != null) {
throw new TemplateException(data.srcCode, "Invalid Syntax Closing [)] for function [" + (flf != null ? flf.getName() : ASMUtil.display(name)) + "] not found");
}
throw new TemplateException(data.srcCode, "Invalid Syntax Closing [)] not found");
}
return count;
}
Aggregations