@Override TemplateElement[] accept(Environment env) throws TemplateException { if (exp != null) { env.setLastReturnValue(exp.eval(env)); } if (nextSibling() == null && getParentElement() instanceof Macro) { // Avoid unnecessary exception throwing return null; } throw Return.INSTANCE; }
} else if (targetModel instanceof Macro) { Macro func = (Macro) targetModel; env.setLastReturnValue(null); if (!func.isFunction()) { throw new _MiscTemplateException(env, "A macro cannot be called in an expression. (Functions can be.)");
@Override TemplateElement[] accept(Environment env) throws TemplateException { if (exp != null) { env.setLastReturnValue(exp.eval(env)); } if (nextSibling() == null && getParentElement() instanceof Macro) { // Avoid unnecessary exception throwing return null; } throw Return.INSTANCE; }
@Override TemplateElement[] accept(Environment env) throws TemplateException { if (exp != null) { env.setLastReturnValue(exp.eval(env)); } if (nextSibling() == null && getParentElement() instanceof Macro) { // Avoid unnecessary exception throwing return null; } throw Return.INSTANCE; }
void accept(Environment env) throws TemplateException { if (exp != null) { env.setLastReturnValue(exp.getAsTemplateModel(env)); } if (nextSibling() != null) { // We need to jump out using an exception. throw Return.INSTANCE; } if (!(getParent() instanceof Macro || getParent().getParent() instanceof Macro)) { // Here also, we need to jump out using an exception. throw Return.INSTANCE; } }
env.setLastReturnValue(null); if (!func.isFunction) { throw new TemplateException("A macro cannot be called in an expression.", env);
} else if (targetModel instanceof Macro) { Macro func = (Macro) targetModel; env.setLastReturnValue(null); if (!func.isFunction()) { throw new _MiscTemplateException(env, "A macro cannot be called in an expression. (Functions can be.)");
} else if (targetModel instanceof Macro) { Macro func = (Macro) targetModel; env.setLastReturnValue(null); if (!func.isFunction()) { throw new _MiscTemplateException(env, "A macro cannot be called in an expression. (Functions can be.)");