public void visit(AssignmentInstruction node) {
super.visit(node);
if (template.strictVariableDeclaration()) {
if (node.getType() == AssignmentInstruction.NAMESPACE) {
ParsingProblem problem = new ParsingProblem("The assign directive is deprecated and cannot be used in strict_vars mode. See the var and set directives.", node);
template.addParsingProblem(problem);
}
if (node.getType() == AssignmentInstruction.LOCAL) {
ParsingProblem problem = new ParsingProblem("The local directive is deprecated and cannot be used in strict_vars mode. See the var and set directives.", node);
template.addParsingProblem(problem);
}
}
if (node.getType() == AssignmentInstruction.LOCAL) {
Macro macro = getContainingMacro(node);
if (macro == null) {
ParsingProblem problem = new ParsingProblem("The local directive can only be used inside a function or macro.", node);
template.addParsingProblem(problem);
}
else for (String varname : node.getVarNames()) {
if (!macro.declaresVariable(varname)) {
macro.declareVariable(varname);