#![allow(clippy::wildcard_imports, clippy::enum_glob_use)]
use super::*;
impl Checker for PerlCode {
fn is_comment(node: &Node) -> bool {
matches!(node.kind_id().into(), Perl::Comments | Perl::PodStatement)
}
fn is_func_space(node: &Node) -> bool {
matches!(
node.kind_id().into(),
Perl::SourceFile
| Perl::FunctionDefinition
| Perl::FunctionDefinitionWithoutSub
| Perl::AnonymousFunction
)
}
fn is_func(node: &Node) -> bool {
matches!(
node.kind_id().into(),
Perl::FunctionDefinition | Perl::FunctionDefinitionWithoutSub
)
}
fn is_closure(node: &Node) -> bool {
node.kind_id() == Perl::AnonymousFunction
}
fn is_call(node: &Node) -> bool {
matches!(
node.kind_id().into(),
Perl::CallExpressionWithSpacedArgs
| Perl::CallExpressionWithSub
| Perl::CallExpressionWithArgsWithBrackets
| Perl::CallExpressionWithVariable
| Perl::CallExpressionWithBareword
| Perl::CallExpressionRecursive
| Perl::MethodInvocation
)
}
fn is_non_arg(node: &Node) -> bool {
matches!(
node.kind_id().into(),
Perl::LPAREN | Perl::COMMA | Perl::RPAREN | Perl::FatComma
)
}
impl_simple_is_string!(
Perl,
StringSingleQuoted,
StringDoubleQuoted,
StringQQuoted,
StringQqQuoted,
BacktickQuoted,
CommandQxQuoted,
HeredocBodyStatement,
);
impl_is_else_if_clause!(Perl, ElsifClause);
}