zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: function declaration syntax
Date: Thu, 29 Jun 2000 14:06:59 +0200 (MET DST)	[thread overview]
Message-ID: <200006291206.OAA05600@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Thu, 29 Jun 2000 12:38:54 +0100


Peter Stephenson wrote:

> Did anybody notice that according to the manual (and the reference card,
> which was how I noticed) this was supposed to work?
> 
> % fn() print foo
> # Looks like it worked...
> % which fn
> fn() {
>        print foo
> }
> # but it doesn't.
> % fn
> % 
> 
> Either we should fix it or remove it.

My fault, I guess. I have a faint memory of having tested it, but that 
was probably before the last changes to the word code stuff.

Bye
 Sven

P.S.: The comments in parse.c talk about a list1 being allowed there,
      which would be a sublist.  The manual says it's a command. It
      would be easy to change...

Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.9
diff -u -r1.9 parse.c
--- Src/parse.c	2000/06/14 09:26:56	1.9
+++ Src/parse.c	2000/06/29 12:05:34
@@ -1516,10 +1516,11 @@
 		}
 		yylex();
 	    } else {
-		int ll, sl, c = 0;
+		int ll, sl, pl, c = 0;
 
 		ll = ecadd(0);
 		sl = ecadd(0);
+		pl = ecadd(WCB_PIPE(WC_PIPE_END, 0));
 
 		par_cmd(&c);
 
Index: Test/09funcdef.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/09funcdef.ztst,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 09funcdef.ztst
--- Test/09funcdef.ztst	2000/01/31 11:46:35	1.1.1.1
+++ Test/09funcdef.ztst	2000/06/29 12:05:35
@@ -6,3 +6,8 @@
   f$$
 0:Regression test: `function f$$ () { ... }'
 >regress expansion of function names
+
+  function foo () print bar
+  foo
+0:Function definition without braces
+>bar

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-06-29 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200006291206.OAA05600@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).