@Override
public void refactor(Node current, String helpers, TreeRebuilder rebuilder)
throws ParseException {
//helpers like name arg2=val2,arg3=var3
String name = "";// TODO get from helpers;
Node defineNode = rebuilder.fetchNode(MacroMacro.MACRO_NAME_PREFIX + name);
if ( defineNode == null ) {
throw new ParseException("Call a macro didn't define yet >>> " + name);
}
String[] args = new String[]{};// TODO resolve from macro's helpers
String[] vals = new String[]{};// TODO resolve from helpers and macro's helpers
for (int i=0; i<args.length; i++ ) {
TagNode tn = new TagNode(new TagToken("{%set "+args[i] + " " + vals[i] + " just %}"));
rebuilder.nodeInsertBefore(current, tn);
}
rebuilder.nodeReplace(current, defineNode.clone().children());
}