Skip to content

Commit

Permalink
do tree walking of packages instead of grepping
Browse files Browse the repository at this point in the history
Following up on
31b5319#commitcomment-17801202

I got an EVAL in there which I haven't figured out how to get rid
of yet.

Closes #141.
  • Loading branch information
Carl Masak committed Jun 14, 2016
1 parent c1d413d commit fe2ebe5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions t/integration/val-q-classes.t
@@ -1,9 +1,23 @@
use v6;
use MONKEY-SEE-NO-EVAL;
use Test;
use _007;

my @p6types = flat
"lib/_007/Q.pm".IO.lines.map({ ~$0 if /^ < class role > \h+ ("Q::" \S+)/ }),
"lib/_007/Val.pm".IO.lines.map({ ~$0 if /^ class \h+ ("Val::" \S+)/ });
sub tree-walk($package, @accum) {
for $package.keys -> $key {
my $name = "{$package}::{$key}";
# make a little exception for Val::Sub::Builtin, which is just an
# implementation detail and doesn't have a corresponding builtin
# (because it tries to pass itself off as a Val::Sub)
next if $name eq "Val::Sub::Builtin";
push @accum, $name;
tree-walk(EVAL("{$name}::"), @accum)
}
}

my @p6types;
tree-walk(Q::, @p6types);
tree-walk(Val::, @p6types);

my @builtins = "lib/_007/Runtime/Builtins.pm".IO.lines.map({
~$0 if /^ \h+ ([Val|Q] "::" <-[,]>+) "," \h* $/
Expand Down

0 comments on commit fe2ebe5

Please sign in to comment.