Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in 3.0.0?
- X-seq: zsh-workers 2051
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: schaefer@xxxxxxx
- Subject: Re: bug in 3.0.0?
- Date: Thu, 22 Aug 1996 23:10:11 +0200 (MET DST)
- Cc: mliggett@xxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <960821121437.ZM11481@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Aug 21, 96 12:14:37 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> The problem is with "else { ... }". 3.0 wants a "fi" at the end of the
> if/elif/else chain, even when using the { ... } form -- but only when
> it ends with "else { ... }".
>
> This seems to fix it.
That breaks
if ... ; then ... ; else { ... } ; ... fi
The patch below is a slighly modified version of Bart's patch.
Zoltan
*** Src/parse.c 1996/08/14 16:48:19 2.25
--- Src/parse.c 1996/08/22 21:07:43
***************
*** 605,611 ****
unsigned char nc;
LinkList ifsl, thensl;
LinkNode no;
! int ni = 0, nt = 0;
List l, *ll;
ifsl = newlinklist();
--- 605,611 ----
unsigned char nc;
LinkList ifsl, thensl;
LinkNode no;
! int ni = 0, nt = 0, usebrace = 0;
List l, *ll;
ifsl = newlinklist();
***************
*** 634,639 ****
--- 634,640 ----
xtok = FI;
nc = cmdstack[cmdsp - 1] == CS_IF ? CS_IFTHEN : CS_ELIFTHEN;
if (tok == THEN) {
+ usebrace = 0;
cmdpop();
cmdpush(nc);
yylex();
***************
*** 643,648 ****
--- 644,650 ----
cmdpop();
} else {
if (tok == INBRACE) {
+ usebrace = 1;
cmdpop();
cmdpush(nc);
yylex();
***************
*** 676,685 ****
cmdpush(CS_ELSE);
while (tok == SEPER)
yylex();
! l = par_list();
! if (tok != FI) {
! cmdpop();
! YYERRORV;
}
addlinknode(thensl, l);
nt++;
--- 678,696 ----
cmdpush(CS_ELSE);
while (tok == SEPER)
yylex();
! if (tok == INBRACE && usebrace) {
! yylex();
! l = par_list();
! if (tok != OUTBRACE) {
! cmdpop();
! YYERRORV;
! }
! } else {
! l = par_list();
! if (tok != FI) {
! cmdpop();
! YYERRORV;
! }
}
addlinknode(thensl, l);
nt++;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author