Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RakuAST: get meaningful .raku output for RakuAST classes
This should help with people writing RakuAST tests, and will probably also be helpful in the future for people doing other stuff with RakuAST, as you can now easily get the RakuAST calls for a given piece of Raku source code. Something like: say Q|sub Bar::foo($a) { say $a }|.AST.raku now produces a roundtripping: RakuAST::StatementList.new( RakuAST::Statement::Expression.new( expression => RakuAST::Sub.new( name => RakuAST::Name.from-identifier-parts("Bar","foo")), signature => RakuAST::Signature.new( parameters => ( RakuAST::Parameter.new( type => RakuAST::Type::Simple.new( RakuAST::Name.from-identifier("Any") ), target => RakuAST::ParameterTarget::Var.new("\$a") ), ) ), body => RakuAST::Blockoid.new( RakuAST::StatementList.new( RakuAST::Statement::Expression.new( expression => RakuAST::Call::Name.new( name => RakuAST::Name.from-identifier("say"), args => RakuAST::ArgList.new( RakuAST::Var::Lexical.new("\$a") ) ) ) ) ) ) ) )
- Loading branch information