Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Load tab completion hash from CORE
  • Loading branch information
hoelzro committed Mar 25, 2015
1 parent 883d4cc commit 7d04536
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Perl6/Compiler.nqp
Expand Up @@ -109,6 +109,24 @@ class Perl6::Compiler is HLL::Compiler {

$!completions := nqp::hash();

my $core_keys := self.eval('CORE::.keys');

my $i := 0;
my $core_elems := $core_keys.elems();

while $i < $core_elems {
my $e := $core_keys.AT-POS($i);
$i := $i + 1;

my $m := $e ~~ /^ "&" $<word>=[\w+] $/;
if $m {
my $word := $m<word>;
unless $word ~~ /^ "&" <.upper>+ $/ {
nqp::bindkey($!completions, $word, 1);
}
}
}

$linenoise_set_completion_callback(sub ($line, $c) {
my $m := $line ~~ /^ $<prefix>=[.*?] <|w>$<last_word>=[\w*]$/;

Expand Down

0 comments on commit 7d04536

Please sign in to comment.