experiment - allow = in words late in the command line
This commit is contained in:
parent
b7d8e86a72
commit
aec641d24c
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
%term WORD REDIR DUP PIPE SUB
|
%term WORD REDIR DUP PIPE SUB
|
||||||
%term SIMPLE ARGLIST WORDS BRACE PAREN PCMD PIPEFD /* not used in syntax */
|
%term SIMPLE ARGLIST WORDS BRACE PAREN PCMD PIPEFD /* not used in syntax */
|
||||||
/* operator priorities -- lowest first */
|
/* operator priorities -- lowest first */
|
||||||
|
%left LOW
|
||||||
%left IF WHILE FOR SWITCH ')' NOT
|
%left IF WHILE FOR SWITCH ')' NOT
|
||||||
%left ANDAND OROR
|
%left ANDAND OROR
|
||||||
%left BANG SUBSHELL
|
%left BANG SUBSHELL
|
||||||
|
|
@ -9,6 +10,7 @@
|
||||||
%left '^'
|
%left '^'
|
||||||
%right '$' COUNT '"'
|
%right '$' COUNT '"'
|
||||||
%left SUB
|
%left SUB
|
||||||
|
%left '='
|
||||||
%{
|
%{
|
||||||
#include "rc.h"
|
#include "rc.h"
|
||||||
#include "fns.h"
|
#include "fns.h"
|
||||||
|
|
@ -78,6 +80,7 @@ first: comword
|
||||||
word: keyword {lastword=1; $1->type=WORD;}
|
word: keyword {lastword=1; $1->type=WORD;}
|
||||||
| comword
|
| comword
|
||||||
| word '^' word {$$=tree2('^', $1, $3);}
|
| word '^' word {$$=tree2('^', $1, $3);}
|
||||||
|
| word '=' word %prec LOW {$$=tree2('^', tree2('^', $1, token("=", WORD)), $3);}
|
||||||
comword: '$' word {$$=tree1('$', $2);}
|
comword: '$' word {$$=tree1('$', $2);}
|
||||||
| '$' word SUB words ')' {$$=tree2(SUB, $2, $4);}
|
| '$' word SUB words ')' {$$=tree2(SUB, $2, $4);}
|
||||||
| '"' word {$$=tree1('"', $2);}
|
| '"' word {$$=tree1('"', $2);}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue