Skip to content

Commit

Permalink
[info vars]
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Jul 11, 2010
1 parent 3a358b6 commit 760c05c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/Partcl/commands/info.pm
Expand Up @@ -232,7 +232,15 @@ my sub sharedlibextension() {
}

my sub vars($pattern = '*') {
'';
my %LEXPAD := pir::find_dynamic_lex__Ps('%LEXPAD');
my $globber := StringGlob::Compiler.compile($pattern);
my @result := pir::new__Ps('TclList');

for %LEXPAD -> $var {
@result.push($var) if
?Regex::Cursor.parse($var, :rule($globber), :c(0));
}
@result;
}

# vim: filetype=perl6:
6 changes: 3 additions & 3 deletions t/cmd_info.t
Expand Up @@ -135,7 +135,7 @@ eval_is {
lsort [info vars]
}
test 3 4
} {a b c d} {info vars} {TODO NQPRX}
} {a b c d} {info vars}

eval_is {
proc test {a b} {
Expand All @@ -145,7 +145,7 @@ eval_is {
lsort [info vars]
}
test 3 4
} {a args b c d} {info vars - with special args} {TODO NQPRX}
} {a args b c d} {info vars - with special args}

eval_is {
set a:b 2
Expand All @@ -154,7 +154,7 @@ eval_is {
return [info vars]
}
list [a] [info vars *:*]
} {q a:b} {scope of info vars in proc and global} {TODO NQPRX}
} {q a:b} {scope of info vars in proc and global}

eval_is {info level a b} \
{wrong # args: should be "info level ?number?"} \
Expand Down

0 comments on commit 760c05c

Please sign in to comment.