Skip to content

Commit

Permalink
Fix deparsing of Var::Compiler::(File|Line)
Browse files Browse the repository at this point in the history
Remove the RakuAST::Var::Compiler::xxx:U candidates, they can
not exist as type objects in ASTs.  Also put RakuAST::Var:: section
in alphabetical order for easier lookup
  • Loading branch information
lizmat committed Jan 12, 2023
1 parent 9270133 commit 9686757
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/core.c/RakuAST/Deparse.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -1598,34 +1598,28 @@ class RakuAST::Deparse {

#- Var -------------------------------------------------------------------------

multi method deparse(RakuAST::Var::Lexical:D $ast --> Str:D) {
multi method deparse(RakuAST::Var::Attribute:D $ast --> Str:D) {
$ast.name
}

multi method deparse(RakuAST::Var::Dynamic:D $ast --> Str:D) {
$ast.name
multi method deparse(RakuAST::Var::Compiler::File:D $ast --> Str:D) {
$.var-compiler-file
}

multi method deparse(RakuAST::Var::Attribute:D $ast --> Str:D) {
$ast.name
multi method deparse(RakuAST::Var::Compiler::Line:D $ast --> Str:D) {
$.var-compiler-line
}

multi method deparse(RakuAST::Var::Compiler::Lookup:D $ast --> Str:D) {
$ast.name
}

multi method deparse(RakuAST::Var::Compiler::File:U $ --> Str:D) {
$.var-compiler-file
}
multi method deparse(RakuAST::Var::Compiler::File:D $ast --> Str:D) {
$ast.file
multi method deparse(RakuAST::Var::Dynamic:D $ast --> Str:D) {
$ast.name
}

multi method deparse(RakuAST::Var::Compiler::Line:U $ --> Str:D) {
$.var-compiler-line
}
multi method deparse(RakuAST::Var::Compiler::Line:D $ast --> Str:D) {
$ast.line
multi method deparse(RakuAST::Var::Lexical:D $ast --> Str:D) {
$ast.name
}

multi method deparse(RakuAST::Var::NamedCapture:D $ast --> Str:D) {
Expand Down

0 comments on commit 9686757

Please sign in to comment.