/** * Called by code internally to maintain a table of macros * * @deprecated Should only be used internally, and might will be removed later. */ @Deprecated public void addMacro(Macro macro) { macros.put(macro.getName(), macro); }
/** * Defines the given macro in the current namespace (doesn't call it). */ void visitMacroDef(Macro macro) { macroToNamespaceLookup.put(macro, currentNamespace); currentNamespace.put(macro.getName(), macro); }
static String formatLocationForEvaluationError(Macro macro, int line, int column) { Template t = macro.getTemplate(); return formatLocation("at", t != null ? t.getSourceName() : null, macro.getName(), macro.isFunction(), line, column); }
if (macro.isFunction() && !legacySyntax) { throw new _MiscTemplateException(env, "Routine ", new _DelayedJQuote(macro.getName()), " is a function, not a directive. " + "Functions can only be called from expressions, like in ${f()}, ${x + f()} or ", "<@someDirective someParam=f() />", ".");
(macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " has no parameter with name ", new _DelayedJQuote(argName), "."); if (argNames.length < argsCnt && catchAllParamName == null) { throw new _MiscTemplateException(this, (macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " only accepts ", new _DelayedToString(argNames.length), " parameters, but got ", new _DelayedToString(argsCnt), ".");
/** * Called by code internally to maintain * a table of macros */ public void addMacro(Macro macro) { macros.put(macro.getName(), macro); }
/** * Called by code internally to maintain a table of macros * * @deprecated Should only be used internally, and might will be removed later. */ @Deprecated public void addMacro(Macro macro) { macros.put(macro.getName(), macro); }
/** * Called by code internally to maintain a table of macros * * @deprecated Should only be used internally, and might will be removed later. */ @Deprecated public void addMacro(Macro macro) { macros.put(macro.getName(), macro); }
/** * Defines the given macro in the current namespace (doesn't call it). */ void visitMacroDef(Macro macro) { macroToNamespaceLookup.put(macro, currentNamespace); currentNamespace.put(macro.getName(), macro); }
/** * Defines the given macro in the current namespace (doesn't call it). */ void visitMacroDef(Macro macro) { macroToNamespaceLookup.put(macro, currentNamespace); currentNamespace.put(macro.getName(), macro); }
void visitMacroDef(Macro macro) { macroToNamespaceLookup.put(macro, currentNamespace); currentNamespace.put(macro.getName(), macro); }
static String formatLocationForEvaluationError(Macro macro, int line, int column) { Template t = macro.getTemplate(); return formatLocation("at", t != null ? t.getSourceName() : null, macro.getName(), macro.isFunction(), line, column); }
static String formatLocationForEvaluationError(Macro macro, int line, int column) { Template t = macro.getTemplate(); return formatLocation("at", t != null ? t.getSourceName() : null, macro.getName(), macro.isFunction(), line, column); }
Macro macro = (Macro) tm; if (macro.isFunction && !legacySyntax) { throw new TemplateException("Routine " + macro.getName() + " is a function. A function can only be called " + "within the evaluation of an expression.", env);
if (macro.isFunction() && !legacySyntax) { throw new _MiscTemplateException(env, "Routine ", new _DelayedJQuote(macro.getName()), " is a function, not a directive. " + "Functions can only be called from expressions, like in ${f()}, ${x + f()} or ", "<@someDirective someParam=f() />", ".");
if (macro.isFunction() && !legacySyntax) { throw new _MiscTemplateException(env, "Routine ", new _DelayedJQuote(macro.getName()), " is a function, not a directive. " + "Functions can only be called from expressions, like in ${f()}, ${x + f()} or ", "<@someDirective someParam=f() />", ".");
String msg = "Macro " + macro.getName() + " has no such argument: " + varName; throw new TemplateException(msg, this); int size = positionalArgs.size(); if (argumentNames.length < size && catchAll == null) { throw new TemplateException("Macro " + macro.getName() + " only accepts " + argumentNames.length + " parameters.", this);
(macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " has no parameter with name ", new _DelayedJQuote(argName), "."); if (argNames.length < argsCnt && catchAllParamName == null) { throw new _MiscTemplateException(this, (macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " only accepts ", new _DelayedToString(argNames.length), " parameters, but got ", new _DelayedToString(argsCnt), ".");
(macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " has no parameter with name ", new _DelayedJQuote(argName), "."); if (argNames.length < argsCnt && catchAllParamName == null) { throw new _MiscTemplateException(this, (macro.isFunction() ? "Function " : "Macro "), new _DelayedJQuote(macro.getName()), " only accepts ", new _DelayedToString(argNames.length), " parameters, but got ", new _DelayedToString(argsCnt), ".");