diff options
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='<<-';; |