Search in sources :

Example 1 with PerlBuiltInSubDefinition

use of com.perl5.lang.perl.psi.impl.PerlBuiltInSubDefinition in project Perl5-IDEA by Camelcade.

the class PerlImplicitDeclarationsProvider method readSub.

private void readSub(@NotNull PerlImplicitDeclarationsService declarationsService, @NotNull String namespaceName, @NotNull Element element) {
    String subName = element.getAttributeValue(NAME);
    if (StringUtil.isEmpty(subName)) {
        LOG.warn("Missing or empty name attribute for sub");
        return;
    }
    PerlImplicitSubDefinition subDefinition;
    if (PerlPackageUtil.CORE_NAMESPACE.equals(namespaceName)) {
        subDefinition = new PerlBuiltInSubDefinition(declarationsService.getPsiManager(), subName, PerlPackageUtil.CORE_NAMESPACE, readArguments(element.getChild(ARGUMENTS_ELEMENT), subName));
    } else {
        subDefinition = new PerlImplicitSubDefinition(declarationsService.getPsiManager(), subName, namespaceName, readArguments(element.getChild(ARGUMENTS_ELEMENT), subName));
    }
    declarationsService.registerSub(subDefinition);
}
Also used : PerlImplicitSubDefinition(com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition) PerlBuiltInSubDefinition(com.perl5.lang.perl.psi.impl.PerlBuiltInSubDefinition)

Aggregations

PerlBuiltInSubDefinition (com.perl5.lang.perl.psi.impl.PerlBuiltInSubDefinition)1 PerlImplicitSubDefinition (com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition)1