REFERENCE
ASTQuery Reference: Groups, Built-in Functions, and ID Fields
This document enumerates all built-in groups (used as .group in selectors), all built-in &functions, and the mapping of RakuAST types to their #id attribute used by the matcher when comparing identifiers.
Generated from the implementation in lib/ASTQuery/Matcher.rakumod and lib/ASTQuery.rakumod. Keep this file in sync with changes to those modules.
Groups
Each entry lists the group name (as used in queries with a leading .), a short description, and the types included in that group.
.apply-operator: Operator application nodes (including ternary)Types:
RakuAST::ApplyInfix,RakuAST::ApplyListInfix,RakuAST::ApplyPostfix,RakuAST::Ternary
.apply-op: Alias of operator application nodesTypes:
RakuAST::ApplyInfix,RakuAST::ApplyListInfix,RakuAST::ApplyPostfix,RakuAST::Ternary
.assignment: Assignment and initializer formsTypes:
RakuAST::Assignment,RakuAST::Initializer,RakuAST::Initializer::Assign,RakuAST::Initializer::Bind,RakuAST::Initializer::CallAssign,RakuAST::Initializer::Expression
.call: Call nodesTypes:
RakuAST::Call
.code: Code containers and context helpersTypes:
RakuAST::CompUnit,RakuAST::Code,RakuAST::Routine,RakuAST::Method,RakuAST::Methodish,RakuAST::Sub,RakuAST::Submethod,RakuAST::Contextualizable,RakuAST::Contextualizer,RakuAST::Contextualizer::Hash,RakuAST::Contextualizer::Item,RakuAST::Contextualizer::List,RakuAST::ImplicitBlockSemanticsProvider,RakuAST::ImplicitDeclarations,RakuAST::ImplicitLookups,RakuAST::LexicalScope,RakuAST::AttachTarget
.control: High-level control flow constructsTypes:
RakuAST::ForLoopImplementation,RakuAST::FlipFlop,RakuAST::Statement::IfWith,RakuAST::Statement::Unless,RakuAST::Statement::With,RakuAST::Statement::When,RakuAST::Statement::Given,RakuAST::Statement::Whenever,RakuAST::StatementModifier::Condition,RakuAST::StatementModifier::For
.data: Data-ish helpers and containersTypes:
RakuAST::CaptureSource,RakuAST::ArgList,RakuAST::Name,RakuAST::Label,RakuAST::Lookup,RakuAST::ColonPair,RakuAST::ColonPair::False,RakuAST::ColonPair::Number,RakuAST::ColonPair::True,RakuAST::ColonPair::Value,RakuAST::ColonPair::Variable,RakuAST::ColonPairs,RakuAST::QuotePair,RakuAST::QuoteWordsAtom,RakuAST::SemiList,RakuAST::Postcircumfix,RakuAST::Postcircumfix::ArrayIndex,RakuAST::Postcircumfix::HashIndex,RakuAST::Postcircumfix::LiteralHashIndex,RakuAST::Circumfix,RakuAST::Circumfix::ArrayComposer,RakuAST::Circumfix::HashComposer,RakuAST::Circumfix::Parentheses,RakuAST::OnlyStar
.declaration: Declarations, parameters, and packageish typesTypes:
RakuAST::Declaration,RakuAST::Declaration::External,RakuAST::Declaration::Import,RakuAST::Declaration::LexicalPackage,RakuAST::Declaration::ResolvedConstant,RakuAST::Declaration::External::Constant,RakuAST::Declaration::External::Setting,RakuAST::Var,RakuAST::NamedArg,RakuAST::Parameter,RakuAST::ParameterDefaultThunk,RakuAST::ParameterTarget,RakuAST::ParameterTarget::Term,RakuAST::ParameterTarget::Var,RakuAST::ParameterTarget::Whatever,RakuAST::Signature,RakuAST::Class,RakuAST::Role,RakuAST::RoleBody,RakuAST::Role::ResolveInstantiations,RakuAST::Role::TypeEnvVar,RakuAST::Module,RakuAST::Package,RakuAST::Package::Attachable,RakuAST::Grammar,RakuAST::AttachTarget
.doc: Documentation and pragma nodesTypes:
RakuAST::Doc,RakuAST::Doc::Block,RakuAST::Doc::Declarator,RakuAST::Doc::LegacyRow,RakuAST::Doc::Markup,RakuAST::Doc::Paragraph,RakuAST::Doc::Row,RakuAST::Pragma,RakuAST::Substitution,RakuAST::SubstitutionReplacementThunk
.expression: Expression wrapper nodes (Statement::Expression)Types:
RakuAST::Statement::Expression
.ignorable: Nodes skipped by>>/<<when traversingTypes:
RakuAST::Block,RakuAST::Blockoid,RakuAST::StatementList,RakuAST::Statement::Expression,RakuAST::ArgList
.int: Integer literal nodesTypes:
RakuAST::IntLiteral
.iterable: Loop/iteration constructsTypes:
RakuAST::Statement::Loop,RakuAST::Statement::Loop::RepeatUntil,RakuAST::Statement::Loop::RepeatWhile,RakuAST::Statement::Loop::Until,RakuAST::Statement::Loop::While,RakuAST::Statement::For,RakuAST::Statement::Whenever
.literal: Literal and constant nodesTypes:
RakuAST::ComplexLiteral,RakuAST::IntLiteral,RakuAST::NumLiteral,RakuAST::StrLiteral,RakuAST::RatLiteral,RakuAST::VersionLiteral,RakuAST::Constant,RakuAST::Literal,RakuAST::Heredoc,RakuAST::Heredoc::InterpolatedWhiteSpace,RakuAST::QuotedString,RakuAST::QuoteWordsAtom
.meta: Meta-level constructs and compile-time valuesTypes:
RakuAST::Meta,RakuAST::MetaInfix,RakuAST::CurryThunk,RakuAST::FakeSignature,RakuAST::PlaceholderParameterOwner,RakuAST::Knowhow,RakuAST::Nqp,RakuAST::Nqp::Const,RakuAST::CompileTimeValue,RakuAST::StubbyMeta
.method-declaration: Method declaration nodesTypes:
RakuAST::Method
.node: Any RakuAST node baseTypes:
RakuAST::Node
.op: Operator kinds (alias of.operator)Types:
RakuAST::Infixish,RakuAST::Prefixish,RakuAST::Postfixish
.operator: Operator kindsTypes:
RakuAST::Infixish,RakuAST::Prefixish,RakuAST::Postfixish
.phaser: Phasers and phase-time markersTypes:
RakuAST::StatementPrefix::Phaser,RakuAST::StatementPrefix::Phaser::Begin,RakuAST::StatementPrefix::Phaser::Block,RakuAST::StatementPrefix::Phaser::Check,RakuAST::StatementPrefix::Phaser::Close,RakuAST::StatementPrefix::Phaser::End,RakuAST::StatementPrefix::Phaser::Enter,RakuAST::StatementPrefix::Phaser::First,RakuAST::StatementPrefix::Phaser::Init,RakuAST::StatementPrefix::Phaser::Keep,RakuAST::StatementPrefix::Phaser::Last,RakuAST::StatementPrefix::Phaser::Leave,RakuAST::StatementPrefix::Phaser::Next,RakuAST::StatementPrefix::Phaser::Post,RakuAST::StatementPrefix::Phaser::Pre,RakuAST::StatementPrefix::Phaser::Quit,RakuAST::StatementPrefix::Phaser::Sinky,RakuAST::StatementPrefix::Phaser::Temp,RakuAST::StatementPrefix::Phaser::Undo,RakuAST::BeginTime,RakuAST::CheckTime,RakuAST::ParseTime
.regex: Regex AST nodesTypes:
RakuAST::Regex,RakuAST::RegexDeclaration,RakuAST::RegexThunk,RakuAST::QuotedRegex,RakuAST::QuotedMatchConstruct,RakuAST::QuotedString,RakuAST::Regex::Alternation,RakuAST::Regex::Anchor,RakuAST::Regex::Anchor::BeginningOfLine,RakuAST::Regex::Anchor::BeginningOfString,RakuAST::Regex::Anchor::EndOfLine,RakuAST::Regex::Anchor::EndOfString,RakuAST::Regex::Anchor::LeftWordBoundary,RakuAST::Regex::Anchor::RightWordBoundary,RakuAST::Regex::Assertion,RakuAST::Regex::Assertion::Alias,RakuAST::Regex::Assertion::Callable,RakuAST::Regex::Assertion::CharClass,RakuAST::Regex::Assertion::Fail,RakuAST::Regex::Assertion::InterpolatedBlock,RakuAST::Regex::Assertion::InterpolatedVar,RakuAST::Regex::Assertion::Lookahead,RakuAST::Regex::Assertion::Named,RakuAST::Regex::Assertion::Named::Args,RakuAST::Regex::Assertion::Named::RegexArg,RakuAST::Regex::Assertion::Pass,RakuAST::Regex::Assertion::PredicateBlock,RakuAST::Regex::Assertion::Recurse,RakuAST::Regex::Atom,RakuAST::Regex::BackReference,RakuAST::Regex::BackReference::Named,RakuAST::Regex::BackReference::Positional,RakuAST::Regex::Backtrack,RakuAST::Regex::Backtrack::Frugal,RakuAST::Regex::Backtrack::Greedy,RakuAST::Regex::Backtrack::Ratchet,RakuAST::Regex::BacktrackModifiedAtom,RakuAST::Regex::Block,RakuAST::Regex::Branching,RakuAST::Regex::CapturingGroup,RakuAST::Regex::CharClass,RakuAST::Regex::CharClass::Any,RakuAST::Regex::CharClass::BackSpace,RakuAST::Regex::CharClass::CarriageReturn,RakuAST::Regex::CharClass::Digit,RakuAST::Regex::CharClass::Escape,RakuAST::Regex::CharClass::FormFeed,RakuAST::Regex::CharClass::HorizontalSpace,RakuAST::Regex::CharClass::Negatable,RakuAST::Regex::CharClass::Newline,RakuAST::Regex::CharClass::Nul,RakuAST::Regex::CharClass::Space,RakuAST::Regex::CharClass::Specified,RakuAST::Regex::CharClass::Tab,RakuAST::Regex::CharClass::VerticalSpace,RakuAST::Regex::CharClass::Word,RakuAST::Regex::CharClassElement,RakuAST::Regex::CharClassElement::Enumeration,RakuAST::Regex::CharClassElement::Property,RakuAST::Regex::CharClassElement::Rule,RakuAST::Regex::CharClassEnumerationElement,RakuAST::Regex::CharClassEnumerationElement::Character,RakuAST::Regex::CharClassEnumerationElement::Range,RakuAST::Regex::Conjunction,RakuAST::Regex::Group,RakuAST::Regex::InternalModifier,RakuAST::Regex::InternalModifier::IgnoreCase,RakuAST::Regex::InternalModifier::IgnoreMark,RakuAST::Regex::InternalModifier::Ratchet,RakuAST::Regex::InternalModifier::Sigspace,RakuAST::Regex::Interpolation,RakuAST::Regex::Literal,RakuAST::Regex::MatchFrom,RakuAST::Regex::MatchTo,RakuAST::Regex::NamedCapture,RakuAST::Regex::Nested,RakuAST::Regex::QuantifiedAtom,RakuAST::Regex::Quantifier,RakuAST::Regex::Quantifier::BlockRange,RakuAST::Regex::Quantifier::OneOrMore,RakuAST::Regex::Quantifier::Range,RakuAST::Regex::Quantifier::ZeroOrMore,RakuAST::Regex::Quantifier::ZeroOrOne,RakuAST::Regex::Quote,RakuAST::Regex::Sequence,RakuAST::Regex::SequentialAlternation,RakuAST::Regex::SequentialConjunction,RakuAST::Regex::Statement,RakuAST::Regex::Term,RakuAST::Regex::WithWhitespace,RakuAST::RuleDeclaration,RakuAST::TokenDeclaration
.special: Special terms and sink/sinkable helpersTypes:
RakuAST::Blorst,RakuAST::Stub,RakuAST::Stub::Die,RakuAST::Stub::Fail,RakuAST::Stub::Warn,RakuAST::Term,RakuAST::Termish,RakuAST::Term::Capture,RakuAST::Term::EmptySet,RakuAST::Term::HyperWhatever,RakuAST::Term::Name,RakuAST::Term::Named,RakuAST::Term::RadixNumber,RakuAST::Term::Rand,RakuAST::Term::Reduce,RakuAST::Term::Self,RakuAST::Term::TopicCall,RakuAST::Term::Whatever,RakuAST::OnlyStar,RakuAST::ProducesNil,RakuAST::SinkBoundary,RakuAST::SinkPropagator,RakuAST::Sinkable
.statement: Statement nodes (broad wrapper)Types:
RakuAST::Statement
.str: String literal nodesTypes:
RakuAST::StrLiteral
.type: Type objects and trait nodesTypes:
RakuAST::Type,RakuAST::Type::Capture,RakuAST::Type::Coercion,RakuAST::Type::Definedness,RakuAST::Type::Derived,RakuAST::Type::Enum,RakuAST::Type::Parameterized,RakuAST::Type::Setting,RakuAST::Type::Simple,RakuAST::Type::Subset,RakuAST::Native,RakuAST::Trait,RakuAST::Trait::Does,RakuAST::Trait::Handles,RakuAST::Trait::Hides,RakuAST::Trait::Is,RakuAST::Trait::Of,RakuAST::Trait::Returns,RakuAST::Trait::Type,RakuAST::Trait::Will,RakuAST::Trait::WillBuild
.variable: Variables and declarationsTypes:
RakuAST::Var,RakuAST::VarDeclaration,RakuAST::VarDeclaration::Simple
.variable-declaration: Variable declaration nodesTypes:
RakuAST::VarDeclaration::Simple,RakuAST::VarDeclaration
.variable-usage: Variable usage nodesTypes:
RakuAST::Var
.var: Variable family (usage and assorted specialized forms)Types:
RakuAST::VarDeclaration,RakuAST::Var,RakuAST::Var::Attribute,RakuAST::Var::Compiler,RakuAST::Var::Doc,RakuAST::Var::Dynamic,RakuAST::Var::Lexical,RakuAST::Var::NamedCapture,RakuAST::Var::Package,RakuAST::Var::PositionalCapture,RakuAST::Var::Slang,RakuAST::Var::Attribute::Public,RakuAST::Var::Compiler::Block,RakuAST::Var::Compiler::File,RakuAST::Var::Compiler::Line,RakuAST::Var::Compiler::Lookup,RakuAST::Var::Compiler::Routine,RakuAST::Var::Lexical::Constant,RakuAST::Var::Lexical::Setting
.var-declaration: Variable declaration (simple)Types:
RakuAST::VarDeclaration::Simple
.var-usage: Variable usage nodesTypes:
RakuAST::Var
.conditional: Conditional statements (if/unless/without variants)Types:
RakuAST::Statement::IfWith,RakuAST::Statement::Unless,RakuAST::Statement::Without
Built-in &functions
These are registered at module load and are always available in selectors.
&is-call: True when the node type name starts withRakuAST::Call(any call form).&is-operator: True for operator-kind nodes (Infix*,Prefix*,Postfix*, including*ish).&is-apply-operator: True for operator application nodes (ApplyInfix,ApplyListInfix,ApplyPostfix) orTernary.&is-assignment: True for assignment or initializer nodes (type name containsAssignmentor starts withRakuAST::Initializer::).&is-conditional: True for conditional statements (Statement::If,Statement::Unless,Statement::With,Statement::Without).&has-var: True if the node has a descendant that matches.variable-usage.&has-call: True if the node has a descendant that matches.call.&has-int: True if the node has a descendant that matches.int.
ID Fields (#id)
The matcher uses the following attribute for the #id comparison per type (including via MRO lookup):
RakuAST::ArgList:argsRakuAST::ApplyDottyInfix:infixRakuAST::ApplyInfix:infixRakuAST::ApplyListInfix:infixRakuAST::ApplyPostfix:postfixRakuAST::ApplyPrefix:prefixRakuAST::Assignment:operatorRakuAST::Call:nameRakuAST::Class:nameRakuAST::ColonPair:keyRakuAST::FatArrow:keyRakuAST::Grammar:nameRakuAST::Infix:operatorRakuAST::Infixish:infixRakuAST::Label:nameRakuAST::Literal:valueRakuAST::Method:nameRakuAST::Module:nameRakuAST::Name:simple-identifierRakuAST::Package:nameRakuAST::Prefix:operatorRakuAST::Postfix:operatorRakuAST::Regex::NamedCapture:nameRakuAST::RegexDeclaration:nameRakuAST::Role:nameRakuAST::Routine:nameRakuAST::RuleDeclaration:nameRakuAST::Statement::Expression:expressionRakuAST::Statement::For:sourceRakuAST::Statement::If:conditionRakuAST::Statement::IfWith:conditionRakuAST::Statement::Loop:conditionRakuAST::Statement::Unless:conditionRakuAST::Statement::When:conditionRakuAST::Statement::With:conditionRakuAST::Statement::Without:conditionRakuAST::Sub:nameRakuAST::Submethod:nameRakuAST::Term::Name:nameRakuAST::TokenDeclaration:nameRakuAST::Var::Attribute:nameRakuAST::Var::Doc:nameRakuAST::Var::Dynamic:nameRakuAST::Var::Lexical:desigilnameRakuAST::Var::Package:nameRakuAST::VarDeclaration:nameRakuAST::VarDeclaration::Simple:name
Notes
The matcher traverses nested RakuAST nodes following their configured id field to reach comparable leaf values when matching attributes.
For variable declarations, bare identifiers in selectors (e.g.,
#x) automatically strip sigils for comparison with declaration names.