Skip to content

Commit

Permalink
Load tab completion hash from CORE
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Apr 24, 2015
1 parent 188863b commit fbf24c7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Perl6/Compiler.nqp
Expand Up @@ -62,6 +62,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 fbf24c7

Please sign in to comment.