use of com.perl5.lang.perl.psi.PerlCompositeElement in project Perl5-IDEA by Camelcade.
the class PerlPsiUtil method processNamespaceStatements.
public static boolean processNamespaceStatements(@NotNull PsiElement rootElement, Processor<PsiElement> processor) {
PsiElement run = rootElement.getFirstChild();
boolean result = true;
while (run != null && result) {
if (!(run instanceof PerlNamespaceDefinitionWithIdentifier)) {
if (run instanceof PerlCompositeElement) {
result = processor.process(run);
}
if (result && run instanceof PerlStatementsContainer) {
result = processNamespaceStatements(run, processor);
}
}
run = run.getNextSibling();
}
return result;
}
use of com.perl5.lang.perl.psi.PerlCompositeElement in project Perl5-IDEA by Camelcade.
the class PerlResolveUtil method processChildren.
public static boolean processChildren(@NotNull PsiElement element, @NotNull PsiScopeProcessor processor, @NotNull ResolveState resolveState, @Nullable PsiElement lastParent, @NotNull PsiElement place) {
PsiElement run = lastParent == null ? element.getLastChild() : lastParent.getPrevSibling();
while (run != null) {
ProgressManager.checkCanceled();
if (run instanceof PerlCompositeElement && // fixme this should be in composite
!(run instanceof PerlLexicalScope) && !run.processDeclarations(processor, resolveState, null, place)) {
return false;
}
run = run.getPrevSibling();
}
// checking implicit variables fixme: decide, move processchildren to here or move this one to processDeclarations?
if (element instanceof PerlImplicitVariablesProvider) {
for (PerlVariableDeclarationElement wrapper : ((PerlImplicitVariablesProvider) element).getImplicitVariables()) {
ProgressManager.checkCanceled();
if (!processor.execute(wrapper, resolveState)) {
return false;
}
}
}
return true;
}
Aggregations