Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created June 5, 2023 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/1fdb280ac50bb54bca8b19abb9e03c37 to your computer and use it in GitHub Desktop.
Save Whateverable/1fdb280ac50bb54bca8b19abb9e03c37 to your computer and use it in GitHub Desktop.
evalable6
use v6.e.PREVIEW; say gather { "[+] !(1 + 2)".AST.visit({ .take if .^name.ends-with: "fix"; True }) }
(RakuAST::Infix.new("+") RakuAST::ApplyPrefix.new(
prefix => RakuAST::Prefix.new("!"),
operand => RakuAST::Circumfix::Parentheses.new(
RakuAST::SemiList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::ApplyInfix.new(
left => RakuAST::IntLiteral.new(1),
infix => RakuAST::Infix.new("+"),
right => RakuAST::IntLiteral.new(2)
)
)
)
)
) RakuAST::Prefix.new("!") RakuAST::ApplyInfix.new(
left => RakuAST::IntLiteral.new(1),
infix => RakuAST::Infix.new("+"),
right => RakuAST::IntLiteral.new(2)
) RakuAST::Infix.new("+"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment