Skip to content

Instantly share code, notes, and snippets.

@ab5tract
Created November 19, 2025 18:17
Show Gist options
  • Select an option

  • Save ab5tract/da93dea39dec512076478451f5c253fa to your computer and use it in GitHub Desktop.

Select an option

Save ab5tract/da93dea39dec512076478451f5c253fa to your computer and use it in GitHub Desktop.
Not parsed as RakuAST::Tyoe::Parameterized
# say q|Array[Int]|.AST;
RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::Type::Parameterized.new(
base-type => RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Array")
),
args => RakuAST::ArgList.new(
RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Int")
)
)
)
)
)
# say q|R[Int]|.AST;
RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::ApplyPostfix.new(
operand => RakuAST::Term::Name.new(
RakuAST::Name.from-identifier("R")
),
postfix => RakuAST::Postcircumfix::ArrayIndex.new(
index => RakuAST::SemiList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Int")
)
)
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment