aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/syn.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/rc/syn.y')
-rw-r--r--src/cmd/rc/syn.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/rc/syn.y b/src/cmd/rc/syn.y
index c7de3531..5c98ef80 100644
--- a/src/cmd/rc/syn.y
+++ b/src/cmd/rc/syn.y
@@ -1,5 +1,5 @@
%term FOR IN WHILE IF NOT TWIDDLE BANG SUBSHELL SWITCH FN
-%term WORD REDIR DUP PIPE SUB
+%term WORD REDIR REDIRW DUP PIPE SUB
%term SIMPLE ARGLIST WORDS BRACE PAREN PCMD PIPEFD /* not used in syntax */
/* operator priorities -- lowest first */
%left IF WHILE FOR SWITCH ')' NOT
@@ -19,7 +19,7 @@
%type<tree> line paren brace body cmdsa cmdsan assign epilog redir
%type<tree> cmd simple first word comword keyword words
%type<tree> NOT FOR IN WHILE IF TWIDDLE BANG SUBSHELL SWITCH FN
-%type<tree> WORD REDIR DUP PIPE
+%type<tree> WORD REDIR REDIRW DUP PIPE
%%
rc: { return 1;}
| line '\n' {return !compile($1);}
@@ -45,7 +45,7 @@ cmd: {$$=0;}
| IF NOT {skipnl();} cmd {$$=mung1($2, $4);}
| FOR '(' word IN words ')' {skipnl();} cmd
/*
- * if ``words'' is nil, we need a tree element to distinguish between
+ * if ``words'' is nil, we need a tree element to distinguish between
* for(i in ) and for(i), the former being a loop over the empty set
* and the latter being the implicit argument loop. so if $5 is nil
* (the empty set), we represent it as "()". don't parenthesize non-nil
@@ -73,7 +73,7 @@ cmd: {$$=0;}
simple: first
| simple word {$$=tree2(ARGLIST, $1, $2);}
| simple redir {$$=tree2(ARGLIST, $1, $2);}
-first: comword
+first: comword
| first '^' word {$$=tree2('^', $1, $3);}
word: keyword {lastword=1; $1->type=WORD;}
| comword
@@ -85,7 +85,7 @@ comword: '$' word {$$=tree1('$', $2);}
| WORD
| '`' brace {$$=tree1('`', $2);}
| '(' words ')' {$$=tree1(PAREN, $2);}
-| REDIR brace {$$=mung1($1, $2); $$->type=PIPEFD;}
+| REDIRW brace {$$=mung1($1, $2); $$->type=PIPEFD;}
keyword: FOR|IN|WHILE|IF|NOT|TWIDDLE|BANG|SUBSHELL|SWITCH|FN
words: {$$=(struct tree*)0;}
| words word {$$=tree2(WORDS, $1, $2);}