use of lucee.runtime.interpreter.ref.op.Concat in project Lucee by lucee.
the class CFMLExpressionInterpreter method string.
/**
* Transfomiert einen lierale Zeichenkette.
* <br />
* EBNF:<br />
* <code>("'" {"##"|"''"|"#" impOp "#"| ?-"#"-"'" } "'") |
* (""" {"##"|""""|"#" impOp "#"| ?-"#"-""" } """);</code>
* @return CFXD Element
* @throws PageException
*/
protected Ref string() throws PageException {
// Init Parameter
char quoter = cfml.getCurrentLower();
LStringBuffer str = new LStringBuffer();
Ref value = null;
while (cfml.hasNext()) {
cfml.next();
// check sharp
if (!limited && cfml.isCurrent('#')) {
if (cfml.isNext('#')) {
cfml.next();
str.append('#');
} else {
cfml.next();
cfml.removeSpace();
if (!str.isEmpty() || value != null)
str.append(assignOp());
else
value = assignOp();
cfml.removeSpace();
if (!cfml.isCurrent('#'))
throw new InterpreterException("Invalid Syntax Closing [#] not found");
}
} else if (cfml.isCurrent(quoter)) {
if (cfml.isNext(quoter)) {
cfml.next();
str.append(quoter);
} else {
break;
}
} else // all other character
{
str.append(cfml.getCurrent());
}
}
if (!cfml.forwardIfCurrent(quoter))
throw new InterpreterException("Invalid String Literal Syntax Closing [" + quoter + "] not found");
cfml.removeSpace();
mode = STATIC;
if (value != null) {
if (str.isEmpty())
return value;
return new Concat(value, str, limited);
}
return str;
}
use of lucee.runtime.interpreter.ref.op.Concat in project Lucee by lucee.
the class CFMLExpressionInterpreter method _concat.
private Ref _concat(Ref ref) throws PageException {
// &=
if (cfml.forwardIfCurrent('=')) {
cfml.removeSpace();
Ref right = assignOp();
Ref res = new Concat(ref, right, limited);
ref = new Assign(ref, res, limited);
} else {
cfml.removeSpace();
ref = new Concat(ref, plusMinusOp(), limited);
}
return ref;
}
Aggregations