}
}
@Override
public void visitFunctionCall(FunctionCall functionCall) {
final PsiElement head = functionCall.getHead();
if (head instanceof Symbol) {
// The next set are symbols that are just ignored and we have to check their first argument for a symbol
// which is defined
if (functionCall.matchesHead("HoldPattern|Longest|Shortest|Repeated")) {
final PsiElement arg1 = functionCall.getArgument(1);
if (arg1 != null) {
arg1.accept(this);
}
}
// check if we have an assignment of the form Options[sym] = {...}
if (functionCall.equals(myStartElement) && functionCall.matchesHead("Options|Attributes|MessageName|Default|Format|N|SyntaxInformation")) {
if (myFoundAssignmentType) {
// we already saw eg Options[..] and this cannot be handled any further
return;
}
setMyAssignmentType(functionCall.getHead().getText());
myFoundAssignmentType = true;
PsiElement arg1 = functionCall.getArgument(1);
if (arg1 != null) {
if (functionCall.matchesHead("Options|Attributes|MessageName|Default|SyntaxInformation")) {
if (arg1 instanceof Symbol) myUnboundSymbols.add((Symbol) arg1);
} else {
//if we have for instance N[e : poly[cp_], pa_] := ... where the argument itself can be a complicated
// patter, then we just go on with the visitor, but we remember that we already know the assignment type
arg1.accept(this);
}
}
} else {
myUnboundSymbols.add((Symbol) head);
}