[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

0.84



This is a rude hack to make es allow commands to have arguments with
embedded '='.  I don't know yacc very well (and me a professional compiler
hack!) so I probably changed more than I had to in parse.y


; diff  ../parse.y parse.y 
40,41c40,41
< end	: NL			{ if (!readheredocs(FALSE)) { first_reset(); YYABORT; } }
< 	| ENDFILE		{ if (!readheredocs(TRUE)) { first_reset(); YYABORT; } }
---
> end	: NL			{ if (!readheredocs(FALSE)) YYABORT; }
> 	| ENDFILE		{ if (!readheredocs(TRUE)) YYABORT; }
49,50c49,50
< cmdsa	: cmd ';'		{ $$ = $1; first_reset(); }
< 	| cmd '&'		{ $$ = prefix("%background", mk(nList, thunkify($1), NULL)); first_reset(); }
---
> cmdsa	: cmd ';'		{ $$ = $1; }
> 	| cmd '&'		{ $$ = prefix("%background", mk(nList, thunkify($1), NULL)); }
53c53
< 	| cmd NL		{ $$ = $1; if (!readheredocs(FALSE)) { first_reset();  YYABORT; } else { first_reset(); } }
---
> 	| cmd NL		{ $$ = $1; if (!readheredocs(FALSE)) YYABORT; }
56,57c56,57
< 	| simple				{ $$ = redirect($1); if ($$ == &errornode) { first_reset(); YYABORT; } }
< 	| redir cmd	%prec '!'		{ $$ = redirect(mk(nRedir, $1, $2)); if ($$ == &errornode) { first_reset(); YYABORT; } }
---
> 	| simple				{ $$ = redirect($1); if ($$ == &errornode) YYABORT; }
> 	| redir cmd	%prec '!'		{ $$ = redirect(mk(nRedir, $1, $2)); if ($$ == &errornode) YYABORT; }
87,88c87,88
< first	: comword			{ $$ = $1; first_set(); }
< 	| first '^' sword		{ $$ = mk(nConcat, $1, $3); first_set(); }
---
> first	: comword			{ $$ = $1; }
> 	| first '^' sword		{ $$ = mk(nConcat, $1, $3); }
; diff  ../token.c token.c
15,16d14
< static Boolean first_seen = FALSE;
< 
31c29
<  char nw[] = {
---
> const char nw[] = {
50c48
<  char dnw[] = {
---
> const char dnw[] = {
70,77d67
< void first_set() {
<   first_seen = TRUE;
< }
< 
< void first_reset() {
<   first_seen = FALSE;
< }
< 
160c150
< 	char *meta;
---
> 	const char *meta;		/* allow optimizing compilers like gcc to load these	*/
185d174
< 		if (first_seen) meta[(unsigned char)'='] = 0;
191d179
< 		meta[(unsigned char)'='] = 1;
332d319
< 		first_seen = FALSE;
; diff  ../input.h input.h
36c36
< extern char dnw[];
---
> extern const char dnw[];