diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-19 18:06:07 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-19 18:06:07 (EST) |
commit | 872012edc169d128e721b20ecaf5f3875776db37 (patch) | |
tree | abcce7584d52722e5dece409beb4f39e3371faa2 /parsing | |
parent | b77d7967e9cf00002c6bc9fd1bbcf891a197115e (diff) | |
download | eggshell-872012edc169d128e721b20ecaf5f3875776db37.zip eggshell-872012edc169d128e721b20ecaf5f3875776db37.tar.gz eggshell-872012edc169d128e721b20ecaf5f3875776db37.tar.bz2 |
Add missing I/O tokens
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/lexer.sh | 40 | ||||
-rw-r--r-- | parsing/tokens.sh | 2 |
2 files changed, 31 insertions, 11 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh index 1f40138..bf6ad7d 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -113,24 +113,42 @@ next_io() case "${c}" in '<') pgetc - case "${c}" in '<') - pgetc - case "${c}" in '-') + case "${c}" in + '<') + pgetc + case "${c}" in '-') + pgetc + tok=T_DLESSDASH + ;; + esac + tok=T_DLESS + ;; + '&') pgetc - tok=T_DLESSDASH + tok=T_LESSAND + ;; + '>') + pgetc + tok=T_LESSGREAT ;; - esac - tok=T_DLESS - ;; esac tok=T_LESS ;; '>') pgetc - case "${c}" in '>') - pgetc - tok=T_DGREAT - ;; + case "${c}" in + '>') + pgetc + tok=T_DGREAT + ;; + '&') + pgetc + tok=T_GREATAND + ;; + '|') + pgetc + tok=T_CLOBBER + ;; esac tok=T_GREAT ;; diff --git a/parsing/tokens.sh b/parsing/tokens.sh index 37d741b..fef9dc0 100644 --- a/parsing/tokens.sh +++ b/parsing/tokens.sh @@ -17,7 +17,9 @@ tokname() T_GREAT) n='>';; T_DLESS) n='<<';; T_DGREAT) n='>>';; + T_LESS) n='<';; T_LESSAND) n='<&';; + T_GREAT) n='>';; T_GREATAND) n='>&';; T_LESSGREAT) n='<>';; T_DLESSDASH) n='<<-';; |