zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.dk
Cc: Hugo Haas <hugo@larve.net>, 262247-forwarded@bugs.debian.org
Subject: Re: Bug#262247: zsh: Improved make completion
Date: Fri, 30 Jul 2004 11:30:54 -0400	[thread overview]
Message-ID: <20040730153054.GA4059@scowler.net> (raw)
In-Reply-To: <20040730101751.GA11905@larve.net>

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

> Attached is a Perl script that can be used as a replacement of the
> Perl script appearing in the make completion code (_make) to follow
> include statements in Makefiles.

You mean it should replace the expression

'@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/  and
        print join(" ", @matches);
if (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
    /^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) {
    print "fetch fetch-list extract patch configure build install reinstall dein
stall package describe checkpatch checksum makesum\n";
    }
'

in _make?

Maybe the perl and awk bits should be replaced by some native Z-Shell parsing.

[-- Attachment #2: ma.pl --]
[-- Type: text/x-perl, Size: 673 bytes --]

sub match() {
    my ($fn) = @_;
    @matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/  and 
    print join(" ", @matches);
    if (/^include\s+(\S+)/) {
	my $i = $1;;
	if ($fn =~ m|/|) {
	    $fn =~ s|/[^/]+$|/$i|;
	} else {
	    $fn = $i;
	}
	&parse($fn);
    }
    elsif (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
	     /^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) {
	print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum\n";
    }
}

sub parse() {
    my ($fn) = @_;
    my $f;
    open($f, $fn) || return;
    while (<$f>) {
	&match($fn);
    }
    close($f);
}

&parse($ARGV[0]);

       reply	other threads:[~2004-07-30 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040730101751.GA11905@larve.net>
2004-07-30 15:30 ` Clint Adams [this message]
2004-07-30 16:51   ` Hugo Haas
2004-08-18 15:07     ` Hugo Haas
2004-08-18 17:04       ` Wayne Davison
2004-08-21 18:09       ` Wayne Davison
2004-08-22  1:47         ` Bart Schaefer
2004-08-26 16:10         ` Hugo Haas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040730153054.GA4059@scowler.net \
    --to=schizo@debian.org \
    --cc=262247-forwarded@bugs.debian.org \
    --cc=hugo@larve.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).