diff --git a/src/core.c/RakuAST/Deparse.pm6 b/src/core.c/RakuAST/Deparse.pm6 index 6827069bc3d..10cb249a6bf 100644 --- a/src/core.c/RakuAST/Deparse.pm6 +++ b/src/core.c/RakuAST/Deparse.pm6 @@ -1789,6 +1789,18 @@ class RakuAST::Deparse { #- Type ------------------------------------------------------------------------ + multi method deparse(RakuAST::Type::Enum:D $ast --> Str:D) { + my str @parts = 'enum'; + my str $scope = $ast.scope; + + @parts.unshift($scope) if $scope && $scope ne 'our'; # XXX + @parts.unshift(self.deparse($_)) with $ast.of; + @parts.push(self.deparse($_)) with $ast.name; + @parts.push(self.deparse($ast.term)); + + @parts.join(' '); + } + multi method deparse(RakuAST::Type::Simple:D $ast --> Str:D) { self.deparse($ast.name) } diff --git a/src/core.c/RakuAST/Raku.pm6 b/src/core.c/RakuAST/Raku.pm6 index 79fbf149c38..eb2bff12542 100644 --- a/src/core.c/RakuAST/Raku.pm6 +++ b/src/core.c/RakuAST/Raku.pm6 @@ -1076,6 +1076,10 @@ augment class RakuAST::Node { #- Type ------------------------------------------------------------------------ + multi method raku(RakuAST::Type::Enum:D: --> Str:D) { + self!nameds: + } + multi method raku(RakuAST::Type::Simple:D: --> Str:D) { self!positional(self.name) }