From: Matt S Trout Date: Mon, 24 Feb 2014 07:49:54 +0000 (+0000) Subject: add support for not rules X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc2be68b2ee6e1ad4274bd7094f8e9d4a1c487e9;p=scpubgit%2FDKit.git add support for not rules --- diff --git a/bin/dx-shell b/bin/dx-shell index b540453..2df61b5 100644 --- a/bin/dx-shell +++ b/bin/dx-shell @@ -59,9 +59,10 @@ sub expand_def { } sub expand_body { - my (@body) = @_; + my ($body) = @_; + die "No body!" unless $body; local our @Body_Parts; - $tcl->Eval(@body); + $tcl->Eval($body); return @Body_Parts; } @@ -133,6 +134,12 @@ $tcl->CreateCommand(findall => sub { return; }); +$tcl->CreateCommand(not => sub { + my (undef, undef, undef, $body) = @_; + push our @Body_Parts, [ not => expand_body($body) ]; + return; +}); + $tcl->CreateCommand(n => \&show); #$tcl->Eval(q{query D {directory_at D 't'; mode D '0755'; }});